Encrypted Payload
Using the Apple Pay encrypted payload
Make the following sequence of API calls once you obtain the encrypted payload from the Apple Pay session:
-
Create a single-use token using the Apple Pay payment bundle. At this step, use your Paysafe API key for single-use token generation.
URL: POST /customervault/v1/applepaysingleusetokens
{
"applePayPaymentToken": {
"token": {
"paymentMethod": {
"network": "Visa",
"type": "debit",
"displayName": "Visa 4228"
},
"paymentData": {
"data": "o6XJTbwthpq0gO3B/xDD5...redacted...gVH9A4rqXVm+zaUCqVik4CuJo=",
"signature": "MIAGCSqGSIb3DQEHAqCAMIACAQ...redacted...aVHLvRKl2RPDhQW9EhmLWwAAAAAAAA=",
"header": {
"publicKeyHash": "LthuroOCZyhMvL2cv7xUTiG+ki8adzCoc51DbiAKVSw=",
"ephemeralPublicKey": "MFkwEwYHKoZIzj0CAQYIKo...redacted...0S5jwZt5ZZqkiJwt6/0v7bA==",
"transactionId": "0da34782ad82fcebc927b96e6076a13d21f65b6b78bb6478da2e155978f1e03e"
},
"version": "EC_v1"
},
"transactionIdentifier": "0da34782ad82fcebc927b96e6076a13d21f65b6b78bb6478da2e155978f1e03e"
},
"billingContact": {
"familyName": "Doe",
"phoneticGivenName": "",
"postalCode": "32256",
"country": "United States",
"subAdministrativeArea": "",
"subLocality": "",
"givenName": "John",
"locality": "Jacksonville",
"phoneticFamilyName": "",
"administrativeArea": "FL",
"countryCode": "US",
"addressLines": [
"5335 Gate Pkwy"
]
}
}
}
{
"id": "16e7dca5-0432-45ea-9754-2ae6abc89e1a",
"paymentToken": "A7JOXr9omKUnpMx",
"timeToLiveSeconds": 899,
"isFromMultiUseToken": false,
"transaction": {
"amount": 2000,
"currencyCode": "USD"
},
"applePayPaymentToken": {
"decryptedData": {
"paymentData": {
"eciIndicator": "7",
"blank": false
},
"blank": false
},
"billingContact": {
"addressLines": [
"5335 Gate Pkwy"
],
"administrativeArea": "FL",
"countryCode": "US",
"locality": "Jacksonville",
"postalCode": "32256"
},
"token": {
"paymentData": {
"header": {
"transactionId": "0da34782ad82fcebc927b96e6076a13d21f65b6b78bb6478da2e155978f1e03e",
"publicKeyHash": "LthuroOCZyhMvL2cv7xUTiG+ki8adzCoc51DbiAKVSw="
},
"signature": "MIAGCSqGSIb3DQEHAqCAMIACAQ...redacted...aVHLvRKl2RPDhQW9EhmLWwAAAAAAAA=",
"version": "EC_v1"
},
"paymentMethod": {
"displayName": "Visa 4228",
"network": "Visa",
"type": "debit"
}
}
},
"card": {
"status": "ACTIVE",
"cardBin": "481852",
"lastDigits": "4228",
"holderName": "John Doe",
"cardType": "VI",
"cardCategory": "CREDIT",
"issuingCountry": "US",
"tokenType": "APPLE_PAY",
"applePay": {
"bin": "481852",
"lastDigits": "0737",
"expiry": {
"year": 2030,
"month": 1
},
"status": "ACTIVE",
"subtype": "DEVICE"
}
},
"authentication": {
"eci": "7"
}
}
2. Call the Card Payments API using the single-use token to process the transaction
From your server, use the single-use token (paymentToken) to make an authorization or purchase request to our Card Payments API. At this step, use the backend/server-to-server API key of Paysafe.
URL: POST /cardpayments/v1/accounts/account_id/auths
{
"merchantRefNum": "4e411a88-ea12-41fe-83f0-2aa6dcc9678c",
"amount": 2000,
"settleWithAuth": true,
"card": {
"paymentToken": "A7JOXr9omKUnpMx"
},
"billingDetails": {
"street": "5335 Gate Parkway",
"city": "Jacksonville",
"zip": "32256",
"state": "FL",
"country": "US"
},
"profile": {
"firstName": "John",
"lastName": "Doe",
"email": "john.doe@paysafe.com"
},
"merchantDescriptor": {
"dynamicDescriptor": "Apple Pay Test"
},
"description": "Apple Pay Test Transaction"
}
{
"id": "1adaf5d9-cb42-4df8-ba85-3e6bd3970fb3",
"merchantRefNum": "4e411a88-ea12-41fe-83f0-2aa6dcc9678c",
"txnTime": "2025-12-12T09:12:31Z",
"status": "COMPLETED",
"acquirerResponse": {
"code": "VPS",
"responseCode": "00",
"responseCodeDescription": "Approved and completed",
"avsCode": "X"
},
"cardSchemeTransactionId": "375688995366115",
"amount": 2000,
"settleWithAuth": true,
"preAuth": false,
"availableToSettle": 0,
"card": {
"tokenType": "APPLE_PAY",
"applePay": {
"expiry": {
"month": 1,
"year": 2030
},
"lastDigits": "0737",
"subtype": "DEVICE"
},
"type": "VI",
"lastDigits": "4228",
"cardExpiry": {
"month": 1,
"year": 2030
},
"issuingCountry": "US"
},
"authentication": {
"eci": 7
},
"authCode": "139879",
"profile": {
"firstName": "John",
"lastName": "Doe",
"email": "john.doe@paysafe.com"
},
"billingDetails": {
"street": "5335 Gate Parkway",
"city": "Jacksonville",
"state": "FL",
"country": "US",
"zip": "32256"
},
"merchantDescriptor": {
"dynamicDescriptor": "Apple Pay Test",
"phone": "1231231323"
},
"visaAdditionalAuthData": {},
"description": "Apple Pay Test Transaction",
"currencyCode": "USD",
"avsResponse": "NOT_PROCESSED",
"cvvVerification": "NOT_PROCESSED",
"settlements": [
{
"id": "1adaf5d9-cb42-4df8-ba85-3e6bd3970fb3",
"merchantRefNum": "4e411a88-ea12-41fe-83f0-2aa6dcc9678c",
"txnTime": "2025-12-12T09:12:31Z",
"status": "PENDING",
"gatewayReconciliationId": "ZZ2949088240",
"amount": 150,
"availableToRefund": 150,
"links": [
{
"rel": "self",
"href": "https://api.test.paysafe.com/cardpayments/v1/accounts/1002316170/settlements/1adaf5d9-cb42-4df8-ba85-3e6bd3970fb3"
}
]
}
],
"links": [
{
"rel": "settlement",
"href": "https://api.test.paysafe.com/cardpayments/v1/accounts/1002316170/settlements/1adaf5d9-cb42-4df8-ba85-3e6bd3970fb3"
},
{
"rel": "self",
"href": "https://api.test.paysafe.com/cardpayments/v1/accounts/1002316170/auths/1adaf5d9-cb42-4df8-ba85-3e6bd3970fb3"
}
]
}
3. Send the response your server receives from the Card Payments API to the website.
The Card Payments API will return a response (successful or failed) to your server, which you must forward to your website. Ensure you provide only a brief message to the user and avoid disclosing the reason for a failed transaction.