Pagination
All list endpoints return paginated results using offset-based pagination.
Query parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
page | number | 1 | Page number (1-indexed) |
limit | number | 20 | Items per page (max 100) |
sortBy | string | varies | Field to sort by |
sortOrder | string | DESC | ASC or DESC |
Response format
Paginated responses include a pagination object in the meta envelope:
{
"meta": {
"statusCode": 200,
"success": true,
"errors": [],
"message": "Success",
"pagination": {
"total": 150,
"page": 1,
"pageSize": 20,
"totalPages": 8,
"hasNext": true,
"hasPrevious": false
},
"timestamp": "2026-04-30T10:00:00.000Z"
},
"data": []
}| Field | Type | Description |
|---|---|---|
total | number | Total items across all pages |
page | number | Current page number |
pageSize | number | Items per page |
totalPages | number | Total number of pages |
hasNext | boolean | Whether a next page exists |
hasPrevious | boolean | Whether a previous page exists |
REST example
SDK example
const page1 = await client.invoices.list({ page: 1, limit: 10 });
if (page1.meta.pagination?.hasNext) {
const page2 = await client.invoices.list({ page: 2, limit: 10 });
}Iterating all pages
async function getAllInvoices() {
const invoices = [];
let page = 1;
let hasNext = true;
while (hasNext) {
const response = await client.invoices.list({ page, limit: 100 });
invoices.push(...response.data);
hasNext = response.meta.pagination?.hasNext ?? false;
page++;
}
return invoices;
}Endpoints that support pagination
All list endpoints across the API use the same pagination format: invoices, sellers, buyers, webhooks, webhook deliveries, API keys, users, invitations, roles, payment history, credit transactions, and subscription history.
Last updated on