Save Card
Save card details securely for future transactions. The card information is tokenized and stored securely.
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
- Compliance with data protection regulations
🏷️ Card Organization
- Optional card nickname for easy identification
- Support for multiple card types (Credit Card, Debit Dard)
- 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_card, debit_card) |
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 transactions
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
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_tokensecurely - 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 Application ID - Your unique application identifier used to authenticate API requests. You can find your Client ID in the Developer Settings section of the merchant dashboard.
Client Secret Key - Your secret key used alongside the Client ID for secure authentication. Keep this confidential and never expose it in client-side code. Available in the Developer Settings section of the merchant dashboard.
Merchant Identifier - The unique ID for the merchant account. This is required for PSP (Payment Service Provider) merchants who manage multiple merchant accounts. You can find merchant IDs in the Merchant Management section of the dashboard.
API Version - Specifies which version of the API to use (e.g., '1.X.X', '2.X.X', or '3.X.X'). This header allows you to control which API version your integration uses. Default version information is available in the Developer Settings.
Body
Card details to save
Unique identifier for the card owner
Card number (will be tokenized and securely stored)
^[0-9]{13,19}$Name on the card
Card expiry month (1-12)
1 <= x <= 12Card expiry year (YYYY format)
x >= 2024Card network
visa, mastercard, amex, discover, rupay Type of card
credit_card, debit_card 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.