Docs / Pagination
Pagination
List endpoints use cursor pagination, newest items first.
How it works#
| Parameter | Description |
|---|---|
limit | Items per page, 1–200. Default 50. |
cursor | The next_cursor value from the previous page (an ISO timestamp). Omit it for the first page. |
Most list endpoints return { "data": [...], "next_cursor": "…" | null }. When next_cursor is null you have reached the last page. GET /customers pages by the customer's last order date instead of the creation date.
Orders response#
GET /orders returns the cursor inside a pagination object:
GET /orders
{
"data": [
"…"
],
"pagination": {
"limit": 50,
"has_more": true,
"next_cursor": "2026-11-12T08:41:02.118Z"
}
}Loop through all pages#
async function all(path) {
const items = [];
let cursor = null;
do {
const url = new URL("https://api.ecomone.shop/api/public/v1" + path);
url.searchParams.set("limit", "200");
if (cursor) url.searchParams.set("cursor", cursor);
const res = await fetch(url, { headers: { "X-Api-Key": KEY, "X-Api-Secret": SECRET } });
const body = await res.json();
items.push(...body.data);
cursor = body.next_cursor ?? body.pagination?.next_cursor ?? null;
} while (cursor);
return items;
}def all_items(path):
items, cursor = [], None
while True:
params = {"limit": 200, **({"cursor": cursor} if cursor else {})}
body = requests.get(API + path, params=params, headers=HEADERS).json()
items += body["data"]
cursor = body.get("next_cursor") or (body.get("pagination") or {}).get("next_cursor")
if not cursor:
return itemsi
Items that share exactly the same timestamp at a page boundary can be skipped. For complete exports, re-read the last second of each page or de-duplicate by id.