Automatic forwarding
Automatically save each new card in your TokenEx vault as it's created and receive the token by webhook.
Automatic forwarding saves each new card in a vault you own as soon as the payment method is created. When a new card, Apple Pay, or Google Pay payment method is created in your account, Pay.com sends its card number to your vault, stores the vault's token with the card, and notifies you by webhook. Unlike forwarding a request, you don't call a forwarding endpoint.
Destination vaults
Automatic forwarding currently supports TokenEx.
| Vault | Behavior | Webhook |
|---|---|---|
| TokenEx | Pay.com saves each new card in your TokenEx vault right after the payment method is created. | payment_method.third_party_token.created |
Turn on forwarding to TokenEx
Ask your account manager to turn on automatic forwarding to TokenEx. Pay.com needs your TokenEx ID and an API key for your TokenEx vault.
Pay.com then saves each new card number in your TokenEx vault. A card that already has a TokenEx token keeps it.
Get the TokenEx token
Pay.com forwards the card after it creates the payment method, so the response that creates the payment method doesn't include the token yet. To receive the token, subscribe a webhook endpoint to payment_method.third_party_token.created. See Set up an endpoint.
The event identifies the payment method and its customer, with type set to tokenex and the token in tokenex.token.
Verify the Pay-Signature header on every incoming event before processing it. See Verify webhook signatures.
Payments made with the card also return the token in payment_method_details.third_party_tokens:
{
"payment_method_details": {
"type": "card",
"third_party_tokens": [
{
"type": "tokenex",
"tokenex": {
"token": "9461820537144242"
}
}
]
}
}When Pay.com processes a card through your Stripe account, third_party_tokens also includes a type: "stripe" entry with account, customer, and payment_method.
Next steps
- TokenEx: Send cards from your TokenEx vault to the Pay.com API.
- Payment method events: Every event Pay.com sends about payment methods.
- Forward cards to another provider: Send a saved card to any provider in its own request.