{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/atlar/json-schema/atlar-create-glentity-request-schema.json",
  "title": "CreateGLEntityRequest",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/atlar-gl-entities-api-openapi.yml#/components/schemas/CreateGLEntityRequest",
  "type": "object",
  "properties": {
    "currency": {
      "$ref": "#/$defs/CurrencyCode",
      "description": "Base currency of the GL entity when known (e.g. subsidiary currency from the ERP)."
    },
    "externalId": {
      "$ref": "#/$defs/ExternalID"
    },
    "name": {
      "type": "string",
      "description": "The name of the GL entity.",
      "minLength": 1,
      "maxLength": 64
    },
    "thirdPartyId": {
      "description": "ID of the associated third-party, e.g. the ERP in which the account is held.",
      "type": "string"
    },
    "associatedConnections": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/AssociatedConnection"
      },
      "x-omitempty": true
    }
  },
  "required": [
    "externalId",
    "name"
  ],
  "$defs": {
    "AssociatedConnection": {
      "type": "object",
      "properties": {
        "connectionId": {
          "type": "string"
        }
      },
      "required": [
        "connectionId"
      ]
    },
    "CurrencyCode": {
      "type": "string",
      "description": "Three-letter ISO 4217 currency code.",
      "minLength": 3,
      "maxLength": 3,
      "pattern": "^[A-Z]{3,3}$"
    },
    "ExternalID": {
      "type": "string",
      "pattern": "^[a-zA-Z0-9._\\-+=]{1,64}$",
      "description": "External ID is optional to use, but if used, the Atlar platform will persist it, index it, as well as require it to be unique across all resources. It is possible to retrieve a resource using the external ID using the prefix `external:`.",
      "x-omitempty": true
    }
  }
}