> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trio.com.br/llms.txt
> Use this file to discover all available pages before exploring further.

# Pagination

> How V2 list endpoints paginate with before and after cursors, limit and has_more.

List endpoints return one page at a time and use cursor-based pagination: instead of numbered pages, each page carries an opaque pointer (a cursor) to the item where the next or previous page starts. This lets you walk large data sets without duplicating or missing results, and keeps the API fast and stable.

## How it works

Every paginated response carries a `metadata` object with two cursors and one flag:

* `after`: points to the next page; `null` on the last page.
* `before`: points to the previous page; `null` on the first page.
* `has_more`: whether a next page exists.

Pass `after` or `before` as a query parameter of the next request to move forward or backward. They are mutually exclusive: send only one of them per request.

Endpoints that accept a `limit` query parameter return 50 records per page by default and at most 100.

Document listings are also bounded in time: `GET /v2/documents/in`, `GET /v2/documents/out` and the refund listings require `from_datetime` and `to_datetime`, so a page is always taken from the period you ask for.

## Example

All examples use the sandbox base URL `https://api.sandbox.trio.com.br`. The `metadata` of a paginated response looks like this:

```json theme={null}
{
  "data": [],
  "metadata": {
    "before": null,
    "after": "g3QAAAACZAACaWRt...",
    "has_more": true
  }
}
```

To fetch the next page, repeat the request with the `after` cursor:

```bash theme={null}
curl "https://api.sandbox.trio.com.br/v2/documents/in?from_datetime=2026-10-01T00:00:00Z&to_datetime=2026-10-31T23:59:59Z&after=g3QAAAACZAACaWRt..." \
  -H "Content-Type: application/json" \
  -u {client_id}:{client_secret}
```

> [!NOTE]
>
> **Coming from V1?** V1 named the flag `has_next`. On V2 it is `has_more`.

## Next steps

* [Date and time](https://docs.trio.com.br/v2/developers/date-and-time.md): the format of `from_datetime` and `to_datetime`.
* [List receivables](https://docs.trio.com.br/v2/api-reference/banking-api/documents/receivables/list-receivables.md): a paginated endpoint in the API reference.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.