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 thelimit and offset query parameters to control how many items are returned and where to start in the result set. For the first request, you typically use offset=0. The API then returns an updated offset in the response that you can reuse directly for the next page.
Paginated API responses
List endpoints return a standardized format with the requested items in anitems array and pagination metadata in a pagination object.
The response format is:
limit: Maximum Number of items returned in this page (default: 50).offset: The offset you should use when requesting the next page. For the first request, you typically passoffset=0; the API returnsoffset = request_offset + limitin the response.total: Total number of items in the database that match your query, not just the items in the current response.
offset value returned in the previous response instead of computing it yourself. For example:
- First request:
limit=50&offset=0returns items 1-50 and apagination.offsetvalue of50. - Second request:
limit=50&offset=50(using the previouspagination.offset) returns items 51-100 and apagination.offsetvalue of100. - Third request:
limit=50&offset=100returns items 101-150, and so on.
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 50 items. You can request up to 1000 items per page using thelimit query parameter.
