Customer objects represent the end users who purchase products and services through your platform.

A customer record is the foundation of the EPD ecosystem. Before processing a payment or creating a subscription, you need a customer. Each customer can have:

  • Multiple payment methods (cards stored via EPD Gateway vault)
  • Active subscriptions for recurring billing
  • A history of orders and transactions
  • Custom metadata for your internal tracking

Tip: Store customer IDs in your database to avoid creating duplicate records. Use the email or phone parameters to look up existing customers.

POST /customers

Create a customer

Creates a new customer record with contact information and optional payment details.

Before You Start

Create a customer before processing their first payment or starting a subscription. The customer record links together their payment methods, orders, and subscription history.

Uniqueness Constraints

Both email and phone must be unique per merchant. Attempting to create a duplicate returns a 409 Conflict error. To find an existing customer, use GET /v1/customers?email=john@example.com.

EPD Gateway Vault Integration

If you've already vaulted the customer's card through EPD Gateway, pass the epd_gateway_customer_vault_id to automatically link their payment method. See the Card Vaulting Guide for the full Collect.js → EPD Gateway → EPD Commerce flow.

Sandbox Testing

In sandbox mode, pass a test card token (e.g. card_visa, card_visa_declined) as the epd_gateway_customer_vault_id to create a customer with a simulated payment method — no card vaulting required. See the Testing Guide for all available tokens.

Header parameters

NameTypeDescription
EPD-Version
string
API version override (format `YYYY-MM-DD`). If omitted, your account's pinned version or the latest version is used.
e.g. "2026-02-11"
X-EPD-Idempotency-Key
string (uuid)
Optional UUID v4 idempotency key for retry safety.
e.g. "550e8400-e29b-41d4-a716-446655440000"

Request body required

FieldTypeDescription
emailrequired
string (email)
Customer's email address. Must be unique per merchant.
e.g. "john@example.com"
first_namerequired
string
Customer's first name. HTML not allowed.
e.g. "John"
last_namerequired
string
Customer's last name. HTML not allowed.
e.g. "Doe"
phonerequired
string
Phone number in E.164 format (e.g., `+14155551234`). Must be unique per merchant. Minimum 8 characters (including `+`).
e.g. "+14155551234"
company
string
Company name.
e.g. "Acme Corp"
shipping
ShippingAddress
metadata
Metadata
epd_gateway_customer_vault_id
string
EPD Gateway customer vault ID for linking existing payment data. **Sandbox only:** Pass a test card token (e.g. `card_visa`, `card_visa_declined`) to create a simulated payment method. See the [Testing Guide](/guides/testing) for all available tokens.
e.g. "12345678"

Code samples

curl -X POST https://api.epd.com/v1/customers \
  -H "Authorization: Bearer epd_test_sk_xxxx" \
  -H "Content-Type: application/json" \
  -H "EPD-Version: 2026-02-11" \
  -d '{
    "email": "john@example.com",
    "first_name": "John",
    "last_name": "Doe",
    "phone": "+14155551234",
    "company": "Acme Corp"
  }'
const response = await fetch('https://api.epd.com/v1/customers', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer epd_test_sk_xxxx',
    'Content-Type': 'application/json',
    'EPD-Version': '2026-02-11',
  },
  body: JSON.stringify({
    email: 'john@example.com',
    first_name: 'John',
    last_name: 'Doe',
    phone: '+14155551234',
    company: 'Acme Corp',
  }),
});

const customer = await response.json();
console.log(customer.id); // 550e8400-e29b-41d4-a716-446655440000
import requests

response = requests.post(
    'https://api.epd.com/v1/customers',
    headers={
        'Authorization': 'Bearer epd_test_sk_xxxx',
        'EPD-Version': '2026-02-11',
    },
    json={
        'email': 'john@example.com',
        'first_name': 'John',
        'last_name': 'Doe',
        'phone': '+14155551234',
        'company': 'Acme Corp',
    }
)

