This guide will be removed on April 29, 2022. Please use our new, easier-to-use Toast technical documentation site. All updated content is on the new site.

Programming a client for sustained time-sensitive requests

Toast API rate limits include both shorter and longer time slices to support bursts of requests (20 per second) as well as sustained requests over time (10,000 per 15 minutes). API clients that need to make sustained requests for time-sensitive data, such as order status updates, must be programmed to take both time slices into account so that they are not rate limited when attempting to make a request for that time-sensitive data.

To better understand why, consider the following example:

  • A global rate limit of 20 requests/second and 10,000 requests per 15 minutes.

  • All requests in the example are made within the same 15 minute time slice.

If an API client makes 20 requests per second, as allowed by the shorter time slice, then in 8 minutes and 20 seconds, it will have made 10,000 requests and any subsequent requests will exceed the limit for the 15-minute time slice. The client must wait 6 minutes and 40 seconds for the 15-minute time slice to reset before it can continue to make requests.

To avoid this long delay, the client application should throttle its requests so that it does not exceed either limit. Specifically, if the client makes 11 requests per second, it does not exceed either limit because this request frequency translates into 9,900 requests in 15 minutes (11 requests X 60 seconds X 15 minutes = 9,900).