Skip to main content

Pagination

The Flexprice API uses offset-based pagination for endpoints that list resources, such as the List Customers endpoint. This lets you load resources incrementally without transferring large amounts of data in a single request. Use the limit and offset query parameters to control how many items are returned and where to start in the result set.

Paginated API responses

List endpoints return a standardized format with the requested items in an items array and pagination metadata in a pagination object. The response format is:
{
    "items": [
       ...
    ],
    "pagination": {
        "limit": 20,
        "offset": 0,
        "total": 150
    }
}
Response fields:
  • limit: Maximum number of items per page (default: 20, maximum: 1000)
  • offset: Starting position in the result set (default: 0)
  • total: Total number of items available across all pages
Fetching the next page: To get the next page, increment offset by limit. For example:
  • First page: limit=20&offset=0 returns items 1-20
  • Second page: limit=20&offset=20 returns items 21-40
  • Third page: limit=20&offset=40 returns items 41-60
Sorting: By default, resources are sorted by created_at in descending order (newest first). Use the sort and order query parameters to change the sorting behavior.

Limits

The default page size is 20 items. You can request up to 1000 items per page using the limit query parameter.