Skip to main content
POST
Delete Saved Card

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 and identifier 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

Security Requirements

Both parameters are required for enhanced security:
  • card_token: Identifies the specific card to delete
  • identifier: Verifies ownership of the card
This dual verification prevents:
  • Accidental deletion of wrong cards
  • Unauthorized deletion by malicious actors
  • Cross-customer data access

Usage Examples

Basic Card Deletion

Request:
Response:

Batch Card Cleanup

Implementation Examples

Frontend Card Management

Backend Integration

Error Handling

Common Error Scenarios

Invalid Card Token

Mismatched Identifier

Best Practices

🚨 User Experience

  1. Always Confirm: Show confirmation dialogs before deletion
  2. Clear Messaging: Explain that deletion is permanent
  3. Loading States: Show progress during deletion
  4. Error Handling: Provide clear error messages

🔒 Security

  1. Validate Ownership: Always verify the customer owns the card
  2. Audit Logging: Log all deletion requests for compliance
  3. Rate Limiting: Implement rate limits to prevent abuse
  4. Authentication: Ensure proper authentication before deletion

💡 Business Logic

  1. Cleanup Expired Cards: Automatically remove expired cards
  2. User Notifications: Notify users when cards are deleted
  3. Backup Considerations: Consider if you need to retain deletion logs
  4. 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:
  1. Token Invalidation: The card token becomes immediately invalid
  2. Transaction Prevention: No future transactions can use this token
  3. UI Updates: Remove the card from all user interfaces
  4. Clean State: The system has no residual card data

Migration Notes

If you’re migrating from a different card storage system:
  1. Map Tokens: Ensure proper mapping between old and new tokens
  2. Batch Operations: Use batch deletion for bulk migrations
  3. Customer Communication: Inform customers about card re-saving if needed
  4. Testing: Thoroughly test deletion flows before production

Authorizations

X-Client-ID
string
header
required

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.

X-Client-Secret
string
header
required

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.

X-Merchant-ID
string
header
required

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.

X-API-Version
string
header
required

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

application/json

Card token details to delete

card_token
string
required

Token of the card to delete

identifier
string
required

Unique identifier for the card owner

Response

Card deleted successfully

success
boolean
required

Indicates if the request was successful

message
string
required

Response message

data
object
required

Empty object confirming deletion