Skip to Content
Docs

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.

Sending a network token requires an API key enabled for raw card data. Pay.com tokenizes the network token before it reaches the payment API.

Send the token

Set source_data.type to network_token and pass the token details in source_data.network_token.

FieldTypeRequiredDescription
tokenstringYesThe network token number.
token_typestringYesToken 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_monthstringYesThe token's expiration month.
expiry_yearstringYesThe token's expiration year.
cryptogramstringNoThe 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_dsobjectNoA wallet token's cryptogram with its ECI, or the result of 3D Secure run with a third party.
namestringNoThe cardholder's name.
authentication_contextobjectNoThe 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.

TokenWhere 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 Securethree_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:

POST /v1/charges

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

POST /v1/payouts

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

EndpointDescription
POST /v1/chargesCharges the token.
POST /v1/holdsAuthorizes the token for later capture. See Hold and capture.
POST /v1/payment_methodsSaves the token. Set type to network_token and pass the object in network_token.
POST /v1/authentication/session/independentRuns standalone 3D Secure on the token. Accepts only the token's cryptogram and rejects external 3D Secure results. See Standalone 3DS authentication.
POST /v1/payoutsPays out to the token. External 3D Secure results aren't supported. See Create a payout.

Next steps

Was this page helpful?