{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/atlar/json-schema/atlar-glaccount-jsonpatch-request-schema.json",
  "title": "GLAccountJSONPatchRequest",
  "description": "JSON Patch Request",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/atlar-gl-accounts-api-openapi.yml#/components/schemas/GLAccountJSONPatchRequest",
  "type": "array",
  "items": {
    "oneOf": [
      {
        "$ref": "#/$defs/GLAccountJSONPatchReplaceThirdPartyId"
      },
      {
        "$ref": "#/$defs/GLAccountJSONPatchReplaceAccountId"
      },
      {
        "$ref": "#/$defs/GLAccountJSONPatchRemoveAccountId"
      },
      {
        "$ref": "#/$defs/GLAccountJSONPatchReplaceType"
      },
      {
        "$ref": "#/$defs/GLAccountJSONPatchReplaceGlEntityIds"
      },
      {
        "$ref": "#/$defs/GLAccountJSONPatchReplaceName"
      },
      {
        "$ref": "#/$defs/GLAccountJSONPatchReplaceNumber"
      },
      {
        "$ref": "#/$defs/GLAccountJSONPatchReplaceExternalId"
      },
      {
        "$ref": "#/$defs/GLAccountJSONPatchReplaceDisplayType"
      },
      {
        "$ref": "#/$defs/GLAccountJSONPatchReplaceCurrency"
      }
    ]
  },
  "$defs": {
    "CurrencyCode": {
      "type": "string",
      "description": "Three-letter ISO 4217 currency code.",
      "minLength": 3,
      "maxLength": 3,
      "pattern": "^[A-Z]{3,3}$"
    },
    "GLAccountJSONPatchRemoveAccountId": {
      "description": "Unset the Atlar account identifier that corresponds to this general ledger account.",
      "type": "object",
      "properties": {
        "op": {
          "type": "string",
          "enum": [
            "remove"
          ]
        },
        "path": {
          "type": "string",
          "enum": [
            "/accountId"
          ]
        }
      },
      "additionalProperties": false,
      "required": [
        "op",
        "path"
      ]
    },
    "GLAccountJSONPatchReplaceAccountId": {
      "description": "Set the Atlar account identifier that corresponds to this general ledger account.",
      "type": "object",
      "properties": {
        "op": {
          "type": "string",
          "enum": [
            "replace"
          ]
        },
        "path": {
          "type": "string",
          "enum": [
            "/accountId"
          ]
        },
        "value": {
          "$ref": "#/$defs/ResourceID"
        }
      },
      "additionalProperties": false,
      "required": [
        "op",
        "path",
        "value"
      ]
    },
    "GLAccountJSONPatchReplaceCurrency": {
      "description": "Set the currency of the general ledger account.",
      "type": "object",
      "properties": {
        "op": {
          "type": "string",
          "enum": [
            "replace"
          ]
        },
        "path": {
          "type": "string",
          "enum": [
            "/currency"
          ]
        },
        "value": {
          "$ref": "#/$defs/CurrencyCode"
        }
      },
      "additionalProperties": false,
      "required": [
        "op",
        "path",
        "value"
      ]
    },
    "GLAccountJSONPatchReplaceDisplayType": {
      "description": "Set the display type of the general ledger account.",
      "type": "object",
      "properties": {
        "op": {
          "type": "string",
          "enum": [
            "replace"
          ]
        },
        "path": {
          "type": "string",
          "enum": [
            "/displayType"
          ]
        },
        "value": {
          "type": "string"
        }
      },
      "additionalProperties": false,
      "required": [
        "op",
        "path",
        "value"
      ]
    },
    "GLAccountJSONPatchReplaceExternalId": {
      "description": "Set the external identifier of the general ledger account.",
      "type": "object",
      "properties": {
        "op": {
          "type": "string",
          "enum": [
            "replace"
          ]
        },
        "path": {
          "type": "string",
          "enum": [
            "/externalId"
          ]
        },
        "value": {
          "type": "string"
        }
      },
      "additionalProperties": false,
      "required": [
        "op",
        "path",
        "value"
      ]
    },
    "GLAccountJSONPatchReplaceGlEntityIds": {
      "description": "Set the GL entity IDs for the general ledger account.",
      "type": "object",
      "properties": {
        "op": {
          "type": "string",
          "enum": [
            "replace"
          ]
        },
        "path": {
          "type": "string",
          "enum": [
            "/glEntityIds"
          ]
        },
        "value": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "minItems": 1
        }
      },
      "additionalProperties": false,
      "required": [
        "op",
        "path",
        "value"
      ]
    },
    "GLAccountJSONPatchReplaceName": {
      "description": "Set the name of the general ledger account.",
      "type": "object",
      "properties": {
        "op": {
          "type": "string",
          "enum": [
            "replace"
          ]
        },
        "path": {
          "type": "string",
          "enum": [
            "/name"
          ]
        },
        "value": {
          "type": "string"
        }
      },
      "additionalProperties": false,
      "required": [
        "op",
        "path",
        "value"
      ]
    },
    "GLAccountJSONPatchReplaceNumber": {
      "description": "Set the number of the general ledger account.",
      "type": "object",
      "properties": {
        "op": {
          "type": "string",
          "enum": [
            "replace"
          ]
        },
        "path": {
          "type": "string",
          "enum": [
            "/number"
          ]
        },
        "value": {
          "type": "string"
        }
      },
      "additionalProperties": false,
      "required": [
        "op",
        "path",
        "value"
      ]
    },
    "GLAccountJSONPatchReplaceThirdPartyId": {
      "description": "Set the third party identifier that corresponds to this general ledger account.",
      "type": "object",
      "properties": {
        "op": {
          "type": "string",
          "enum": [
            "replace"
          ]
        },
        "path": {
          "type": "string",
          "enum": [
            "/thirdPartyId"
          ]
        },
        "value": {
          "type": "string"
        }
      },
      "additionalProperties": false,
      "required": [
        "op",
        "path",
        "value"
      ]
    },
    "GLAccountJSONPatchReplaceType": {
      "description": "Set the type of the general ledger account.",
      "type": "object",
      "properties": {
        "op": {
          "type": "string",
          "enum": [
            "replace"
          ]
        },
        "path": {
          "type": "string",
          "enum": [
            "/type"
          ]
        },
        "value": {
          "$ref": "#/$defs/GLAccountType"
        }
      },
      "additionalProperties": false,
      "required": [
        "op",
        "path",
        "value"
      ]
    },
    "GLAccountType": {
      "type": "string",
      "description": "The general ledger account types are not uniform across other third-party systems.\nHowever, it is useful to have a consistent type for the general ledger account. For example,\nto suggest accounts one can match with a bank account.\n",
      "enum": [
        "UNSPECIFIED",
        "BANK",
        "ACCOUNTS_PAYABLE",
        "ACCOUNTS_RECEIVABLE"
      ]
    },
    "ResourceID": {
      "type": "string",
      "description": "Unique resource identifier.",
      "minLength": 32,
      "maxLength": 64
    }
  }
}