# Erase a customer

Removes the customer, then redacts the personal details that their
orders and transactions copied when they were created. Those records
are kept, because they are financial records, with the embedded
name, email and card details replaced by `[REDACTED]`. Records are
matched by the customer's current email, so a record made under an
earlier email is not redacted.
Erasing a customer does not stop their billing. Before you erase a
customer:
- Cancel their subscriptions with
`PUT /subscriptions/cancel`
.

Otherwise they keep billing.
- Settle their unpaid invoices, or delete them with

`DELETE /invoices/{token}`
. Erasing the customer does not delete or

redact them.

Stored cards and payment methods are not removed. This cannot be
undone.

Endpoint: DELETE /customers/{token}
Security: ClientKey, SecretKey

## Security:

  - `ClientKey` (unknown)
    apiKey in header X-Dime-Client

  - `SecretKey` (unknown)
    http bearer

## Path parameters:

  - `token` (string, required)
    The customer's `token`, from create or list.

## Response 200:

  - `200` (unknown)
    The customer was erased.

## Response 200 fields (application/json):

  - `token` (string, required)
    The erased customer's `token`.
    Example: cus_2ex3bH8t_I8wppHr5_nnWIbSOb_0xGEWoW

  - `object` (string, required)
    Enum: "customer"

  - `deleted` (boolean, required)
    Enum: "true"

## Response 401:

  - `401` (unknown)
    The client key or secret key was missing, not recognized, or the two do not belong to the same key.

## Response 401 fields (application/json):

  - `error` (object, required)

  - `error.type` (string, required)
    Which kind of failure occurred. Always one of four values, so
a client can branch on `type` before reading `code`.
    Enum: "invalid_request_error", "card_error", "idempotency_error", "api_error"

  - `error.code` (string, required)
    Example: parameter_missing

  - `error.message` (string, required)
    Example: Order ID is required.

  - `error.param` (string)
    The field that caused the failure, when applicable.
    Example: id

## Response 404:

  - `404` (unknown)
    No record matches the token in the request. A database id in a URL
also ends here: v2 looks records up by token only.

## Response 404 fields (application/json):

  - `error` (object, required)

  - `error.type` (string, required)
    Which kind of failure occurred. Always one of four values, so
a client can branch on `type` before reading `code`.
    Enum: "invalid_request_error", "card_error", "idempotency_error", "api_error"

  - `error.code` (string, required)
    Example: parameter_missing

  - `error.message` (string, required)
    Example: Order ID is required.

  - `error.param` (string)
    The field that caused the failure, when applicable.
    Example: id

## Response 200 examples:

  - `Deletion acknowledged` (unknown)

## Response 401 examples:

  - `unauthorized` (unknown)

  - `Client key sent without its secret key` (unknown)

## Response 404 examples:

  - `missing` (unknown)

