{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/ibanfirst/main/json-schema/ibanfirst-balance-schema.json",
  "title": "Balance",
  "description": "Representation of a balance.\n",
  "x-generated": "2026-10-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/ibanfirst-accounts-api-openapi.yml#/components/schemas/Balance",
  "type": "object",
  "properties": {
    "closingDate": {
      "$ref": "#/$defs/Date"
    },
    "bookingAmount": {
      "$ref": "#/$defs/Amount"
    },
    "valueAmount": {
      "$ref": "#/$defs/Amount"
    }
  },
  "$defs": {
    "Amount": {
      "type": [
        "object",
        "null"
      ],
      "description": "Representation of an amount.\n",
      "required": [
        "value",
        "currency"
      ],
      "properties": {
        "value": {
          "$ref": "#/$defs/QuotedDecimal"
        },
        "currency": {
          "$ref": "#/$defs/Currency"
        }
      }
    },
    "Currency": {
      "type": "string",
      "pattern": "^[A-Z]{3}$",
      "format": "^[A-Z]{3}$",
      "description": "A String representing the Three-digit ISO 4217 Currency Code of a currency. This String only contains capitalized letters.\n"
    },
    "Date": {
      "type": "string",
      "pattern": "^[0-9]{4}\\-[0-9]{2}\\-[0-9]{2}$",
      "format": "^[0-9]{4}\\-[0-9]{2}\\-[0-9]{2}$",
      "description": "A String representing a date by its year, month and day in month.\n    \n"
    },
    "QuotedDecimal": {
      "type": "string",
      "pattern": "^((\\-)?)[0-9]{12}((\\.[0-9]{1,7})?)$",
      "format": "^((\\-)?)[0-9]{12}((\\.[0-9]{1,7})?)$",
      "description": "A String representing a formatted floating number.\n"
    }
  }
}