Customers

Delete Customer

Soft-delete a customer by setting deletedAt timestamp. If the customer has active subscriptions, you must specify cascade=true to cancel them first. Without cascade, the request will fail with a 409 error listing the active subscriptions. The operation is atomic—if cascade fails, the customer won't be deleted.

DELETE
/customers/{id}

Authorization

bearerAuth
AuthorizationBearer <token>

Use your secret API key as the bearer token

In: header

Path Parameters

id*string

Lumen customer ID (must start with cus_)

Match^cus_[a-z0-9]+$

Query Parameters

cascade?string

If true, cancels all active subscriptions before deleting the customer. If false (default), deletion fails if active subscriptions exist.

Default"false"
Value in"true" | "false"

Response Body

application/json

application/json

application/json

application/json

curl -X DELETE "https://api.getlumen.dev/v1/customers/cus_01hrwzqrz4ytkwv07syv8k7g3z"

{
  "success": true,
  "cascaded": false,
  "canceledSubscriptions": []
}

{
  "error": "Customer not found or access denied"
}
{
  "error": "Customer has active subscriptions. Confirm cascade to delete customer and cancel subscriptions.",
  "requiresCascade": true,
  "activeSubscriptionCount": 2,
  "subscriptionIds": [
    "sub_stable_abc123",
    "sub_stable_def456"
  ]
}
{
  "error": "Failed to delete customer",
  "details": "Database transaction failed"
}