customer = response.json()
print(customer['id'])  # 550e8400-e29b-41d4-a716-446655440000
$ch = curl_init('https://api.epd.com/v1/customers');
curl_setopt_array($ch, [
    CURLOPT_POST => true,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer epd_test_sk_xxxx',
        'Content-Type: application/json',
        'EPD-Version: 2026-02-11',
    ],
    CURLOPT_POSTFIELDS => json_encode([
        'email' => 'john@example.com',
        'first_name' => 'John',
        'last_name' => 'Doe',
        'phone' => '+14155551234',
    ]),
]);

$response = json_decode(curl_exec($ch), true);
echo $response['id']; // 550e8400-e29b-41d4-a716-446655440000

Responses

201 Customer created successfully.
FieldTypeDescription
idrequired
string
Unique identifier (UUID).
e.g. "550e8400-e29b-41d4-a716-446655440000"
emailnullable
string (email)
e.g. "john@example.com"
first_namenullable
string
e.g. "John"
last_namenullable
string
e.g. "Doe"
phonenullable
string
Phone number in E.164 format.
e.g. "+14155551234"
companynullable
string
e.g. "Acme Corp"
shippingnullable
object
Customer's default shipping address.
id
string (uuid)
Shipping address ID.
e.g. "6ba7b818-9dad-11d1-80b4-00c04fd430c8"
name
string
Recipient name.
e.g. "John Doe"
line1
string
Street address line 1.
e.g. "123 Main St"
line2nullable
string
Street address line 2.
e.g. "Suite 100"
city
string
e.g. "San Francisco"
state
string
e.g. "CA"
postal_code
string
e.g. "94105"
country
string
Two-letter ISO 3166-1 alpha-2 country code.
e.g. "US"
phonenullable
string
Recipient phone in E.164 format.
e.g. "+14155551234"
metadata
Metadata
default_payment_methodnullable
string
ID of the default payment method.
e.g. "6ba7b815-9dad-11d1-80b4-00c04fd430c8"
payment_methods
array[PaymentMethod]
List of payment methods (only present when expanded).
created_atrequired
string (date-time)
ISO 8601 timestamp of creation.
e.g. "2024-01-15T10:30:00.000Z"
updated_atrequired
string (date-time)
ISO 8601 timestamp of last update.
e.g. "2024-01-15T10:30:00.000Z"
400 Bad Request — The request was invalid or cannot be served.
FieldTypeDescription
errorrequired
object
typerequired
enum
The type of error.
invalid_request_errorauthentication_errorauthorization_errorrate_limit_erroridempotency_errorprocessing_errorwebhook_error
coderequired
string
A short string identifying the specific error.
e.g. "validation_error"
messagerequired
string
A human-readable message providing details about the error.
e.g. "Request validation failed"
paramnullable
string
The parameter that caused the error, if applicable.
e.g. "email"
request_id
string
Unique request identifier for debugging.
e.g. "req_a1b2c3d4e5f67890abcdef0123456789"
field_errors
array[object]
Detailed field-level errors for validation failures.
401 Unauthorized — Authentication failed.
FieldTypeDescription
errorrequired
object
typerequired
enum
The type of error.
invalid_request_errorauthentication_errorauthorization_errorrate_limit_erroridempotency_errorprocessing_errorwebhook_error
coderequired
string
A short string identifying the specific error.
e.g. "validation_error"
messagerequired
string
A human-readable message providing details about the error.
e.g. "Request validation failed"
paramnullable
string
The parameter that caused the error, if applicable.
e.g. "email"
request_id
string
Unique request identifier for debugging.
e.g. "req_a1b2c3d4e5f67890abcdef0123456789"
field_errors
array[object]
Detailed field-level errors for validation failures.
409 Conflict — The request conflicts with existing data.
FieldTypeDescription
errorrequired
object
typerequired
enum
The type of error.
invalid_request_errorauthentication_errorauthorization_errorrate_limit_erroridempotency_errorprocessing_errorwebhook_error
coderequired
string
A short string identifying the specific error.
e.g. "validation_error"
messagerequired
string
A human-readable message providing details about the error.
e.g. "Request validation failed"
paramnullable
string
The parameter that caused the error, if applicable.
e.g. "email"
request_id
string
Unique request identifier for debugging.
e.g. "req_a1b2c3d4e5f67890abcdef0123456789"
field_errors
array[object]
Detailed field-level errors for validation failures.
429 Too Many Requests — Rate limit exceeded.
FieldTypeDescription
errorrequired
object
typerequired
enum
The type of error.
invalid_request_errorauthentication_errorauthorization_errorrate_limit_erroridempotency_errorprocessing_errorwebhook_error
coderequired
string
A short string identifying the specific error.
e.g. "validation_error"
messagerequired
string
A human-readable message providing details about the error.
e.g. "Request validation failed"
paramnullable
string
The parameter that caused the error, if applicable.
e.g. "email"
request_id
string
Unique request identifier for debugging.
e.g. "req_a1b2c3d4e5f67890abcdef0123456789"
field_errors
array[object]
Detailed field-level errors for validation failures.
GET /customers

