API reference
Refunds
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 |
|---|---|---|
| 200 | Successful Response | object |
| 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 refunds (Stripe's refunds.list)
GET/
Lists refunds and voids newest first.
Arguments: payment_intent (pay_...: that payment's only), limit, starting_after (or cursor). With the ZeroPoint-Account (or Stripe-Account) header: only that merchant's. Any other parameter (charge, created) is refused by name.
Errors: parameter_invalid, parameter_unknown, resource_missing.
Next step: GET /v1/refunds/{id}.
Parameters
| Name | Description |
|---|---|
payment_intentquery, 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
Example
curl -X GET "https://api.zeropointapp.com/v1/refunds" \
-H "Authorization: Bearer zp_test_..."Refund a payment (Stripe's refunds.create)
POST/
Stripe's refunds.create over the same refund as POST /v1/payments/{id}/refund: returns settled money in full or in part.
Arguments: payment_intent (pay_...; payment is accepted too), amount (optional, cents; omit for the remaining balance), reason (duplicate, fraudulent or requested_by_customer; echoed only). Idempotency-Key is required: pass your own on every refund, derived from the operation, so a retry of your code reuses it. Never voids: the refund is sent to the processor, and only when the processor refuses it because the payment has not settled does it answer not_settled_use_void naming POST /v1/payments/{id}/void (nothing reversed); a refund the processor accepts before settlement succeeds. Refused by name: charge, metadata, refund_application_fee, reverse_transfer, instructions_email.
Returns the refund object with Stripe's amount, status, payment_intent and currency beside ours.
Errors: as POST /v1/payments/{id}/refund (idempotency_key_required, resource_missing, payment_not_refundable, refund_exceeds_balance, not_settled_use_void, processor_unavailable: unknown outcome, retry the same key).
Next step: GET /v1/refunds/{id}.
Parameters
| Name | Description |
|---|---|
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
| Field | Description |
|---|---|
payment_intentstring or null | The payment to refund (pay_...). Required (or payment). |
paymentstring or null | The same as payment_intent. |
chargestring or null | Refused: ZeroPoint has no charge objects. Send payment_intent. |
amountinteger or null | Partial amount in cents; omit to refund the remaining balance. |
reasonstring or null | Echoed on this answer only; not stored and not sent to the processor. One of: |
Responses
| Status | Description | Body |
|---|---|---|
| 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
curl -X POST "https://api.zeropointapp.com/v1/refunds" \
-H "Authorization: Bearer zp_test_..." \
-H "Idempotency-Key: <Idempotency-Key>" \
-H "Content-Type: application/json" \
-d '{}'