Pagination, rate limits and errors
Lists come in pages, every app has request limits, and every error has a code you can act on.
Pagination
Lists take page and per_page (up to 50). meta returns the next page in meta.next_page, which is null on the last page.
curl 'https://naqllah.com/api/apps/v1/orders?page=2&per_page=50&updated_since=2026-11-01T00:00:00Z' \
-H 'Authorization: Bearer $NAQLLAH_ACCESS_TOKEN'
{
"data": [
"\u2026"
],
"meta": {
"page": 2,
"per_page": 50,
"next_page": 3
}
}
Reading every page
<?php
$page = 1;
do {
$res = naqllah_get('/orders?per_page=50&page=' . $page);
foreach ($res['data'] as $order) {
handle($order);
}
$page = $res['meta']['next_page'];
} while ($page !== null);
let page = 1;
while (page !== null) {
const res = await naqllahGet(`/orders?per_page=50&page=${page}`);
res.data.forEach(handle);
page = res.meta.next_page;
}
page = 1
while page is not None:
res = naqllah_get(f"/orders?per_page=50&page={page}")
for order in res["data"]:
handle(order)
page = res["meta"]["next_page"]
To keep your copy current, read only what changed with updated_since and rely on notifications, instead of reading everything again.
Rate limits
120 requests a minute per store, and 1200 requests a minute for your app across all stores. Over the limit you get 429 with Retry-After.
| Header | Description |
|---|---|
X-RateLimit-Limit | The limit for this store per minute (120). |
X-RateLimit-Remaining | Requests left in the current minute. |
Retry-After | Seconds to wait, with 429 only. |
HTTP/1.1 429 Too Many Requests
Retry-After: 12
X-RateLimit-Limit: 120
X-RateLimit-Remaining: 0
{"error":"rate_limited","message":"The app is over its request limit. Try again shortly."}
Wait the seconds in Retry-After before trying again, and rely on webhooks instead of polling for changes. Repeated requests with an invalid token from one address are also limited.
Errors
Every error comes with an HTTP status and a JSON body: the error code in error and a readable message in message.
{
"error": "insufficient_scope",
"message": "The merchant has not granted this permission to the app.",
"required": "orders.read"
}
| HTTP | Code | Meaning | Retry? |
|---|---|---|---|
| 401 | invalid_token | The access token is invalid or expired. | No, fix the request |
| 401 | not_installed | The app is not installed on this store. | No, fix the request |
| 402 | payment_required | The app's subscription on this store is unpaid. | No, fix the request |
| 403 | insufficient_scope | The merchant has not granted this permission to the app. | No, fix the request |
| 403 | app_suspended | The app or the developer account is suspended. | No, fix the request |
| 403 | store_unavailable | The store is unavailable. | Later |
| 404 | not_found | Not found. | No, fix the request |
| 409 | idempotency_key_reused | The same Idempotency-Key was used for a different request. | No, fix the request |
| 400 | idempotency_key_required | Send an Idempotency-Key header (8 to 80 characters). | No, fix the request |
| 422 | invalid_request | The request is not valid. | No, fix the request |
| 422 | invalid_carrier | Unknown carrier. | No, fix the request |
| 429 | rate_limited | The app is over its request limit. Try again shortly. | Yes, after Retry-After |
A 5xx answer or a network failure may be retried with growing waits. For an action, retry with the same Idempotency-Key.
Version v1.0.0 Changelog Service status openapi-v1.json Support