List all customers

Returns a paginated list of customers sorted by creation date (newest first). Supports filtering, full-text search, date ranges, resource expansion, and sparse fieldsets.

Pagination

Uses cursor-based pagination for consistent results. Use starting_after with the last customer's ID to get the next page.

GET /v1/customers?limit=20
GET /v1/customers?limit=20&starting_after=550e8400-e29b-41d4-a716-446655440000
Parameter Description Example
email Exact email match ?email=john@example.com
q Full-text search (name, email, company) ?q=acme
created_at[gte] Created on or after date ?created_at[gte]=2024-01-01
deleted Include soft-deleted customers ?deleted=true

Query parameters

NameTypeDescription
limit
integer
Number of items to return per page.
Default: 10
starting_after
string
Cursor for forward pagination. Returns items created after this ID.
e.g. "550e8400-e29b-41d4-a716-446655440000"
ending_before
string
Cursor for backward pagination. Returns items created before this ID.
e.g. "550e8400-e29b-41d4-a716-446655440001"
sort
string
Sort order. Format: `field[direction]` or `-field` for descending. Default: `created_at[desc]`.
e.g. "created_at[desc]"
email
string
Filter by exact email address.
e.g. "john@example.com"
q
string
Full-text search across name, email, and company.
e.g. "acme"
tags[]
array[string]
Filter by tags.
e.g. ["vip"]
deleted
boolean
Include soft-deleted customers.
Default: false
e.g. false
expand
string
Expand related resources (comma-separated): `payment_methods`, `subscriptions`.
e.g. "payment_methods"
created_at[gte]
string
Filter by creation date (on or after, ISO 8601).
e.g. "2024-01-01"
created_at[lt]
string
Filter by creation date (before, ISO 8601).
e.g. "2024-02-01"
fields[customers]
string
Sparse fieldsets — comma-separated list of fields to include (e.g., `id,email,created`).
e.g. "id,email,first_name,created"

Header parameters

NameTypeDescription
EPD-Version
string
API version override (format `YYYY-MM-DD`). If omitted, your account's pinned version or the latest version is used.
e.g. "2026-02-11"

Code samples

# List first 20 customers
curl https://api.epd.com/v1/customers?limit=20 \
  -H "Authorization: Bearer epd_test_sk_xxxx" \
  -H "EPD-Version: 2026-02-11"

# Search by email
curl "https://api.epd.com/v1/customers?email=john@example.com" \
  -H "Authorization: Bearer epd_test_sk_xxxx"

# Full-text search with date filter
curl "https://api.epd.com/v1/customers?q=acme&created_at[gte]=2024-01-01" \
  -H "Authorization: Bearer epd_test_sk_xxxx"
// List customers with pagination
const params = new URLSearchParams({
  limit: '20',
  expand: 'payment_methods',
});

const response = await fetch(
  `https://api.epd.com/v1/customers?${params}`,
  {
    headers: {
      'Authorization': 'Bearer epd_test_sk_xxxx',
      'EPD-Version': '2026-02-11',
    },
  }
);

