DuevanceAPI documentation

Rate limits

The buckets, their limits and the headers.

Requests are counted in buckets. Authenticated buckets are counted per project and environment, so a load test in test mode never slows your live checkout, and one project can't use up another's allowance.

BucketCoversCounted perRequests per minute
ipEvery request to the API host, before the key is checkedclient IP address600
apiEvery authenticated requestproject and environment120
chargesPOST /v1/payments and POST /v1/payment-instruments/{id}/chargesproject and environment30

A request counts against every bucket that covers it: a charge counts in ip, api and charges.

How the limit refills

Each bucket is a token bucket: you may burst up to the limit at once, and capacity comes back steadily. With 120 a minute, a client that sent 120 requests in a few seconds may send the next one about half a second later.

Headers

Every answer on an authenticated route carries the state of its most specific bucket:

HeaderMeaning
RateLimit-LimitRequests per minute in the bucket
RateLimit-RemainingRequests you may send right now
RateLimit-ResetSeconds until the bucket is full again

Over the limit, the answer is 429 with type rate_limit_error, code rate_limited, Retry-After (seconds to wait before the next request is allowed) and the three headers above, with RateLimit-Remaining: 0.

Handling a 429

Wait Retry-After seconds and retry. Nothing ran: a 429 never charges and never uses up an Idempotency-Key, so retry with the same key.