{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/gsma/json-schema/gsma-response-authorisation-code-schema.json",
  "title": "responseAuthorisationCode",
  "x-generated": "2026-11-09",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/gsma-authorisation-codes-api-openapi.yml#/components/schemas/responseAuthorisationCode",
  "type": "object",
  "required": [
    "authorisationCode",
    "codeState"
  ],
  "properties": {
    "authorisationCode": {
      "$ref": "#/$defs/authorisationCode"
    },
    "codeState": {
      "$ref": "#/$defs/codeState"
    },
    "amount": {
      "description": "Indicates the amount associated with the authorisation code.",
      "allOf": [
        {
          "$ref": "#/$defs/amount"
        }
      ]
    },
    "currency": {
      "description": "Indicates the Amount Currency. Must be supplied when an amount is supplied.",
      "allOf": [
        {
          "$ref": "#/$defs/currency"
        }
      ]
    },
    "amountType": {
      "$ref": "#/$defs/amountType"
    },
    "codeLifetime": {
      "$ref": "#/$defs/codeLifetime"
    },
    "holdFundsIndicator": {
      "$ref": "#/$defs/holdFundsIndicator"
    },
    "redemptionAccountIdentifiers": {
      "$ref": "#/$defs/redemptionAccountIdentifiers"
    },
    "redemptionChannels": {
      "$ref": "#/$defs/redemptionChannels"
    },
    "redemptionTransactionTypes": {
      "$ref": "#/$defs/redemptionTransactionTypes"
    },
    "requestingOrganisation": {
      "$ref": "#/$defs/requestingOrganisation"
    },
    "creationDate": {
      "$ref": "#/$defs/creationDate"
    },
    "modificationDate": {
      "$ref": "#/$defs/modificationDate"
    },
    "requestDate": {
      "$ref": "#/$defs/requestDate"
    },
    "customData": {
      "$ref": "#/$defs/customDataArray"
    },
    "metadata": {
      "$ref": "#/$defs/metadataArray"
    }
  },
  "$defs": {
    "amount": {
      "type": "string",
      "minLength": 1,
      "maxLength": 23,
      "pattern": "^([0]|([1-9][0-9]{0,17}))([.][0-9]{0,3}[0-9])?$"
    },
    "amountType": {
      "type": "string",
      "description": "The amount for the authorisation can be an exact amount or can be a maximum amount.",
      "enum": [
        "exact",
        "maximum"
      ]
    },
    "authorisationCode": {
      "type": "string",
      "description": "The code that will be presented to the other party for redemption.",
      "maxLength": 256
    },
    "codeLifetime": {
      "type": "number",
      "format": "int32",
      "minimum": 1,
      "description": "Indicates the expiry time in seconds of the code."
    },
    "codeState": {
      "type": "string",
      "description": "Indicates the state of the Authorisation Code.",
      "enum": [
        "active",
        "expired",
        "cancelled"
      ]
    },
    "creationDate": {
      "type": "string",
      "format": "date-time",
      "description": "Date and time when the object was created by the API Provider."
    },
    "currency": {
      "type": "string",
      "enum": [
        "AED",
        "AFN",
        "ALL",
        "AMD",
        "ANG",
        "AOA",
        "ARS",
        "AUD",
        "AWG",
        "AZN",
        "BAM",
        "BBD",
        "BDT",
        "BGN",
        "BHD",
        "BIF",
        "BMD",
        "BND",
        "BOB",
        "BOV",
        "BRL",
        "BSD",
        "BTN",
        "BWP",
        "BYN",
        "BZD",
        "CAD",
        "CDF",
        "CHE",
        "CHF",
        "CHW",
        "CLF",
        "CLP",
        "CNY",
        "COP",
        "COU",
        "CRC",
        "CUC",
        "CUP",
        "CVE",
        "CZK",
        "DJF",
        "DKK",
        "DOP",
        "DZD",
        "EGP",
        "ERN",
        "ETB",
        "EUR",
        "FJD",
        "FKP",
        "GBP",
        "GEL",
        "GHS",
        "GIP",
        "GMD",
        "GNF",
        "GTQ",
        "GYD",
        "HKD",
        "HNL",
        "HRK",
        "HTG",
        "HUF",
        "IDR",
        "ILS",
        "INR",
        "IQD",
        "IRR",
        "ISK",
        "JMD",
        "JOD",
        "JPY",
        "KES",
        "KGS",
        "KHR",
        "KMF",
        "KPW",
        "KRW",
        "KWD",
        "KYD",
        "KZT",
        "LAK",
        "LBP",
        "LKR",
        "LRD",
        "LSL",
        "LYD",
        "MAD",
        "MDL",
        "MGA",
        "MKD",
        "MMK",
        "MNT",
        "MOP",
        "MRO",
        "MUR",
        "MVR",
        "MWK",
        "MXN",
        "MXV",
        "MYR",
        "MZN",
        "NAD",
        "NGN",
        "NIO",
        "NOK",
        "NPR",
        "NZD",
        "OMR",
        "PAB",
        "PEN",
        "PGK",
        "PHP",
        "PKR",
        "PLN",
        "PYG",
        "QAR",
        "RON",
        "RSD",
        "RUB",
        "RWF",
        "SAR",
        "SBD",
        "SCR",
        "SDG",
        "SEK",
        "SGD",
        "SHP",
        "SLL",
        "SOS",
        "SRD",
        "SSP",
        "STD",
        "SVC",
        "SYP",
        "SZL",
        "THB",
        "TJS",
        "TMT",
        "TND",
        "TOP",
        "TRY",
        "TTD",
        "TWD",
        "TZS",
        "UAH",
        "UGX",
        "USD",
        "USN",
        "UYI",
        "UYU",
        "UZS",
        "VEF",
        "VND",
        "VUV",
        "WST",
        "XAF",
        "XAG",
        "XAU",
        "XBA",
        "XBB",
        "XBC",
        "XBD",
        "XCD",
        "XDR",
        "XOF",
        "XPD",
        "XPF",
        "XPT",
        "XSU",
        "XTS",
        "XUA",
        "XXX",
        "YER",
        "ZAR",
        "ZMW",
        "ZWL"
      ]
    },
    "customData": {
      "type": "object",
      "required": [
        "key",
        "value"
      ],
      "properties": {
        "key": {
          "type": "string",
          "description": "Identifies the type of additional field.",
          "minLength": 1,
          "maxLength": 256
        },
        "value": {
          "type": "string",
          "description": "Identifies the value of the additional field.",
          "minLength": 1,
          "maxLength": 256
        }
      }
    },
    "customDataArray": {
      "type": "array",
      "description": "A collection of key/value pairs. These can be used to populate provider specific fields.",
      "items": {
        "$ref": "#/$defs/customData"
      },
      "maxItems": 20
    },
    "holdFundsIndicator": {
      "type": "boolean",
      "description": "Indicates whether funds should be reserved against the payers account where the payer is the requestor."
    },
    "metadata": {
      "type": "object",
      "required": [
        "key",
        "value"
      ],
      "properties": {
        "key": {
          "type": "string",
          "description": "Identifies the type of additional field.",
          "minLength": 1,
          "maxLength": 256
        },
        "value": {
          "type": "string",
          "description": "Identifies the value of the additional field.",
          "minLength": 1,
          "maxLength": 256
        }
      }
    },
    "metadataArray": {
      "type": "array",
      "description": "A collection of key/value pairs. These can be used to populate additional properties that describe administrative information regarding the resource.",
      "items": {
        "$ref": "#/$defs/metadata"
      },
      "maxItems": 20
    },
    "modificationDate": {
      "type": "string",
      "format": "date-time",
      "description": "Date and time when the object was modified by the API Provider."
    },
    "party": {
      "type": "object",
      "required": [
        "key",
        "value"
      ],
      "properties": {
        "key": {
          "type": "string",
          "description": "Provides the account identifier type.",
          "minLength": 1,
          "maxLength": 256
        },
        "value": {
          "type": "string",
          "description": "Provides the account identifier type value.",
          "minLength": 1,
          "maxLength": 256
        }
      }
    },
    "redemptionAccountIdentifiers": {
      "type": "array",
      "description": "A collection of key/value pairs that enable the redemption account to be identified. Keys include MSISDN and Wallet Identifier.",
      "items": {
        "$ref": "#/$defs/party"
      },
      "maxItems": 50
    },
    "redemptionChannels": {
      "type": "array",
      "description": "Indicates the channel(s) that the code can be redeemed against, e.g. ATM, Merchant, etc.",
      "items": {
        "type": "object",
        "properties": {
          "channelType": {
            "type": "string",
            "description": "Identifies the channel type.",
            "minLength": 1,
            "maxLength": 256
          }
        },
        "required": [
          "channelType"
        ]
      },
      "maxItems": 50
    },
    "redemptionTransactionTypes": {
      "type": "array",
      "description": "Indicates the Transaction Types(s) that the code can be redeemed against.",
      "items": {
        "type": "object",
        "properties": {
          "transactionType": {
            "$ref": "#/$defs/type"
          },
          "transactionSubtype": {
            "$ref": "#/$defs/subType"
          }
        },
        "required": [
          "transactionType"
        ]
      },
      "maxItems": 50
    },
    "requestDate": {
      "type": "string",
      "format": "date-time",
      "description": "The date and time of the request as supplied by the client."
    },
    "requestingOrganisation": {
      "type": "object",
      "description": "An object that details the originating organisation of the request.",
      "required": [
        "requestingOrganisationIdentifierType",
        "requestingOrganisationIdentifier"
      ],
      "properties": {
        "requestingOrganisationIdentifierType": {
          "type": "string",
          "description": "Identifies the identifier type of the requesting organisation.",
          "enum": [
            "lei",
            "swiftbic",
            "organisationid"
          ]
        },
        "requestingOrganisationIdentifier": {
          "type": "string",
          "description": "Contains the requesting organisation identifier.",
          "minLength": 1,
          "maxLength": 256
        }
      }
    },
    "subType": {
      "type": "string",
      "description": "A non-harmonised sub-classification of the type of transaction. Values are not fixed, and usage will vary according to Provider.",
      "minLength": 0,
      "maxLength": 256
    },
    "type": {
      "type": "string",
      "description": "The harmonised Transaction Type.",
      "enum": [
        "billpay",
        "deposit",
        "disbursement",
        "transfer",
        "merchantpay",
        "inttransfer",
        "adjustment",
        "reversal",
        "withdrawal"
      ]
    }
  }
}