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

# Pagination

> Cursor-based pagination for list endpoints

List endpoints return paginated results. Most endpoints use **cursor-based pagination** — a stateless, efficient approach that works well even as new records are inserted.

## Cursor-based pagination

Used by: `payment_links`, `checkout_sessions`, `webhook_endpoints`, `events`.

### Request

| Parameter        | Type    | Description                                                            |
| ---------------- | ------- | ---------------------------------------------------------------------- |
| `limit`          | integer | Number of results per page. Min 1, max 100. Default 20.                |
| `starting_after` | string  | Cursor from the previous page's `nextCursor`. Omit for the first page. |

### Response

```json theme={null}
{
  "data": [...],
  "hasMore": true,
  "nextCursor": "cs_01HQXYZ..."
}
```

| Field        | Description                                                                             |
| ------------ | --------------------------------------------------------------------------------------- |
| `data`       | Array of objects for this page                                                          |
| `hasMore`    | `true` if there are more results after this page                                        |
| `nextCursor` | Pass this as `starting_after` to fetch the next page. `null` when `hasMore` is `false`. |

### Iterating all pages

```ts theme={null}
let cursor: string | undefined;

do {
  const page = await client.paymentLinks.list({
    limit: 100,
    starting_after: cursor,
  });

  for (const link of page.data) {
    // process link
  }

  cursor = page.nextCursor ?? undefined;
} while (cursor);
```

## Offset-based pagination

Used by: `customers` (legacy).

### Request

| Parameter | Type    | Description                        |
| --------- | ------- | ---------------------------------- |
| `limit`   | integer | Results per page. Default 20.      |
| `page`    | integer | Page number, 1-indexed. Default 1. |
| `email`   | string  | Filter by email address.           |

### Response

```json theme={null}
{
  "object": "list",
  "data": [...],
  "total": 142,
  "page": 1,
  "limit": 20
}
```
