Skip to content

Pagination

Open .md

Lists and filters return one page of records at a time, with a pagination block next to data:

{
"status": 200,
"success": true,
"data": [
{ "id": "V4keXwwxMQyXw7", "name": "Northwind Apparel" }
],
"pagination": {
"count": 50,
"total": 128,
"perPage": 50,
"currentPage": 1,
"totalPages": 3,
"links": {
"next": "https://secure.yoprint.com/v1/api/store/your-team/customer?page=2"
}
}
}
Field Meaning
count Records on this page.
total Records across all pages.
perPage The page size.
currentPage This page’s number, from 1.
totalPages How many pages there are.
links previous and next URLs when they exist. With no other pages, links is an empty array [], not an object, so handle both shapes if your client parses JSON with strict types.

Send page with the page number you want. On a GET list, put it in the query string:

Terminal window
curl "https://secure.yoprint.com/v1/api/store/your-team/customer?page=2" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Accept: application/json" \
-H "X-Yoprint-Decimal-Format: exact-v1"

On a POST filter, put it in the body or the query string, and send the same filters again with each page:

{
"filters": [{ "key": "is_rush", "operator": "eq", "value": true }],
"page": 2
}

A missing, invalid or 0 page number returns page 1.

Loop until currentPage equals totalPages:

let page = 1;
let totalPages = 1;
const records = [];
do {
const response = await fetch(`${base}/customer?page=${page}`, { headers });
const body = await response.json();
records.push(...body.data);
totalPages = body.pagination.totalPages;
page += 1;
} while (page <= totalPages);

Records can be added or changed while you page. For a stable list, sort by a field that doesn’t change, such as when the record was created. See Filtering and sorting.

The page size is controlled by the pagination_per_page setting on the team (50 by default, configurable between 5 and 100). The team owner and members with the Manage Settings permission set it in the team’s settings, or with pagination_per_page:

PUT Update general settings /v1/api/store/{team_slug}/setting/general

Callers cannot set page size per request: a per_page parameter is ignored on standard lists and filters. Read perPage from the pagination block rather than assuming a fixed size.

The job calendar is an exception. It accepts per_page in the query string up to 1,000, and returns 500 by default:

POST List jobs in a date range /v1/api/store/{team_slug}/job/calendar

The task calendar is different. It ignores page and per_page, returns at most 1,200 tasks, and never returns a pagination block:

POST List tasks in a date range /v1/api/store/{team_slug}/work_pipeline/calendar

Some lists return every record at once, with no pagination block. They are lists inside one record, such as an order’s jobs, invoices or shipments:

GET List the jobs of a sales order or quote /v2/api/store/{team_slug}/v2/sales_order/{hash_id}/job

Order search returns at most 30 matches and isn’t paginated. Narrow the search words to find a record that isn’t in the first 30:

GET Search sales orders and quotes /v2/api/store/{team_slug}/search/orders

The v2 filters accept "count_only": true. The answer has the pagination block, with total, and no records.