Saved cards
Tokenize cards into reusable pm_card_ payment methods and network tokens without handling raw card data.
A saved card is a reusable payment method (pm_card_…) that lets you charge a
returning customer for future purchases, one-click checkouts, or subscriptions
without collecting card details again.
Pay.com uses two-stage tokenization so raw card data never touches your
servers. Pay.com.js collects the card and returns a card token (tok_card_…),
which your server can exchange for a permanent pm_card_… ID.
Token types
Pay.com uses two token types at different stages of the flow:
| Property | Card token | Permanent payment method |
|---|---|---|
| Prefix | tok_card_ | pm_card_, pm_paypal_, and others |
| Lifetime | Reusable. The card stays in the vault, and the CVV collected with it is kept for 15 minutes at most | Permanent until deleted or expired |
| Purpose | Raw card data collected by Pay.com.js | Stored, reusable payment method |
| Used in | POST /v1/payment_methods or source_data on charges and holds | source (or its alias payment_method) on charges and holds, and payment_method on subscriptions |
Tokenization flow
Follow these four steps to vault a card without handling raw card numbers on your server.
- 1
Create a session
Your server creates a tokenization session via
POST /v1/sessions/tokenizationand passes itsclient_secretto Pay.com.js. - 2
Collect card details
Pay.com.js renders a secure card input on your frontend. When the customer submits the form, Pay.com.js sends the card directly to Pay.com and returns a
tok_card_token. - 3
Exchange for a permanent ID
Your server calls
POST /v1/payment_methodswithcustomer_reference_id,type: "token", andtoken: { "id": "tok_card_…" }(orPOST /v1/payment_methods/create_from_token). The responseidis the permanent payment method (for example,pm_card_685217824846643200). - 4
Charge the saved payment method
Pass the
pm_ID assource(or its aliaspayment_method) when you create charges and holds, and aspayment_methodwhen you create subscriptions.
Network tokens
Pay.com can add a network token from Visa, Mastercard, or American Express to a
card you save. The token keeps working when the issuer replaces the card, so
you keep charging the same pm_card_ ID. See Network tokens.
Importing payment methods from an external vault
To migrate cards from an external PCI-compliant vault into Pay.com, call
POST /v1/payment_methods/import.
It accepts raw card details and returns a permanent pm_ ID you can use across
charges, holds, and subscriptions.
Next steps
Follow these guides to implement saved cards:
- Tokenize a card: Collect card details with Pay.com.js and exchange them for a token.
- Save a payment method: Store a card for future charges via Pay.com.js or the API.
- Pay with a saved card: Let returning customers pay with a stored card.
- CVV and 3DS on a saved card: Re-collect CVV and run 3D Secure when charging a saved card.