Pagination
How to paginate through API results
The Lirium API uses cursor-based pagination for resource collections.
Pagination Parameters
| Parameter | Description |
|---|---|
starting_after | Return resources listed after the specified cursor value |
ending_before | Return resources listed before the specified cursor value |
limit | Maximum number of results to return (page size) |
Note:
starting_afterandending_beforeare mutually exclusive. Only one may be used per request.
Response Format
All paginated responses include a pagination object alongside the collection of results. The collection is not returned under a generic data key — it is named after the resource for each endpoint (e.g. orders for order search, customers for customer search, events for webhook event search, partner_orders for partner order search):
{
"orders": [
...
],
"pagination": {
"ending_before": "20210109013316841679",
"starting_after": "20210109013316841679",
"limit": 10
}
}Navigation
- Use
starting_afterfrom the response to navigate to the next page - Use
ending_beforefrom the response to navigate to the previous page
Empty Results
When there are no results, both starting_after and ending_before will be null.
To avoid losing your cursor position:
- If using
starting_afterand you receive an empty response, there is no next page - If using
ending_beforeand you receive an empty response, there is no previous page
Updated 9 days ago
Did this page help you?
