Skip to main content

The envelope

Every route except the token endpoint answers in the Laces envelope.
Every error from the Partner API carries an error_code, including rate limits (rate_limited), unknown paths (not_found), malformed bodies (invalid_json) and unexpected failures (server_error). The token endpoint is the exception to all of this: it uses the OAuth { "error", "error_description" } shape (below).

Request ids

Every response carries an X-Request-Id header, for example X-Request-Id: req_V1StGXR8Z5jdHi6BmyT2. Log it with your errors, and quote it when you contact support@laces.run: it lets Laces find your exact request. A 500 server_error also repeats the id as request_id in the JSON body. Its error text is deliberately generic and never names the cause. Browsers can read the header too: the API exposes X-Request-Id and Retry-After to your page’s scripts through CORS, so res.headers.get("X-Request-Id") works in fetch.

Wrong host

Partner credentials are accepted only on https://connect.laces.run. If you send a bearer token, client credentials or a publishable key to another Laces host (for example https://api.laces.run), the request is refused before anything else:
Fix your base URL to https://connect.laces.run/v1.

Which error codes can the API return?

Authentication (every route)

Events

Checkout sessions

Create and publish events

Scope events:write, bearer token only. Details that carry extra information use error_details (for example { "field": "timezone" }). See Create and publish events.

Create an order

Create or quote a payment

Scope payments:write, bearer token only. The full list with what to do is on Payment errors.

Pay an order

When a payment attempt fails or expires, the pay response also has retry_safe: true means this failed attempt can’t charge the payer, so the buyer may try again; false means read the order first. Never retry pay automatically. Every pay response also has failure_kind: null unless the attempt failed, otherwise provider_not_reached (nothing was charged; the buyer can try again), timed_out, declined or other. See Why it failed.

Orders list and read

Everywhere

Token endpoint

POST /oauth/token answers in the OAuth shape (RFC 6749 §5.2): { "error": "invalid_client", "error_description": "Client authentication failed" }. See Authentication.

Retrying safely

Last modified on November 26, 2026