ZeroPointPayments

Guides

Customers

Create, read, change and delete the customers of a merchant, the owners of saved cards; the fields, the Stripe id link, what a delete refuses and what it erases, and the customer events.

A customer (cus_...) is a person a merchant sells to: the owner of saved cards, and the buyer on subscriptions and checkouts. It belongs to one merchant, and through it to one platform and one mode. It is a ZeroPoint record only. It is never sent to the processor and holds no card data.

Scopes: customers:read for reads, customers:write for creates, changes and deletes.

The object

JSON
{
  "object": "customer",
  "id": "cus_01j...",
  "created": 1794790000,
  "updated": 1794790000,
  "livemode": false,
  "merchant_id": "mch_01j...",
  "email": "pat@example.com",
  "name": "Pat Lee",
  "phone": "+1 504 555 0100",
  "description": "Front desk regular",
  "metadata": {"member_id": "42"},
  "stripe_id": null,
  "test_clock": null
}
FieldRule
emailOptional, up to 254 characters with one @. Not unique: two customers may share one.
nameOptional, 1 to 250 characters.
phoneOptional, up to 32 characters of digits and + - ( ) and space.
descriptionOptional internal note, 1 to 500 characters.
metadataUp to 50 string pairs. Put your own customer id here.
stripe_idOptional, the Stripe customer id this customer came from. Set once.
test_clockTest mode only, optional on create: the test clock (clock_...) whose time this customer's subscriptions run on (Test your billing with test clocks). The customer shows it; null when none. Set at create, never changed.

No free-text field may hold a card number. There is no address, tax id, balance or default card in this version.

Create

POST /v1/customers
Idempotency-Key: signup-42
{"merchant_id":"mch_...","email":"pat@example.com","name":"Pat Lee","phone":"+1 504 555 0100","metadata":{"member_id":"42"}}

The answer is the customer, and customer.created is sent. Call GET /v1/customers with email=pat@example.com first and reuse a customer that exists. The email filter is exact and case-sensitive, as Stripe's: email=pat@example.com does not find a customer saved as Pat@Example.com. ZeroPoint keeps the email as you sent it (spaces at either end removed). So that one person never becomes two customers, put every email in one form in your app (trimmed and lower case is the usual choice) before you create a customer or search for one, and search with that same form.

Change

PATCH /v1/customers/{customer_id} changes only the fields you send. null clears email, name, phone or description. metadata merges key by key, as on Stripe: a key sent as "" is removed, "metadata": "" removes every key, and {} changes nothing. POST /v1/customers/{customer_id} does the same as PATCH. A change sends customer.updated; a PATCH that changes nothing sends no event.

stripe_id is set once: on create, or by PATCH while it is null. That lets you link a customer made before a migration instead of making a second one. It is unique per merchant. A create or PATCH that repeats one answers 409 stripe_id_in_use and names the customer that holds it, and says so when that customer was deleted: do not recreate it. A different stripe_id on a customer that has one answers 400 parameter_immutable; the same one again changes nothing. GET /v1/customers with stripe_id=cus_Stripe9 finds it.

Read and list

GET /v1/customers/{customer_id} reads one. GET /v1/customers lists newest first, with filters merchant_id, email (exact, case-sensitive), stripe_id and include_deleted (default false), plus limit and cursor.

A deleted customer reads as {"object": "customer", "id": "cus_...", "deleted": true}, so you can tell a deleted customer from a wrong id (404 resource_missing). A PATCH of a deleted customer answers 404 resource_missing and changes nothing, and no card can be saved for it.

Delete

DELETE /v1/customers/{customer_id} either completes or changes nothing. First it refuses while money still depends on the customer:

RefusalWhenWhat to do
409 checkout_session_busy, Retry-After: 30A checkout for this customer is being paid right nowRetry after the wait
409 customer_has_subscriptionsA subscription of this customer is not canceled; the message names itCancel the subscription, then delete
409 payment_method_in_useA saved card of this customer is still needed. This is the same check as DELETE /v1/payment_methods/{payment_method_id}. With Retry-After: 30 a payment using it has not finished. With Retry-After: 60 a payment using it has a processor answer still being recorded, or the check could not be run. Without Retry-After, the message says what holds the card.Retry after the wait; without one, remove that use first

Then, in one change: every saved card of the customer is deleted (the card's token is erased here and payment_method.detached is sent for each; the processor has no token delete, so nothing is sent to it), the customer is marked deleted, and customer.deleted is sent after them. If any step fails, nothing changes: no token is erased and the customer stays. The answer is {"object": "customer", "id": "cus_...", "deleted": true}. A second delete gives the same answer and sends nothing.

The deleted customer's record is kept, because past payments and subscriptions name it. Its name, email, phone and description stay on it.

A code with once_per_customer counts uses by email when one is known, so deleting a customer and making a new one with the same email does not give a second use (catalog has the details).

Events

customer.created, customer.updated and customer.deleted are billing events: subscribe to them by type (billing-webhooks). customer.updated carries previous_attributes with the old values of what changed.

MCP tools

create_customer (all the fields above, merchant_id required), get_customer, list_customers and update_customer (the same as PATCH; clear lists fields to set to null). Each calls the same service as its route. Calling create_customer again with the same arguments within 24 hours returns the first customer. There is no delete tool: a delete erases saved cards, so it stays a REST call your own code makes on purpose.

Routes

Method and pathScopePurpose
POST /v1/customerscustomers:writeCreate (Idempotency-Key)
GET /v1/customerscustomers:readList
GET /v1/customers/{customer_id}customers:readRead; a deleted one reads deleted: true
PATCH /v1/customers/{customer_id}customers:writeChange fields; link stripe_id
DELETE /v1/customers/{customer_id}customers:writeDelete, with the refusals above