Create an Apple Pay payment token
Use the Apple Pay payment token as a source token to create a charge or pay for an order.
North America—United States and Canada
An Apple Pay® payment token is a unique, single-use code that encrypts the Apple Pay digital wallet payment data. The token securely processes payments without exposing the actual digital wallet details or directly handling sensitive information. Use this token as the payment source in single-payment endpoints, such as create a charge or pay for an order.
Prerequisites
- Create an ecommerce app integration in the Global Developer Dashboard. See Get started with the Global Developer Dashboard.
- See the Apple Pay Payment Token Reference for information on how to verify an Apple Pay payment token and validate a transaction. You need to use this information to request an Apple Pay payment token using Clover Ecommerce
/v1/tokensendpoint. See Create an Apple Pay payment token.
Steps
- Generate an Ecommerce API key or
apiAccessKey. - Send a
POSTrequest to the /v1/tokens endpoint. - In the
applePayPaymentDataobject, enter information for the required parameters:
data—Encrypted payment data. See Payment Data Keys for the decrypted payment data.header—Apple pay payment data header. See Header Keys and Values for information on:ephemeralPublicKeypublicKeyHashtransactionId
signature—Signature of the payment and header data. See Payment Token Structure.version—Version information about the payment token that is also available in the payment token structure.
- Set the Ecommerce API key or
apiAccessKeygenerated in step 1 as the value of theapikeyheader.
In response, a single-pay Apple Pay payment token returns. This token is alphanumeric and begins with clv_. Example: clv_1ABCDefgHI23jKL4m5nOPqR
Request and Response example—Apple Pay payment token
curl --request POST \
--url 'https://token-sandbox.dev.clover.com/v1/tokens' \
--header 'accept: application/json' \
--header 'apikey: {apiAccessKey}' \
--header 'content-type: application/json' \
--data '{
"encryptedWallet": {
"applePayPaymentData": {
"version": "{}",
"data": "{}",
"signature": "{}",
"header": {
"ephemeralPublicKey": "{}",
"publicKeyHash": "{}",
"transactionId": "{}"
}
},
"address_line1": "{}",
"address_zip": "{}"
}
}'
'
{
"id": "clv_1AbcDefgHijkLmnoPQRs",
"object": "token",
"card": {
"exp_month": "05",
"exp_year": "2025",
"first6": "400551",
"last4": "0004",
"brand": "VISA",
"address_line1": "123 Main Street",
"address_zip": "11235"
}
}
Related topics
Updated 9 months ago
