ZeroPointPayments

API reference

Checkout

Common headers

Every endpoint on this page takes these headers.

NameDescription
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.

StatusDescriptionBody
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 checkout sessions

GET/v1/checkout/sessions

Lists sessions newest first.

Arguments: merchant_id, status (open, complete, expired), customer (cus_...), payment_intent (pay_...; payment is the same filter), subscription (sub_...), client_reference_id (exact match), created (Unix seconds: created=, created[gt]=, created[gte]=, created[lt]=, created[lte]=), limit, starting_after (or cursor), expand[] (data.line_items, already inline; data.customer, data.subscription, data.invoice, data.payment_intent). Any other parameter is refused by name (customer_details and payment_link are not supported).

Returns a list of sessions with the list's url.

Errors: parameter_invalid, parameter_unavailable, parameter_unknown.

Next step: GET /v1/checkout/sessions/{id}.

Parameters

NameDescription
merchant_idquery, string or null
statusquery, string or null

One of: "open", "complete", "expired"

client_reference_idquery, string or null
paymentquery, string or null
payment_intentquery, string or null

Stripe's name for the payment filter.

customerquery, string or null
subscriptionquery, string or null
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.

expand[]query, array of string or null

Optional. Expandable here: data.customer, data.invoice, data.line_items, data.payment_intent, data.subscription. Any other value answers 400 parameter_unavailable.

Responses

StatusDescriptionBody
200

Successful Response

ListOut_CheckoutSessionOut_

Example

Shell
curl -X GET "https://api.zeropointapp.com/v1/checkout/sessions" \
  -H "Authorization: Bearer zp_test_..."

Create a checkout session

POST/v1/checkout/sessions

Creates a hosted payment page for a fixed amount. Send the buyer to url; fulfil on the checkout.session.completed webhook, never on the success redirect. JSON or Stripe's form encoding.

