Skip to Content
Core ConceptsPagination

Pagination

All list endpoints return paginated results using offset-based pagination.

Query parameters

ParameterTypeDefaultDescription
pagenumber1Page number (1-indexed)
limitnumber20Items per page (max 100)
sortBystringvariesField to sort by
sortOrderstringDESCASC 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": [] }
FieldTypeDescription
totalnumberTotal items across all pages
pagenumberCurrent page number
pageSizenumberItems per page
totalPagesnumberTotal number of pages
hasNextbooleanWhether a next page exists
hasPreviousbooleanWhether a previous page exists

REST example

bash
curl "https://gateway.useyona.com/i/v1/invoices?page=2&limit=10&sortBy=createdAt&sortOrder=DESC" \
  -H "Authorization: Bearer sk_test_your_key_here"

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