Pay with an existing network token
Charge, hold, pay out to, or save a Visa, Mastercard, or American Express network token, or a decrypted Apple Pay or Google Pay token.
If you already hold a network token, from your own token requestor or from an Apple Pay or Google Pay payment you decrypted, send it to Pay.com with its expiration date and cryptogram. You can charge it, hold it, pay out to it, or save it as a payment method.
Send the token
Set source_data.type to network_token and pass the token details in
source_data.network_token.
| Field | Type | Required | Description |
|---|---|---|---|
token | string | Yes | The network token number. |
token_type | string | Yes | Token origin: vts (Visa Token Service), mdes (Mastercard Digital Enablement Service), aets (American Express Token Service), or applepay or googlepay for a decrypted wallet token. Send in lowercase, or the request fails. |
expiry_month | string | Yes | The token's expiration month. |
expiry_year | string | Yes | The token's expiration year. |
cryptogram | string | No | The token's cryptogram, such as a TAVV from the token service. For a wallet token on a charge or hold, send the cryptogram in three_ds instead. |
three_ds | object | No | A wallet token's cryptogram with its ECI, or the result of 3D Secure run with a third party. |
name | string | No | The cardholder's name. |
authentication_context | object | No | The customer's browser details, for 3D Secure through Pay.com. |
This request charges a Visa network token. Amounts are in minor units, so 2000
is $20.00 USD.
POST https://api.sandbox.pay.com/v1/charges
{
"amount": 2000,
"currency": "usd",
"source_data": {
"type": "network_token",
"network_token": {
"token": "4242424242424242",
"token_type": "vts",
"expiry_month": "12",
"expiry_year": "2028",
"cryptogram": "AAEBAwQjSQAAXXXXXXXJYe0BbQA="
}
},
"customer_reference_id": "cust_ext_abc123"
}Send the cryptogram
Where you place the cryptogram depends on where the token comes from.
| Token | Where to send the cryptogram |
|---|---|
Token service token (vts, mdes, or aets) | cryptogram at the top level of network_token. No ECI is needed. |
Decrypted Apple Pay or Google Pay token (applepay or googlepay) | three_ds.cryptogram, with the wallet's ECI in three_ds.eci. Pay.com forwards both values to the issuer as the wallet's authentication result. |
| Any token with third-party 3D Secure | three_ds, with cavv (or cryptogram), eci, ds_trans_id, and version. See External MPI. |
For a token service token, a three_ds object containing only eci and
cryptogram behaves the same as the top-level cryptogram. Pay.com keeps the
cryptogram with the token and omits the ECI.
This charge pays $20.00 USD with a decrypted Google Pay token:
{
"amount": 2000,
"currency": "usd",
"source_data": {
"type": "network_token",
"network_token": {
"token": "4895370012003478",
"token_type": "googlepay",
"expiry_month": "12",
"expiry_year": "2028",
"three_ds": {
"cryptogram": "AgAAAAAABk4DWZ4C28yUQAAAAAA=",
"eci": "05"
}
}
}
}For a later merchant-initiated payment with the same token and no cryptogram,
pass the first payment's network transaction ID in
source_data.underlying_network_id. See
Merchant-initiated authentication.
Pay out to a network token
A payout accepts the same network_token object inside destination_data, with
the cryptogram at the top level of network_token for every token type. Payouts
don't accept eci or external 3D Secure results. See
Create a payout.
{
"amount": 5000,
"currency": "usd",
"destination_data": {
"type": "network_token",
"network_token": {
"token": "4242424242424242",
"token_type": "vts",
"expiry_month": "12",
"expiry_year": "2028",
"cryptogram": "AAEBAwQjSQAAXXXXXXXJYe0BbQA="
}
}
}Where you can send a network token
The same network_token object works on these endpoints.
| Endpoint | Description |
|---|---|
POST /v1/charges | Charges the token. |
POST /v1/holds | Authorizes the token for later capture. See Hold and capture. |
POST /v1/payment_methods | Saves the token. Set type to network_token and pass the object in network_token. |
POST /v1/authentication/session/independent | Runs standalone 3D Secure on the token. Accepts only the token's cryptogram and rejects external 3D Secure results. See Standalone 3DS authentication. |
POST /v1/payouts | Pays out to the token. External 3D Secure results aren't supported. See Create a payout. |
Next steps
- Wallets with the API: Decrypt Apple Pay and Google Pay tokens yourself, or let Pay.com decrypt them.
- Provision network tokens: Let Pay.com request network tokens for the cards you save.