Token Vault
Store your card credentials with Cashfree in a secure manner.
With Token Vault, you can securely generate and store card tokens as part of the card-saving process. This enables them to retrieve and display saved card tokens to customers, allowing for convenient, quick transactions using stored cards. We generate network tokens which are interoperable, meaning that tokens saved with us can be used to process payments with any compatible payment provider.
Seamless Guide to save a card for a customer
Create order with customer id
To begin you need to send the customer information to cashfree as part of the create order
api. You do this by sending customer_id
parameter in the (create order api request)[/api/payments/latest/orders/create].
Here’s a sample request for creating an order using your desired backend language. Cashfree offers backend SDKs to simplify the integration process.
You can find the SDKs here.
After successfully creating an order, you will receive a unique order_id
and payment_session_id
that you need for subsequent steps.
You can view all the complete api request and response for /orders
here.
Render UI to the customer
In this step, you need to display the checkout interface to the customer. The UI should include a checkbox, allowing the customer to consent to card storage for future use.
Send card details to Cashfree
In the make payment api, you need to set save_instrument
to true
after obtaining the customer’s consent. Once consent is received, Cashfree will initiate a token generation request with the card networks. Cashfree will first process the payment, completing the 2FA (two-factor authentication) step before sending the token generation request. If 2FA is not successfully completed—meaning the payment fails—Cashfree will not send the token provisioning request to the card networks, and the card will not be tokenized.
Next learn how to use an exsting stored card for a customer.
Guide to get and use a saved Card
Get Saved Cards
You first need to get the saved cards for a customer using the customer_id
. You can then display these cards to the customer.
Payment for a saved card
Once you have the instrument_uid
, you can pass that in the order pay api to intiate payment for a specific card.
Was this page helpful?