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:
- Call the endpoint without
lastId. - If the response's
hasMoreistrue, call the endpoint again with thelastIdquery parameter set to the response'slastId. Send the same filters on every call. - Repeat until
hasMoreisfalse.
For example, a page from List Merchants looks like this:
{
"hasMore": true,
"lastId": "{merchantId}",
"merchants": [
{
"id": "{merchantId}"
}
]
}The response is abbreviated.
| Field | Description |
|---|---|
hasMore | true when more results exist after this page. |
lastId | When 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 array | The 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
hasMoreistrue. Keep paging untilhasMoreisfalse.
Paginated endpoints
| Endpoint | Results array | Items per page |
|---|---|---|
| List Merchants | merchants | Set with pageSize, from 1 to 50. Default 10. |
| List locations for a merchant | locations | Set with pageSize, from 1 to 50. Default 10. |
| List the form's merchant's locations | locations | Set with pageSize, from 1 to 50. Default 10. |
| List Transactions | transactions | Up to 50. |
| List Payment Method Tokens | data | Up to 50. |
| Get Loans | loans | Up to 10. |
| Get merchant SAQ list | data | Up 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.
Updated 31 minutes ago
Did this page help you?
