Base URL
All requests go to a versioned base URL. The current version isv1.
The sandbox is fully isolated from production. Data, keys, and charges created there never affect real money. See Sandbox.
Authentication
Every request must include your secret key in theAuthorization header as a Bearer token.
sk_sandbox_... keys against the sandbox base URL and sk_live_... keys against production. Keys are scoped: a key can only call the endpoints its scopes permit. A request with a missing or invalid key returns 401; a valid key without the required scope returns 403. See Authentication and Permissions.
Request format
Send request bodies as JSON with aContent-Type: application/json header. Set Accept: application/json to receive JSON responses.
- Money is a decimal string. Amounts are sent and returned as strings with two decimal places in the currency’s major unit:
"29.00"for $29.00,"75000.00"for ₦75,000.00. Never send a number, and never use minor units (cents). - Timestamps are ISO 8601. All dates and times are UTC strings, e.g.
"2026-04-27T12:00:00Z". - IDs are prefixed strings. Every resource ID carries a type prefix, e.g.
prod_...for products,cust_...for customers,chk_...for checkout sessions. Treat IDs as opaque; do not parse them.
Response format
Successful responses return a JSON object with an HTTP2xx status. Single-resource endpoints return the resource object directly. Endpoints that return a list wrap results in items alongside a pagination object. See Success responses and Pagination.
HTTP status codes
Bachs uses conventional HTTP status codes to indicate the result of a request. In general,2xx means success, 4xx means the request was rejected for a reason you can fix, and 5xx means something went wrong on our side.
Every
4xx response carries a machine-readable error_code you can branch on. See Errors for the shape and the full error code reference.
Query parameters
List endpoints accept query parameters to filter and page through results. Parameters are simple key/value pairs appended to the URL.- Pagination. List endpoints accept a
limit(max100; values above are clamped, not rejected) and page with either acursoror anoffset, depending on the endpoint. Each endpoint’s reference page states its defaultlimitand which paging style it uses. See Pagination. - Booleans. Pass
trueorfalse, e.g.include_archived=true. - Unknown parameters are ignored. An unrecognized query parameter does not error; it is silently dropped.
Idempotency
PublicPOST and PATCH requests under /v1/ support an Idempotency-Key header. Successful responses are cached for matching retries; a timeout or 5xx still requires outcome reconciliation. DELETE is not covered by this middleware. See Idempotency.
Rate limits
Requests are rate limited per API key, so each key has its own budget.
Every response includes headers describing your current budget:
If you exceed the limit you receive a
429 Too Many Requests. Read Retry-After and wait that many seconds before retrying.