const { data, has_more, cursors } = await response.json();

// Get next page
if (has_more) {
  const nextPage = await fetch(
    `https://api.epd.com/v1/customers?limit=20&starting_after=${cursors.next}`,
    { headers: { 'Authorization': 'Bearer epd_test_sk_xxxx' } }
  );
}
import requests

# List customers with filters
response = requests.get(
    'https://api.epd.com/v1/customers',
    headers={
        'Authorization': 'Bearer epd_test_sk_xxxx',
        'EPD-Version': '2026-02-11',
    },
    params={
        'limit': 20,
        'expand': 'payment_methods',
        'created_at[gte]': '2024-01-01',
    }
)

result = response.json()
customers = result['data']

# Iterate through all pages
while result['has_more']:
    response = requests.get(
        'https://api.epd.com/v1/customers',
        headers={'Authorization': 'Bearer epd_test_sk_xxxx'},
        params={
            'limit': 20,
            'starting_after': result['cursors']['next'],
        }
    )
    result = response.json()
    customers.extend(result['data'])

Responses

200 A paginated list of customers.
FieldTypeDescription
data
array[Customer]
url
any
e.g. "/v1/customers"
401 Unauthorized — Authentication failed.
FieldTypeDescription
errorrequired
object
typerequired
enum
The type of error.
invalid_request_errorauthentication_errorauthorization_errorrate_limit_erroridempotency_errorprocessing_errorwebhook_error
coderequired
string
A short string identifying the specific error.
e.g. "validation_error"
messagerequired
string
A human-readable message providing details about the error.
e.g. "Request validation failed"
paramnullable
string
The parameter that caused the error, if applicable.
e.g. "email"
request_id
string
Unique request identifier for debugging.
e.g. "req_a1b2c3d4e5f67890abcdef0123456789"
field_errors
array[object]
Detailed field-level errors for validation failures.
429 Too Many Requests — Rate limit exceeded.
FieldTypeDescription
errorrequired
object
typerequired
enum
The type of error.
invalid_request_errorauthentication_errorauthorization_errorrate_limit_erroridempotency_errorprocessing_errorwebhook_error
coderequired
string
A short string identifying the specific error.
e.g. "validation_error"
messagerequired
string
A human-readable message providing details about the error.
e.g. "Request validation failed"
paramnullable
string
The parameter that caused the error, if applicable.
e.g. "email"
request_id
string
Unique request identifier for debugging.
e.g. "req_a1b2c3d4e5f67890abcdef0123456789"
field_errors
array[object]
Detailed field-level errors for validation failures.
GET /customers/{id}

Retrieve a customer

Retrieves the details of an existing customer by ID. Use expand to include related resources like payment methods or subscriptions in a single request.

Path parameters

NameTypeDescription
idrequired
string
Customer ID (UUID).
e.g. "550e8400-e29b-41d4-a716-446655440000"

Query parameters

NameTypeDescription
expand
string
Comma-separated: `payment_methods`, `subscriptions`.

Header parameters

NameTypeDescription
EPD-Version
string
API version override (format `YYYY-MM-DD`). If omitted, your account's pinned version or the latest version is used.
e.g. "2026-02-11"

Code samples

# Basic retrieval
curl https://api.epd.com/v1/customers/550e8400-e29b-41d4-a716-446655440000 \
  -H "Authorization: Bearer epd_test_sk_xxxx"

# With expanded payment methods
curl "https://api.epd.com/v1/customers/550e8400-e29b-41d4-a716-446655440000?expand=payment_methods" \
  -H "Authorization: Bearer epd_test_sk_xxxx"
const response = await fetch(
  'https://api.epd.com/v1/customers/550e8400-e29b-41d4-a716-446655440000?expand=payment_methods',
  {
    headers: { 'Authorization': 'Bearer epd_test_sk_xxxx' },
  }
);

const customer = await response.json();
console.log(customer.email);
console.log(customer.payment_methods); // expanded

Responses

