Pagination
List endpoints in the Orbi Payments Gateway API use page-based pagination. Pagination allows you to retrieve large result sets in smaller, predictable chunks.
In addition to pagination, list endpoints support sorting by creation time.
Request parameters
Use the following query parameters when listing resources:
page(integer, optional) — The page number to retrieve. Defaults to1.limit(integer, optional) — The maximum number of items returned per page. Defaults to10. Must be between1and100.sort(string, optional) — Sort order by creation date (created_at). Defaults todesc(newest first).asc— Oldest firstdesc— Newest first
Example
curl -X GET "https://sandbox.orbipayments.com/v1/orders?page=1&limit=25&sort=desc" \
-H "x-api-key: ak_sandbox_xxxxx..."Sorting behavior
Results are sorted by the resource creation timestamp (createdAt):
sort=descreturns the newest records firstsort=ascreturns the oldest records first
If sort is not provided, the API defaults to desc.
Response shape
Paginated responses include both the list of items and pagination metadata:
| Field | Type | Description |
|---|---|---|
items | array<T> | Items returned in the current page. |
limit | number | Maximum number of items per page. |
count | number | Number of items returned in the current page. |
total | number | Total number of matching items across all pages. |
page | number | Current page number. |
totalPages | number | Total number of pages available. |
Example response
{
"items": [
{
"id": "ord_123",
"status": "awaiting_payment",
"createdAt": "2025-12-16T02:23:00.000Z"
}
],
"limit": 25,
"count": 1,
"total": 42,
"page": 1,
"totalPages": 2
}Best practices
- Stop iterating when
page >= totalPages. countmay be less thanlimiton the last page.- Prefer
sort=descfor user-facing feeds (newest-first) unless you have a specific reason to process oldest-first.
Example: Fetch all pages (pseudo-code)
let page = 1;
const limit = 100;
while (true) {
const res = await listOrders({ page, limit, sort: "desc" });
for (const item of res.items) {
// process item
}
if (page >= res.totalPages) break;
page += 1;
}Updated 7 months ago
Did this page help you?