{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/swift/json-schema/swift-cash-account41-schema.json",
  "title": "CashAccount41",
  "description": "Specifies the details of the cash account.",
  "x-generated": "2026-11-05",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/swift-cash-management-api-openapi.yml#/components/schemas/CashAccount41",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "account_identification",
    "name",
    "currency",
    "balances"
  ],
  "properties": {
    "account_identification": {
      "description": "Identification of the account as defined by the account service provider. It can be in IBAN or proprietary format.\n\nRECOMMENDATION IN ORDER OF PREFERENCE:\nIBAN - When available IBAN must be specified for instance endpoint or hyper link to work.\nOther - In the absence of IBAN, this must be an unique account identification used for routing of the payment to the account via clearing system. A format which is agreed between the account owner and the account servicer. For example a SWIFT BIC/Branch Code and Account number.\n",
      "type": "string",
      "minLength": 1,
      "maxLength": 34
    },
    "alternate_identification": {
      "description": "The ID of the account that the bank account is associated with. The value must be constant throughout the lifecycle of the account. This identification shall be used as a resource identifier where account identification cannot be used as a resource identification. Specified as Universally Unique Identifier (UUID) version 4, as described in IETC RFC 4122 \"Universally Unique Identifier (UUID) URN Namespace\n\nUsage: The account_identification is the resource identification. This identification should be used when account_identification cannot be used as an identification due to the internal policy of an organisation. Should that be the case, all other endpoint require account_identification in path parameter must use the same identification return by this endpoint.\n",
      "type": "string",
      "format": "uuid"
    },
    "account_servicer": {
      "$ref": "#/$defs/BICFIDec2014Identifier"
    },
    "name": {
      "$ref": "#/$defs/Max70Text"
    },
    "owner_name": {
      "$ref": "#/$defs/Max70Text"
    },
    "currency": {
      "$ref": "#/$defs/ActiveCurrencyCode"
    },
    "related_account": {
      "description": "Identifies the parent account of the account for which the statement has been issued.\nUsage: Should be used when more than one identification is required to clearly establish the identity. For example when Proxy Identification is specified in primary identification a secondary identification Proxy Code is required for unambiguous identification. Another example is when Virtual Account or Zero Balance Account is specified in the primary identification, the alternate identification should be the parent account.\n",
      "type": "string",
      "minLength": 1,
      "maxLength": 34
    },
    "balances": {
      "$ref": "#/$defs/BalancesList3"
    },
    "status": {
      "$ref": "#/$defs/Max35Text"
    },
    "credit_limit": {
      "$ref": "#/$defs/ActiveCurrencyAndAmount"
    },
    "links": {
      "$ref": "#/$defs/Links"
    }
  },
  "$defs": {
    "ActiveCurrencyAndAmount": {
      "type": "object",
      "description": "A number of monetary units specified in an active currency where the unit of currency is explicit and compliant with ISO 4217.",
      "properties": {
        "currency": {
          "$ref": "#/$defs/ActiveCurrencyCode"
        },
        "amount": {
          "type": "string",
          "maxLength": 19,
          "pattern": "^0*(([0-9]{0,13}\\.[0-9]{1,5})|([0-9]{0,14}\\.[0-9]{1,4})|([0-9]{0,15}\\.[0-9]{1,3})|([0-9]{0,16}\\.[0-9]{1,2})|([0-9]{0,17}\\.[0-9]{1,1})|0*|([0-9]{0,18}))$"
        }
      }
    },
    "ActiveCurrencyCode": {
      "type": "string",
      "pattern": "^[A-Z]{3,3}$",
      "description": "A code allocated to a currency by a Maintenance Agency under an international identification scheme as described in the latest edition of the international standard ISO 4217 'Codes for the representation of currencies and funds\n"
    },
    "AmountAndDirection52": {
      "type": "object",
      "description": "Posting of an item to a cash account, in the context of a cash transaction, that results in an increase or decrease to the balance of the account.",
      "additionalProperties": false,
      "properties": {
        "amount": {
          "$ref": "#/$defs/ActiveCurrencyAndAmount"
        },
        "credit_debit_indicator": {
          "$ref": "#/$defs/CreditDebitCode"
        }
      },
      "required": [
        "amount",
        "credit_debit_indicator"
      ]
    },
    "BICFIDec2014Identifier": {
      "type": "string",
      "description": "Code allocated to a financial institution by the ISO 9362 Registration Authority as described in ISO 9362 - 2014 - Banking - Banking telecommunication messages - Business identifier code (BIC)\n",
      "pattern": "^[A-Z0-9]{4,4}[A-Z]{2,2}[A-Z0-9]{2,2}([A-Z0-9]{3,3}){0,1}$"
    },
    "BalancesList3": {
      "type": "object",
      "description": "List of the balances that can be retrieved on a given account",
      "additionalProperties": false,
      "properties": {
        "current_balance": {
          "$ref": "#/$defs/CashCurrentBalance1"
        },
        "available_balance": {
          "$ref": "#/$defs/CashAvailableBalance1"
        },
        "forward_available_balance": {
          "type": "array",
          "description": "Provides detailed information of the forward available balance of a specific cash account. Subject to the service provided by the Account Servicer, forward available balance can be presented with multiple times for multiple reference dates.\n",
          "items": {
            "$ref": "#/$defs/CashForwardAvailableBalance1"
          }
        }
      },
      "required": [
        "current_balance"
      ]
    },
    "CashAvailableBalance1": {
      "type": "object",
      "description": "The amount of money that is at the disposal of the account owner on the date time specified. Available balance is calculated in the course of the account servicer business day, at the time specified, and subject to further changes during the business day. The balance is calculated on the basis of booked credit and debit items during the calculation time/period specified.\n",
      "additionalProperties": false,
      "properties": {
        "balance_amount": {
          "$ref": "#/$defs/AmountAndDirection52"
        },
        "availability_date": {
          "$ref": "#/$defs/ISODateTime"
        }
      },
      "required": [
        "balance_amount",
        "availability_date"
      ]
    },
    "CashCurrentBalance1": {
      "type": "object",
      "description": "Provides detailed information of the current balance of a specific cash account. It is the balance of the account calculated at the time of request before returning the response as specified in the date_time element. If the balance include credit line, this must be indicated using the element credit_line.\n",
      "additionalProperties": false,
      "properties": {
        "balance_amount": {
          "$ref": "#/$defs/AmountAndDirection52"
        },
        "last_change_date_time": {
          "$ref": "#/$defs/ISODateTime"
        },
        "date_time": {
          "$ref": "#/$defs/ISODateTime"
        },
        "last_committed_transaction_identification": {
          "$ref": "#/$defs/Max40Text"
        },
        "credit_line": {
          "type": "array",
          "description": "Provides details on the credit line linked to the account.",
          "items": {
            "$ref": "#/$defs/CreditLine6"
          }
        }
      },
      "required": [
        "balance_amount",
        "date_time"
      ]
    },
    "CashForwardAvailableBalance1": {
      "type": "object",
      "description": "Individual forward available balance details on a given cash account. It is the forward available balance of money that is at the disposal of the account owner on the date specified.\n",
      "additionalProperties": false,
      "properties": {
        "balance_amount": {
          "$ref": "#/$defs/AmountAndDirection52"
        },
        "availability_date": {
          "$ref": "#/$defs/ISODate"
        }
      },
      "required": [
        "balance_amount",
        "availability_date"
      ]
    },
    "CreditDebitCode": {
      "type": "string",
      "description": "Specifies if an operation is an increase or a decrease.\n*`CRDT_credit`-Operation is an increase.\n*`DBIT_debit`-Operation is a decrease.\n",
      "enum": [
        "CRDT",
        "DBIT"
      ]
    },
    "CreditLine6": {
      "type": "object",
      "description": "Specifies the details of a credit line.",
      "additionalProperties": false,
      "properties": {
        "included": {
          "description": "Indicates whether or not the credit line is included in the balance.",
          "type": "boolean"
        },
        "type": {
          "$ref": "#/$defs/Max35Text"
        },
        "amount": {
          "$ref": "#/$defs/ActiveCurrencyAndAmount"
        }
      },
      "required": [
        "included"
      ]
    },
    "ISODate": {
      "type": "string",
      "description": "A particular point in the progression of time in a calendar year expressed in the YYYY-MM-DD format. This representation is defined in \"XML Schema Part 2: Datatypes Second Edition - W3C Recommendation 28 October 2004\" which is aligned with ISO 8601.",
      "pattern": "^(?:[1-9]\\d{3}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1\\d|2[0-8])|(?:0[13-9]|1[0-2])-(?:29|30)|(?:0[13578]|1[02])-31)|(?:[1-9]\\d(?:0[48]|[2468][048]|[13579][26])|(?:[2468][048]|[13579][26])00)-02-29)$"
    },
    "ISODateTime": {
      "type": "string",
      "description": "A particular point in the progression of time defined by a mandatory date and a mandatory time component, expressed in either UTC time format (YYYY-MM-DDThh:mm:ss.sssZ), local time with UTC offset format (YYYY-MM-DDThh:mm:ss.sss+/-hh:mm), or local time format (YYYY-MM-DDThh:mm:ss.sss). These representations are defined in \"XML Schema Part 2: Datatypes Second Edition - W3C Recommendation 28 October 2004\" which is aligned with ISO 8601.\nNote on the time format:\n1) beginning / end of calendar day\n00:00:00 = the beginning of a calendar day\n24:00:00 = the end of a calendar day\n2) fractions of second in time format\nDecimal fractions of seconds may be included. In this case, the involved parties shall agree on the maximum number of digits that are allowed.\n",
      "pattern": "^(?:[1-9]\\d{3}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1\\d|2[0-8])|(?:0[13-9]|1[0-2])-(?:29|30)|(?:0[13578]|1[02])-31)|(?:[1-9]\\d(?:0[48]|[2468][048]|[13579][26])|(?:[2468][048]|[13579][26])00)-02-29)T(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.[0-9]+)?(?:Z|[+-][01]\\d:[0-5]\\d)?$"
    },
    "Link": {
      "type": "object",
      "readOnly": true,
      "description": "Contains a generic structure to support hyperlinking (REST level 3).",
      "additionalProperties": false,
      "required": [
        "href"
      ],
      "properties": {
        "href": {
          "description": "Specifies the link as a url. The href member identifies the target IRI location of the resource.",
          "type": "string",
          "maxLength": 256
        },
        "rel": {
          "description": "Specifies the operation. The value of this property MUST be a string. This property is required except self. The self reference contains the URI of the same resource.",
          "type": "string",
          "maxLength": 35
        },
        "type": {
          "description": "The value containing the HTTP verb used for the URL. If the type element is not included then the link MUST be available using GET.",
          "type": "string",
          "maxLength": 35
        }
      }
    },
    "Links": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Link"
      }
    },
    "Max35Text": {
      "type": "string",
      "description": "Specifies a character string with a maximum length of 35 characters.",
      "minLength": 1,
      "maxLength": 35
    },
    "Max40Text": {
      "type": "string",
      "description": "Specifies a character string with a maximum length of 40 characters.",
      "minLength": 1,
      "maxLength": 40
    },
    "Max70Text": {
      "type": "string",
      "description": "Specifies a character string with a maximum length of 70characters.",
      "minLength": 1,
      "maxLength": 70
    }
  }
}