API reference
The AQ Pay API is REST over HTTPS with JSON bodies. Resources are consistent across every connected provider; provider-specific details appear in a route object rather than in the shape of the resource. This reference describes the v1 contract; a machine-readable OpenAPI document will be published alongside the sandbox.
Authentication
Server calls use a secret key in the Authorization: Bearer header. Browser-side tokenization uses a publishable key that can only create tokens. Keys are scoped to one environment and one tenant.
sk_live_… / sk_sandbox_…pk_live_… / pk_sandbox_…whsec_…Conventions
Idempotency-KeyRequired on POST. Same key within 24h returns the original response.AmountsIntegers in minor units. Currencies without minor units use the whole number.PaginationCursor-based: limit (max 100) and starting_after. Responses include has_more.VersioningPath version (/v1). Additive changes are not versioned; breaking changes get a new path.Rate limitsPer key. 429 responses include Retry-After.TimestampsISO 8601 UTC everywhere.Error model
Errors return a stable type and code. Provider decline codes are normalised into a shared taxonomy and the raw provider code is preserved for support.
{ "error": {
"type": "card_declined",
"code": "insufficient_funds",
"retryable": false,
"provider": { "id": "acquirer_a", "raw_code": "51" },
"request_id": "req_…" } }Payments
A payment is one customer intent to pay. It may contain several provider attempts (cascades); the resource exposes the final state and the route that produced it.
amountintegerMinor units (cents). 12800 = €128.00.currencyISO 4217Presentment currency. Settlement currency depends on the route.payment_methodobjectA token, a stored method id, or a redirect method type.routing.profilestringRouting profile to evaluate. Defaults to the merchant’s assigned profile.statusenumrequires_action · authorized · captured · voided · refunded · failedrouteobjectprovider, attempt number, cascade reason, 3DS outcome.Tokens & customers
Tokens replace card data. Create them from hosted fields with a publishable key; attach them to a customer to reuse for recurring or one-click payments.
tokenstringtok_… — single use, expires after 15 minutes.network_tokenbooleanWhether a scheme network token was provisioned for the stored method.Merchants
For tenants and platforms. Create merchants, assign provider accounts and routing profiles, and read per-merchant configuration. Requires a tenant-scoped key.
Routing profiles
Ordered rule sets evaluated per payment. Read access is available to all keys; write access requires the routing permission on a tenant key.
Disputes
Chargebacks and retrieval requests from any connected provider, normalised into one lifecycle with deadlines.
Webhooks
Events are signed with an HMAC-SHA256 over timestamp.body using your endpoint secret, delivered at least once, and retried with exponential backoff for 24 hours until your endpoint returns 2xx. Reject signatures older than five minutes to prevent replay.
payment.authorizedpayment.requires_actionpayment.capturedpayment.failedpayment.refundedpayment.cascadeddispute.createddispute.updatedpayout.settledprovider.health_changed