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
}
FieldWhat it tells you
dataThe records on this page.
limitThe most records this page can hold.
offsetHow many records come before this page.
returnedCountHow many records are on this page.
totalCountHow many records match in total.
hasMoretrue 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


Did this page help you?