Create an Apple Pay wallet token

North America—United States and Canada

An Apple Pay® token is a unique, single-use code that represents an Apple Pay wallet. It securely processes payments without exposing the actual 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.

Create a single-pay Apple Pay wallet token

  1. Generate a PAKMS key.
  2. Send a POST request to the /v1/tokens endpoint.
  3. Expand the encryptedWallet object.
  4. Enter information in the required fields.
FieldDescription
applePayPaymentDataDisplays encrypted Apple Pay payment data information.
Note: See the Apple Pay PassKit Payment token documentation for up-to-date details.
dataEncrypted payment data.
headerApple pay payment data header.
ephemeralPublicKeyEphemeral public key in bytes.
EC_v1 only.
publicKeyHashHash of the X.509 encoded public key bytes of the merchant’s certificate.
transactionIdTransaction identifier, generated on the device.
signatureSignature of the payment and header data.
The signature includes the signing certificate, its intermediate CA certificate, and information about the signing algorithm.
versionVersion information about the payment token.
The token uses EC_v1 for ECC-encrypted data and RSA_v1 for RSA-encrypted data.
apikeyPublic Ecommerce API key associated with a specific merchant and developer app. Use Retrieve an Ecommerce API key or PAKMS key to generate this key.

In response, a single-pay Apple Pay wallet token returns. This token is alphanumeric and begins with clv_. Example: clv_1ABCDefgHI23jKL4m5nOPqR

Request example

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": "{}"
    }
  }'
'

Response example

{
    "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"
    }
}