Skip to content

Apple Pay transaction

Process an online transaction using Apple Pay.

Overview

You can submit an Apple Pay transaction in two ways:

  • Encrypted token (recommended): Pass the payment token from the Apple Pay sheet in fundingData.card.applePayToken. PXP decrypts it during transaction processing. You do not need to call the wallet decrypt endpoint or send card number fields.
  • Decrypted token: Decrypt the token on your backend using POST /v1/wallets/ApplePay/decrypt-token, then submit the decrypted card details using the card not present card type with walletType set to ApplePay.

Initiate an Apple Pay transaction

POST
/v1/transactions

Request examples

Use the following request when you have the encrypted payment token from the Apple Pay sheet on the client device.

{
  "merchant": "MERCHANT-1",
  "site": "SITE-1",
  "merchantTransactionId": "This_is_my_merchant_transaction_id",
  "merchantTransactionDate": "2024-01-27 08:51:02.826445+00:00",
  "transactionMethod": {
    "intent": "Authorisation",
    "entryType": "Ecom",
    "fundingType": "Card"
  },
  "amounts": {
    "transaction": 30.32,
    "currencyCode": "EUR"
  },
  "fundingData": {
    "card": {
      "applePayToken": "{\"version\":\"EC_v1\",\"data\":\"eyJhbGciOiJSU0EtT0FFUC0yNTYiLCJlbmMiOiJBMjU2R0NNIn0...\",\"signature\":\"MIAGCSqGSIb3DQEHAqCAMIACAQEx...\",\"header\":{\"ephemeralPublicKey\":\"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE...\",\"publicKeyHash\":\"h0j3M6S0X8/x...\",\"transactionId\":\"32b030ca0603b2c5f0e2c5c8f0c0e0c0\"}}"
    }
  },
  "shopper": {
    "id": "Shopper_01",
    "firstName": "John",
    "lastName": "Doe",
    "dateOfBirth": "1980-03-01",
    "email": "shopper@example.com"
  }
}
ParameterDescription
merchant
string (≤ 20 characters)
required
Your unique merchant identifier, as assigned by PXP.
site
string (≤ 20 characters)
required
Your unique site identifier, as assigned by PXP.
merchantTransactionId
string (≤ 50 characters)
required
A unique identifier for this transaction.
merchantTransactionDate
date-time
required
The date and time when the transaction happened, in ISO 8601 format.
transactionMethod
object
required
Details about the transaction method.
transactionMethod.entryType
string
required
The entry type. For e-commerce transactions, this is always Ecom.
transactionMethod.fundingType
string
required
The funding type. For card transactions, this is always Card.
transactionMethod.intent
string
required
The payment intent. Learn more about intents.

Possible values:
  • Authorisation
  • EstimatedAuthorisation
  • Purchase
  • Payout
  • Refund
amounts
object
required
Details about the transaction amount.
amounts.transaction
number
The transaction amount. The numbers after the decimal will be zero padded if they are less than the expected currencyCode exponent. For example, GBP 1.1 = GBP 1.10, EUR 1 = EUR 1.00, or BHD 1.3 = 1.300. The transaction will be rejected if numbers after the decimal are greater than the expected currencyCode exponent (e.g., GBP 1.234), or if a decimal is supplied when the currencyCode exponent does not require it (e.g., JPY 1.0).
amounts.currencyCode
string (1-3 characters)
required
The currency code associated with the transaction, in ISO 4217 format.
fundingData
object
required
Details about the payment method used for the transaction.
fundingData.card
object
required
Apple Pay card details. Use the Apple Pay card type and submit only applePayToken (and optional dynamicDescriptors).
fundingData.card.applePayToken
string
required
The encrypted payment token returned by Apple Pay on the client device. Submit this value as a JSON string serialisation of the Apple Pay payment token object (including version, data, signature, and header). PXP decrypts this server-side during transaction processing.
fundingData.card.dynamicDescriptors
object
Optional merchant-defined descriptors that appear on the cardholder's statement. Learn more about dynamic descriptors.
fundingData.card.dynamicDescriptors.cardAcceptorName
string (≤ 22 characters)
A description of the transaction that will appear on the cardholder's statement.
shopper
object
Details about the shopper making the payment.

Response example

If your request is successful, you'll receive a 200 response that includes the transaction's state. You'll also receive a Transaction (Card Authorised) webhook notification. Learn more about webhooks.

{
  "state": "Authorised",
  "stateData": {},
  "approvalCode": "676821",
  "merchantTransactionDate": "2025-03-31T10:39:37",
  "merchantTransactionId": "08081f55-6b8b-45d5-b097-3450dfff61e7",
  "systemTransactionId": "7cf52570-9ca3-4423-b246-e0bcb0fb34d1",
  "fundingData": {
    "cardScheme": "MasterCard",
    "expiryMonth": null,
    "expiryYear": null,
    "gatewayTokenId": "5fbd77ce-02c1-40ed-94bc-1016660b7512",
    "providerResponse": {
      "provider": "pxpfinancial",
      "code": "00",
      "emvDataResponse": {},
      "paymentAccountReference": "637607302178175469",
      "electronicCommerceIndicatorAdjustment": "05",
      "merchantAdvice": {},
      "authorisedAmount": 10,
      "settlementDate": "2025-04-01T00:00:00"
    },
    "processorTransactionId": "403e7285-2993-4de4-b0ff-5e2f18bf7a8f"
  }
}