API Reference
Call the Peer Pay API from your backend. The SDK wraps order creation, payouts and merchant reads; these pages document the HTTP endpoints behind them and the ones it doesn't wrap.
Base URL
https://api.pay.peer.xyz
Every path on these pages is relative to that host and lives under /api/v1.
Authentication
Send your API key in the X-API-Key header. The key is under Settings, Developer in the
merchant dashboard; see
API keys and webhooks for rotation.
curl https://api.pay.peer.xyz/api/v1/merchants/me/orders \
-H "X-API-Key: $ZKPAY_API_KEY"
An API key reads and creates orders and payouts for your whole account. Send it only from a trusted backend, never from browser or mobile code.
Sandbox and live are separate accounts with separate keys. A sandbox key sees only sandbox
data, and a live key only live data. A missing or unknown key returns 401 with the message
Missing API key or Invalid API key.
Get an order by id takes no key: the order id is the credential.
IP allowlist
Owners can restrict the API key to specific source addresses under Settings, Developer, API
key IP allowlist. Entries are public IPv4 or IPv6 addresses or CIDR blocks (IPv4 prefix 8–32,
IPv6 prefix 32–128), up to 50. A bare address is stored as /32 or /128. Live and sandbox
keys have separate lists, and an empty list turns the allowlist off. Dashboard sessions and
the Peer Pay Telegram bot are not affected.
The API accepts IPv6 as well as IPv4, and the allowlist sees the address your server connects from. An entry only matches addresses of its own family, so an IPv4 entry never matches a call made over IPv6. If your servers' network has IPv6, add their IPv6 addresses or your /64 too, or make your HTTP client connect over IPv4.
A request from an address outside the list gets 403:
{
"success": false,
"message": "IP address 203.0.114.7 is not in this merchant's API key IP allowlist",
"responseObject": { "ip": "203.0.114.7", "reason": "IP_NOT_ALLOWED" },
"statusCode": 403,
"errorCode": "IP_NOT_ALLOWED"
}
responseObject.ip is the address to add if the caller is yours. reason is
CLIENT_IP_UNRESOLVED instead when the API could not determine the caller's address.
Response envelope
Every response, success or failure, is a JSON object with the same four fields:
{
"success": true,
"message": "Merchant orders retrieved",
"responseObject": { "...": "..." },
"statusCode": 200
}
| Field | Type | Description |
|---|---|---|
success | boolean | true for a 2xx response |
message | string | For logs. Don't match on it |
responseObject | object | null | The payload. null on most failures |
statusCode | number | Mirrors the HTTP status |
The examples on these pages use this type:
type Envelope<T> = { success: boolean; message: string; responseObject: T | null; statusCode: number };
A 400 from query or body validation carries the details in responseObject:
{
"success": false,
"message": "Invalid request",
"responseObject": {
"formErrors": [],
"fieldErrors": { "limit": ["Number must be less than or equal to 100"] }
},
"statusCode": 400
}
Some failures also carry a top-level errorCode to branch on. Order creation codes, such as
AMOUNT_ABOVE_MAX for an order above the order maximum,
are listed under createCheckout errors. The same maximum
applies to each customer payment, fees included: when customer-paid fees push a bank or app
payment above it, the customer can't start that payment (INTENT_ABOVE_MAX).
Common errors
The endpoint pages cover additional errors specific to each operation.
| Status | Cause |
|---|---|
400 | A path parameter, query parameter, or body failed validation. Details in responseObject.fieldErrors |
401 | Missing or invalid API key. Never returned by the keyless order read |
403 | IP_NOT_ALLOWED if the IP allowlist refused the request, MERCHANT_SUSPENDED if the API key belongs to a suspended account, or MERCHANT_IDENTITY_REQUIRED / MERCHANT_IDENTITY_OVERDUE if a live key's owner has not verified their identity and the endpoint starts live money movement |
429 | Rate limit exceeded |
Pagination
The order, payment and payout lists take two query parameters and report the total. List payments for an order returns every row and takes neither.
| Parameter | Default | Max | Description |
|---|---|---|---|
page | 1 | none | 1-based page number |
limit | 20 | 100 | Rows per page. Above 100 returns 400; it is not clamped |
The payload carries the rows, total matching rows across all pages, and the page and
limit applied. Rows are newest first.
Dates and amounts
Timestamps are ISO 8601 strings in UTC, for example 2026-09-03T10:15:42.318Z. Amounts are
decimal strings, never floats, such as "25", "12.5" or "23.14". The number of decimals
varies, so parse amounts instead of comparing strings. Chain ids on orders are decimal strings
too, so Base is "8453"; payouts use numbers (8453).
Rate limits
The API allows 1,200 requests per minute per source IP across all endpoints. An IPv6 caller's
whole /64 counts as one source. Past that it returns 429 with the message Too many requests.
Responses carry these headers:
| Header | Value |
|---|---|
x-retry-after | Seconds until you may retry |
x-rate-limit-remaining | Requests left in the current window |
x-rate-limiter-resets-at | ISO 8601 time the window resets |
For this limit, use x-retry-after on a 429 response. Remediation
endpoints add a per-merchant limit with the same 429 shape, and
checkout grants have an hourly limit per merchant.
Use webhooks to learn that something changed, and these endpoints to reconcile.
Endpoints
| Endpoint | Auth | Documented at |
|---|---|---|
POST /api/v1/orders | API key | createCheckout, open-amount orders |
GET /api/v1/merchants/me/orders | API key | List orders |
GET /api/v1/orders/{orderId} | None | Get an order by id |
GET /api/v1/merchants/me/payments | API key | List payments |
GET /api/v1/merchants/me/orders/{orderId}/payments | API key | List payments for an order |
GET /api/v1/merchants/me/payouts/summary | API key | Deferred payout state |
GET /api/v1/merchants/me/invoice | API key | Get an invoice |
POST /api/v1/merchants/me/orders/{orderId}/payments/{paymentId}/recreate | API key | Recreate |
POST /api/v1/merchants/me/orders/{orderId}/payments/{paymentId}/extend | API key | Extend |
POST /api/v1/merchants/me/orders/{orderId}/payments/{paymentId}/fulfill-sar | API key | Fulfill from a transaction id |
GET /api/v1/merchants/me/orders/{orderId}/actions/{actionId} | API key | Poll an action |
POST /api/v1/payouts | API key | Create a payout |
GET /api/v1/payouts | API key | List payouts |
GET /api/v1/payouts/{id} | API key | Get a payout |
POST /api/v1/payouts/{id}/cancel | API key | Cancel a payout |
POST /api/v1/checkout-grants | API key | Create a grant |
GET /api/v1/merchants/me | API key | getMerchant |
GET /api/v1/merchants/me/tier-usage | API key | Watching your usage |
POST /api/v1/merchants/me/quotes/availability | API key | checkQuoteAvailability |
POST, GET /api/v1/webhooks; PATCH, DELETE /api/v1/webhooks/{webhookId} | API key | Webhooks |
POST /api/v1/webhooks/{webhookId}/test, GET /api/v1/webhooks/{webhookId}/deliveries | API key | Manage webhooks |
POST /api/v1/sandbox/test-order | Sandbox key | Let a coding agent integrate |
GET /api/v1/integration/status | API key | Let a coding agent integrate |
POST /api/v1/integration/setup-runs, POST /api/v1/integration/setup-runs/{runId}/events | API key | peer-pay-cli progress |
Cancelling an order and the merchant-scoped single-order read need a dashboard session; see what you can't do with an API key.