# Example of Cardholder Present Requests
source: https://developer.mastercard.com/mastercard-gateway/documentation/gateway-features/trans-enrich-data/cardholder-present-data/exam-cardhold-pre-req/index.md

## Start of travel period {#start-of-travel-period}

Example: Mastercard and American Express -- Authorize before the start of a travel period.

### Authorize {#authorize}

| HTTP Method |                                                     URL                                                      |
|-------------|--------------------------------------------------------------------------------------------------------------|
| PUT         | https://{{host}}/api/rest/version/66/merchant/CYG_S2I_MER2/order/{{order_id}}/transaction/{{transaction_id}} |

```json
{
  "apiOperation": "AUTHORIZE",
  "order": {
    "amount": "1.00",
    "currency": "AUD"
  },
  "posTerminal": {
    "address": {
      "country": "AUS",
      "postcodeZip": "4000"
    },
    "attended": "UNATTENDED",
    "cardPresenceCapability": "CARD_PRESENT",
    "cardholderActivated": "SELF_SERVICE_TERMINAL",
    "inputCapability": "CONTACTLESS_CHIP",
    "lane": "99991111",
    "location": "MERCHANT_TERMINAL_ON_PREMISES",
    "panEntryMode": "CONTACTLESS",
    "pinEntryCapability": "PIN_NOT_SUPPORTED"
  },
  "sourceOfFunds": {
    "provided": {
      "card": {
        "emvRequest": {
          "5F2A": "036",
          "5F34": "099",
          "82": "0000",
          "84": "010101010101",
          "95": "0000000000",
          "9A": "161021",
          "9B": "0101",
          "9C": "00",
          "9F02": "000000010000",
          "9F03": "000000000000",
          "9F10": "06011103A000000A0100000000000BB0ABAD",
          "9F1A": "036",
          "9F1E": "0123ABCD",
          "9F26": "D1F722D47FCA8273",
          "9F27": "40",
          "9F33": "E0B8C8",
          "9F34": "1E0300",
          "9F35": "12",
          "9F36": "0002",
          "9F37": "2A4E1690",
          "9F6E": "0101"
        },
        "expiry": {
          "month": "12",
          "year": "39"
        },
        "track2": "400555xxxxxx0019=391220xxxx06711"
      }
    }
  },
  "type": "CARD",
  "transaction": {
    "source": "CARD_PRESENT",
    "transit": {
      "aggregatedFare": {
        "type": "FARE",
        "aggregationStartDate": "2023-04-20",
        "transportationMode": "Bus"
      }
    }
  }
}
```

Example: Visa -- card verification before the start of a travel period.

### Verify {#verify}

| HTTP Method |                                                     URL                                                      |
|-------------|--------------------------------------------------------------------------------------------------------------|
| PUT         | https://{{host}}/api/rest/version/66/merchant/CYG_S2I_MER2/order/{{order_id}}/transaction/{{transaction_id}} |

```json
{
  "apiOperation": "VERIFY",
  "order": {
    "amount": "0.00",
    "currency": "AUD"
  },
  "posTerminal": {
    "address": {
      "country": "AUS",
      "postcodeZip": "4000"
    },
    "attended": "UNATTENDED",
    "cardPresenceCapability": "CARD_PRESENT",
    "cardholderActivated": "SELF_SERVICE_TERMINAL",
    "inputCapability": "CONTACTLESS_CHIP",
    "lane": "99991111",
    "location": "MERCHANT_TERMINAL_ON_PREMISES",
    "panEntryMode": "CONTACTLESS",
    "pinEntryCapability": "PIN_NOT_SUPPORTED"
  },
  "sourceOfFunds": {
    "provided": {
      "card": {
        "emvRequest": {
          "5F2A": "036",
          "5F34": "099",
          "82": "0000",
          "84": "010101010101",
          "95": "0000000000",
          "9A": "161021",
          "9B": "0101",
          "9C": "00",
          "9F02": "000000010000",
          "9F03": "000000000000",
          "9F10": "06011103A000000A0100000000000BB0ABAD",
          "9F1A": "036",
          "9F1E": "0123ABCD",
          "9F26": "D1F722D47FCA8273",
          "9F27": "40",
          "9F33": "E0B8C8",
          "9F34": "1E0300",
          "9F35": "12",
          "9F36": "0002",
          "9F37": "2A4E1690",
          "9F6E": "0101"
        },
        "expiry": {
          "month": "12",
          "year": "39"
        },
        "track2": "400555xxxxxx0019=391220xxxx06711"
      }
    }
  },
  "type": "CARD",
  "transaction": {
    "source": "CARD_PRESENT",
    "transit": {
      "aggregatedFare": {
        "type": "FARE",
        "aggregationStartDate": "2023-04-20",
        "transportationMode": "Bus"
      }
    }
  }
}
```