200 The customer.
FieldTypeDescription
idrequired
string
Unique identifier (UUID).
e.g. "550e8400-e29b-41d4-a716-446655440000"
emailnullable
string (email)
e.g. "john@example.com"
first_namenullable
string
e.g. "John"
last_namenullable
string
e.g. "Doe"
phonenullable
string
Phone number in E.164 format.
e.g. "+14155551234"
companynullable
string
e.g. "Acme Corp"
shippingnullable
object
Customer's default shipping address.
id
string (uuid)
Shipping address ID.
e.g. "6ba7b818-9dad-11d1-80b4-00c04fd430c8"
name
string
Recipient name.
e.g. "John Doe"
line1
string
Street address line 1.
e.g. "123 Main St"
line2nullable
string
Street address line 2.
e.g. "Suite 100"
city
string
e.g. "San Francisco"
state
string
e.g. "CA"
postal_code
string
e.g. "94105"
country
string
Two-letter ISO 3166-1 alpha-2 country code.
e.g. "US"
phonenullable
string
Recipient phone in E.164 format.
e.g. "+14155551234"
metadata
Metadata
default_payment_methodnullable
string
ID of the default payment method.
e.g. "6ba7b815-9dad-11d1-80b4-00c04fd430c8"
payment_methods
array[PaymentMethod]
List of payment methods (only present when expanded).
created_atrequired
string (date-time)
ISO 8601 timestamp of creation.
e.g. "2024-01-15T10:30:00.000Z"
updated_atrequired
string (date-time)
ISO 8601 timestamp of last update.
e.g. "2024-01-15T10:30:00.000Z"
401 Unauthorized — Authentication failed.
FieldTypeDescription
errorrequired
object
typerequired
enum
The type of error.
invalid_request_errorauthentication_errorauthorization_errorrate_limit_erroridempotency_errorprocessing_errorwebhook_error
coderequired
string
A short string identifying the specific error.
e.g. "validation_error"
messagerequired
string
A human-readable message providing details about the error.
e.g. "Request validation failed"
paramnullable
string
The parameter that caused the error, if applicable.
e.g. "email"
request_id
string
Unique request identifier for debugging.
e.g. "req_a1b2c3d4e5f67890abcdef0123456789"
field_errors
array[object]
Detailed field-level errors for validation failures.
404 Not Found — The requested resource doesn't exist.
FieldTypeDescription
errorrequired
object
typerequired
enum
The type of error.
invalid_request_errorauthentication_errorauthorization_errorrate_limit_erroridempotency_errorprocessing_errorwebhook_error
coderequired
string
A short string identifying the specific error.
e.g. "validation_error"
messagerequired
string
A human-readable message providing details about the error.
e.g. "Request validation failed"
paramnullable
string
The parameter that caused the error, if applicable.
e.g. "email"
request_id
string
Unique request identifier for debugging.
e.g. "req_a1b2c3d4e5f67890abcdef0123456789"
field_errors
array[object]
Detailed field-level errors for validation failures.
PATCH /customers/{id}

Update a customer

Updates the specified customer by setting the values of the parameters passed. Any parameters not provided remain unchanged.

Uniqueness constraints still apply — if you change the email or phone to a value already used by another customer, a 409 Conflict is returned.

Note: Deleted customers cannot be updated. Attempting to update a deleted customer returns a 400 error.

Path parameters

NameTypeDescription
idrequired
string
Customer ID (UUID).
e.g. "550e8400-e29b-41d4-a716-446655440000"

Header parameters

NameTypeDescription
EPD-Version
string
API version override (format `YYYY-MM-DD`). If omitted, your account's pinned version or the latest version is used.
e.g. "2026-02-11"
X-EPD-Idempotency-Keyrequired
string (uuid)
UUID v4 idempotency key. Same key with same request returns cached response. Keys expire after 24 hours.
e.g. "550e8400-e29b-41d4-a716-446655440000"

Request body required

