Pagination
Read long lists one page at a time and know when you have reached the end.
Long lists arrive in pages, not one huge response. Use limit for the number of items per page
and page for the page number. Standardized v2 operations default to 15 items
per page and reject limits above 100 with a 422 response.
Some operations document a different default or maximum. For example, variant serial inventory defaults to 50 items and accepts up to 250. The limits shown on the endpoint take precedence over the general defaults here.
Most operations accept limit and page as query parameters. Order and line
item search operations accept the same fields inside a pagination object in
the JSON request body.
The response calls the page size meta.per_page. Send limit in the request,
not per_page.
Follow links.next to get the next page. When it is null, you have reached
the end of the list.
When an operation supports pagination=false, the response omits pagination
links and metadata and returns a single data array. This does not request an
unlimited result set: standardized operations still return at most 100 items.
Example using invoices
In this example, we request page 10 with a limit of 20 results per
page. The response returns twenty invoices and the last_page attribute
tells us we have not yet reached the end of the result set. The abbreviated
response below shows only three of those twenty invoices and selected fields.
- Name
limitinteger- Description
The maximum number of items to return on one page.
- Name
pageinteger- Description
The page to retrieve, starting at
1.
Set SELLAPP_API_BASE_URL, SELLAPP_API_KEY, and SELLAPP_STORE as shown
in the quickstart.
curl --request GET \
--url "${SELLAPP_API_BASE_URL}/v2/invoices?page=10&limit=20" \
--header "Authorization: Bearer ${SELLAPP_API_KEY}" \
--header "X-STORE: ${SELLAPP_STORE}" \
--header 'Content-Type: application/json'{
"data": [
{
"id": 181
},
{
"id": 182
},
{
"id": 183
}
],
"links": {
"first": "https://sell.app/api/v2/invoices?page=1&limit=20",
"last": "https://sell.app/api/v2/invoices?page=42&limit=20",
"prev": "https://sell.app/api/v2/invoices?page=9&limit=20",
"next": "https://sell.app/api/v2/invoices?page=11&limit=20"
},
"meta": {
"current_page": 10,
"from": 181,
"last_page": 42,
"links": [
{
"url": "https://sell.app/api/v2/invoices?page=9&limit=20",
"label": "« Previous",
"active": false
},
{
"url": "https://sell.app/api/v2/invoices?page=10&limit=20",
"label": "10",
"active": true
},
{
"url": "https://sell.app/api/v2/invoices?page=11&limit=20",
"label": "Next »",
"active": false
}
],
"path": "https://sell.app/api/v2/invoices",
"per_page": 20,
"to": 200,
"total": 831
}
}