ZeroPointPayments

API reference

Catalog

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 products

GET/v1/products

Lists products newest first; deleted ones are left out.

Arguments: active, ids (ids[]=prod_..., up to 100; not with cursor or starting_after), merchant_id, stripe_id, limit, cursor.

Returns a list of product objects.

Errors: parameter_invalid, parameter_unknown.

Next step: GET /v1/prices?product={id}. merchant_id filters to one merchant; without it, a ZeroPoint-Account (or Stripe-Account) header filters the same way. A query parameter this list does not take is refused by name (400 parameter_unknown), never ignored; Stripe's array forms name[]=a and name[0]=a are read.

Parameters

NameDescription
activequery, boolean or null
idsquery, array of string or null
merchant_idquery, string or null
stripe_idquery, 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.

Responses

StatusDescriptionBody
200

Successful Response

ListOut_ProductOut_

Example

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

Create a product

POST/v1/products

Creates a product a merchant sells (a plan, a pass). Prices hang off it.

Arguments: merchant_id (optional, see below), name, description, active, metadata, stripe_id. merchant_id is optional: without it, the ZeroPoint-Account header (or Stripe-Account), else the platform's only merchant in this mode. Idempotency-Key is optional: with one, a retry with the same key and body replays the first answer; without one the request runs once.

Returns the product object.

Errors: parameter_invalid, resource_missing (the merchant), stripe_id_in_use, resource_limit_exceeded (sandbox ceiling).

Next step: POST /v1/prices with this product's id.

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

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

namestringRequired

Shown to customers. 1 to 250 characters.

descriptionstring or null

Up to 2,000.

activeboolean

False archives it.

Default: true

metadataobject of string

Up to 50 string pairs.

stripe_idstring or null

The Stripe id this object was migrated from. Set once, on create or by PATCH while null. Unique per merchant.

Responses

StatusDescriptionBody
201

Successful Response

ProductOut
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/products" \
  -H "Authorization: Bearer zp_test_..." \
  -H "Idempotency-Key: <Idempotency-Key>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": <name>
  }'

Retrieve a product

GET/v1/products/{product_id}

Returns one product.

Arguments: product_id (prod_...).

Returns the product object.

Errors: resource_missing (also for a deleted product).

Next step: list its prices.

Parameters

NameDescription
product_idpath, stringRequired

Responses

StatusDescriptionBody
200

Successful Response

ProductOut

Example

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

