Delete Payment Method

Delete a specific payment method by ID.

Request

curl -X DELETE \
  https://api.basistheory.ai/tenants/your-tenant-id/payment-methods/26859380-7829-4ee1-8a0a-38927881e7ef \
  -H 'Authorization: Bearer your-api-key'

URL Parameters

ParameterRequiredTypeDefaultDescription
tenantIdtruestringnullThe tenant ID.
idtruestringnullThe payment method ID to delete.

Response

// No content - successful deletion

The successful deletion returns a 204 No Content status with an empty response body.

Important Considerations

Irreversible Action

  • Permanent deletion: Once deleted, the payment method cannot be recovered
  • Active credentials: Any active purchase intents using this payment method will be invalidated
  • References: Any stored references to this payment method ID will become invalid

Security

  • Authentication required: Valid API key must be provided
  • Authorization check: User must have permission to delete the payment method
  • Audit trail: Deletion is logged for compliance and security purposes

Best Practices

  1. Confirm before deletion: Always confirm with the user before permanent deletion
  2. Check dependencies: Verify no active transactions depend on this payment method
  3. Alternative approach: Consider marking as inactive instead of deletion for audit purposes
  4. Error handling: Implement proper error handling for deletion failures

Error Handling

{
  "error": {
    "status": 401,
    "type": "unauthorized",
    "title": "Unauthorized",
    "message": "Missing or invalid API key was provided."
  }
}