Pagination
How paginated results work
When you fetch a collection of resources, you get paginated results. The response contains the record count and the page count, number, and size in the meta attribute and the URLs of the other pages in the links attribute.
{
"data": [...],
"meta": {
"record_count": 140,
"page_count": 14,
"page_number": 1,
"page_size": 10,
"...": "..."
},
"links": {
"first": "https://yourdomain.commercelayer.io/api/skus?page[number]=1&page[size]=10",
"next": "https://yourdomain.commercelayer.io/api/skus?page[number]=2&page[size]=10",
"last": "https://yourdomain.commercelayer.io/api/skus?page[number]=14&page[size]=10"
}
}Example
The following request fetches the SKUs, setting the page number to 3 and the page size to 5:
On success, the API responds with a 200 OK status code, returning the five resource objects listed on the third page (from the 6th object to the 10th), together with the record and page counts and the links to the first, prev, next, and last page.
Last updated