Arguments: merchant_id (optional: without it the ZeroPoint-Account header, else the platform's only merchant in this mode), success_url, line_items (price or price_data), cancel_url, expires_at, client_reference_id, customer_email, customer, customer_creation, allow_promotion_codes, discounts, metadata, payment_intent_data.metadata (copied onto the payment), subscription_data.metadata (subscription mode only), expand (line_items, customer, subscription, invoice, payment_intent, as on retrieve; not in the query string); currency usd, payment_method_types [card], ui_mode hosted_page, billing_address_collection auto (required is parameter_unknown: the page collects no billing address), locale auto, submit_type auto, payment_method_collection always (not with allow_promotion_codes in payment mode, where a 100 percent off code completes with no card), payment_intent_data.capture_method automatic, and line_items[].adjustable_quantity, automatic_tax, phone_number_collection, tax_id_collection, invoice_creation, adaptive_pricing with enabled false are accepted as no-ops.

Returns the session with status open and url; line_items is a list object whose items carry price as a price object. The Idempotency-Key is optional (a session never reaches the processor): with one, a retry replays the first answer.

Errors: parameter_invalid, parameter_unknown (a field this API never supports, such as shipping_address_collection or custom_fields), parameter_unavailable (not in this version yet), price_not_recurring (a one-time price in subscription mode), url_invalid, checkout_unavailable (live mode not enabled for this platform), resource_missing, customer_identity_required (400, subscription mode: the merchant's subscription_guard is on, so send customer, client_reference_id or customer_email), checkout_outcome_unknown (409: a session for this client_reference_id, customer or customer_email and plan is waiting for its payment to be confirmed; the error names it in held_session_id), subscription_create_unresolved (409, subscription mode: a first payment for this buyer and plan is still being confirmed; names subscription and invoice), subscription_exists (409, subscription mode: the merchant's subscription_guard found a live subscription of this buyer to the same price, product or, under customer, anything; names subscription), resource_limit_exceeded and sandbox_daily_limit_exceeded (409, test mode). A refusal is kept under its Idempotency-Key for 24 hours (except checkout_unavailable and merchant refusals, checked before the key is claimed): after fixing the cause, send the request under a new key.

Next step: redirect the buyer to url.

Parameters

NameDescription
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

FieldDescription
merchant_idstring or null

The merchant taking the payment (mch_...). Optional: without it, the ZeroPoint-Account header (Stripe-Account is accepted too), else the platform's only merchant in this mode.

success_urlstringRequired

Where the buyer goes after paying: https, at most 2,000 characters. The literal {CHECKOUT_SESSION_ID} is replaced with the session id.

line_itemsarray of CheckoutLineItemInRequired

1 to 100 lines.

Fields inside line_items
FieldDescription
line_items.pricestring or null

A catalog price of this merchant (price_...): one-time in payment mode, recurring (month or year, interval_count 1) in subscription mode. Its amount and product name are copied onto the session at create.

line_items.price_dataCheckoutPriceDataIn or null

The price of this line, set inline.

Fields inside price_data
FieldDescription
line_items.price_data.currencystringRequired

usd only.

line_items.price_data.unit_amountintegerRequired

Integer cents, 0 to 99,999,999. The session total must be at least 1.

line_items.price_data.product_dataCheckoutProductDataInRequired
line_items.price_data.recurringobject or null

Not available in this version (parameter_unavailable).

line_items.quantityinteger or null

1 to 999 with price_data; exactly 1 with price.

line_items.adjustable_quantityCheckoutToggleIn or null

Only {enabled false} (Stripe's default): the buyer cannot change the quantity on the page. enabled true is refused (parameter_unknown).

Fields inside adjustable_quantity
FieldDescription
line_items.adjustable_quantity.enabledbooleanRequired

Only false is accepted: hosted checkout does not offer this.

modestring

payment (a one-time charge) or subscription (exactly one line with a recurring catalog price and quantity 1; the buyer's card is saved and charged, and the subscription renews on it).

Default: "payment"

cancel_urlstring or null

Optional back link shown on the page: https.

expires_atinteger or null

Unix seconds, 30 minutes to 24 hours from now. Default 24 hours.

client_reference_idstring or null

Your order or user id, 1 to 200 characters; in subscription mode a stable id for the customer (a per-order or per-cart id leaves the subscription guard nothing to match), compared exactly (case and spaces count). While another session of this merchant with the same value is waiting for its payment to be confirmed, create answers 409 checkout_outcome_unknown naming it in held_session_id.

customer_emailstring or null

Prefills the page's email field. At most 254 characters.

customerstring or null

A customer of this merchant (cus_...), not deleted. Send customer or customer_email, not both.

customer_creationstring or null

Payment mode only: if_required (default) or always. always creates a customer from the buyer's email when the session completes, unless customer is set. Subscription mode always creates one at the buyer's first confirm (unless customer is set) and refuses this field, as Stripe does.

allow_promotion_codesboolean or null

true shows a promotion code field on the page. Needs exactly one line, with a catalog price.

discountsarray of object of string or null

At most one [{"promotion_code": "promo_..."}], applied at create. Needs exactly one line, with a catalog price.

automatic_taxCheckoutAutomaticTaxIn or null
Fields inside automatic_tax
FieldDescription
automatic_tax.enabledbooleanRequired

Only false is accepted; no tax is computed.

metadataobject of string or null

Up to 50 string pairs, echoed back.

payment_intent_dataCheckoutPaymentIntentDataIn or null

Payment mode: only metadata, copied onto the payment.

Fields inside payment_intent_data
FieldDescription
payment_intent_data.metadataobject of string or null

Copied onto the payment the session creates, over the session's own metadata (a key in both takes this value). The same rules as metadata; together at most 50 keys.

payment_intent_data.capture_methodstring or null

automatic only (Stripe's default): the payment is captured when the buyer pays. manual and automatic_async are refused (parameter_unknown).

subscription_dataCheckoutSubscriptionDataIn or null

Subscription mode only: {metadata: {...}}, copied onto the subscription. Every other key (trials included) answers parameter_unavailable.

Fields inside subscription_data
FieldDescription
subscription_data.metadataobject of string or null

Subscription mode only: copied onto the subscription the session creates.

currencystring or null

usd only (the line items' currency).

payment_method_typesarray of string or null

["card"] only: the page takes cards and the wallets it offers.

ui_modestring or null

hosted_page (or hosted) only: the ZeroPoint hosted page.

billing_address_collectionstring or null

auto only (Stripe's default): the card form asks for the ZIP code, as it always does. required is refused (parameter_unknown): the page does not collect a billing address.

localestring or null

auto only (Stripe's default): the page shows its own language. Any other locale is refused (parameter_unknown).

submit_typestring or null

auto only (Stripe's default): the page sets its own button wording. pay, book, donate and subscribe are refused (parameter_unknown).

payment_method_collectionstring or null

always only (Stripe's default): the page asks for a card. In payment mode it cannot be sent with allow_promotion_codes true, because a 100 percent off code completes a $0 order with no card (parameter_invalid). if_required is refused (parameter_unknown).

phone_number_collectionCheckoutToggleIn or null
Fields inside phone_number_collection
FieldDescription
phone_number_collection.enabledbooleanRequired

Only false is accepted: hosted checkout does not offer this.

tax_id_collectionCheckoutToggleIn or null
Fields inside tax_id_collection
FieldDescription
tax_id_collection.enabledbooleanRequired

Only false is accepted: hosted checkout does not offer this.

invoice_creationCheckoutToggleIn or null
Fields inside invoice_creation
FieldDescription
invoice_creation.enabledbooleanRequired

Only false is accepted: hosted checkout does not offer this.

adaptive_pricingCheckoutToggleIn or null
Fields inside adaptive_pricing
FieldDescription
adaptive_pricing.enabledbooleanRequired

Only false is accepted: hosted checkout does not offer this.

expandarray of string or null

Optional: line_items (always inline, so a no-op), customer, subscription, invoice and payment_intent, as on retrieve. Any other value answers 400 parameter_unavailable.

Responses

StatusDescriptionBody
200

Successful Response

CheckoutSessionOut
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

Shell
curl -X POST "https://api.zeropointapp.com/v1/checkout/sessions" \
  -H "Authorization: Bearer zp_test_..." \
  -H "Idempotency-Key: <Idempotency-Key>" \
  -H "Content-Type: application/json" \
  -d '{
    "success_url": <success_url>,
    "line_items": <line_items>
  }'

Retrieve a checkout session

GET/v1/checkout/sessions/{session_id}

Returns one session. Show a purchase as paid only when status is complete, payment_status is paid, merchant_id is yours and amount_total is what you expected.

Arguments: session_id (cs_...), expand[] (line_items, already inline; customer, subscription, invoice, payment_intent: each the object its own GET answers).

Returns the session; url is null once it is closed.

Errors: resource_missing, parameter_unavailable (any other expansion).

Next step: GET /v1/payments/{payment}.

Parameters

NameDescription
session_idpath, stringRequired
expand[]query, array of string or null

Optional. Expandable here: customer, invoice, line_items, payment_intent, subscription. Any other value answers 400 parameter_unavailable.

Responses

StatusDescriptionBody
200

Successful Response

CheckoutSessionOut

Example

Shell
curl -X GET "https://api.zeropointapp.com/v1/checkout/sessions/{session_id}" \
  -H "Authorization: Bearer zp_test_..."

Retrieve a checkout session's line items

GET/v1/checkout/sessions/{session_id}/line_items

Lists the session's line items in order, as Stripe's list object; each item carries price as a price object (null id and product for a price_data line).

Arguments: session_id (cs_...), limit, starting_after (or cursor: the id of the last line of the previous page).

Returns a list of line items with the list's url.

Errors: resource_missing, parameter_unavailable (expand[]: nothing expands here).

Next step: GET /v1/checkout/sessions/{session_id}.

Parameters

NameDescription
session_idpath, stringRequired
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.

expand[]query, array of string or null

Optional. Expandable here: nothing. Any other value answers 400 parameter_unavailable.

Responses

StatusDescriptionBody
200

Successful Response

CheckoutLineItemListOut

Example

Shell
curl -X GET "https://api.zeropointapp.com/v1/checkout/sessions/{session_id}/line_items" \
  -H "Authorization: Bearer zp_test_..."

Expire a checkout session

POST/v1/checkout/sessions/{session_id}/expire

Closes an open session so it can no longer be paid; Stripe's expire, with no body.

Arguments: session_id (cs_...). The Idempotency-Key is optional.

Returns the session with status expired.

Errors: resource_missing, checkout_session_not_open (409), checkout_session_busy (409 with Retry-After: a payment attempt is in flight), checkout_outcome_unknown (409: the payment's outcome is being confirmed).

Next step: create a new session if the buyer still wants to pay.

Parameters

NameDescription
session_idpath, stringRequired
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.

Responses

StatusDescriptionBody
200

Successful Response

CheckoutSessionOut
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

Shell
curl -X POST "https://api.zeropointapp.com/v1/checkout/sessions/{session_id}/expire" \
  -H "Authorization: Bearer zp_test_..." \
  -H "Idempotency-Key: <Idempotency-Key>"