Transfer Pagination
In this guide, we will explore how to handle paginated responses when fetching transfer records via the Supesa API. By default, all transfer-related responses limit results to ten items. You can, however, request up to 100 items by including a limit parameter in your request. If you use any of the official Supesa API client libraries, the pagination is seamlessly managed for you.
When the API returns a list of transfers, regardless of the quantity, pagination is always supported. For paginated responses, transfers are nested under a data attribute. The has_more attribute will let you know if there are more pages of results available. To navigate between pages, use the starting_after and ending_before query parameters.
Example using cursors
In this example, we aim to fetch the page following the transfer with the id s4WycXedwhQrEFuM. The response provides us with three transfers, and the has_more attribute indicates that we've fetched the final set of results.
- Name
starting_after- Type
- string
- Description
The ID of the last transfer on your current page when you wish to retrieve the subsequent page.
- Name
ending_before- Type
- string
- Description
The ID of the first transfer on your current page if you aim to access the preceding page.
- Name
limit- Type
- integer
- Description
Specify the maximum number of transfers to return.
Manual pagination using cURL
curl -G https://api.supesa.io/v1/transfers \
-H "content-type: application/json" \
-d starting_after="s4WycXedwhQrEFuM" \
-d limit=10
Paginated response
{
"has_more": false,
"data": [
{
"id": "WAz8eIbvDR60rouK",
"amount": 150.00,
"currency": "NGN",
// ...
},
{
"id": "hSIhXBhNe8X1d8Et",
"amount": 250.00,
"currency": "GHS",
// ...
},
{
"id": "fbwYwpi9C2ybt6Yb",
"amount": 350.00,
"currency": "KES",
// ...
}
]
}