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

# Pagination

> Page through lists with cursors.

List endpoints return a page of items and a `pagination` object:

```json theme={null}
{
  "items": [ ... ],
  "pagination": {
    "hasNextPage": true,
    "nextPageCursor": "eyJjcmVhdGVkQXQiOi...",
    "hasPreviousPage": false,
    "previousPageCursor": null
  }
}
```

| Parameter | Meaning |
| - | - |
| `pagination[limit]` | Items per page, 1 to 100. The default is 20. |
| `pagination[after]` | The `nextPageCursor` of the previous page, to get the next one. |
| `pagination[before]` | The `previousPageCursor`, to go back a page. |

Keep the same filters and sort for every page of one list. Request pages until `hasNextPage` is `false`.

```bash theme={null}
curl -g "https://api.weticket.io/public/v1/orders?pagination[limit]=100&pagination[after]=eyJjcmVhdGVkQXQiOi..." \
  -H "Authorization: Bearer wt_live_..."
```

Cursors are opaque: don't build or change them yourself. A cursor does not expire, so you can store it
and continue later. A malformed cursor returns `400`. Only use a cursor with the endpoint, filters and sort it came from: the API can't always tell when a cursor belongs to another list. Without a
`sort` parameter, each list has a [default sort](https://developers.weticket.com/guides/filtering-and-sorting.md).

> [!NOTE]
>
> The brackets in parameter names mean something to `curl`, so the examples use `curl -g` (`--globoff`). Most HTTP libraries need nothing special; encode `[` and `]` as `%5B` and `%5D` if yours does.


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