API reference
Customers
Common headers
Every endpoint on this page takes these headers.
| Name | Description |
|---|---|
ZeroPoint-Accountheader, string or null | Optional. The merchant (mch_...) this request acts on, when the body has no merchant_id: the analogue of Stripe's Stripe-Account header. |
Stripe-Accountheader, string or null | Optional. A synonym of ZeroPoint-Account; holds a merchant id (mch_...). |
Common responses
Every endpoint on this page can answer with these.
| Status | Description | Body |
|---|---|---|
| 400 | Invalid request. A parameter, header or body field failed validation (code parameter_invalid, with param naming it), or another invalid_request code this operation's description lists. Fix the request; do not retry it unchanged. | ErrorResponse |
| 401 | The API key is missing, malformed, unknown or revoked (api_key_missing, api_key_malformed, api_key_invalid). Fix the Authorization header. | ErrorResponse |
| 403 | The key is valid but may not do this: platform_suspended, insufficient_scope, live_mode_unavailable, or a permission code this operation's description lists (for example processor_currency_unsupported). | ErrorResponse |
| 404 | No such resource for this platform (resource_missing), or another not_found code this operation's description lists. | ErrorResponse |
| 429 | Too many requests (rate_limited). Wait for the Retry-After header, then retry. | ErrorResponse |
List customers
GET/
Lists customers newest first.
Arguments: merchant_id (or the ZeroPoint-Account or Stripe-Account header), email (case-sensitive exact match, as Stripe's), stripe_id, include_deleted (default false; a deleted customer reads {object, id, deleted: true}), limit, cursor. A query parameter this list does not take is refused by name (400 parameter_unknown), never ignored.
Returns a list of customer objects.
Errors: parameter_invalid, parameter_unknown.
Next step: GET /v1/customers/{id}.
Parameters
| Name | Description |
|---|---|
merchant_idquery, string or null | |
emailquery, string or null | |
stripe_idquery, string or null | |
include_deletedquery, boolean | |
limitquery, integer | Items per page, default 20. |
cursorquery, string or null | next_cursor from the previous page. |
starting_afterquery, string or null | Stripe's name for cursor: the id of the last object of the previous page. Same value, same meaning. Send cursor or starting_after, not both. |
ending_beforequery, string or null | Not supported: answers 400 parameter_unavailable. Lists page newest first; page forward with starting_after. |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | Successful Response | ListOut_Union_CustomerOut__DeletedOut__ |
Example
curl -X GET "https://api.zeropointapp.com/v1/customers" \
-H "Authorization: Bearer zp_test_..."Create a customer
POST/
Creates a customer of one merchant, the owner a saved card belongs to. A customer is a ZeroPoint record only: it is never sent to the processor and holds no card data.
Arguments: merchant_id (optional: without it the ZeroPoint-Account header, else the platform's only merchant in this mode), email, name, phone, description, metadata, stripe_id, test_clock (test mode only: a clock_... whose time the customer's subscriptions then use).
Returns the customer object and emits customer.created. The Idempotency-Key is optional here (nothing reaches the processor): with one, a retry replays the first answer; without one, each request creates a customer.
Errors: parameter_invalid, resource_missing, stripe_id_in_use (409), resource_limit_exceeded (409, test mode), test_mode_only (400: test_clock with a live merchant).
Next step: save a card for it.
Parameters
| Name | Description |
|---|---|
Idempotency-Keyheader, string or null | Optional on this endpoint. Any unique string up to 255 characters (a UUID is fine): a retry with the same key and body replays the first answer. Without it the request runs once, with no replay protection. |
Request body
| Field | Description |
|---|---|
merchant_idstring or null | Optional. The merchant (mch_...). Without it: the ZeroPoint-Account header, else the platform's only merchant in this mode. |
emailstring or null | Optional. At most 254 characters with one @. Not unique. |
namestring or null | Optional, 1 to 250 characters. |
phonestring or null | Optional, up to 32 of digits and + - ( ) space. |
descriptionstring or null | Optional internal note, 1 to 500 characters. |
metadataobject of string | Up to 50 string pairs. Put your own customer id here. A key sent with "" is not stored. |
stripe_idstring or null | The Stripe customer id this customer was migrated from. Set once: on create, or by PATCH while it is null. Unique per merchant. |
test_clockstring or null | Test mode only (Stripe's parameter). A test clock (clock_...) to attach the customer to: its subscriptions then live on the clock's time. |
Responses
| Status | Description | Body |
|---|---|---|
| 201 | Successful Response | CustomerOut |
| 409 | Conflict with the current state: idempotency_in_progress (another request with this Idempotency-Key is still running; wait for Retry-After), or a conflict code this operation's description lists. | ErrorResponse |
| 413 | The request body is over 1048576 bytes, its Content-Length is not a number, or it is sent chunked (code payload_too_large). Every write method is checked, before routing. Send a smaller body with a Content-Length. | ErrorResponse |
| 422 | This Idempotency-Key was already used with a different request body (code idempotency_key_reused). Send the original body to retry, or a new key for a new request. | ErrorResponse |
Example
curl -X POST "https://api.zeropointapp.com/v1/customers" \
-H "Authorization: Bearer zp_test_..." \
-H "Idempotency-Key: <Idempotency-Key>" \
-H "Content-Type: application/json" \
-d '{}'Retrieve a customer
GET/
Returns one customer.
Arguments: customer_id (cus_...).
Returns the customer object, or {object: customer, id, deleted: true} for a deleted customer.
Errors: resource_missing.
Next step: PATCH to change it.
Parameters
| Name | Description |
|---|---|
customer_idpath, stringRequired |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | Successful Response | CustomerOut or DeletedOut |
Example
curl -X GET "https://api.zeropointapp.com/v1/customers/{customer_id}" \
-H "Authorization: Bearer zp_test_..."Update a customer (POST, Stripe's verb)
POST/
Changes email, name, phone, description, metadata or stripe_id. An omitted field stays as it is; null clears email, name, phone or description; metadata merges key by key (a key sent as "" is removed, metadata "" removes every key); stripe_id is set only while null. POST and PATCH are the same operation (POST is Stripe's verb); neither takes an Idempotency-Key. Emits customer.updated when something changed.
Returns the updated customer.
Errors: resource_missing (also for a deleted customer), parameter_invalid, parameter_immutable, stripe_id_in_use.
Next step: GET /v1/customers/{id}.
Parameters
| Name | Description |
|---|---|
customer_idpath, stringRequired |
Request body
| Field | Description |
|---|---|
emailstring or null | null clears it. |
namestring or null | null clears it. |
phonestring or null | null clears it. |
descriptionstring or null | null clears it. |
metadataobject of string or string or null | Merged into the stored metadata key by key. A key sent with "" is removed; metadata "" removes every key; {} or no metadata changes nothing; null is refused. |
stripe_idstring or null | Settable only while null; never cleared. |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | Successful Response | CustomerOut |
| 409 | Conflict with the current state. The code this operation's description lists says which, and whether to wait or change the request. | ErrorResponse |
| 413 | The request body is over 1048576 bytes, its Content-Length is not a number, or it is sent chunked (code payload_too_large). Every write method is checked, before routing. Send a smaller body with a Content-Length. | ErrorResponse |
Example
curl -X POST "https://api.zeropointapp.com/v1/customers/{customer_id}" \
-H "Authorization: Bearer zp_test_..." \
-H "Content-Type: application/json" \
-d '{}'Update a customer
PATCH/
Changes email, name, phone, description, metadata or stripe_id. An omitted field stays as it is; null clears email, name, phone or description; metadata merges key by key (a key sent as "" is removed, metadata "" removes every key); stripe_id is set only while null. POST and PATCH are the same operation (POST is Stripe's verb); neither takes an Idempotency-Key. Emits customer.updated when something changed.
Returns the updated customer.
Errors: resource_missing (also for a deleted customer), parameter_invalid, parameter_immutable, stripe_id_in_use.
Next step: GET /v1/customers/{id}.
Parameters
| Name | Description |
|---|---|
customer_idpath, stringRequired |
Request body
| Field | Description |
|---|---|
emailstring or null | null clears it. |
namestring or null | null clears it. |
phonestring or null | null clears it. |
descriptionstring or null | null clears it. |
metadataobject of string or string or null | Merged into the stored metadata key by key. A key sent with "" is removed; metadata "" removes every key; {} or no metadata changes nothing; null is refused. |
stripe_idstring or null | Settable only while null; never cleared. |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | Successful Response | CustomerOut |
| 409 | Conflict with the current state. The code this operation's description lists says which, and whether to wait or change the request. | ErrorResponse |
| 413 | The request body is over 1048576 bytes, its Content-Length is not a number, or it is sent chunked (code payload_too_large). Every write method is checked, before routing. Send a smaller body with a Content-Length. | ErrorResponse |
Example
curl -X PATCH "https://api.zeropointapp.com/v1/customers/{customer_id}" \
-H "Authorization: Bearer zp_test_..." \
-H "Content-Type: application/json" \
-d '{}'Delete a customer
DELETE/
Deletes a customer and every saved card it holds (each card's token is erased here, the processor has no token delete, and payment_method.detached is sent), then sends customer.deleted, all in one commit. Refused, changing nothing, while the customer has an open checkout session, a subscription that is not canceled, or a saved card that is still needed (the same check as DELETE /v1/payment_methods/{id}). The customer stays as a tombstone: GET answers {object, id, deleted: true}.
Arguments: customer_id.
Returns {object, id, deleted: true}; a second delete answers the same.
Errors: resource_missing, checkout_session_busy (409, Retry-After), customer_has_subscriptions (409, cancel the subscription first), payment_method_in_use (409; Retry-After 30 while a payment using the card is pending, 60 while a processor answer is being recorded or the check could not run, none when another use holds the card).
Next step: none.
Parameters
| Name | Description |
|---|---|
customer_idpath, stringRequired |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | Successful Response | DeletedOut |
| 409 | Conflict with the current state. The code this operation's description lists says which, and whether to wait or change the request. | ErrorResponse |
| 413 | The request body is over 1048576 bytes, its Content-Length is not a number, or it is sent chunked (code payload_too_large). Every write method is checked, before routing. Send a smaller body with a Content-Length. | ErrorResponse |
Example
curl -X DELETE "https://api.zeropointapp.com/v1/customers/{customer_id}" \
-H "Authorization: Bearer zp_test_..."