# Pagination
Pagination allows you to subdivide an API Response of n
objects into subsets of less than n
objects.
You can then navigate from subset to subset and browse the whole object collection in a more user friendly way.
Depending on the endpoints, two methods of pagination may be used:
- Offset-based pagination
- Cursor-based pagination
# Offset-based pagination
# Supported endpoints
All endpoints using the GET
verb, except:
/heartbeats
/cardreserve
/transactions
/cardtransactions
/operations
/payins
# Key parameters
It requires the following parameters to be provided in the request:
pageNumber
sets the page number to retrievepageCount
sets the number of objects per pagesortBy
sets the attribute used for sorting (e.g.,creationDate
,modificationDate
, etc.)sortOrder
sets the sorting order, it can be inDESC
(Descending) orASC
(Ascending) order.
# Examples
Get the 1st page, with 30 objects per page, sorted by ascending creationDate
.
Outputs an array of 30
objects (or less, in the last page).
Get the 5th page, with 50 objects per page, sorted by descending amount
.
Outputs an array of 50
objects (or less, in the last page).
# Cursor-based pagination
The cursor-based pagination works by returning a pointer to a specific item in the dataset.
Navigating the datasets can be done by specifying one of the cursors provided in the response in your next request.
# Supported endpoints
Currently, the following endpoints support cursor-based navigation:
/operations
/payins
/payinrefunds
/scheduledPayment
API Response supporting cursors will include the following object:
If there is no adjacent operation, the next
attribute will be valued to null
. The current
attribute can be cached and used later to only retrieve new operations.
# Key parameters
cursor
is the desired starting position for your next subset of objects.
The size of the subset (number of objects returned) varies depending on each endpoint.