Update a product (Stripe's POST)

POST/v1/products/{product_id}

Stripe's update verb: the same operation as PATCH on this path, with the same fields, validation and scope; no Idempotency-Key. Changes name, description, active, default_price, metadata, or stripe_id while it is null.

Arguments: any subset of those fields; metadata merges key by key (a key sent as "" is removed, metadata "" removes every key).

Returns the updated product.

Errors: resource_missing, parameter_invalid (default_price that is not an active price of this product), parameter_immutable (a different stripe_id), stripe_id_in_use.

Next step: GET /v1/products/{id}.

Parameters

NameDescription
product_idpath, stringRequired

Request body

FieldDescription
namestring or null
descriptionstring or null

Null clears it.

activeboolean or null

False archives it.

default_pricestring or null

An active price of this product; 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

The Stripe id this object was migrated from. Set once, on create or by PATCH while null. Unique per merchant.

Responses

StatusDescriptionBody
200

Successful Response

ProductOut
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

Shell
curl -X POST "https://api.zeropointapp.com/v1/products/{product_id}" \
  -H "Authorization: Bearer zp_test_..." \
  -H "Content-Type: application/json" \
  -d '{}'

Update a product

PATCH/v1/products/{product_id}

Changes name, description, active, default_price, metadata, or stripe_id while it is null.

Arguments: any subset of those fields; metadata merges key by key (a key sent as "" is removed, metadata "" removes every key).

Returns the updated product.

Errors: resource_missing, parameter_invalid (default_price that is not an active price of this product), parameter_immutable (a different stripe_id), stripe_id_in_use.

Next step: GET /v1/products/{id}. POST to the same path (Stripe's update verb) does exactly the same.

Parameters

NameDescription
product_idpath, stringRequired

Request body

FieldDescription
namestring or null
descriptionstring or null

Null clears it.

activeboolean or null

False archives it.

default_pricestring or null

An active price of this product; 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

The Stripe id this object was migrated from. Set once, on create or by PATCH while null. Unique per merchant.

Responses

StatusDescriptionBody
200

Successful Response

ProductOut
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

Shell
curl -X PATCH "https://api.zeropointapp.com/v1/products/{product_id}" \
  -H "Authorization: Bearer zp_test_..." \
  -H "Content-Type: application/json" \
  -d '{}'

Delete a product

DELETE/v1/products/{product_id}

Deletes a product that has no prices. A product with prices cannot be deleted, because prices are never deleted; archive it with active: false instead.

Arguments: product_id.

Returns {object, id, deleted: true}.

Errors: resource_missing, product_has_prices.

Next step: none; a deleted product reads 404.

Parameters

NameDescription
product_idpath, stringRequired

Responses

StatusDescriptionBody
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

Shell
curl -X DELETE "https://api.zeropointapp.com/v1/products/{product_id}" \
  -H "Authorization: Bearer zp_test_..."

List prices

GET/v1/prices

Lists prices newest first, archived included unless active is set.

Arguments: active, merchant_id, product, type, recurring.interval (or recurring[interval]), currency (usd; another currency lists nothing, as no price has it), lookup_keys (exact, any of up to 10: lookup_keys[]=a, lookup_keys[0]=a or lookup_keys=a), stripe_id, limit, cursor, expand[] (data.product).

Returns a list of price objects.

Errors: parameter_invalid (param merchant_id: lookup_keys matched prices of more than one merchant and none was named), parameter_unknown.

Next step: GET /v1/prices/{id}. merchant_id filters to one merchant; without it, a ZeroPoint-Account (or Stripe-Account) header filters the same way. A query parameter this list does not take is refused by name (400 parameter_unknown), never ignored; Stripe's array forms name[]=a and name[0]=a are read.

Parameters

NameDescription
activequery, boolean or null
merchant_idquery, string or null
productquery, string or null
typequery, string or null

One of: "one_time", "recurring"

recurring.intervalquery, string or null

One of: "month", "year"

lookup_keysquery, array of string or null
currencyquery, string or null
stripe_idquery, 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.

Responses

StatusDescriptionBody
200

Successful Response

ListOut_PriceOut_

Example

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

Create a price

POST/v1/prices

Creates a price for a product: one_time, or recurring monthly or yearly. unit_amount is integer cents. A price's amount, currency, interval and product never change; to change a price, create a new one (transfer_lookup_key moves your lookup_key to it) and archive the old one. merchant_id is optional: without it, the ZeroPoint-Account header (or Stripe-Account), else the platform's only merchant in this mode. Idempotency-Key is optional: with one, a retry with the same key and body replays the first answer; without one the request runs once.

Arguments: merchant_id, product, unit_amount, currency, type, recurring {interval, interval_count}, active, lookup_key, transfer_lookup_key, nickname, metadata, stripe_id.

Returns the price object.

Errors: parameter_invalid (also an archived product), resource_missing (the merchant or product), lookup_key_in_use, stripe_id_in_use, resource_limit_exceeded (sandbox ceiling).

Next step: set it as the product's default_price, or use it in a checkout.

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

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

productstringRequired

Product of the same merchant.

unit_amountintegerRequired

Integer cents, e.g. 2900 = $29.00. Never changes after create.

currencystring

Lowercase ISO 4217; usd only.

Value: "usd"

typestring or null

Derived from recurring; when sent it must agree.

One of: "one_time", "recurring"

recurringPriceRecurring or null

Send it for a recurring price; leave it out for one_time.

Fields inside recurring
FieldDescription
recurring.intervalstringRequired

Billing period: month or year.

One of: "month", "year"

recurring.interval_countinteger

1 only.

Default: 1

recurring.trial_period_daysany

Not supported on prices; set trials on the subscription.

activeboolean

Default: true

lookup_keystring or null

Your stable name for the price, unique per merchant.

transfer_lookup_keyboolean

True moves lookup_key from the price that holds it to this one.

Default: false

nicknamestring or null

Internal label.

metadataobject of string
stripe_idstring or null

The Stripe id this object was migrated from. Set once, on create or by PATCH while null. Unique per merchant.

Responses

StatusDescriptionBody
201

Successful Response

PriceOut
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/prices" \
  -H "Authorization: Bearer zp_test_..." \
  -H "Idempotency-Key: <Idempotency-Key>" \
  -H "Content-Type: application/json" \
  -d '{
    "product": <product>,
    "unit_amount": <unit_amount>
  }'

Retrieve a price

GET/v1/prices/{price_id}

Returns one price, archived or not.

Arguments: price_id (price_...), expand[] (product; any other path is parameter_unavailable).

Returns the price object.

Errors: resource_missing.

Next step: use it in a checkout.

Parameters

NameDescription
price_idpath, stringRequired

Responses

StatusDescriptionBody
200

Successful Response

PriceOut

Example

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

Update a price (Stripe's POST)

POST/v1/prices/{price_id}

Stripe's update verb: the same operation as PATCH on this path, with the same fields, validation and scope; no Idempotency-Key. Changes active, lookup_key (with transfer_lookup_key), nickname, metadata, or stripe_id while it is null; metadata merges key by key (a key sent as "" is removed, metadata "" removes every key). Prices cannot change amount, currency, interval or product: sending one answers parameter_immutable; create a new price and archive this one. Archiving a product's default price clears it.

Returns the updated price.

Errors: resource_missing, parameter_immutable, lookup_key_in_use, stripe_id_in_use.

Next step: GET /v1/prices/{id}.

Parameters

NameDescription
price_idpath, stringRequired

Request body

FieldDescription
activeboolean or null

False archives it.

lookup_keystring or null

Null removes it.

transfer_lookup_keyboolean or null
nicknamestring or null
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

The Stripe id this object was migrated from. Set once, on create or by PATCH while null. Unique per merchant.

unit_amountany

Cannot change after create; sending it answers parameter_immutable.

currencyany

Cannot change after create; sending it answers parameter_immutable.

typeany

Cannot change after create; sending it answers parameter_immutable.

recurringany

Cannot change after create; sending it answers parameter_immutable.

productany

Cannot change after create; sending it answers parameter_immutable.

Responses

StatusDescriptionBody
200

Successful Response

PriceOut
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

Shell
curl -X POST "https://api.zeropointapp.com/v1/prices/{price_id}" \
  -H "Authorization: Bearer zp_test_..." \
  -H "Content-Type: application/json" \
  -d '{}'

Update a price

PATCH/v1/prices/{price_id}

Changes active, lookup_key (with transfer_lookup_key), nickname, metadata, or stripe_id while it is null; metadata merges key by key (a key sent as "" is removed, metadata "" removes every key). Prices cannot change amount, currency, interval or product: sending one answers parameter_immutable; create a new price and archive this one. Archiving a product's default price clears it.

Returns the updated price.

Errors: resource_missing, parameter_immutable, lookup_key_in_use, stripe_id_in_use.

Next step: GET /v1/prices/{id}. POST to the same path (Stripe's update verb) does exactly the same.

Parameters

NameDescription
price_idpath, stringRequired

Request body

FieldDescription
activeboolean or null

False archives it.

lookup_keystring or null

Null removes it.

transfer_lookup_keyboolean or null
nicknamestring or null
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

The Stripe id this object was migrated from. Set once, on create or by PATCH while null. Unique per merchant.

unit_amountany

Cannot change after create; sending it answers parameter_immutable.

currencyany

Cannot change after create; sending it answers parameter_immutable.

typeany

Cannot change after create; sending it answers parameter_immutable.

recurringany

Cannot change after create; sending it answers parameter_immutable.

productany

Cannot change after create; sending it answers parameter_immutable.

Responses

StatusDescriptionBody
200

Successful Response

PriceOut
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

Shell
curl -X PATCH "https://api.zeropointapp.com/v1/prices/{price_id}" \
  -H "Authorization: Bearer zp_test_..." \
  -H "Content-Type: application/json" \
  -d '{}'

List coupons

GET/v1/coupons

Lists coupons newest first; deleted ones are left out.

Arguments: merchant_id, stripe_id, limit, cursor.

Returns a list of coupon objects.

Errors: parameter_invalid, parameter_unknown.

Next step: GET /v1/promotion_codes?coupon={id}. merchant_id filters to one merchant; without it, a ZeroPoint-Account (or Stripe-Account) header filters the same way. A query parameter this list does not take is refused by name (400 parameter_unknown), never ignored; Stripe's array forms name[]=a and name[0]=a are read.

Parameters

NameDescription
merchant_idquery, string or null
stripe_idquery, 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.

Responses

StatusDescriptionBody
200

Successful Response

ListOut_CouponOut_

Example

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

Create a coupon

POST/v1/coupons

Creates a discount: percent_off or amount_off (integer cents, currency usd), for once, repeating (duration_in_months) or forever. Customers use it through a promotion code. merchant_id is optional: without it, the ZeroPoint-Account header (or Stripe-Account), else the platform's only merchant in this mode. Idempotency-Key is optional: with one, a retry with the same key and body replays the first answer; without one the request runs once.

Arguments: merchant_id, name, percent_off or amount_off, currency, duration, duration_in_months, max_redemptions, redeem_by, applies_to.products, metadata, stripe_id.

Returns the coupon object.

Errors: parameter_invalid, resource_missing (the merchant or a product), stripe_id_in_use, resource_limit_exceeded (sandbox ceiling).

Next step: POST /v1/promotion_codes.

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

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

namestring or null

Shown to the customer. Up to 40.

percent_offnumber

Percent off, more than 0 and at most 100, at most two decimal places.

amount_offinteger or null

Integer cents off.

currencystring or null

usd, with amount_off.

Value: "usd"

durationstringRequired

once: the first charge; repeating: duration_in_months; forever: all.

One of: "once", "repeating", "forever"

duration_in_monthsinteger or null

1 to 60, for repeating only.

max_redemptionsinteger or null

Total uses across all its codes.

redeem_byinteger or null

Unix seconds in the future; no new use after it.

applies_toAppliesTo or null

Limit it to these products. Set on create only.

Fields inside applies_to
FieldDescription
applies_to.productsarray of stringRequired

Product ids.

metadataobject of string
stripe_idstring or null

The Stripe id this object was migrated from. Set once, on create or by PATCH while null. Unique per merchant.

Responses

StatusDescriptionBody
201

Successful Response

CouponOut
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/coupons" \
  -H "Authorization: Bearer zp_test_..." \
  -H "Idempotency-Key: <Idempotency-Key>" \
  -H "Content-Type: application/json" \
  -d '{
    "duration": <duration>
  }'

Retrieve a coupon

GET/v1/coupons/{coupon_id}

Returns one coupon with times_redeemed and valid.

Arguments: coupon_id (coupon_...).

Errors: resource_missing (also for a deleted coupon).

Next step: create a code for it.

Parameters

NameDescription
coupon_idpath, stringRequired

Responses

StatusDescriptionBody
200

Successful Response

CouponOut

Example

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

Update a coupon (Stripe's POST)

POST/v1/coupons/{coupon_id}

Stripe's update verb: the same operation as PATCH on this path, with the same fields, validation and scope; no Idempotency-Key. Changes name, metadata, or stripe_id while it is null; metadata merges key by key (a key sent as "" is removed, metadata "" removes every key). The discount terms never change: sending one answers parameter_immutable; create a new coupon instead.

Returns the updated coupon.

Errors: resource_missing, parameter_immutable, stripe_id_in_use.

Next step: GET /v1/coupons/{id}.

Parameters

NameDescription
coupon_idpath, stringRequired

Request body

FieldDescription
namestring 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

The Stripe id this object was migrated from. Set once, on create or by PATCH while null. Unique per merchant.

percent_offany

Cannot change after create; sending it answers parameter_immutable.

amount_offany

Cannot change after create; sending it answers parameter_immutable.

currencyany

Cannot change after create; sending it answers parameter_immutable.

durationany

Cannot change after create; sending it answers parameter_immutable.

duration_in_monthsany

Cannot change after create; sending it answers parameter_immutable.

max_redemptionsany

Cannot change after create; sending it answers parameter_immutable.

redeem_byany

Cannot change after create; sending it answers parameter_immutable.

applies_toany

Cannot change after create; sending it answers parameter_immutable.

Responses

StatusDescriptionBody
200

Successful Response

CouponOut
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

Shell
curl -X POST "https://api.zeropointapp.com/v1/coupons/{coupon_id}" \
  -H "Authorization: Bearer zp_test_..." \
  -H "Content-Type: application/json" \
  -d '{}'

Update a coupon

PATCH/v1/coupons/{coupon_id}

Changes name, metadata, or stripe_id while it is null; metadata merges key by key (a key sent as "" is removed, metadata "" removes every key). The discount terms never change: sending one answers parameter_immutable; create a new coupon instead.

Returns the updated coupon.

Errors: resource_missing, parameter_immutable, stripe_id_in_use.

Next step: GET /v1/coupons/{id}. POST to the same path (Stripe's update verb) does exactly the same.

Parameters

NameDescription
coupon_idpath, stringRequired

Request body

FieldDescription
namestring 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

The Stripe id this object was migrated from. Set once, on create or by PATCH while null. Unique per merchant.

percent_offany

Cannot change after create; sending it answers parameter_immutable.

amount_offany

Cannot change after create; sending it answers parameter_immutable.

currencyany

Cannot change after create; sending it answers parameter_immutable.

durationany

Cannot change after create; sending it answers parameter_immutable.

duration_in_monthsany

Cannot change after create; sending it answers parameter_immutable.

max_redemptionsany

Cannot change after create; sending it answers parameter_immutable.

redeem_byany

Cannot change after create; sending it answers parameter_immutable.

applies_toany

Cannot change after create; sending it answers parameter_immutable.

Responses

StatusDescriptionBody
200

Successful Response

CouponOut
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

Shell
curl -X PATCH "https://api.zeropointapp.com/v1/coupons/{coupon_id}" \
  -H "Authorization: Bearer zp_test_..." \
  -H "Content-Type: application/json" \
  -d '{}'

Delete a coupon

DELETE/v1/coupons/{coupon_id}

Deletes a coupon: its promotion codes stop working at once and read active: false. Discounts already applied keep their remaining duration.

Arguments: coupon_id.

Returns {object, id, deleted: true}.

Errors: resource_missing.

Next step: none.

Parameters

NameDescription
coupon_idpath, stringRequired

Responses

StatusDescriptionBody
200

Successful Response

DeletedOut
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

Shell
curl -X DELETE "https://api.zeropointapp.com/v1/coupons/{coupon_id}" \
  -H "Authorization: Bearer zp_test_..."

List promotion codes

GET/v1/promotion_codes

Lists promotion codes newest first. code matches regardless of case and returns every code with that text, inactive ones included unless active=true.

Arguments: merchant_id, code, coupon, customer, active, stripe_id, limit, cursor.

Returns a list of promotion_code objects.

Errors: parameter_invalid, parameter_unknown.

Next step: GET /v1/promotion_codes/{id}. merchant_id filters to one merchant; without it, a ZeroPoint-Account (or Stripe-Account) header filters the same way. A query parameter this list does not take is refused by name (400 parameter_unknown), never ignored; Stripe's array forms name[]=a and name[0]=a are read.

Parameters

NameDescription
merchant_idquery, string or null
codequery, string or null
couponquery, string or null
customerquery, string or null
activequery, boolean or null
stripe_idquery, 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.

Responses

StatusDescriptionBody
200

Successful Response

ListOut_PromotionCodeOut_

Example

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

Create a promotion code

POST/v1/promotion_codes

Creates the text a customer types (LAUNCH20) for a coupon. Codes are unique per merchant among active codes, regardless of case. merchant_id is optional: without it, the ZeroPoint-Account header (or Stripe-Account), else the platform's only merchant in this mode. Idempotency-Key is optional: with one, a retry with the same key and body replays the first answer; without one the request runs once.

Arguments: merchant_id, coupon (or promotion.coupon), code, active, customer, expires_at, max_redemptions, restrictions {minimum_amount, minimum_amount_currency, once_per_customer}, metadata, stripe_id.

Returns the promotion_code object.

Errors: parameter_invalid, resource_missing (the merchant, coupon or customer), coupon_invalid, promotion_code_in_use, stripe_id_in_use, resource_limit_exceeded (sandbox ceiling).

Next step: POST /v1/prices/{id}/discount_preview with the code.

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

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

couponstring or null

Coupon of the same merchant.

promotionPromotionIn or null

Stripe's current shape; must agree with coupon if both.

Fields inside promotion
FieldDescription
promotion.typestring

Value: "coupon"

promotion.couponstringRequired

Coupon id.

codestring or null

1 to 64 of A-Z a-z 0-9 -. Generated (8 characters) when left out.

activeboolean

Default: true

customerstring or null

Only this customer may use it.

expires_atinteger or null

Unix seconds; not after the coupon's redeem_by.

max_redemptionsinteger or null

This code's cap.

restrictionsRestrictionsIn or null
Fields inside restrictions
FieldDescription
restrictions.minimum_amountinteger or null

Minimum subtotal in integer cents.

restrictions.minimum_amount_currencystring or null

Value: "usd"

restrictions.once_per_customerboolean

One use per customer: by email when known, else by customer id.

Default: false

metadataobject of string
stripe_idstring or null

The Stripe id this object was migrated from. Set once, on create or by PATCH while null. Unique per merchant.

Responses

StatusDescriptionBody
201

Successful Response

PromotionCodeOut
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/promotion_codes" \
  -H "Authorization: Bearer zp_test_..." \
  -H "Idempotency-Key: <Idempotency-Key>" \
  -H "Content-Type: application/json" \
  -d '{}'

Retrieve a promotion code

GET/v1/promotion_codes/{promotion_code_id}

Returns one promotion code. active reads false when the code is deactivated or its coupon is deleted or no longer valid.

Arguments: promotion_code_id (promo_...).

Errors: resource_missing.

Next step: preview it on a price.

Parameters

NameDescription
promotion_code_idpath, stringRequired

Responses

StatusDescriptionBody
200

Successful Response

PromotionCodeOut

Example

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

Update a promotion code (Stripe's POST)

POST/v1/promotion_codes/{promotion_code_id}

Stripe's update verb: the same operation as PATCH on this path, with the same fields, validation and scope; no Idempotency-Key. Changes active, metadata, or stripe_id while it is null; metadata merges key by key (a key sent as "" is removed, metadata "" removes every key). There is no delete; deactivate with active: false. Reactivating a code whose text an active code now holds answers promotion_code_in_use.

Returns the updated promotion_code.

Errors: resource_missing, parameter_immutable, promotion_code_in_use, stripe_id_in_use.

Next step: GET /v1/promotion_codes/{id}.

Parameters

NameDescription
promotion_code_idpath, stringRequired

Request body

FieldDescription
activeboolean or null

False deactivates 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

The Stripe id this object was migrated from. Set once, on create or by PATCH while null. Unique per merchant.

codeany

Cannot change after create; sending it answers parameter_immutable.

couponany

Cannot change after create; sending it answers parameter_immutable.

promotionany

Cannot change after create; sending it answers parameter_immutable.

customerany

Cannot change after create; sending it answers parameter_immutable.

expires_atany

Cannot change after create; sending it answers parameter_immutable.

max_redemptionsany

Cannot change after create; sending it answers parameter_immutable.

restrictionsany

Cannot change after create; sending it answers parameter_immutable.

Responses

StatusDescriptionBody
200

Successful Response

PromotionCodeOut
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

Shell
curl -X POST "https://api.zeropointapp.com/v1/promotion_codes/{promotion_code_id}" \
  -H "Authorization: Bearer zp_test_..." \
  -H "Content-Type: application/json" \
  -d '{}'

Update a promotion code

PATCH/v1/promotion_codes/{promotion_code_id}

Changes active, metadata, or stripe_id while it is null; metadata merges key by key (a key sent as "" is removed, metadata "" removes every key). There is no delete; deactivate with active: false. Reactivating a code whose text an active code now holds answers promotion_code_in_use.

Returns the updated promotion_code.

Errors: resource_missing, parameter_immutable, promotion_code_in_use, stripe_id_in_use.

Next step: GET /v1/promotion_codes/{id}. POST to the same path (Stripe's update verb) does exactly the same.

Parameters

NameDescription
promotion_code_idpath, stringRequired

Request body

FieldDescription
activeboolean or null

False deactivates 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

The Stripe id this object was migrated from. Set once, on create or by PATCH while null. Unique per merchant.

codeany

Cannot change after create; sending it answers parameter_immutable.

couponany

Cannot change after create; sending it answers parameter_immutable.

promotionany

Cannot change after create; sending it answers parameter_immutable.

customerany

Cannot change after create; sending it answers parameter_immutable.

expires_atany

Cannot change after create; sending it answers parameter_immutable.

max_redemptionsany

Cannot change after create; sending it answers parameter_immutable.

restrictionsany

Cannot change after create; sending it answers parameter_immutable.

Responses

StatusDescriptionBody
200

Successful Response

PromotionCodeOut
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

Shell
curl -X PATCH "https://api.zeropointapp.com/v1/promotion_codes/{promotion_code_id}" \
  -H "Authorization: Bearer zp_test_..." \
  -H "Content-Type: application/json" \
  -d '{}'

Preview a promotion code on a price

POST/v1/prices/{price_id}/discount_preview

Read only: answers what a promotion code would take off this price, and writes nothing (no use is reserved, no counter moves). A POST so the code and the email never travel in a URL; no Idempotency-Key needed.

Arguments: price_id, merchant_id (optional: else the ZeroPoint-Account header, else the only merchant), promotion_code, customer (cus_..., for codes limited to one customer), email (the shopper's, for once_per_customer), quantity (1).

Returns a discount_preview with subtotal, discount_amount and total in integer cents. A code that does not apply is still a 200: refusal is promotion_code_invalid, promotion_code_not_applicable, promotion_code_exhausted or promotion_code_already_redeemed, with refusal_message to show the shopper, and total is the undiscounted amount. A total of 0 is returned as a number.

Errors: resource_missing (price, merchant or customer), price_inactive, parameter_invalid.

Next step: start a checkout with the code.

Parameters

NameDescription
price_idpath, stringRequired

Request body

FieldDescription
merchant_idstring or null

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

promotion_codestringRequired

The text the shopper typed; matched regardless of case.

customerstring or null

A customer of this merchant (cus_...), for codes limited to one.

emailstring or null

The email typed on this purchase, for once_per_customer.

quantityinteger

1 only.

Default: 1

Responses

StatusDescriptionBody
200

Successful Response

DiscountPreviewOut
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

Shell
curl -X POST "https://api.zeropointapp.com/v1/prices/{price_id}/discount_preview" \
  -H "Authorization: Bearer zp_test_..." \
  -H "Content-Type: application/json" \
  -d '{
    "promotion_code": <promotion_code>
  }'