Rate Limits#
Afosto applies rate limits to all API calls. Limits are dynamically applied and based on several factors including request volume, query complexity, and tenant activity.
·
Note:Exact rate limit thresholds are not published — they adapt to platform conditions to ensure fair usage across all tenants.
When you hit a rate limit#
When a rate limit is exceeded, the API returns an error in the standard GraphQL error format:
Best practices#
- Cache responses — Avoid re-fetching data that hasn't changed. Cache order lists, product data, and other read-heavy resources on your side.
- Request only what you need — Include only the fields your application actually uses. Smaller queries are cheaper and faster.
- Back off on errors — When you receive a
RATE_LIMITEDerror, wait before retrying. Use exponential backoff: wait 1s, then 2s, then 4s, etc. - Avoid polling — Use webhooks to react to events instead of repeatedly querying the API for changes.
- Batch where possible — Some operations can be combined into a single request. For example, fetch all required order fields in one query instead of multiple separate calls.