Pagination
Learn how to paginate through Finix's APIs.
Overview
Finix's API supports cursor based pagination for listing resources. All api requests should include the Finix-Version: 2022-02-01
header.
Note: All API responses are limited to 100 results per page.
Cursor-Based Pagination
Basic Usage
To use cursor-based pagination:
- Include the version header:
Finix-Version: 2022-02-01
- Specify the number of items using the
limit
parameter - Use the returned
next_cursor
for subsequent requests
curl "https://finix.sandbox-payments-api.com/transfers?limit=10" \
-H "Finix-Version: 2022-02-01" \
-u USsRhsHYZGBPnQw8CByJyEQW:8a14c2f9-d94b-4c72-8f5c-a62908e5b30e
In the response, you will see the limit
defined in the request, as well as the next_cursor
.
{
"_embedded": {
"transfers": [...]
},
"_links": {...},
"page": {
"limit": 10,
"next_cursor": "TRnasXQ5AmjsLnPMwnme7TL4"
}
}
Navigation
Forward Navigation
To get results after next_cursor
, pass in after_cursor: {{next_cursor}}
:
curl "https://finix.sandbox-payments-api.com/transfers?limit=10&after_cursor=TRnasXQ5AmjsLnPMwnme7TL4" \
-H "Finix-Version: 2022-02-01" \
-u USsRhsHYZGBPnQw8CByJyEQW:8a14c2f9-d94b-4c72-8f5c-a62908e5b30e
Backward Navigation
To get results _before _ next_cursor
, pass in before_cursor: {{next_cursor}}
:
curl "https://finix.sandbox-payments-api.com/transfers?limit=10&before_cursor=TRnasXQ5AmjsLnPMwnme7TL4" \
-H "Finix-Version: 2022-02-01" \
-u USsRhsHYZGBPnQw8CByJyEQW:8a14c2f9-d94b-4c72-8f5c-a62908e5b30e
End of Results
When next_cursor
is null
, there are no more results available.
Example: Listing Transfers
Here's a complete example showing how to fetch and page through transfers:
curl "https://finix.sandbox-payments-api.com/transfers?limit=3" \
-H "Content-Type: application/json" \
-H 'Finix-Version: 2022-02-01' \
-u USsRhsHYZGBPnQw8CByJyEQW:8a14c2f9-d94b-4c72-8f5c-a62908e5b30e
{
"_embedded": {
"transfers": [
{
"id": "TRtLhSEAHak7isKjZu9x7Gjh",
...
}
},
{
"id": "TR2fXt8wHuHxjVPZ1MvrnSU8",
...
},
{
"id": "TRuzk139AayVqe1K9eyz18q9",
...
}
]
},
"_links": {...},
"page": {
"limit": 3,
"next_cursor": "TRuzk139AayVqe1K9eyz18q9"
}
}
To get the next page:
curl "https://finix.sandbox-payments-api.com/transfers?limit=3&after_cursor=TRuzk139AayVqe1K9eyz18q9" \
-H "Content-Type: application/json" \
-H 'Finix-Version: 2022-02-01' \
-u USsRhsHYZGBPnQw8CByJyEQW:8a14c2f9-d94b-4c72-8f5c-a62908e5b30e
To get the previous page:
curl "https://finix.sandbox-payments-api.com/transfers?limit=3&before_cursor=TRuzk139AayVqe1K9eyz18q9" \
-H "Content-Type: application/json" \
-H 'Finix-Version: 2022-02-01' \
-u USsRhsHYZGBPnQw8CByJyEQW:8a14c2f9-d94b-4c72-8f5c-a62908e5b30e
Filter Support
For available filters, consult the API documentation for each endpoint's specific supported filters.