Pagination
All endpoints, which return a listing, allow pagination by supporting two query parameters on the requests.
| Parameter name | Description | Default value |
|---|---|---|
page | Identifies the requested page. First page has number 1 | 1 |
size | Defines the number of entries to show on each page. Maximum value is 100 | 10 |
| Format | GET <url>?page=$pageNumber&size=$pageSize |
| Example | GET /stores?page=2&size=25 |
| Explanation | Would return the 26th until the 50th store entries. |
Pagination information in response
On all responses to any requests for a listing there will be two headers, which provide information about the pagination.
| Header | Description |
|---|---|
| Total number of entries available |
| Multiple links providing information about how to navigate through the entries. Links are separated by a comma ',' Format is compliant with RFC 8288 Web Linking If the page size is larger than the total number of entries, then this header will be empty. |
Example
Given there is a merchant with 67 stores, when the merchant sends the
following request: /stores?page=3&size=10 then the response will
contain the following headers:
X-Total-Count: 67
Link: <baseUrl/stores?size=10&page=2>; rel="prev",<baseUrl/stores?size=1&page=4>; rel="next",<baseUrl/stores?size=1&page=1>; rel="first",<baseUrl/stores?size=1&page=7>; rel="last"