FieldTypeDescription
email
string (email)
e.g. "newemail@example.com"
first_name
string
e.g. "Jane"
last_name
string
e.g. "Smith"
phone
string
Phone number in E.164 format (e.g., `+14155551234`).
e.g. "+14155559876"
company
string
e.g. "Acme Corp"
shipping
ShippingAddress
metadata
Metadata
epd_gateway_customer_vault_id
string
e.g. "87654321"

Code samples

curl -X PATCH https://api.epd.com/v1/customers/550e8400-e29b-41d4-a716-446655440000 \
  -H "Authorization: Bearer epd_test_sk_xxxx" \
  -H "Content-Type: application/json" \
  -H "X-EPD-Idempotency-Key: $(uuidgen)" \
  -d '{
    "email": "newemail@example.com",
    "metadata": { "tier": "enterprise" }
  }'
const response = await fetch('https://api.epd.com/v1/customers/550e8400-e29b-41d4-a716-446655440000', {
  method: 'PATCH',
  headers: {
    'Authorization': 'Bearer epd_test_sk_xxxx',
    'Content-Type': 'application/json',
    'X-EPD-Idempotency-Key': crypto.randomUUID(),
  },
  body: JSON.stringify({
    email: 'newemail@example.com',
    metadata: { tier: 'enterprise' },
  }),
});

const customer = await response.json();

Responses

200 The updated customer.
FieldTypeDescription
idrequired
string
Unique identifier (UUID).
e.g. "550e8400-e29b-41d4-a716-446655440000"
emailnullable
string (email)
e.g. "john@example.com"
first_namenullable
string
e.g. "John"
last_namenullable
string
e.g. "Doe"
phonenullable
string
Phone number in E.164 format.
e.g. "+14155551234"
companynullable
string
e.g. "Acme Corp"
shippingnullable
object
Customer's default shipping address.
id
string (uuid)
Shipping address ID.
e.g. "6ba7b818-9dad-11d1-80b4-00c04fd430c8"
name
string
Recipient name.
e.g. "John Doe"
line1
string
Street address line 1.
e.g. "123 Main St"
line2nullable
string
Street address line 2.
e.g. "Suite 100"
city
string
e.g. "San Francisco"
state
string
e.g. "CA"
postal_code
string
e.g. "94105"
country
string
Two-letter ISO 3166-1 alpha-2 country code.
e.g. "US"
phonenullable
string
Recipient phone in E.164 format.
e.g. "+14155551234"
metadata
Metadata
default_payment_methodnullable
string
ID of the default payment method.
e.g. "6ba7b815-9dad-11d1-80b4-00c04fd430c8"
payment_methods
array[PaymentMethod]
List of payment methods (only present when expanded).
created_atrequired
string (date-time)
ISO 8601 timestamp of creation.
e.g. "2024-01-15T10:30:00.000Z"
updated_atrequired
string (date-time)
ISO 8601 timestamp of last update.
e.g. "2024-01-15T10:30:00.000Z"
400 Bad Request — The request was invalid or cannot be served.
FieldTypeDescription
errorrequired
object
typerequired
enum
The type of error.
invalid_request_errorauthentication_errorauthorization_errorrate_limit_erroridempotency_errorprocessing_errorwebhook_error
coderequired
string
A short string identifying the specific error.
e.g. "validation_error"
messagerequired
string
A human-readable message providing details about the error.
e.g. "Request validation failed"
paramnullable
string
The parameter that caused the error, if applicable.
e.g. "email"
request_id
string
Unique request identifier for debugging.
e.g. "req_a1b2c3d4e5f67890abcdef0123456789"
field_errors
array[object]
Detailed field-level errors for validation failures.
401 Unauthorized — Authentication failed.
FieldTypeDescription
errorrequired
object
typerequired
enum
The type of error.
invalid_request_errorauthentication_errorauthorization_errorrate_limit_erroridempotency_errorprocessing_errorwebhook_error
coderequired
string
A short string identifying the specific error.
e.g. "validation_error"
messagerequired
string
A human-readable message providing details about the error.
e.g. "Request validation failed"
paramnullable
string
The parameter that caused the error, if applicable.
e.g. "email"
request_id
string
Unique request identifier for debugging.
e.g. "req_a1b2c3d4e5f67890abcdef0123456789"
field_errors
array[object]
Detailed field-level errors for validation failures.
404 Not Found — The requested resource doesn't exist.
FieldTypeDescription
errorrequired
object
typerequired
enum
The type of error.
invalid_request_errorauthentication_errorauthorization_errorrate_limit_erroridempotency_errorprocessing_errorwebhook_error
coderequired
string
A short string identifying the specific error.
e.g. "validation_error"
messagerequired
string
A human-readable message providing details about the error.
e.g. "Request validation failed"
paramnullable
string
The parameter that caused the error, if applicable.
e.g. "email"
request_id
string
Unique request identifier for debugging.
e.g. "req_a1b2c3d4e5f67890abcdef0123456789"
field_errors
array[object]
Detailed field-level errors for validation failures.
409 Conflict — The request conflicts with existing data.
FieldTypeDescription
errorrequired
object
typerequired
enum
The type of error.
invalid_request_errorauthentication_errorauthorization_errorrate_limit_erroridempotency_errorprocessing_errorwebhook_error
coderequired
string
A short string identifying the specific error.
e.g. "validation_error"
messagerequired
string
A human-readable message providing details about the error.
e.g. "Request validation failed"
paramnullable
string
The parameter that caused the error, if applicable.
e.g. "email"
request_id
string
Unique request identifier for debugging.
e.g. "req_a1b2c3d4e5f67890abcdef0123456789"
field_errors
array[object]
Detailed field-level errors for validation failures.
DELETE /customers/{id}

