Customers

A customer is the buyer-side identity. Customers can have many orders, many addresses, and many stored payment methods.

Object

FieldTypeNotes
idstringcust_…
emailstringUnique within tenant, case-folded
namestring?Display name
phonestring?E.164
addresses[]arrayDefault address has is_default: true
default_currencystringISO 4217
metadataobject
created_attimestamp

Endpoints

MethodPathPurpose
GET/v1/customersList
POST/v1/customersCreate
GET/v1/customers/{id}Retrieve
PATCH/v1/customers/{id}Update
DELETE/v1/customers/{id}Anonymise (GDPR-compliant)
POST/v1/customers/{id}/mergeMerge target into source

Merging customers

A common shape: a returning customer signs up with a different email and the storefront creates a new identity. Merge consolidates everything onto the older record.

curl -sS https://api.zephyrcart.io/v1/customers/cust_OLDER/merge \
  -H "Authorization: Bearer $ZEPHYR_API_KEY" \
  -d '{ "target": "cust_NEWER" }'

What moves:

  • All carts, orders, and refunds.
  • All stored payment methods (deduplicated by fingerprint).
  • All addresses (deduplicated by normalised form).
  • All metadata (target wins on conflict).

The target customer is then deleted. The operation is not reversible — keep a backup if you need one.

Anonymisation

DELETE /v1/customers/{id} does not hard-delete. It clears PII (email, name, phone, addresses), marks the record status=anonymised, and preserves the order history for accounting. Hard deletion requires a separate, audited support ticket.