Pagination
All endpoints that return lists of results support server-side pagination. This allows you to retrieve large data sets in manageable chunks.
Request parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
page |
integer | 1 | Page number (1-based) |
page_size |
integer | 100 | Number of items per page |
Example:
Response header
The response includes the Invoicetronic-Total-Count header, which indicates the total number of items matching the query, regardless of pagination.
| Header | Description |
|---|---|
Invoicetronic-Total-Count |
Total number of available items |
The response body only contains the items for the current page.
Example
Request:
Response (headers):
Response (body):
In this example, there are 150 total items. With page_size=20, there are 8 pages (the last one with 10 items).
Calculating total pages
The total number of pages can be calculated as:
Tip
Use Invoicetronic-Total-Count to display navigation information to the user, such as the total number of pages or results. Set page_size to the minimum needed for your use case to reduce response times and resource usage.