Skip to content

Limits & safe retries

Limits are counted per API key, per minute:

Key All requests Orders and bookings created
Publishable 120 / minute 20 / minute
Secret 600 / minute 120 / minute

Publishable keys also have a limit per visitor (per IP address): 30 requests and 5 orders or bookings per minute, so one visitor cannot use up the limit that all your site’s customers share. Repeated requests with wrong keys from one IP address are refused for the rest of the minute after 20 failures.

Responses to requests that pass the key checks include:

  • X-RateLimit-Limit: requests allowed this minute;
  • X-RateLimit-Remaining: requests left this minute;
  • X-RateLimit-Reset: when the minute ends, in Unix seconds.

Over the limit you get 429 rate_limited with a Retry-After header in seconds. Wait that long before trying again.

Networks fail. If a request to create an order or booking times out, you cannot tell whether it was saved. To retry without creating a duplicate, send an Idempotency-Key header with POST /orders and POST /reservations:

POST /orders
Idempotency-Key: 6f1d2c1e-6a2b-4b8e-9b55-0d9a7e2c3f10
  • Use a new random value (for example crypto.randomUUID()) for each new order, and the same value when you retry that order.
  • If the first request finished, the retry returns the same response with the header Idempotent-Replayed: true. No second order is created.
  • If the first request is still running, you get 409 request_in_progress; retry a few seconds later.
  • Reusing a key with a different body gives 409 idempotency_conflict.
  • Keys are remembered for 24 hours, per API key.

A good retry pattern: up to 3 attempts, waiting 1, 2 and 4 seconds, only for network errors, 409 request_in_progress, 429 and 500. Never retry 400, 401, 403, 404 or 422 without changing the request.

Marking an order as paid (POST /orders/{id}/payment) is safe to repeat without an Idempotency-Key: once paid, it returns the order unchanged.