## Example: AES verify transaction with Point-to-Point Encryption (P2PE) block {#example-aes-verify-transaction-with-point-to-point-encryption-p2pe-block}

```json
{
  "order": {
    "currency": "AUD"
  },
  "apiOperation": "VERIFY",
  "transaction": {
    "source": "CARD_PRESENT"
  },
  "posTerminal": {
    "address": {
      "city": "Abu Dhabi",
      "country": "ARE"
    },
    "attended": "UNATTENDED",
    "cardholderActivated": "SELF_SERVICE_TERMINAL",
    "cardPresenceCapability": "CARD_PRESENT",
    "inputCapability": "CONTACTLESS_CHIP",
    "lane": "Lane_03",
    "location": "MERCHANT_TERMINAL_ON_PREMISES",
    "onlineReasonCode": "OVER_FLOOR_LIMIT",
    "panEntryMode": "CONTACTLESS",
    "pinEntryCapability": "PIN_NOT_SUPPORTED",
    "pinLengthCapability": "6",
    "serialNumber": "12345678"
  },
  "sourceOfFunds": {
    "provided": {
      "card": {
        "emvRequest": {
          "5F2A": "036",
          "5F34": "099",
          "82": "0000",
          "84": "010101010101",
          "95": "0000000000",
          "9A": "161021",
          "9B": "0101",
          "9C": "00",
          "9F02": "000000010000",
          "9F03": "000000000000",
          "9F10": "06011103A000000A0100000000000BB0ABAD",
          "9F1A": "036",
          "9F1E": "0123ABCD",
          "9F26": "D1F722D47FCA8273",
          "9F27": "40",
          "9F33": "E0B8C8",
          "9F34": "1E0300",
          "9F35": "12",
          "9F36": "0002",
          "9F37": "2A4E1690",
          "9F6E": "0101",
          "9F39": "07",
          "9F1C": "01"
        },
        "p2pe": {
          "cardBin": "512345",
          "encryptionState": "VALID",
          "initializationVector": "00000000000000000000000000000000",
          "keySerialNumber": "3CE000000000000000000001",
          "payload": "1A984A8E5B91E4CBFF5F76AFE6913D2F4FF1F0FF271B61664F08AA734722C183"
        }
      }
    },
    "type": "CARD"
  }
}
```

