Pagination

Page through list results with hasMore and lastId.

List endpoints return results one page at a time. Each response says whether more results exist and gives you the cursor for the next page.


Cursor pagination

To get every result from a list endpoint, follow these steps:

  1. Call the endpoint without lastId.
  2. If the response's hasMore is true, call the endpoint again with the lastId query parameter set to the response's lastId. Send the same filters on every call.
  3. Repeat until hasMore is false.

For example, a page from List Merchants looks like this:

{
  "hasMore": true,
  "lastId": "{merchantId}",
  "merchants": [
    {
      "id": "{merchantId}"
    }
  ]
}

The response is abbreviated.

FieldDescription
hasMoretrue when more results exist after this page.
lastIdWhen hasMore is true, the cursor for the next page. Pass it back unchanged as the lastId query parameter. When hasMore is false, ignore it: depending on the endpoint, it's an empty string, null, an ID, or absent.
Results arrayThe items on this page. Its name depends on the endpoint. See the Paginated endpoints section.
📘

Rely on hasMore, not the page size

A page can hold fewer items than the page size, or none, while hasMore is true. Keep paging until hasMore is false.


Paginated endpoints

EndpointResults arrayItems per page
List MerchantsmerchantsSet with pageSize, from 1 to 50. Default 10.
List locations for a merchantlocationsSet with pageSize, from 1 to 50. Default 10.
List the form's merchant's locationslocationsSet with pageSize, from 1 to 50. Default 10.
List TransactionstransactionsUp to 50.
List Payment Method TokensdataUp to 50.
Get LoansloansUp to 10.
Get merchant SAQ listdataUp to 10.

A pageSize outside 1 to 50 returns 400 with the message pageSize must be a number between 1 and 50. To learn about error responses, see Errors.


Did this page help you?