Pagination
Set how many records a list call returns and check whether there are more
List calls return one page of records at a time. Set the page size with limit, then check hasMore to see if more records follow.
limit can be 1 to 250. The default is 25. A value outside that range returns 422.
curl "https://sandbox-api.prioritycommerce.com/v1/businesses?limit=50" \
-H "x-api-key: <your-key>"The Priority Commerce Engine (PCE) returns the records in data, with paging fields next to it:
{
"data": [
{
"id": "bus_8f3a2c",
"externalId": "example-online-goods-001",
"legalName": "Example Online Goods LLC"
}
],
"limit": 50,
"offset": 0,
"returnedCount": 1,
"totalCount": 1,
"hasMore": false
}| Field | What it tells you |
|---|---|
data | The records on this page. |
limit | The most records this page can hold. |
offset | How many records come before this page. |
returnedCount | How many records are on this page. |
totalCount | How many records match in total. |
hasMore | true if more records follow this page. |
To get the next page, skip the records you've already seen with offset. With limit=50, the second page is ?limit=50&offset=50, the third is ?limit=50&offset=100, and so on. Stop when hasMore is false.
To sort a list, see Query parameters.
Next steps
Updated 9 days ago
Did this page help you?