```json
{
  "gatewayEntryPoint": "WEB_SERVICES_API",
  "merchant": "CYG_S2I_MER1",
  "order": {
    "amount": 0.00,
    "chargeback": {
      "amount": 0,
      "currency": "AUD"
    },
    "creationTime": "2024-09-30T11:46:58.267Z",
    "currency": "AUD",
    "id": "911080425",
    "lastUpdatedTime": "2024-09-30T11:46:58.601Z",
    "merchantAmount": 0.00,
    "merchantCategoryCode": "1234",
    "merchantCurrency": "AUD",
    "status": "VERIFIED",
    "totalAuthorizedAmount": 0.00,
    "totalCapturedAmount": 0.00,
    "totalDisbursedAmount": 0.00,
    "totalRefundedAmount": 0.00
  },
  "posTerminal": {
    "address": {
      "city": "Abu Dhabi",
      "country": "ARE"
    },
    "attended": "UNATTENDED",
    "cardPresenceCapability": "CARD_PRESENT",
    "cardholderActivated": "SELF_SERVICE_TERMINAL",
    "inputCapability": "CONTACTLESS_CHIP",
    "lane": "Lane_03",
    "location": "MERCHANT_TERMINAL_ON_PREMISES",
    "onlineReasonCode": "OVER_FLOOR_LIMIT",
    "panEntryMode": "CONTACTLESS",
    "pinEntryCapability": "PIN_NOT_SUPPORTED",
    "pinLengthCapability": 6,
    "serialNumber": "12345678"
  },
  "response": {
    "acquirerCode": "00",
    "gatewayCode": "APPROVED"
  },
  "result": "SUCCESS",
  "sourceOfFunds": {
    "provided": {
      "card": {
        "brand": "MASTERCARD",
        "emvRequest": {
          "5F2A": "036",
          "5F34": "099",
          "82": "0000",
          "84": "010101010101",
          "95": "0000000000",
          "9A": "161021",
          "9B": "0101",
          "9C": "00",
          "9F02": "000000010000",
          "9F03": "000000000000",
          "9F10": "06011103A000000A0100000000000BB0ABAD",
          "9F1A": "036",
          "9F1C": "01",
          "9F1E": "0123ABCD",
          "9F26": "D1F722D47FCA8273",
          "9F27": "40",
          "9F33": "E0B8C8",
          "9F34": "1E0300",
          "9F35": "12",
          "9F36": "0002",
          "9F37": "2A4E1690",
          "9F39": "07",
          "9F6E": "0101"
        },
        "expiry": {
          "month": "1",
          "year": "39"
        },
        "fundingMethod": "DEBIT",
        "issuer": "AFRILAND FIRST BANK",
        "number": "512345xxxxxx2298",
        "paymentAccountReference": "1234567890123456TC020MDESDE56",
        "scheme": "MASTERCARD",
        "sequenceNumber": "099",
        "storedOnFile": "NOT_STORED",
        "trackDataProvided": true
      }
    },
    "type": "CARD"
  },
  "timeOfLastUpdate": "2024-09-30T11:46:58.601Z",
  "timeOfRecord": "2024-09-30T11:46:58.403Z",
  "transaction": {
    "acquirer": {
      "id": "CYG_TESTACQ_S2I",
      "merchantId": "9808"
    },
    "amount": 0.00,
    "currency": "AUD",
    "id": "395744825",
    "receipt": "427411097136",
    "source": "CARD_PRESENT",
    "stan": "97136",
    "terminal": "0001",
    "type": "VERIFICATION"
  },
  "version": "100"
}
```

## Example: Auth transaction to verify the PAR in response {#example-auth-transaction-to-verify-the-par-in-response}

```json
{
  "order": {
    "amount": "100",
    "currency": "AUD"
  },
  "apiOperation": "AUTHORIZE",
  "transaction": {
    "source": "INTERNET"
  },
  "sourceOfFunds": {
    "provided": {
      "card": {
        "expiry": {
          "month": "01",
          "year": "39"
        },
        "number": "5123459999992298",
        "securityCode": "100",
        "storedOnFile": "TO_BE_STORED"
      }
    },
    "type": "CARD"
  }
}
```

