نقلة
Docs menuPagination, rate limits and errors

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
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'
meta · JSON
{
    "data": [
        "\u2026"
    ],
    "meta": {
        "page": 2,
        "per_page": 50,
        "next_page": 3
    }
}

Reading every page

PHP
<?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);
Node.js
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;
}
Python
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.

HeaderDescription
X-RateLimit-LimitThe limit for this store per minute (120).
X-RateLimit-RemainingRequests left in the current minute.
Retry-AfterSeconds to wait, with 429 only.
429
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.

403 · JSON
{
    "error": "insufficient_scope",
    "message": "The merchant has not granted this permission to the app.",
    "required": "orders.read"
}
HTTPCodeMeaningRetry?
401invalid_tokenThe access token is invalid or expired.No, fix the request
401not_installedThe app is not installed on this store.No, fix the request
402payment_requiredThe app's subscription on this store is unpaid.No, fix the request
403insufficient_scopeThe merchant has not granted this permission to the app.No, fix the request
403app_suspendedThe app or the developer account is suspended.No, fix the request
403store_unavailableThe store is unavailable.Later
404not_foundNot found.No, fix the request
409idempotency_key_reusedThe same Idempotency-Key was used for a different request.No, fix the request
400idempotency_key_requiredSend an Idempotency-Key header (8 to 80 characters).No, fix the request
422invalid_requestThe request is not valid.No, fix the request
422invalid_carrierUnknown carrier.No, fix the request
429rate_limitedThe 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.

Authentication errors

Version v1.0.0 Changelog Service status openapi-v1.json Support