Overview
The Save Card endpoint allows you to securely save card details for future transactions. Card information is tokenized and stored securely, ensuring PCI compliance while enabling seamless repeat transactions. When you save a card, the system generates a uniquecard_token
that can be used for future payments without requiring the customer to re-enter their card details.
Key Features
🔒 Security First
- Card numbers are immediately tokenized and never stored in plain text
- PCI DSS compliant tokenization process
- Secure token-based card management
📱 Customer Consent
- Explicit cardholder consent verification required
card_holder_consent
must betrue
to save cards- Compliance with data protection regulations
🏷️ Card Organization
- Optional card nickname for easy identification
- Support for multiple card types (Credit, Debit, Prepaid)
- Network identification (VISA, MASTERCARD, AMEX, etc.)
Required Parameters
Parameter | Type | Description |
---|---|---|
identifier | string | Unique identifier for the card owner (customer ID, user ID, etc.) |
card_number | string | Full card number (will be tokenized immediately) |
cardholder_name | string | Name as it appears on the card |
expiry_month | integer | Card expiry month (1-12) |
expiry_year | integer | Card expiry year (YYYY format) |
network | string | Card network (VISA, MASTERCARD, AMEX, DISCOVER, RUPAY) |
card_type | string | Type of card (CREDIT, DEBIT, PREPAID) |
card_holder_consent | boolean | Must be true - confirms cardholder consent |
Optional Parameters
Parameter | Type | Description |
---|---|---|
nickname | string | Custom name for easy card identification |
Conditional Parameters
Parameter | Type | Description |
---|---|---|
authorization_reference_number | string | Required for Rupay and AMEX cards only - See details below |
Authorization Reference Number Details
Theauthorization_reference_number
parameter is mandatory for specific card networks:
Rupay Cards
- Required: Yes
- Value: The authorization reference number received during the authorization call of Rupay card transactions
- Note: Authentication reference number will be sent by the PG in the authorization response. Currently, this check is skipped by Rupay
AMEX Cards
- Required: Yes
- Value: The AEVV (American Express Verification Value) received during authorization call of AMEX card transactions
- Note: American Express Verification Value will be sent by the PG in the authorization response
Other Networks (VISA, MASTERCARD, DISCOVER)
- Required: No
- Value: This parameter should not be included for other card networks
Response
The API returns a tokenized representation of the saved card:card_label
: Display-friendly card labelcard_token
: Unique token for future transactionsnetwork_token
: Network-specific tokenissuer_token
: Issuer-specific token (if available)
Usage Examples
Saving a Credit Card
Saving a Debit Card
Saving a Rupay Card (with Authorization Reference)
Saving an AMEX Card (with AEVV)
Security Notes
- Immediate Tokenization: Card numbers are tokenized as soon as they’re received
- No Plain Text Storage: Full card numbers are never stored in our systems
- Token Uniqueness: Each saved card gets a unique, non-reversible token
- Consent Tracking: Cardholder consent is recorded and verified
Error Handling
Common Error Responses
400 - Validation Error
When required fields are missing or invalid:Multiple Validation Errors
Authorization Reference Number Missing (Rupay/AMEX)
401 - Authentication Error
Error Response Structure
Status Code | Error Type | Description |
---|---|---|
400 | Validation Error | Missing or invalid request parameters |
401 | Authentication Error | Invalid or missing credentials |
403 | Authorization Error | Insufficient permissions |
409 | Conflict Error | Card already exists or duplicate identifier |
500 | Server Error | Internal system error |
Best Practices
- Always Verify Consent: Ensure customers explicitly consent before saving cards
- Use Descriptive Nicknames: Help customers identify their cards easily
- Validate Card Details: Verify card information before saving
- Handle Errors Gracefully: Implement proper error handling for failed saves
- Secure Transmission: Always use HTTPS for card data transmission
Next Steps
After saving a card successfully:- Store the returned
card_token
securely - Use the token for future order creation
- Allow customers to manage their saved cards
- Implement card deletion when customers request it
Related Endpoints
- List Saved Cards - Retrieve saved cards for a customer
- Delete Saved Card - Remove a saved card
- Create Order - Use saved cards in orders
Authorizations
Client app ID. You can find your app id in the merchant dashboard.
Client secret key. You can find your secret in the merchant dashboard.
Merchant ID. You can find your merchant ID in the merchant section of the merchant dashboard.
Body
Card details to save
Unique identifier for the card owner
Card number (will be tokenized and securely stored)
Name on the card
Card expiry month (1-12)
1 <= x <= 12
Card expiry year (YYYY format)
x >= 2024
Card network
VISA
, MASTERCARD
, AMEX
, DISCOVER
, RUPAY
Type of card
CREDIT
, DEBIT
, PREPAID
Confirmation that the card holder consents to saving card details
Card nickname for easy identification
Conditional parameter required for specific card networks: For Rupay cards - the authorization reference number received during authorization call. For AMEX cards - the AEVV (American Express Verification Value) received during authorization call. This parameter is mandatory for Rupay and AMEX cards only.