{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-payment-cryptography/json-schema/amazon-payment-cryptography-generate-auth-request-cryptogram-input-schema.json",
  "title": "GenerateAuthRequestCryptogramInput",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-payment-cryptography-operations-api-openapi.yml#/components/schemas/GenerateAuthRequestCryptogramInput",
  "type": "object",
  "properties": {
    "KeyIdentifier": {
      "type": "string",
      "description": "The keyARN of the IMK-AC (TR31_E0_EMV_MKEY_APP_CRYPTOGRAMS) that Amazon Web Services Payment Cryptography uses to generate the ARQC."
    },
    "TransactionData": {
      "type": "string",
      "description": "The transaction data that Amazon Web Services Payment Cryptography uses for ARQC generation. The same transaction data is used for ARQC verification by the issuer using VerifyAuthRequestCryptogram."
    },
    "MajorKeyDerivationMode": {
      "type": "string",
      "enum": [
        "EMV_OPTION_A",
        "EMV_OPTION_B"
      ],
      "description": "The method to use when deriving the major encryption key for ARQC generation within Amazon Web Services Payment Cryptography."
    },
    "SessionKeyDerivationAttributes": {
      "$ref": "#/$defs/SessionKeyDerivation"
    }
  },
  "required": [
    "KeyIdentifier",
    "TransactionData",
    "MajorKeyDerivationMode",
    "SessionKeyDerivationAttributes"
  ],
  "$defs": {
    "SessionKeyAmex": {
      "type": "object",
      "properties": {
        "PrimaryAccountNumber": {
          "type": "string",
          "description": "The Primary Account Number (PAN) of the cardholder. A PAN is a unique identifier for a payment credit or debit card and associates the card to a specific account holder."
        },
        "PanSequenceNumber": {
          "type": "string",
          "description": "A number that identifies and differentiates payment cards with the same Primary Account Number (PAN)."
        }
      },
      "required": [
        "PrimaryAccountNumber",
        "PanSequenceNumber"
      ]
    },
    "SessionKeyDerivation": {
      "type": "object",
      "properties": {
        "EmvCommon": {
          "$ref": "#/$defs/SessionKeyEmvCommon"
        },
        "Mastercard": {
          "$ref": "#/$defs/SessionKeyMastercard"
        },
        "Emv2000": {
          "$ref": "#/$defs/SessionKeyEmv2000"
        },
        "Amex": {
          "$ref": "#/$defs/SessionKeyAmex"
        },
        "Visa": {
          "$ref": "#/$defs/SessionKeyVisa"
        },
        "UnionPay": {
          "$ref": "#/$defs/SessionKeyUnionPay"
        }
      },
      "description": "Exactly one member is set."
    },
    "SessionKeyEmv2000": {
      "type": "object",
      "properties": {
        "PrimaryAccountNumber": {
          "type": "string",
          "description": "The Primary Account Number (PAN) of the cardholder. A PAN is a unique identifier for a payment credit or debit card and associates the card to a specific account holder."
        },
        "PanSequenceNumber": {
          "type": "string",
          "description": "A number that identifies and differentiates payment cards with the same Primary Account Number (PAN)."
        },
        "ApplicationTransactionCounter": {
          "type": "string",
          "description": "The transaction counter that is provided by the terminal during transaction processing."
        }
      },
      "required": [
        "PrimaryAccountNumber",
        "PanSequenceNumber",
        "ApplicationTransactionCounter"
      ]
    },
    "SessionKeyEmvCommon": {
      "type": "object",
      "properties": {
        "PrimaryAccountNumber": {
          "type": "string",
          "description": "The Primary Account Number (PAN) of the cardholder. A PAN is a unique identifier for a payment credit or debit card and associates the card to a specific account holder."
        },
        "PanSequenceNumber": {
          "type": "string",
          "description": "A number that identifies and differentiates payment cards with the same Primary Account Number (PAN)."
        },
        "ApplicationTransactionCounter": {
          "type": "string",
          "description": "The transaction counter that is provided by the terminal during transaction processing."
        }
      },
      "required": [
        "PrimaryAccountNumber",
        "PanSequenceNumber",
        "ApplicationTransactionCounter"
      ]
    },
    "SessionKeyMastercard": {
      "type": "object",
      "properties": {
        "PrimaryAccountNumber": {
          "type": "string",
          "description": "The Primary Account Number (PAN) of the cardholder. A PAN is a unique identifier for a payment credit or debit card and associates the card to a specific account holder."
        },
        "PanSequenceNumber": {
          "type": "string",
          "description": "A number that identifies and differentiates payment cards with the same Primary Account Number (PAN)."
        },
        "ApplicationTransactionCounter": {
          "type": "string",
          "description": "The transaction counter that is provided by the terminal during transaction processing."
        },
        "UnpredictableNumber": {
          "type": "string",
          "description": "A random number generated by the issuer."
        }
      },
      "required": [
        "PrimaryAccountNumber",
        "PanSequenceNumber",
        "ApplicationTransactionCounter",
        "UnpredictableNumber"
      ]
    },
    "SessionKeyUnionPay": {
      "type": "object",
      "properties": {
        "PrimaryAccountNumber": {
          "type": "string",
          "description": "The Primary Account Number (PAN) of the cardholder. A PAN is a unique identifier for a payment credit or debit card and associates the card to a specific account holder."
        },
        "PanSequenceNumber": {
          "type": "string",
          "description": "A number that identifies and differentiates payment cards with the same Primary Account Number (PAN). If not used, enter 00."
        },
        "ApplicationTransactionCounter": {
          "type": "string",
          "description": "The transaction counter that the terminal provides during transaction processing. This value is in hexadecimal format. For example, enter a decimal counter of 109 as 006D."
        }
      },
      "required": [
        "PrimaryAccountNumber",
        "PanSequenceNumber",
        "ApplicationTransactionCounter"
      ]
    },
    "SessionKeyVisa": {
      "type": "object",
      "properties": {
        "PrimaryAccountNumber": {
          "type": "string",
          "description": "The Primary Account Number (PAN) of the cardholder. A PAN is a unique identifier for a payment credit or debit card and associates the card to a specific account holder."
        },
        "PanSequenceNumber": {
          "type": "string",
          "description": "A number that identifies and differentiates payment cards with the same Primary Account Number (PAN)."
        }
      },
      "required": [
        "PrimaryAccountNumber",
        "PanSequenceNumber"
      ]
    }
  }
}