Retrieve a network token and cryptogram
Read the network token Pay.com holds for a saved card, and request a cryptogram for a payment you make through another provider.
You can read the network token Pay.com holds for a saved card, and request a cryptogram to pay with it outside Pay.com. Both endpoints take a card payment method's pm_card_ ID.
Retrieve the token
Call GET /v1/payment_methods/{id}/network_token with the payment method's ID.
curl https://api.sandbox.pay.com/v1/payment_methods/pm_card_296645958265997316/network_token \
-u ':sk-pay-com-sandbox-…'{
"id": "ntok_296645958265997316",
"resource": "network_token",
"number": "4242424242424242",
"exp_month": "12",
"exp_year": "2028",
"payment_account_reference": "ABCD1234567890123456789012345",
"token_service": "vts",
"requestor_id": "40010030273"
}| Field | Description |
|---|---|
number | The network token's number. |
exp_month, exp_year | The token's expiration month and year, which can differ from the card's. |
payment_account_reference | The payment account reference (PAR). It stays the same across the card account's numbers and tokens. |
token_service | The network's token service: vts (Visa), mdes (Mastercard), or aets (American Express). Empty if none applies. |
requestor_id | The ID of the token requestor the token was issued to. |
Request a cryptogram
Call GET /v1/payment_methods/{id}/network_token/cryptogram for each payment you make with the token.
curl https://api.sandbox.pay.com/v1/payment_methods/pm_card_296645958265997316/network_token/cryptogram \
-u ':sk-pay-com-sandbox-…'{
"id": "cryptogram_296645958265997345",
"resource": "cryptogram",
"cryptogram": "AgAAAAAAAIR8CQrXcIhbQAAAAAA="
}Forward the token instead
Vault forwarding sends a request to another provider with the token filled in, so your server never handles the raw token number. Use the network_token.number, network_token.exp_month, network_token.exp_year, network_token.cryptogram, and network_token.eci placeholders. See Vault forwarding and Placeholders.
Next steps
- Provision network tokens: Request tokens when saving or charging cards.
- Authorize with network tokens: Pay with network tokens and fall back to the card number when declined.