Delete a customer

Permanently deletes a customer. If the customer has order history, they are soft-deleted instead.

Condition Behavior
Has active/paused subscriptions Blocked (400 error)
Has order history Soft delete (deleted: true)
No order history Hard delete (permanent)
Already deleted Returns success (idempotent)

Path parameters

NameTypeDescription
idrequired
string
e.g. "550e8400-e29b-41d4-a716-446655440000"

Header parameters

NameTypeDescription
EPD-Version
string
API version override (format `YYYY-MM-DD`). If omitted, your account's pinned version or the latest version is used.
e.g. "2026-02-11"
X-EPD-Idempotency-Key
string (uuid)
Optional UUID v4 idempotency key for retry safety.
e.g. "550e8400-e29b-41d4-a716-446655440000"

Responses

200 Customer deleted.
FieldTypeDescription
idrequired
string
e.g. "550e8400-e29b-41d4-a716-446655440000"
deletedrequired
true
messagerequired
string
e.g. "Customer successfully deleted."
400 Bad Request — The request was invalid or cannot be served.
FieldTypeDescription
errorrequired
object
typerequired
enum
The type of error.
invalid_request_errorauthentication_errorauthorization_errorrate_limit_erroridempotency_errorprocessing_errorwebhook_error
coderequired
string
A short string identifying the specific error.
e.g. "validation_error"
messagerequired
string
A human-readable message providing details about the error.
e.g. "Request validation failed"
paramnullable
string
The parameter that caused the error, if applicable.
e.g. "email"
request_id
string
Unique request identifier for debugging.
e.g. "req_a1b2c3d4e5f67890abcdef0123456789"
field_errors
array[object]
Detailed field-level errors for validation failures.
401 Unauthorized — Authentication failed.
FieldTypeDescription
errorrequired
object
typerequired
enum
The type of error.
invalid_request_errorauthentication_errorauthorization_errorrate_limit_erroridempotency_errorprocessing_errorwebhook_error
coderequired
string
A short string identifying the specific error.
e.g. "validation_error"
messagerequired
string
A human-readable message providing details about the error.
e.g. "Request validation failed"
paramnullable
string
The parameter that caused the error, if applicable.
e.g. "email"
request_id
string
Unique request identifier for debugging.
e.g. "req_a1b2c3d4e5f67890abcdef0123456789"
field_errors
array[object]
Detailed field-level errors for validation failures.