# Pagination

Every list endpoint returns its results one page at a time, sorted by `id`
in descending order. A page holds 10 results by default. Set `limit` to
get anywhere from 1 to 100.

To get the next page, send the `next_cursor` from the response back as
`cursor`. When `has_more` is `false`, you're on the last page and
`next_cursor` is `null`.

## Query parameters

- `limit` (integer): Number of results per page. Default: `10`. Min 1. Max 100.
- `cursor` (string): To get the next page, pass the `next_cursor` from the previous response.

## The list object

- `data` (array of client objects): The results on this page.
- `has_more` (boolean): Whether there are more results after this page.
- `next_cursor` (string or null): Pass it as `cursor` to get the next page. `null` when there are no more results.

### Example request

```bash
curl -G https://api.tallymark.com/clients \
  -H "Authorization: Bearer $TALLYMARK_API_KEY" \
  -d limit=10 \
  -d cursor=$NEXT_CURSOR
```

### Example response

```json
{
  "data": [
    {
      "id": "0abcDEF1234567890xyzAB",
      "name": "Jane Doe",
      "emails": [
        "jane@example.com"
      ],
      "address": "1 Main St",
      "currency": "usd",
      "language": "en",
      "default_payment_method_id": "0abcDEF1234567890xyzAB",
      "payment_methods": [
        {
          "id": "0abcDEF1234567890xyzAB",
          "type": "card",
          "brand": "visa",
          "last_four": "4242",
          "exp_month": 12,
          "exp_year": 2030,
          "is_default": true,
          "created_at": "2024-06-15T12:00:00.000000Z",
          "updated_at": "2024-06-15T12:00:00.000000Z"
        }
      ],
      "created_at": "2024-06-15T12:00:00.000000Z",
      "updated_at": "2024-06-15T12:00:00.000000Z",
      "is_deleted": false
    }
  ],
  "has_more": false,
  "next_cursor": null
}
```