```json
{
  "authorizationResponse": {
    "cardSecurityCodeError": "M",
    "commercialCard": "123",
    "commercialCardIndicator": "1",
    "date": "0930",
    "financialNetworkCode": "MCC",
    "posData": "1025104006600",
    "posEntryMode": "812",
    "processingCode": "003000",
    "responseCode": "00",
    "stan": "98136",
    "time": "115541",
    "transactionIdentifier": "165832705",
    "transactionIntegrityClass": "A1"
  },
  "gatewayEntryPoint": "WEB_SERVICES_API",
  "merchant": "CYG_S2I_MER2",
  "order": {
    "amount": 100.00,
    "authenticationStatus": "AUTHENTICATION_NOT_IN_EFFECT",
    "certainty": "FINAL",
    "chargeback": {
      "amount": 0,
      "currency": "AUD"
    },
    "creationTime": "2024-09-30T11:55:41.373Z",
    "currency": "AUD",
    "id": "793102900",
    "lastUpdatedTime": "2024-09-30T11:55:41.718Z",
    "merchantAmount": 100.00,
    "merchantCategoryCode": "4111",
    "merchantCurrency": "AUD",
    "status": "AUTHORIZED",
    "totalAuthorizedAmount": 100.00,
    "totalCapturedAmount": 0.00,
    "totalDisbursedAmount": 0.00,
    "totalRefundedAmount": 0.00
  },
  "response": {
    "acquirerCode": "00",
    "acquirerMessage": "Approved",
    "cardSecurityCode": {
      "acquirerCode": "M",
      "gatewayCode": "MATCH"
    },
    "gatewayCode": "APPROVED",
    "gatewayRecommendation": "NO_ACTION"
  },
  "result": "SUCCESS",
  "sourceOfFunds": {
    "provided": {
      "card": {
        "brand": "MASTERCARD",
        "expiry": {
          "month": "1",
          "year": "39"
        },
        "fundingMethod": "DEBIT",
        "issuer": "AFRILAND FIRST BANK",
        "number": "512345xxxxxx2298",
        "paymentAccountReference": "1234567890123456TC020MDESDE56",
        "scheme": "MASTERCARD",
        "storedOnFile": "TO_BE_STORED"
      }
    },
    "type": "CARD"
  },
  "timeOfLastUpdate": "2024-09-30T11:55:41.718Z",
  "timeOfRecord": "2024-09-30T11:55:41.533Z",
  "transaction": {
    "acquirer": {
      "batch": 20240930,
      "date": "0930",
      "id": "CYG_TESTACQ_S2I",
      "merchantId": "9808",
      "transactionId": "165832705"
    },
    "amount": 100.00,
    "authenticationStatus": "AUTHENTICATION_NOT_IN_EFFECT",
    "authorizationCode": "112233",
    "currency": "AUD",
    "id": "93695445",
    "receipt": "427411098136",
    "source": "INTERNET",
    "stan": "98136",
    "terminal": "0001",
    "type": "AUTHORIZATION"
  },
  "version": "100"
}
```

## Example: Pay the transaction to verify the PAR in response {#example-pay-the-transaction-to-verify-the-par-in-response}

```json
{
  "order": {
    "amount": "100",
    "currency": "AUD"
  },
  "apiOperation": "PAY",
  "transaction": {
    "source": "INTERNET"
  },
  "sourceOfFunds": {
    "provided": {
      "card": {
        "expiry": {
          "month": "01",
          "year": "39"
        },
        "number": "4547426093880978",
        "securityCode": "100",
        "storedOnFile": "TO_BE_STORED"
      }
    },
    "type": "CARD"
  }
}
```

```json
{
  "authorizationResponse": {
    "cardLevelIndicator": "XX",
    "cardSecurityCodeError": "M",
    "commercialCard": "123",
    "commercialCardIndicator": "1",
    "date": "0930",
    "marketSpecificData": "A",
    "posData": "1025100006600",
    "posEntryMode": "812",
    "processingCode": "003000",
    "responseCode": "00",
    "returnAci": "Y",
    "stan": "100246",
    "time": "120042",
    "transactionIdentifier": "476206724886542"
  },
  "gatewayEntryPoint": "WEB_SERVICES_API",
  "merchant": "CYG_S2I_MER1",
  "order": {
    "amount": 100.00,
    "authenticationStatus": "AUTHENTICATION_NOT_IN_EFFECT",
    "chargeback": {
      "amount": 0,
      "currency": "AUD"
    },
    "creationTime": "2024-09-30T12:00:41.942Z",
    "currency": "AUD",
    "id": "121291089",
    "lastUpdatedTime": "2024-09-30T12:00:42.178Z",
    "merchantAmount": 100.00,
    "merchantCategoryCode": "1234",
    "merchantCurrency": "AUD",
    "status": "CAPTURED",
    "totalAuthorizedAmount": 100.00,
    "totalCapturedAmount": 100.00,
    "totalDisbursedAmount": 0.00,
    "totalRefundedAmount": 0.00
  },
  "response": {
    "acquirerCode": "00",
    "acquirerMessage": "Approved",
    "cardSecurityCode": {
      "acquirerCode": "M",
      "gatewayCode": "MATCH"
    },
    "gatewayCode": "APPROVED",
    "gatewayRecommendation": "NO_ACTION"
  },
  "result": "SUCCESS",
  "sourceOfFunds": {
    "provided": {
      "card": {
        "brand": "VISA",
        "deviceSpecificExpiry": {
          "month": "1",
          "year": "39"
        },
        "deviceSpecificNumber": "454742xxxxxx0978",
        "fundingMethod": "UNKNOWN",
        "number": "xxxxxxxxxxxx0978",
        "paymentAccountReference": "12345678901234567TC020VSADE56",
        "scheme": "VISA",
        "storedOnFile": "TO_BE_STORED"
      }
    },
    "type": "CARD"
  },
  "timeOfLastUpdate": "2024-09-30T12:00:42.178Z",
  "timeOfRecord": "2024-09-30T12:00:41.995Z",
  "transaction": {
    "acquirer": {
      "batch": 20240930,
      "date": "0930",
      "id": "CYG_TESTACQ_S2I",
      "merchantId": "9808",
      "settlementDate": "2024-09-30",
      "timeZone": "+1000",
      "transactionId": "476206724886542"
    },
    "amount": 100.00,
    "authenticationStatus": "AUTHENTICATION_NOT_IN_EFFECT",
    "authorizationCode": "112233",
    "currency": "AUD",
    "id": "727432600",
    "receipt": "427412100246",
    "source": "INTERNET",
    "stan": "100246",
    "terminal": "0001",
    "type": "PAYMENT"
  },
  "version": "100"
}
```

