Conventions
Authentication
Send your API key as a bearer token: Authorization: Bearer sk_test_…. Keys beginning
sk_test_/sk_live_ reflect the merchant's is_live flag; the key body is 192 random bits and the first 12 characters are stored as key_prefix for identification. Every resource is scoped to the
merchant that owns the key; accessing another merchant's object returns 404.
Platform-internal routes (merchant registration, provider callbacks) are not part of this API and are not documented here.
Live keys in the dashboard
A live secret works from anywhere until it is revoked, so creating or rotating one in the dashboard needs a passkey
sign-in, for standard and agent keys alike. A session opened with an email link gets 403 passkey_sign_in_required:
add a passkey in Settings, sign out, then sign in with it. Listing and revoking keys need no passkey, and neither do
test accounts. Requests made with a standard API key are not affected.
Approving an app's OAuth connection to a live account needs the same passkey sign-in, because the app keeps its access after you sign out. Declining a request and disconnecting an app need none.
Errors
Non-2xx responses use one envelope:
{
"error": {
"type": "invalid_request_error",
"message": "A default instrument is required to start a subscription without a trial.",
"code": "instrument_required",
"param": "default_instrument_id",
"request_id": "6a1f…"
}
}
type is one of invalid_request_error, authentication_error, permission_error, idempotency_error,
card_error, api_error. Quote request_id (also logged server-side) when reporting problems.
| Status | Meaning |
|---|---|
| 400 | Invalid JSON (invalid_json), failed validation (validation_failed), or a rule violation |
| 401 | Missing or invalid API key |
| 402 | Synchronous unkeyed proration charge declined (proration_payment_failed) |
| 403 | Action not permitted for this credential or scope (permission_error) |
| 404 | Unknown route, or object not found / not yours (resource_missing) |
| 409 | State conflict: invalid_status_transition, instrument_in_use, idempotency conflicts |
| 413 | Request body or JSON dimensions exceed documented limits |
| 429 | Rate limited (rate_limit_exceeded or too_many_auth_failures); honor retry-after |
| 503 | Shared budget storage is unavailable (rate_limit_store_unavailable); retry later |
| 500 | Server error (api_error) |
Validation failures (validation_failed) name the first offending field in param (dotted for
nested fields, e.g. recurring.interval) and in the message.
Updates and deletes
Updates are POST /v1/<resource>/:id with only the fields to change (partial update; an empty
body returns 400 empty_update where applicable). Customer, card, and webhook endpoint deletion
return {"object":"<type>","id":"…","deleted":true}. Product deletion returns the archived
product (active: false); subscription deletion returns the canceled or scheduled subscription.
Pagination
List endpoints accept limit (1–100, default 20) and starting_after (an object ID; results are
ordered by ascending ID) and return:
{ "object": "list", "url": "/v1/customers", "has_more": true, "data": [ … ] }
To page, pass the last id of data as starting_after while has_more is true. The customer, product, price, subscription, payment, payment-link, event, webhook and account-key lists also accept order=desc for newest-first results; in either order, starting_after continues from the last returned ID.
Customer, product and price lists also accept ids, a comma-separated set of up to 100 object IDs, for merchant-scoped related-record lookups.
Date filters. created[gt|gte|lt|lte] and due_date[...] take an ISO 8601 date or date-time, always read as UTC. A date without a time means 00:00:00 UTC of that day, so created[lte]=2026-11-15 stops at the very start of the 15th; to include the whole day, use created[lt]=2026-11-16 or a full date-time such as 2026-11-15T23:59:59Z.
Idempotency
Send an Idempotency-Key header (≤ 96 chars) on merchant-authenticated POST/DELETE requests you may retry. Scope is merchant + key + method + path.
- Same key, same body and query parameters → the stored response is replayed with
idempotency-replayed: true. Query names are sorted; repeated values retain their order. - Same key, different body or query →
409 idempotency_key_in_use. - A stored response belongs to the credential that made the request. That credential and your standard API keys can replay
it or resume an unfinished request; an agent key or a dashboard session using a key another credential used gets
409 idempotency_key_in_use, and nothing runs. This includes a rotated agent key: check what the original request created before sending it again under a new idempotency key. - Same key while the first request is still running →
409 idempotency_key_in_progress; retry shortly. - A request's changes, its events and its saved response are committed together. A failure before commit rolls them all back; an exact retry may execute safely. A lost response after commit replays the original result. Rejected requests also roll back their mutations.
- Payment-producing requests with a key return the committed pending result (
incompleteon first payment; held items and a pending transaction on proration). The charge is submitted after commit. GET the subscription/transaction or consume webhooks for the final outcome. A later decline does not replace that saved pending response with a402. - Queued payment submissions survive a restart. An attempt is recorded as submitted before NETOPIA Payments is contacted, using its transaction ID as the provider order ID, and submitted attempts are reconciled, never blindly sent again.
- Revoked credentials remain invalid, including for replay. Before rotating the credential making the request, keep another active standard API key available: it can recover a lost rotation response using the same idempotency key/method/path/body/query.
- Completed results remain replayable until retention purges them after 24 h. Unfinished claims are
retained for 7 days, then purged (an atomic claim wrote nothing, so a retry just runs again). Unfinished legacy claims (
recovery_version = 0) return409 idempotency_recovery_required: reconcile their resources/payments before deciding their disposition; do not delete them and retry blindly. Completed legacy responses retain their original body-only fingerprint and plaintext format until expiry; legacy records cannot reconstruct a query that was never recorded.
Lifecycle events and recovery
Customer/card mutations and subscription lifecycle changes commit their events with their state, including requests without an idempotency key. Trial notices and expiry/cancellation jobs use the same guarantee: an outbox failure rolls back the change so it can be retried. Creation and elapsed-period resume also commit a durable charge intent before contacting the provider. If post-commit dispatch is interrupted, the billing worker recovers queued work. An unkeyed retry can still create a second resource; use an idempotency key to replay the original request safely.
Request limits
API and callback bodies are limited to 64 KiB, counted from actual stream bytes before
JSON parsing, idempotency fingerprinting or signature-body verification. A large declared
Content-Length rejects early; a small/missing length cannot bypass the limit. Streams are
canceled on overflow. Missing/blocked credentials
are rejected before application body buffering (callback signature presence is checked first).
JSON envelopes allow at most 16 nesting levels. Each metadata value is capped at 16 KiB of
UTF-8 JSON, 8 nesting levels and 100 total object properties/array elements. Subscription items
are capped at 100. Descriptions allow 500 characters; token fields and netopia_api_key allow
4096 UTF-8 bytes. Oversized bodies return 413 body_too_large; excessive JSON dimensions return
413 payload_limit_exceeded with the affected param. Ordinary schema errors still return 400.
These are input-envelope limits; monetary/date/storage constraints remain tracked separately.
Rate limits
Each merchant has a merchant-wide budget of 120 requests per minute, shared across all of its keys.
A window lasts 60 seconds from its first request. Excess requests return
429 rate_limit_exceeded with retry-after seconds. Replays and rejected authenticated requests
consume budget; rolling back a business transaction does not refund it. Creating/rotating keys
does not reset a merchant's budget.
Failed authentication has its own limit: 10 failures per source per 60 seconds. Further attempts from that source,
including valid credentials, return 429 too_many_auth_failures. Successful authentication does not
increase failure counts.
If the limit cannot be checked, requests fail closed with 503 rate_limit_store_unavailable; retry shortly.
The source of a request is the address that connects to Payware.