{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/citi/main/json-schema/citi-bal-inquiry-response-schema.json",
  "title": "BalInquiryResponse",
  "x-generated": "2026-10-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/citi-accounts-api-openapi.yml#/components/schemas/BalInquiryResponse",
  "properties": {
    "accountNumber": {
      "description": "Number of the account to which the balance inquiry relates",
      "type": "string",
      "format": "alphanumeric",
      "maxLength": 19
    },
    "accountLevel": {
      "description": "Heirarchy level to which balance inquiry relates<br>Possible Values<br>G - Corporate Group<br>R - Corporate Relationship<br>A - Financial Account<br>C - Card",
      "type": "string",
      "format": "alphanumeric",
      "maxLength": 1
    },
    "necessaryAmountAvailableRetail": {
      "description": "Returned when Account Type = C  and transactionAmount and transactionAmountCurrency are included in the request<br>Possible Value<br>Y - Yes<br>N - No",
      "type": "string",
      "format": "alphanumeric",
      "maxLength": 1
    },
    "wtpTierPercentage": {
      "description": "Percentage value of wholesale travel product interchange tier",
      "type": "string",
      "format": "alphanumeric",
      "maxLength": 6
    },
    "accountBalanceInfo": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/AccountBalanceInfo"
      }
    },
    "wtpTierCode": {
      "description": "Code of wholesale travel product interchange tier",
      "type": "string",
      "format": "alphanumeric",
      "maxLength": 3
    }
  },
  "required": [
    "accountNumber",
    "accountLevel",
    "accountBalanceInfo"
  ],
  "$defs": {
    "AccountBalanceInfo": {
      "properties": {
        "accountype": {
          "description": "Indicates the account Level or account type the account balance info is being returned for.<br>Possible values<br>Corporate Group<br>Corporate Relationship<br>Financial Account<br>Card<br>Cash<br>Foreign Currency Credit<br>Alternate Currency Credit<br>Declining Balance",
          "type": "string",
          "format": "alphanumeric",
          "maxLength": 1
        },
        "limit": {
          "description": "The maximum amount of credit that can be spent or the maximum amount allowed for cash withdrawals",
          "type": "string",
          "format": "alphanumeric",
          "maxLength": 18
        },
        "currentBalance": {
          "description": "Current balance of the account",
          "type": "string",
          "format": "alphanumeric",
          "maxLength": 18
        },
        "outstandingBalance": {
          "description": "Balance of authorized transactions that are not yet posted on account",
          "type": "string",
          "format": "alphanumeric",
          "maxLength": 18
        },
        "totalUsage": {
          "description": "Total amount of credit limit spent including outstanding balance",
          "type": "string",
          "format": "alphanumeric",
          "maxLength": 18
        },
        "totalUsagePercentage": {
          "description": "Percentage of total amount of credit limit spent including outstanding balance",
          "type": "string",
          "format": "alphanumeric",
          "maxLength": 7
        },
        "availableLimit": {
          "description": "Remaining limit available to spend or remaining limit available for cash withdrawal",
          "type": "string",
          "format": "alphanumeric",
          "maxLength": 18
        },
        "availableLimitPercentage": {
          "description": "The percent of the limit of that account which is allowed to be spent or to be withdrawn",
          "type": "string",
          "format": "alphanumeric",
          "maxLength": 7
        },
        "currency": {
          "description": "The currency of the account",
          "type": "string",
          "format": "alphanumeric",
          "maxLength": 3
        },
        "temporaryLimitExpiry": {
          "description": "Date when Temporary credit or cash Limit will cease to take effect. Returned when temporary credit or cash limit is active",
          "type": "string",
          "format": "alphanumeric",
          "maxLength": 8
        },
        "permanentLimit": {
          "description": "Amount of permanent credit or cash limit, when temporary limit is active. Returned when temporary credit or cash limit is active",
          "type": "string",
          "format": "alphanumeric",
          "maxLength": 18
        },
        "startDate": {
          "description": "Date when Foreign Currency Limit start to take effect",
          "type": "string",
          "format": "alphanumeric",
          "maxLength": 8
        },
        "expiryDate": {
          "description": "Date when Foreign Currency Limit or Declining Balance expires",
          "type": "string",
          "format": "alphanumeric",
          "maxLength": 8
        }
      },
      "required": [
        "accountype"
      ]
    }
  }
}