## Example: Pay and refund transaction to verify the PAR in response {#example-pay-and-refund-transaction-to-verify-the-par-in-response}

```json
{
  "order": {
    "amount": "100",
    "currency": "AUD"
  },
  "apiOperation": "PAY",
  "transaction": {
    "source": "INTERNET"
  },
  "sourceOfFunds": {
    "provided": {
      "card": {
        "expiry": {
          "month": "01",
          "year": "39"
        },
        "number": "4547426093880978",
        "securityCode": "100",
        "storedOnFile": "TO_BE_STORED"
      }
    },
    "type": "CARD"
  }
}
```

```json
{
  "authorizationResponse": {
    "cardLevelIndicator": "XX",
    "cardSecurityCodeError": "M",
    "commercialCard": "123",
    "commercialCardIndicator": "1",
    "date": "0930",
    "marketSpecificData": "A",
    "posData": "1025100006600",
    "posEntryMode": "812",
    "processingCode": "003000",
    "responseCode": "00",
    "returnAci": "Y",
    "stan": "95107",
    "time": "120824",
    "transactionIdentifier": "126683150497935"
  },
  "gatewayEntryPoint": "WEB_SERVICES_API",
  "merchant": "CYG_S2I_MER1",
  "order": {
    "amount": 100.00,
    "authenticationStatus": "AUTHENTICATION_NOT_IN_EFFECT",
    "chargeback": {
      "amount": 0,
      "currency": "AUD"
    },
    "creationTime": "2024-09-30T12:08:23.926Z",
    "currency": "AUD",
    "id": "606155480",
    "lastUpdatedTime": "2024-09-30T12:08:24.151Z",
    "merchantAmount": 100.00,
    "merchantCategoryCode": "1234",
    "merchantCurrency": "AUD",
    "status": "CAPTURED",
    "totalAuthorizedAmount": 100.00,
    "totalCapturedAmount": 100.00,
    "totalDisbursedAmount": 0.00,
    "totalRefundedAmount": 0.00
  },
  "response": {
    "acquirerCode": "00",
    "acquirerMessage": "Approved",
    "cardSecurityCode": {
      "acquirerCode": "M",
      "gatewayCode": "MATCH"
    },
    "gatewayCode": "APPROVED",
    "gatewayRecommendation": "NO_ACTION"
  },
  "result": "SUCCESS",
  "sourceOfFunds": {
    "provided": {
      "card": {
        "brand": "VISA",
        "deviceSpecificExpiry": {
          "month": "1",
          "year": "39"
        },
        "deviceSpecificNumber": "454742xxxxxx0978",
        "fundingMethod": "UNKNOWN",
        "number": "xxxxxxxxxxxx0978",
        "paymentAccountReference": "12345678901234567TC020VSADE56",
        "scheme": "VISA",
        "storedOnFile": "TO_BE_STORED"
      }
    },
    "type": "CARD"
  },
  "timeOfLastUpdate": "2024-09-30T12:08:24.151Z",
  "timeOfRecord": "2024-09-30T12:08:23.986Z",
  "transaction": {
    "acquirer": {
      "batch": 20240930,
      "date": "0930",
      "id": "CYG_TESTACQ_S2I",
      "merchantId": "9808",
      "settlementDate": "2024-09-30",
      "timeZone": "+1000",
      "transactionId": "126683150497935"
    },
    "amount": 100.00,
    "authenticationStatus": "AUTHENTICATION_NOT_IN_EFFECT",
    "authorizationCode": "112233",
    "currency": "AUD",
    "id": "927278125",
    "receipt": "427412095107",
    "source": "INTERNET",
    "stan": "95107",
    "terminal": "0001",
    "type": "PAYMENT"
  },
  "version": "100"
}
```

