Pagination

You don't want 400,000 items all at once? Paginate!

All our Building Blocks have support for bulk fetches via “list” API methods, e.g. you can list Orders, Users, Payments, Subscriptions, etc. They all share a common structure, taking at least two parameters: size and page.

We use pagination based on a page size and current page. With these parameters, you can retrieve the data the way you want and display it using your own pagination scheme. The return of a response header contains the total count, e.g.: X-Pagination-Total: 212.

Example request using size and page:

GET /orders?size=10&page=1 HTTP/1.1
Content-Type: application/json
Authorization: Bearer <jwt>
X-Builton-Api-Key: <builton-api-key>
Host: api.builton.dev

Example request using only size.

GET /orders?size=100 HTTP/1.1
Content-Type: application/json
Authorization: Bearer <jwt>
X-Builton-Api-Key: <builton-api-key>
Host: api.builton.dev
X-Pagination-Total: 212