Limits and locations
Usage quota
Each location has its own monthly allowance of API calls, whether you use an API key or an OAuth token. Only calls answered with a 2xx status count; calls that fail authentication or authorization, or answer a 4xx or 5xx, are not counted (a write that reports its failure inside a 200 answer is counted). A location without the Public API app has a small free allowance, and the app raises it. Both numbers are set per environment, and the app's plan determines yours. Check your plan, or ask support, for the exact figures. GET /api/checkUsageLimit lists what each location has left, and is not counted itself.
A successful call is charged to every location it covers, one call each:
- An ordinary operation covers the credential's own location.
- A cross-location operation (one that takes
locationId) covers the location you name, so that location is charged, not the credential's. - A multi-location operation (for example the product and order imports, the reports and
GET /api/Customers/ByCompany) called with a parent company's credential covers the parent and every one of its locations, so each of them is charged one call, unless you narrow it. To read, and be charged for, specific locations only, sendrestrictByLocations(a list of location IDs); without it, alocationIdquery parameter (or, on a POST, aSelectedCompanieslist in the body) narrows the call the same way. Or use that location's own credential.
Corporate pooling. When the parent company has the Public API app and its account is set to use corporate API calls, calls made with the parent's credential draw on the parent's allowance alone, one call for each location covered, and the locations' own allowances are untouched. Calls made with a location's own credential are always charged to that location. Ask support to turn corporate pooling on or off.
Every call charged to an allowance carries three headers: X-Api-Calls-Limit (the month's allowance), X-Api-Calls-Remaining (what is left after this call; a call that does not answer 2xx is not charged) and X-Api-Calls-Reset (when the allowance resets, the start of the next month in UTC). When a call covers several locations, they describe the one with the fewest calls left. Watch X-Api-Calls-Remaining so your integration slows down before it runs out: the whole month's allowance can be used in a few days.
When an allowance is used up, calls that would be charged to it are refused with a 403 naming the location and the date the allowance resets, until the month rolls over or the allowance is raised. The store is emailed when its integrations have used 80% of the month's calls, and again when they have used all of them.
Rate limits
Separately from the monthly quota, some operations limit how fast they can be called, so one integration cannot slow a store down. A call refused by one of these limits gets 429 Too Many Requests. A 429 is never an access problem: your credential and permissions are unchanged, and the refused call is not charged to your allowance.
- Heavy reads (the operations marked rate limited in the reference, such as the catalog pull and the storefront catalog feeds): 30 calls per minute for each company. There is no daily cap on these calls; your monthly quota is the only limit on the total.
- One request at a time. Bulk reads (the catalog, customer, dictionary and tickets pulls, the storefront feeds, and the reporting API's whole-result reports) serve one request per account at a time. Send the next page after the previous response arrives, not in parallel.
- Full pulls per day. A pull that starts from nothing (an empty cursor, or page 0 with no version) is limited per store per day. Pulling what changed, with a cursor or a version, is not.
The full-pull limits are counted in UTC and reset at 00:00 UTC, whatever the store's time zone. Every 429 carries a Retry-After header with the number of seconds to wait, and a message naming the limit that was reached. Wait at least that long; a call sent sooner is refused the same way. To stay under the limits, pull only what changed and subscribe to webhooks instead of polling.
Catalog: pull only what changed
Do not read a location's whole catalog (GET /api/getProductServicesByCompany/0?cursor=) on every run. Read it in full once, read until hasMore is false, and save the last nextCursor. On every later run, send that saved value as cursor: you receive only the products changed since then, deleted ones included.
A pull from an empty cursor is a full pull, and full pulls are limited to 2 per location per day. A pull from a saved cursor is not limited that way, as long as it is a nextCursor (or version) this API returned for that location in the last 3 days; any other value, or an older one, counts as a full pull. Save the cursor only after you have saved the products it came with, so a failed run resumes where it stopped. For changes as they happen, subscribe to the item, price and inventory webhooks.
Token endpoint limits
- Each IP address may make 120 token requests per minute.
- Ten failed attempts against one client ID lock that credential for 15 minutes. A successful request clears the count, so the owner's integration is not affected by someone else guessing.
Cache the access token and reuse it until it is close to expiring.
Locations
A company can have several locations. Most operations act on the location the credential belongs to. Some can span locations:
- Multi-location operations return data for every location the credential can reach. Pass
restrictByLocations(a list of location IDs separated by commas or semicolons) to narrow the result; without it, alocationIdquery parameter (or a POST body'sSelectedCompanieslist) narrows it. Only locations the credential can reach are ever included. - Cross-location operations take a
locationId, and the credential must be allowed to act for that location. - Resellers can act as one of their merchants. With an API key, append
:LOCATION_IDto the key. With OAuth, passlocation=LOCATION_IDwhen you request the token, and the token is issued for that merchant.
Paging
List operations that return many rows are paged. They take a page number in the path and return {"data": [...], "pages": N, "version": V}, with 50 rows per page. Pass the version from your last full sync to receive only what changed since.
To reconcile a whole catalogue, use the catalog pull's cursor mode (GET /api/getProductServicesByCompany/0?cursor=), not page after page of another list. To keep an external copy current between pulls, subscribe to webhooks and fetch individual records when they change.