Customer deletion is a permanent, irreversible action. Make sure to confirm the deletion intent and understand the implications before proceeding.

Delete a Customer

DELETE /customers/{customer_id}

Delete a customer and all associated data. This action cannot be undone.

Parameters

customer_id
string
required

The unique identifier of the customer to delete

Cascade Deletion Behavior

When you delete a customer, the following associated data will also be permanently removed:

  • Customer profile information
  • Saved payment methods
  • Billing addresses
  • Transaction history references
  • Subscription associations

Transaction records themselves are preserved for compliance and audit purposes, even after customer deletion.

Data Retention Policy

After deletion:

  • Customer data is immediately removed from active systems
  • Backups are retained for 30 days as per our data retention policy
  • Transaction records are maintained in compliance with financial regulations
  • Anonymized analytics data may be retained

Request Examples

curl -X DELETE "https://api.spendjuice.com/v1/customers/cus_12345" \
  -H "Authorization: Bearer YOUR_API_KEY"

Response

A successful deletion returns an HTTP 204 No Content response with no response body.

Error Scenarios

1

Verify Customer Status

Check for any active subscriptions, pending transactions, or other dependencies that might prevent deletion.

2

Backup Data

Consider exporting customer data before deletion if needed for records.

3

Request Confirmation

Implement a confirmation step in your interface to prevent accidental deletions.

4

Execute Deletion

Perform the deletion API call with proper error handling.

5

Verify Deletion

Confirm the customer record has been removed by attempting to fetch it.

Best Practices

Deletion Guidelines

  • Implement confirmation workflows for deletion requests
  • Handle cascade deletion effects in your application
  • Maintain audit logs of deletion operations
  • Consider soft deletion for recoverable data
  • Respect data privacy regulations (GDPR, CCPA)

If you need to preserve customer data for compliance or business purposes, consider implementing a soft delete mechanism instead of permanent deletion.