The Omisell API applies rate limits to the API requests that it receives. Every request is subject to throttling under the general limits. In addition, there are resource-based rate limits and throttles.Limits are calculated using the leaky bucket algorithm. All requests that are made after rate limits have been exceeded are throttled and an HTTP 429 Too Many Requests error is returned. Requests succeed again after enough requests have emptied out of the bucket. You can see the current state of the throttle for a shop by using the rate limits header.
The rate limits are designed to allow your app to make unlimited requests at a steady rate over time while also having the capacity to make infrequent bursts. The rate limits use a leaky bucket algorithm. The bucket size and leak rate properties determine the API's burst behavior and request rate.The default settings are as follows:
Bucket size: 100
Leak rate: 100/minutes
If the bucket size is exceeded, then an HTTP 429 Too Many Requests error is returned. The bucket empties at a leak rate of four requests per second. To avoid being throttled, you can build your app to average four requests per second. The throttle is a pass or fail operation. If there is available capacity in your bucket, then the request is executed without queueing or processing delays. Otherwise, the request is throttled.
You can check how many requests you've already made using the Omisell X-Omisell-Api-Call-Limit header that was sent in response to your API request. This header lists how many requests you've made for a particular shop. For example:
X-Omisell-Api-Call-Limit: 32/100
In this example, 32 is the current request count and 100 is the bucket size. The request count decreases according to the leak rate over time.