Cards & Wallets · Digital Wallets · Apple Pay
Submit a token on an existing account
If you’re using the API product, upon successful completion of your customer’s first payment, we can return a token in the response. This can be used for future Payments, Authorisation or Payout requests in place of the customer’s physical confirmation via the Apple Pay interface. All you need to do is provide the token itself for each subsequent request. As these transactions are using a saved Apple Pay account it is not necessary to perform the “merchant validation” step. To receive the token in the response it is necessary to set registered to true in the payment request. This is the same approach taken for submitting tokens instead of cards.
Please note that the token is only to be used when the merchant is processing a transaction on the customer’s behalf, without the customer being on their site. If the customer is on the site requesting to pay, they should go through the full Apple Pay process.
API examples
Payment with a saved Apple Pay account token
EndpointDefinition
POST /acceptor/rest/transactions/{instId}/paymentRequest body
{
"transaction": {
"currency": "GBP",
"amount": 1000.0,
"description": "Sample Transaction",
"merchantRef": "mer_txn_1234556",
"commerceType": "MOTO",
"channel": "WEB"
},
"paymentMethod": {
"applepay": {
"savedAccountToken": "hJzbc9ccR9CHLlita5g5Jg"
}
},
"customer": {
"merchantRef": "mer_cust_131241413"
}
}cURL
curl -X POST "{targetEnvironmentPath}/acceptor/rest/transactions/{instId}/payment" \
-u "{apiUser}:{apiPassword}" \
-H "Content-Type: application/json" \
-d '{
"transaction": {
"currency": "GBP",
"amount": 1000.0,
"description": "Sample Transaction",
"merchantRef": "mer_txn_1234556",
"commerceType": "MOTO",
"channel": "WEB"
},
"paymentMethod": {
"applepay": {
"savedAccountToken": "hJzbc9ccR9CHLlita5g5Jg"
}
},
"customer": {
"merchantRef": "mer_cust_131241413"
}
}'Response
HTTP/1.1 201
{
"processing": {
"authResponse": {
"statusCode": "00",
"message": "ACQUIRER OK",
"authCode": "112233",
"gatewayReference": "1049167854342314",
"gatewayCode": "1",
"gatewayMessage": "ACCEPTED",
"avsAddressCheck": "FULL_MATCH",
"avsPostcodeCheck": "FULL_MATCH",
"cv2Check": "MATCHED",
"status": "AUTHORISED"
},
"route": "PAYON"
},
"paymentMethod": {
"applepay": {
"savedAccountToken": "hJzbc9ccR9CHLlita5g5Jg",
"cardType": "VISA_DEBIT",
"cardUsageType": "DEBIT",
"cardScheme": "VISA"
},
"billingAddress": {
"line1": "1 Some Street",
"city": "Metropolis",
"postcode": "AA1 1AA",
"country": "United Kingdom",
"countryCode": "GBR"
},
"paymentClass": "CARD"
},
"transaction": {
"transactionId": "13685556791",
"merchantRef": "mer_txn_1234556",
"status": "SUCCESS",
"type": "PAYMENT",
"amount": 1000,
"consumerSpend": 1000,
"currency": "GBP",
"transactionTime": "2014-03-19T10:11:35.962Z",
"receivedTime": "2014-03-19T10:11:35.962Z",
"channel": "WEB"
},
"outcome": {
"status": "SUCCESS",
"reasonCode": "S100",
"reasonMessage": "Authorised"
}
}