### Refund {#refund}

```json
{
  "apiOperation": "REFUND",
  "transaction": {
    "amount": "50",
    "currency": "AUD"
  }
}
```

```json
{
  "authorizationResponse": {
    "cardLevelIndicator": "XX",
    "cardSecurityCodeError": "M",
    "commercialCard": "123",
    "commercialCardIndicator": "1",
    "date": "0930",
    "marketSpecificData": "A",
    "posData": "1025100006600",
    "posEntryMode": "812",
    "processingCode": "203000",
    "responseCode": "00",
    "returnAci": "Y",
    "stan": "95107",
    "time": "120824",
    "transactionIdentifier": "126683150497935"
  },
  "gatewayEntryPoint": "WEB_SERVICES_API",
  "merchant": "CYG_S2I_MER1",
  "order": {
    "amount": 100.00,
    "chargeback": {
      "amount": 0,
      "currency": "AUD"
    },
    "creationTime": "2024-09-30T12:08:23.926Z",
    "currency": "AUD",
    "id": "606155480",
    "lastUpdatedTime": "2024-09-30T12:08:51.024Z",
    "merchantAmount": 100.00,
    "merchantCategoryCode": "1234",
    "merchantCurrency": "AUD",
    "status": "PARTIALLY_REFUNDED",
    "totalAuthorizedAmount": 100.00,
    "totalCapturedAmount": 100.00,
    "totalDisbursedAmount": 0.00,
    "totalRefundedAmount": 50.00
  },
  "response": {
    "acquirerCode": "00",
    "acquirerMessage": "Approved",
    "cardSecurityCode": {
      "acquirerCode": "M",
      "gatewayCode": "MATCH"
    },
    "gatewayCode": "APPROVED"
  },
  "result": "SUCCESS",
  "sourceOfFunds": {
    "provided": {
      "card": {
        "brand": "VISA",
        "deviceSpecificExpiry": {
          "month": "1",
          "year": "39"
        },
        "deviceSpecificNumber": "454742xxxxxx0978",
        "fundingMethod": "UNKNOWN",
        "number": "xxxxxxxxxxxx0978",
        "paymentAccountReference": "12345678901234567TC020VSADE56",
        "scheme": "VISA",
        "storedOnFile": "TO_BE_STORED"
      }
    },
    "type": "CARD"
  },
  "timeOfLastUpdate": "2024-09-30T12:08:51.024Z",
  "timeOfRecord": "2024-09-30T12:08:50.945Z",
  "transaction": {
    "acquirer": {
      "batch": 20240930,
      "date": "0930",
      "id": "CYG_TESTACQ_S2I",
      "merchantId": "9808",
      "settlementDate": "2024-09-30",
      "timeZone": "+1000",
      "transactionId": "126683150497935"
    },
    "amount": 50.00,
    "authorizationCode": "112233",
    "currency": "AUD",
    "id": "690573225",
    "receipt": "427412096127",
    "source": "INTERNET",
    "stan": "96127",
    "terminal": "0001",
    "type": "REFUND"
  },
  "version": "100"
}
```

