{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/citi/main/json-schema/citi-authorization-request-schema.json",
  "title": "authorizationRequest",
  "x-generated": "2026-10-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/citi-authorization-api-openapi.yml#/components/schemas/authorizationRequest",
  "type": "object",
  "required": [
    "MessageTypeID",
    "PrimaryAccountNumber",
    "ProcessingCode",
    "TransactionAmount",
    "BillingAmount",
    "TransmissionDateAndTime",
    "SystemTraceAuditNumber",
    "LocalTransactionTime",
    "LocalTransactionDate",
    "CardExpiryDate",
    "MCCMerchantType",
    "AcquirerCountryCode",
    "POSEntryMode",
    "POSConditionCode",
    "AcquirerInstitutionID",
    "RetrievalReferenceNumber",
    "CardAcceptorTerminalID",
    "CardAcceptorIDCode",
    "CardAcceptorNameLocation",
    "CurrencyCodeTransaction",
    "CurrencyCodeBilling"
  ],
  "properties": {
    "MessageTypeID": {
      "type": "string",
      "minLength": 4,
      "maxLength": 4,
      "description": "ISO 8583 Message Type Identifier. Defines the purpose of the message in the transaction lifecycle.\n| Value | Meaning | |-------|---------| | `0100` | Authorization Request | | `0120` | Authorization Advice | | `0400` | Reversal Request | | `0420` | Reversal Advice |",
      "enum": [
        "0100",
        "0120",
        "0400",
        "0420"
      ]
    },
    "PrimaryAccountNumber": {
      "type": "string",
      "minLength": 19,
      "maxLength": 19,
      "description": "The cardholder's Primary Account Number (PAN) — the real card number. This is a sensitive field and must be handled in accordance with PCI-DSS requirements."
    },
    "ProcessingCode": {
      "type": "string",
      "minLength": 6,
      "maxLength": 6,
      "description": "A 6-digit code that describes the type of transaction being performed and the accounts affected. `000000` represents a standard purchase transaction."
    },
    "TransactionAmount": {
      "type": "string",
      "minLength": 1,
      "maxLength": 13,
      "description": "The transaction amount in the currency of the acquirer (`CurrencyCodeTransaction`). Expressed as a decimal string (e.g., `\"15.06\"` for $15.06)."
    },
    "BillingAmount": {
      "type": "string",
      "minLength": 1,
      "maxLength": 13,
      "description": "The amount billed to the cardholder in the cardholder's billing currency (`CurrencyCodeBilling`). May differ from `TransactionAmount` when a currency conversion is applied."
    },
    "TransmissionDateAndTime": {
      "type": "string",
      "minLength": 10,
      "maxLength": 10,
      "description": "The date and time the message was transmitted, in `MMDDHHmmSS` format (Month, Day, Hour, Minute, Second)."
    },
    "SystemTraceAuditNumber": {
      "type": "string",
      "minLength": 6,
      "maxLength": 6,
      "description": "A unique 6-digit number assigned by the message initiator to identify a specific cardholder transaction. Used to correlate all message types (auth, advice, reversal) that belong to the same transaction."
    },
    "LocalTransactionTime": {
      "type": "string",
      "minLength": 6,
      "maxLength": 6,
      "description": "The local time at the point of transaction, in `HHmmSS` format (Hour, Minute, Second)."
    },
    "LocalTransactionDate": {
      "type": "string",
      "minLength": 4,
      "maxLength": 4,
      "description": "The local date at the point of transaction, in `MMDD` format (Month, Day)."
    },
    "CardExpiryDate": {
      "type": "string",
      "minLength": 4,
      "maxLength": 4,
      "description": "The card's expiration date in `YYMM` format (Year, Month)."
    },
    "MCCMerchantType": {
      "type": "string",
      "minLength": 4,
      "maxLength": 4,
      "description": "The Merchant Category Code (MCC) — a 4-digit code classifying the type of business the merchant operates. Defined by Visa/Mastercard specifications."
    },
    "AcquirerCountryCode": {
      "type": "string",
      "minLength": 3,
      "maxLength": 3,
      "description": "The ISO 3166-1 numeric country code of the country where the acquiring institution is located (e.g., `702` for Singapore, `840` for USA)."
    },
    "POSEntryMode": {
      "type": "string",
      "minLength": 3,
      "maxLength": 4,
      "description": "Indicates the method used to capture the PAN and the PIN entry capability of the terminal. Composed of a PAN entry mode code and a PIN capability code."
    },
    "POSConditionCode": {
      "type": "string",
      "minLength": 0,
      "maxLength": 2,
      "description": "**(Visa only)** A code identifying the transaction conditions at the point-of-sale. For Mastercard transactions, refer to the `MCF61` fields instead. May be empty for non-Visa transactions."
    },
    "AcquirerInstitutionID": {
      "type": "string",
      "minLength": 6,
      "maxLength": 11,
      "description": "Identifies the acquiring institution (e.g., the merchant's bank) or its agent. Also known as the Bank Identification Number (BIN) of the acquirer."
    },
    "RetrievalReferenceNumber": {
      "type": "string",
      "minLength": 12,
      "maxLength": 12,
      "description": "A 12-character reference number supplied by the acquiring system. Used to locate the original source document of the transaction and to correlate related messages (e.g., reversals)."
    },
    "CardAcceptorTerminalID": {
      "type": "string",
      "minLength": 8,
      "maxLength": 8,
      "description": "An 8-character identifier for the specific terminal at the card acceptor's location (e.g., a POS terminal ID)."
    },
    "CardAcceptorIDCode": {
      "type": "string",
      "minLength": 15,
      "maxLength": 15,
      "description": "The Merchant ID (MID) — a 15-character code that uniquely identifies the merchant in the transaction."
    },
    "CardAcceptorNameLocation": {
      "type": "string",
      "minLength": 40,
      "maxLength": 40,
      "description": "The name and location of the card acceptor (merchant), padded to 40 characters. Typically formatted as `<MERCHANT NAME> <CITY> <COUNTRY CODE>`."
    },
    "CurrencyCodeTransaction": {
      "type": "string",
      "minLength": 3,
      "maxLength": 3,
      "description": "The ISO 4217 numeric currency code for the transaction currency — the local currency at the point of sale (e.g., `702` for SGD, `840` for USD)."
    },
    "CurrencyCodeBilling": {
      "type": "string",
      "minLength": 3,
      "maxLength": 3,
      "description": "The ISO 4217 numeric currency code used to bill the cardholder's account. May differ from `CurrencyCodeTransaction` when a currency conversion is applied."
    },
    "VisaF60TermEntCapab": {
      "type": "string",
      "minLength": 1,
      "maxLength": 1,
      "description": "**(Visa only)** Terminal Entry Capability — identifies the terminal's ability to electronically read account numbers and expiration dates from cards."
    },
    "VisaF60ChipCondCode": {
      "type": "string",
      "minLength": 1,
      "maxLength": 1,
      "description": "**(Visa only)** Chip Condition Code — provides information about fallback transactions initiated from the magnetic stripe of a VSDC card at a VSDC terminal."
    },
    "VisaF60SpclCondIndic": {
      "type": "string",
      "minLength": 1,
      "maxLength": 1,
      "description": "**(Visa only)** Special Condition Indicator — describes selected special conditions at the point-of-sale."
    },
    "VisaF60ChipTxnIndic": {
      "type": "string",
      "minLength": 1,
      "maxLength": 1,
      "description": "**(Visa only)** Chip Transaction Indicator — set by full VSDC data acquirers when the terminal indicates a chip-based transaction."
    },
    "VisaF60MoToECIndic": {
      "type": "string",
      "minLength": 2,
      "maxLength": 2,
      "description": "**(Visa only)** Mail Order / Telephone Order / E-Commerce Indicator. For MOTO transactions (field 25 = `08`), identifies the order type. For e-commerce transactions (field 25 = `59`), identifies the security level used."
    },
    "VisaF123VirtualCardNbr": {
      "type": "string",
      "minLength": 19,
      "maxLength": 19,
      "description": "**(Visa only)** The Visa Virtual Card Number (token). Present when the transaction is initiated using a tokenized card (e.g., via a digital wallet)."
    },
    "VisaF123WalletSPId": {
      "type": "string",
      "minLength": 11,
      "maxLength": 11,
      "description": "**(Visa only)** Token Requestor ID / Wallet Service Provider ID. Identifies the digital wallet or token requestor that initiated the transaction."
    },
    "VisaF126RecurTxnIndic": {
      "type": "string",
      "minLength": 1,
      "maxLength": 1,
      "description": "**(Visa only)** Recurring Transaction Indicator. A value of `R` identifies this as a recurring transaction (e.g., a subscription).",
      "enum": [
        "R"
      ]
    },
    "MCF48VirtualCardNbr": {
      "type": "string",
      "minLength": 19,
      "maxLength": 19,
      "description": "**(Mastercard only)** The Mastercard Virtual Card Number (token). Present when the transaction is initiated using a tokenized card (e.g., via a digital wallet)."
    },
    "MCF48WalletSPId": {
      "type": "string",
      "minLength": 11,
      "maxLength": 11,
      "description": "**(Mastercard only)** Token / Wallet Service Provider ID. Identifies the digital wallet or token requestor that initiated the transaction."
    },
    "MCF61POSTermAtt": {
      "type": "string",
      "minLength": 1,
      "maxLength": 1,
      "description": "**(Mastercard only)** POS Terminal Attendance — indicates whether the card acceptor is attending the terminal at the time of the transaction."
    },
    "MCF61POSCHPresence": {
      "type": "string",
      "minLength": 1,
      "maxLength": 1,
      "description": "**(Mastercard only)** POS Cardholder Presence — indicates whether the cardholder is physically present at the point of service. A value of `4` indicates a recurring transaction."
    },
    "MCF61POSCdPresence": {
      "type": "string",
      "minLength": 1,
      "maxLength": 1,
      "description": "**(Mastercard only)** POS Card Presence — indicates whether the physical card is present at the point of service."
    },
    "MCF61POSTranStatus": {
      "type": "string",
      "minLength": 1,
      "maxLength": 1,
      "description": "**(Mastercard only)** POS Transaction Status — indicates the purpose or current status of the authorization request."
    },
    "MCF61POSTranSec": {
      "type": "string",
      "minLength": 1,
      "maxLength": 1,
      "description": "**(Mastercard only)** POS Transaction Security — indicates the card acceptor's confidence level in the security of the transaction."
    },
    "MCF61POSChActTermLvl": {
      "type": "string",
      "minLength": 1,
      "maxLength": 1,
      "description": "**(Mastercard only)** Cardholder-Activated Terminal Level — indicates the type of cardholder-activated terminal used to initiate the transaction (e.g., ATM, kiosk)."
    },
    "MCF61POSCountryCode": {
      "type": "string",
      "minLength": 3,
      "maxLength": 3,
      "description": "**(Mastercard only)** POS Country Code — the ISO 3166-1 numeric country code of the POS location (not the acquirer location)."
    }
  }
}