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

Steps

  1. Generate an Ecommerce API key or apiAccessKey.
  2. Send a POST request to the /v1/tokens endpoint.
  3. In the applePayPaymentData object, 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:
    • ephemeralPublicKey
    • publicKeyHash
    • transactionId
  • 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.
  1. Set the Ecommerce API key or apiAccessKey generated in step 1 as the value of the apikey header.

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