Create Apple Pay token
Connect an Apple Pay token to the specified account.
Read our Apple Pay tutorial to learn more.
The token data is defined by Apple Pay and should be passed through from Apple Pay's response unmodified.
To access this endpoint using an access token
you'll need to specify the /accounts/{accountID}/cards.write scope.
curl -X POST "https://api.moov.io/accounts/{accountID}/apple-pay/tokens" \
-H "Authorization: Bearer {token}" \
-H "X-Moov-Version: v2027.01.00" \
-d '{
"token": {
"paymentData": {
"version": "EC_v1",
"data": "3+f4oOTwPa6f1UZ6tG...CE=",
"signature": "MIAGCSqGSIb3DQ.AAAA==",
"header": {
"publicKeyHash": "l0CnXdMv...D1I=",
"transactionId": "32b...4f3"
}
},
"paymentMethod": {
"displayName": "Visa 1234",
"network": "Visa",
"type": "debit"
},
"transactionIdentifier": "32b...4f3"
}
}'mc, _ := moov.NewClient()
var accountID string
address := moov.ApplePayBillingContact{
AddressLines: []string{
"123 Sesame Street",
},
Locality: "Phoenix",
PostalCode: "30345",
AdministrativeArea: "AZ",
CountryCode: "US",
}
token := moov.ApplePayToken{
PaymentData: moov.ApplePaymentData{
Version: "EC_v1",
Data: "3+f4oOTwPa6f1UZ6tG...CE=",
Signature: "MIAGCSqGSIb3DQ.AAAA==",
Header: moov.ApplePaymentDataHeader{
EphemeralPublicKey: "MFkwEK...Md==",
PublicKeyHash: "l0CnXdMv...D1I=",
TransactionId: "32b...4f3",
},
},
PaymentMethod: moov.ApplePaymentMethod{
DisplayName: "Visa 1234",
Network: "Visa",
Type: "debit",
},
TransactionIdentifier: "32b...4f3",
}
mc.LinkApplePayToken(ctx, accountID,
moov.LinkApplePay{
Token: token,
BillingContact: address,
})
[
{
"paymentMethodID": "string",
"paymentMethodType": "moov-wallet",
"applePay": {
"brand": "Visa",
"cardType": "credit",
"cardDisplayName": "Visa 1256",
"fingerprint": "9948962d92a1ce40c9f918cd9ece3a22bde62fb325a2f1fe2e833969de672ba3",
"expiration": {
"month": "01",
"year": "21"
},
"dynamicLastFour": "string",
"issuerCountry": "US"
}
}
]Response headers
x-request-id
string
required
{
"error": "string"
}Response headers
x-request-id
string
required
Response headers
x-request-id
string
required
Response headers
x-request-id
string
required
Response headers
x-request-id
string
required
{
"error": "string"
}Response headers
x-request-id
string
required
{
"error": "string",
"paymentData": "string",
"paymentMethod": "string",
"transactionIdentifier": "string"
}Response headers
x-request-id
string
required
Response headers
x-request-id
string
required
Response headers
x-request-id
string
required
Response headers
x-request-id
string
required
Headers
X-Moov-Version
string
v2026.08.00 uses v2026.07.00.
A malformed value, such as 2022, returns a 404 response.
v2027.01.00
Path parameters
Body
The JSON structure returned from Apple Pay when authorizing a payment session.
Refer to Apple's documentation for more information.
token
object
required
Contains the user's payment information as returned from Apple Pay.
Refer to Apple's documentation for more information.
Show child attributes
token
paymentData
object
required
Contains the encrypted payment data.
Refer to Apple's documentation for more information.
Show child attributes
token.paymentData
header
object
required
Information needed to decrypt Apple Pay payment data.
Refer to Apple's documentation for more information.
Show child attributes
token.paymentData.header
paymentMethod
object
required
Provides information about the underlying card.
Refer to Apple's documentation for more information.
billingContact
object
Billing contact information as returned from Apple Pay.
Refer to Apple's documentation for more information.
Response
applePay
object
Show child attributes
applePay
brand
string<enum>
required
American Express,
Discover,
Mastercard,
Visa,
Unknown
cardDisplayName
string
required
User-friendly name of the tokenized card returned by Apple.
It usually contains the brand and the last four digits of the underlying card. There is no standard format.
cardType
string<enum>
required
debit,
credit,
prepaid,
unknown
dynamicLastFour
string
required
fingerprint
string
<=100 characters
required
paymentMethodType
string<enum>
moov-wallet,
ach-debit-fund,
ach-debit-collect,
ach-credit-standard,
ach-credit-same-day,
rtp-credit,
card-payment,
push-to-card,
pull-from-card,
apple-pay,
card-present-payment,
instant-bank-credit,
push-to-apple-pay,
pull-from-apple-pay,
google-pay,
push-to-google-pay,
pull-from-google-pay,
wire-credit