Create Apple Pay token

Connect an Apple Pay token to the specified account. The token data is defined by Apple Pay and should be passed through from Apple Pay’s response unmodified.

To use this endpoint from the browser, you’ll need to specify the /accounts/{accountID}/cards.write scope when generating a token.
POST
/accounts/{accountID}/apple-pay/tokens
cURL
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
curl -X POST "https://api.moov.io/accounts/{accountID}/apple-pay/tokens" \
  -H "Authorization: Bearer {token}" \
  --data-raw '{
    "token": {
      "paymentData": {
        "version": "EC_v1",
        "data": "3+f4oOTwPa6f1UZ6tG...CE=",
        "signature": "MIAGCSqGSIb3DQ.AAAA==",
        "header": {
          "ephemeralPublicKey":"MFkwEK...Md==",
          "publicKeyHash": "l0CnXdMv...D1I=",
          "transactionId": "32b...4f3"
        }
      },
      "paymentMethod": {
        "displayName": "Visa 1234",
        "network": "Visa",
        "type":"debit"
      },
      "transactionIdentifier": "32b...4f3"
    },
    "billingContact": {
      "addressLines": [
        "123 Sesame Street"
      ],
      "locality": "Phoenix",
      "postalCode": "30345",
      "administrativeArea": "AZ",
      "countryCode": "US"
    }
  }'\
200 422 429
Apple Pay token linked.
{
  "applePay": {
    "brand": "Discover",
    "cardDisplayName": "Visa 1234",
    "cardType": "debit",
    "dynamicLastFour": "1234",
    "expiration": {
      "month": "01",
      "year": "21"
    },
    "fingerprint": "9948962d92a1ce40c9f918cd9ece3a22bde62fb325a2f1fe2e833969de672ba3"
  },
  "paymentMethodID": "string",
  "paymentMethodType": "moov-wallet"
}
An error occurred when linking an Apple Pay token.
Request was refused due to rate limiting.

X-Retry-In

string <duration>
How long (in milliseconds) to wait until able to retry the request.

Path parameters

accountID

string <uuid> required
ID of the Moov account representing the cardholder.

Body

application/json

token

object required
right_key Show child attributes

paymentData

object required
right_key Show child attributes

data

string required

header

object required
right_key Show child attributes

ephemeralPublicKey

string required

publicKeyHash

string required

transactionId

string required

signature

string required

version

string required

paymentMethod

object required
right_key Show child attributes

displayName

string required

network

string required

type

string required

transactionIdentifier

string required

billingContact

object
right_key Show child attributes

addressLines

array

administrativeArea

string

countryCode

string

locality

string

postalCode

string

Response

application/json

applePay

object required
Describes an Apple Pay token on a Moov account.
right_key Show child attributes

brand

string<enum>
The card brand.
Possible values: American Express, Discover, Mastercard, Visa

cardDisplayName

string
User-friendly name of the tokenized card returned by Apple. It usually contains the brand and the last four digits of the underlying card for example, “Visa 1256”. There is no standard format.

cardType

string<enum>
The type of the card.
Possible values: debit, credit, prepaid, unknown

dynamicLastFour

string
The last four digits of the Apple Pay token, which may differ from the tokenized card’s last four digits

expiration

object
The expiration date of the card or token.
right_key Show child attributes

month

string 2 characters

year

string 2 characters

fingerprint

string <=100 characters
Uniquely identifies a linked payment card or token. For Apple Pay, the fingerprint is based on the tokenized card number and may vary based on the user’s device. This field can be used to identify specific payment methods across multiple accounts on your platform.

paymentMethodID

string required
ID of the payment method.

paymentMethodType

string<enum> required
The payment method type that represents a payment rail and directionality
Possible values: moov-wallet, ach-debit-fund, ach-debit-collect, ach-credit-standard, ach-credit-same-day, rtp-credit, card-payment, apple-pay, push-to-card, pull-from-card