Learn how to paginate through Finix's APIs.
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.
To use cursor-based pagination:
- Include the version header:
Finix-Version: 2022-02-01 - Specify the number of items using the
limitparameter - Use the returned
next_cursorfor subsequent requests
curl "https://finix.sandbox-payments-api.com/transfers?limit=10" \
-H "Finix-Version: 2022-02-01" \
-u USsRhsHYZGBPnQw8CByJyEQW:8a14c2f9-d94b-4c72-8f5c-a62908e5b30eIn 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"
}
}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-a62908e5b30eTo 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-a62908e5b30eWhen next_cursor is null, there are no more results available.
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-a62908e5b30eTo 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-a62908e5b30eFor available filters, consult the API documentation for each endpoint's specific supported filters.