# Pagination

vrtx uses **cursor-based pagination** for all list endpoints.
This ensures stable iteration through large datasets without issues caused by inserts, deletes, or inconsistent page counts.

## <Icon icon="material-outline-question_mark"/> Query Parameters

Every paginated endpoint accepts the following **optional** query parameters:

| Field                | Type               | Description                                                   |
| -------------------- | ------------------ | ------------------------------------------------------------- |
| `cursor`             | string             | The continuation pointer returned from the previous response. |
| `effective_from`     | timestamp / string | Filter results starting from this date.                       |
| `effective_to`       | timestamp / string | Filter results ending on this date.                           |
| `external_reference` | string             | Filter by external reference ID.                              |
| `limit`              | integer            | Maximum results to return in a single response batch.         |

---

### Example Pagination Response

```json
{
  "statusCode": 200,
  "success": true,
  "data": [
    {
      "walletId": "wallet_001",
      "balance": 2000
    },
    {
      "walletId": "wallet_002",
      "balance": 3500
    }
  ],
  "pagination": {
    "nextCursor": "b2Rlcjphc2M6MTIzNDU2",
    "previousCursor": null,
    "limit": 20,
    "hasMore": true
  }
}
```

#### Field Explanation

| Field              | Description                                  |
| ------------------ | -------------------------------------------- |
| `nextCursor`     | Token to retrieve the next batch of results. |
| `previousCursor` | Token to go backward (if supported).         |
| `limit`          | Number of items returned in this batch.      |
| `hasMore`       | Indicates whether additional records remain. |

---


<AccordionGroup>
  <Accordion title="Requesting next Batch">
    To request more results, reuse the same endpoint and pass the `cursor` you received from the previous response.
```curl
curl --request GET \
  --url 'https://api.vrtx.sa/cl/v1/wallets?cursor=b2Rlcjphc2M6MTIzNDU2' \
  --header 'Authorization: Bearer access_token'
```
  </Accordion>
  <Accordion title="Requesting with Limits">
    You can control the batch size using the `limit` parameter.

```curl
curl --request GET \
  --url 'https://api.vrtx.sa/cl/v1/wallets?limit=50' \
  --header 'Authorization: Bearer access_token'
```
  </Accordion>
 
</AccordionGroup>





