Know how to integrate Cashfree’s card vault API to avail the saved card feature.
You need to first save the customer card on checkout after successful transaction. Saving the card for customers enables them to complete payments without having to enter the card details repeatedly for every transaction.
....name="paymentOption" value="card"/>name="card_number" value="4444333322221111"/>name="card_holder" value="John Doe"/>name="card_expiryMonth" value="09"/>name="card_expiryYear" value="2020"/>name="card_cvv" value="123"/>name="card_save" value="1"/>
Add additional parameter ‘card_save’ and set it to 1 to save the card in seamless pro flow.
Card gets saved against the phone number provided in the above request. To fetch the card token you have to call the getCards API.
Use the below form to submit a saved card.
....name="paymentOption" value="savedCard"/>name="card_id" value="A83091283HDKASHKJDH2132"/>name="card_cvv" value="123"/>
Please use the below endpoints to get Saved Cards
URL | Environment |
| TEST |
| PRODUCTION |
Cashfree uses API keys to allow access to the API. Once you have signed up at our merchant site, you will be able to retrieve your AppId and SecretKey.
CashFree expects API key to be included in all API requests to the server. Use the endpoint /api/v1/credentials/verify to verify your credentials first.
To display all cards associated with a customer, use the code below:
URL - POST /api/v1/vault/cards/getCards
Parameter | Required | Description |
appId | Yes | Your app id |
secretKey | Yes | Your Secret Key |
phone | Yes | String Phone number used to identify user |
Parameter | Required | Description |
cardId | Yes | Your Card Id |
maskedCard | Yes | Masked Card Number |
cardScheme | Yes | Card scheme eg .Visa, Mastercard |
curl -X POST \https://test.cashfree.com/api/v1/vault/cards/getCards \-H 'Cache-Control: no-cache' \-H 'Content-Type: application/x-www-form-urlencoded' \-d 'appId=XXXX&secretKey=XXXX&phone=9895XXX649'
[{"cardId":"63E6E4B4208A11E8B6EFB84A4B991DC5","maskedCard":"411111XXXXXX1132","cardScheme":"visa"},{"cardId":"AC94D8B80D9011E8B6EFB84A4B991DC5","maskedCard":"411111XXXXXX1133","cardScheme":"visa"}]
To delete a card associated with a customer, use the code below:
URL - POST /api/v1/vault/cards/deleteCard
Parameter | Required | Description |
appId | Yes | Your app id |
secretKey | Yes | Your Secret Key |
phone | Yes | Phone number used to identify user |
cardId | Yes | Your Card Id |
Parameter | Required | Description |
status | Yes | API call status, values - OK and ERROR |
curl -X POST \https://test.cashfree.com/api/v1/vault/cards/deleteCard \-H 'Cache-Control: no-cache' \-H 'Content-Type: application/x-www-form-urlencoded' \-d'appId=XXXX&secretKey=XXX&phone=9895XXX649&cardId=B3BF498612E611E8A15B0AC953478514'
{“status”:”OK”“message”: “Deleted Successfully”}