ZeroPointPayments

API reference

Payment methods

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 payment methods

GET/v1/payment_methods

Lists saved cards newest first.

Arguments: merchant_id, customer, include_deleted (default false), limit, cursor, type (card only, Stripe's filter: every saved method is a card).

Returns a list of payment methods.

Errors: parameter_invalid.

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

Parameters

NameDescription
merchant_idquery, string or null
customerquery, string or null
include_deletedquery, boolean
typequery, string or null

Value: "card"

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_PaymentMethodOut_

Example

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

Save a card

POST/v1/payment_methods

Saves a card for a customer from a Collect nonce, with no charge. In test mode the nonce may be a test card token instead, with no browser: tok_visa approves every charge; tok_chargeDeclined, tok_chargeDeclinedInsufficientFunds, tok_chargeDeclinedLostCard and tok_chargeDeclinedStolenCard decline every charge with that reason. Present the merchant's terms to the cardholder first. Only a nonce from a typed card form may be sent here: never a wallet nonce (Apple Pay, Google Pay), which cannot be saved. Metadata keys token, token_enc, nonce, consent, secret, client_secret, access_token and refresh_token (any case) are reserved.

Arguments: merchant_id (optional: without it the ZeroPoint-Account header, else the platform's only merchant in this mode), customer, nonce, consent {agreed_at, reference}, metadata.

Returns the payment method; the processor token is never returned.

Errors: idempotency_key_required, parameter_invalid, resource_missing, test_mode_only (400: a test card token with a live key or merchant), card_not_saved (402), nonce_invalid (402), nonce_already_used (409), resource_limit_exceeded and sandbox_daily_limit_exceeded (409, test mode), save_attempt_limit_exceeded (409, live mode), card_on_file_unavailable (400, live mode), sandbox_processor_unconfigured (503), processor_unavailable (502; nothing was stored, retry once with the same Idempotency-Key and nonce).

Next step: charge it with POST /v1/payments.

Parameters

NameDescription
Idempotency-Keyheader, string or null

Required on this endpoint. Any unique string up to 255 characters (a UUID is fine). Reuse it only to retry the same request.

Request body

FieldDescription
merchant_idstring or null

Optional. The merchant (mch_...); must be the customer's merchant. Without it: the ZeroPoint-Account header, else the platform's only merchant in this mode.

customerstringRequired

The customer (cus_...) the card is saved for.

noncestringRequired

One-time value from the Collect form, or in test mode a test card token (tok_visa). Never logged or stored.

consentConsentRequired
Fields inside consent
FieldDescription
consent.agreed_atintegerRequired

Unix seconds when, according to you, the cardholder agreed to the merchant's terms. At most 5 minutes in the future. A record only.

consent.referencestring or null

Optional. Your own reference to that agreement.

metadataobject of string

Responses

StatusDescriptionBody
201

Successful Response

PaymentMethodOut
402

The payment itself failed (type payment_error); branch on code.

ErrorResponse
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
502

The payments network failed or gave no decision (processor_unavailable). The outcome may be unknown: a 5xx releases the Idempotency-Key, so retry with the same key and body.

ErrorResponse
503

No processor is available for this merchant or deployment (processor_not_connected, sandbox_processor_unconfigured, connect_unavailable).

ErrorResponse

Example

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

List a customer's payment methods

GET/v1/customers/{customer_id}/payment_methods

Lists one customer's saved cards newest first: Stripe's path for the same list as GET /v1/payment_methods?customer=.

Arguments: customer_id (cus_...), include_deleted (default false), limit, cursor or starting_after.

Returns a list of payment methods.

Errors: resource_missing, parameter_invalid.

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

Parameters

NameDescription
customer_idpath, stringRequired
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

StatusDescriptionBody
200

Successful Response

ListOut_PaymentMethodOut_

Example

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

Retrieve a payment method

GET/v1/payment_methods/{payment_method_id}

Returns one saved card, deleted ones included.

Arguments: payment_method_id (pm_...).

Returns the payment method with its computed status.

Errors: resource_missing.

Next step: charge it, or delete it.

Parameters

NameDescription
payment_method_idpath, stringRequired

Responses

StatusDescriptionBody
200

Successful Response

PaymentMethodOut

Example

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

Delete a payment method

DELETE/v1/payment_methods/{payment_method_id}

Stops using a saved card: ZeroPoint erases its token locally and can never charge it again (the processor has no delete call, so this is not a processor-side delete). The method stays readable with status deleted, and past payments keep their payment_method. Deleting a deleted method returns it again (200); no Idempotency-Key is needed.

Arguments: payment_method_id (pm_...).

Returns the payment method with status deleted and customer null.

Errors: resource_missing, payment_method_in_use (409; a payment still needs the card: with Retry-After when a pending payment or one still being recorded names it, which ends within the pending window (15 minutes by default; the message states it), or when the in-use check could not run; without it when another use, such as a subscription's default, holds it).

Next step: save a new card with POST /v1/payment_methods to replace it. POST /v1/payment_methods/{id}/detach is the same operation under Stripe's name.

Parameters

NameDescription
payment_method_idpath, stringRequired

Responses

StatusDescriptionBody
200

Successful Response

PaymentMethodOut
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/payment_methods/{payment_method_id}" \
  -H "Authorization: Bearer zp_test_..."

Detach a payment method (Stripe's name for delete)

POST/v1/payment_methods/{payment_method_id}/detach

Stops using a saved card: ZeroPoint erases its token locally and can never charge it again (the processor has no delete call, so this is not a processor-side delete). The method stays readable with status deleted, and past payments keep their payment_method. Deleting a deleted method returns it again (200); no Idempotency-Key is needed.

Arguments: payment_method_id (pm_...).

Returns the payment method with status deleted and customer null.

Errors: resource_missing, payment_method_in_use (409; a payment still needs the card: with Retry-After when a pending payment or one still being recorded names it, which ends within the pending window (15 minutes by default; the message states it), or when the in-use check could not run; without it when another use, such as a subscription's default, holds it).

Next step: save a new card with POST /v1/payment_methods to replace it. POST /v1/payment_methods/{id}/detach is the same operation under Stripe's name.

Parameters

NameDescription
payment_method_idpath, stringRequired

Responses

StatusDescriptionBody
200

Successful Response

PaymentMethodOut
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/payment_methods/{payment_method_id}/detach" \
  -H "Authorization: Bearer zp_test_..."