Overview
The Delete Saved Card endpoint permanently removes a saved card token from the system. This action is irreversible and immediately invalidates the card token for all future transactions. Use this endpoint when customers want to remove payment methods from their account or when you need to clean up expired or invalid cards.Key Features
🗑️ Permanent Deletion
- Immediately removes card token from the system
- Action cannot be undone
- Token becomes invalid for all future transactions
🔒 Dual Verification
- Requires both
card_token
andidentifier
for security - Prevents accidental or unauthorized deletions
- Ensures only the card owner can delete their cards
✅ Clean Removal
- Complete token invalidation
- No residual data retention
- Clean system state after deletion
Required Parameters
Parameter | Type | Description |
---|---|---|
card_token | string | Unique token of the card to delete |
identifier | string | Customer identifier that owns the card |
Security Requirements
Both parameters are required for enhanced security:card_token
: Identifies the specific card to deleteidentifier
: Verifies ownership of the card
- Accidental deletion of wrong cards
- Unauthorized deletion by malicious actors
- Cross-customer data access
Usage Examples
Basic Card Deletion
Request:Batch Card Cleanup
Implementation Examples
Frontend Card Management
Backend Integration
Error Handling
Status Code | Description | Possible Cause | Action |
---|---|---|---|
200 | Success | Card deleted successfully | Update UI, show confirmation |
400 | Bad Request | Missing or invalid parameters | Validate request data |
401 | Unauthorized | Invalid credentials | Check authentication |
404 | Not Found | Card token not found or doesn’t belong to identifier | Verify token and identifier |
500 | Server Error | Internal system error | Retry request or contact support |
Common Error Scenarios
Invalid Card Token
Mismatched Identifier
Best Practices
🚨 User Experience
- Always Confirm: Show confirmation dialogs before deletion
- Clear Messaging: Explain that deletion is permanent
- Loading States: Show progress during deletion
- Error Handling: Provide clear error messages
🔒 Security
- Validate Ownership: Always verify the customer owns the card
- Audit Logging: Log all deletion requests for compliance
- Rate Limiting: Implement rate limits to prevent abuse
- Authentication: Ensure proper authentication before deletion
💡 Business Logic
- Cleanup Expired Cards: Automatically remove expired cards
- User Notifications: Notify users when cards are deleted
- Backup Considerations: Consider if you need to retain deletion logs
- Transaction Checks: Ensure no pending transactions use the token
Use Cases
Customer Account Management
Allow customers to remove unwanted payment methods from their account.Card Expiry Cleanup
Automatically remove expired cards to keep the card list clean.Security Breach Response
Quickly remove compromised cards from the system.Account Closure
Remove all saved cards when a customer closes their account.After Deletion
Once a card is deleted:- Token Invalidation: The card token becomes immediately invalid
- Transaction Prevention: No future transactions can use this token
- UI Updates: Remove the card from all user interfaces
- Clean State: The system has no residual card data
Related Endpoints
- Save Card - Save new cards for customers
- List Saved Cards - View all saved cards
- Create Order - Use remaining saved cards for payments
Migration Notes
If you’re migrating from a different card storage system:- Map Tokens: Ensure proper mapping between old and new tokens
- Batch Operations: Use batch deletion for bulk migrations
- Customer Communication: Inform customers about card re-saving if needed
- Testing: Thoroughly test deletion flows before production
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
application/json
Card token details to delete