Rate limits
Each tenant has two rate limits: one for reads (query) and one for writes (ingest). A bulk import therefore never uses up the capacity your storefront needs for price queries.
How a limit works
Each limit is a token bucket defined by two numbers:
- Rate: how fast the bucket refills, in items per second.
- Burst: how many items the bucket holds, and therefore how many you can send at once.
When the bucket is full, you can send a burst immediately. After that, you can keep sending at the rate. An idle bucket refills up to the burst, and no further. The limit applies to your tenant as a whole, whichever server handles the request.
What a request costs
Limits count items, not HTTP requests, so batching does not bypass them:
| Request | Dimension | Cost |
|---|---|---|
POST /price/query | query | The number of SKUs in skus |
POST /price/batch, DELETE /price/batch, POST /article/batch, POST /pricelist/batch | ingest | The number of items in the array |
POST /fx/daily | ingest | The number of rates |
POST /price/historical-best, POST /pricelist/query, POST /pricelist/search, POST /article/search | query | 1 |
Any other GET | query | 1 |
| Any other write | ingest | 1 |
The number of pricelists in a price query does not affect its cost.
Headers
Every response subject to a limit includes these headers:
| Header | Meaning |
|---|---|
X-RateLimit-Limit | The burst: the number of items a full bucket holds |
X-RateLimit-Remaining | The approximate number of items left in the bucket |
X-RateLimit-Reset | When the bucket will be full again, in Unix seconds |
Exceeding the limit: 429
429 Too Many Requests means the bucket does not hold enough items for this request at the moment. The Retry-After header gives the number of seconds until it does: wait that long, then retry.
{
"status": 429,
"error": "Too Many Requests",
"message": "Rate limit exceeded for QUERY",
"retry_after": 2
}
When a request is too large: 413
A request that costs more than the maximum number of items per request, or more than the burst, can never fit in the bucket. It is rejected with 413 Payload Too Large before any items are deducted. Retrying does not help; split the request instead.
{
"status": 413,
"error": "Payload Too Large",
"message": "This request costs 3000 items; at most 2500 are allowed per request. Split it into smaller requests.",
"max_items_per_request": 2500
}
Staying within the limit
- Send requests at the rate, and keep the burst for peaks.
- On a
429response, wait for theRetry-Afterperiod before you send the next request. Retrying in a tight loop only spends capacity on rejected requests. - Size your batches according to
max_items_per_request, not by trial and error.