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.

Rate limits use fixed time slices

Toast APIs use fixed time slices when they calculate whether the individual limits within a rate limit were reached.

In this approach, each individual limit is associated with a time slice that has a fixed start and end time. For example, you are limited to 20 requests in the 09:00:00 to 09:00:01 time slice, and 10,000 requests in the 09:00:00 to 09:15:00 time slice.

The Toast APIs track the requests made within each time slice independently. When a time slice ends, the limits associated with that time slice are reset.

To illustrate this concept, consider the following example:

  1. Requests allowed:

    • 09:00:00 to 09:00:01 time slice: 20 requests

    • 09:00:00 to 09:15:00 time slice: 10,000 requests

  2. At 09:00:00, a request is made.

    Requests remaining:

    • 09:00:00 to 09:00:01 time slice: 19

    • 09:00:00 to 09:15:00 time slice: 9999

  3. At 09:00:01, the shorter time slice ends and a new one begins:

    Requests remaining:

    • 09:00:01 to 09:00:02 time slice: 20

    • 09:00:00 to 09:15:00 time slice: 9999

With each response, the Toast APIs return a header field that tells you when the time slice for the limit that is closest to being exceeded will be reset.

For more information, see Rate limiting header fields.