Pagination

By default, Fintoc paginates 30 elements on each response from a List endpoint, such as the endpoint to List Movements. The API also returns the pagination information using the Link header, following the RFC standard. Beware: the Link header has nothing to do with Fintoc Links. It is just an unfortunate name collision 😕.

For each paginated request, the API returns the pagination information using the Link header. This header contains one or more URLs that direct to different pages.

Pagination v1

Endpoints in the /v1 namespace, such as List Payment Intents, use offset pagination. The Link header in this namespace allows you to navigate to the next, previous, first and last page:

Link: <https://api.fintoc.com/v1/links?page=1>; rel="first",
  <https://api.fintoc.com/v1/links?page=2; rel="next"

The possible rel values are:

NameDescription
nextLink that leads to the next page of the resource
lastLink that leads to the last page of the resource
firstLink that leads to the first page of the resource
prevLink that leads to the previous page of the resource

Pagination in V2

Endpoints in the /v2 namespace, such as List Transfers, use cursor-based pagination. In this namespace, the Link header only allows navigation to the next page in the list:

Link: <https://api.fintoc.com/v2/transfers?starting_after=tr_12334567>; rel="next"

The possible rel values are:

NameDescription
nextLink that leads to the next page of the resource

If Link is empty, it means there are no more pages.

Automatic pagination

Our Python SDK supports automatic pagination. This feature allows you to easily iterate through large lists of resources without having to manually perform the requests to fetch subsequent pages:

from fintoc import Fintoc

client = new Fintoc("your_api_key")

payment_intents = client.payment_intents.all()
for payment_intent in payment_intents:
    # Do something with the payment intent

Other libraries

If you use other languages or don't want to use our SDK, the following libraries parse the Link header so that you don't have to:

LanguageLibrary
Pythonrequests
RubyNitlink
JavaScriptparse-link-header