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

# Pagination

> How to page through list endpoints, with optional date-range filtering.

List endpoints that can return large result sets are **paginated**. These are the `POST` variants of the list routes — you send the paging parameters in the request body, and the response comes back wrapped in a page envelope.

<Note>
  Each list resource has two forms: a simple **`GET`** that returns results directly, and a **`POST`** that accepts pagination (and, for most, an optional date-range filter). An **empty `POST` body is valid** — it returns the first page using the defaults, so the `POST` form behaves like its `GET` counterpart when you don't pass anything.
</Note>

## Paginated endpoints

Most accept an optional date-range filter:

* `POST /ramp/orders`
* `POST /ramp/customer/{customer_id}/orders`
* `POST /ramp/bank-accounts`
* `POST /ramp/customer/{customer_id}/bank-accounts`
* `POST /ramp/customers`
* `POST /ramp/wallets`
* `POST /ramp/customer/{customer_id}/wallets`

One takes pagination only (no filter):

* `POST /ramp/webhooks`

Find them under the matching groups in the [API Reference](/api-reference/introduction).

## Request

| Field              | Type              | Notes                                                                              |
| ------------------ | ----------------- | ---------------------------------------------------------------------------------- |
| `pageNumber`       | integer           | Which page to return. **Zero-based** (first page is `0`). Defaults to `0`.         |
| `pageSize`         | integer           | Items per page. Defaults to `30`, **maximum `100`**.                               |
| `filters`          | object \| null    | Optional. Omit it (or send an empty body) to return everything from page 0.        |
| `filters.fromDate` | string (ISO 8601) | **Required when `filters` is present.** Returns items created **after** this time. |
| `filters.toDate`   | string (ISO 8601) | Optional upper bound on the creation time.                                         |

```bash theme={null}
curl -X POST https://api.sand.etherfuse.com/ramp/orders \
  -H "Authorization: <your_api_key>" \
  -H "Content-Type: application/json" \
  -d '{
    "pageNumber": 0,
    "pageSize": 30,
    "filters": {
      "fromDate": "2026-01-01T00:00:00Z",
      "toDate": "2026-06-01T00:00:00Z"
    }
  }'
```

<Note>
  **Limits & defaults**

  * `pageSize` defaults to **30** and is capped at **100**. Requesting more returns `400` (`You can only request 100 items at a time`); a `pageSize` of `0` returns `400` (`Page size must be greater than 0`).
  * `pageNumber` defaults to **0**.
  * `filters` is optional. `POST /ramp/webhooks` ignores filters entirely (pagination only).
  * A malformed JSON body returns `400` with a JSON `{ "error": … }` describing the parse failure; an empty body uses the defaults.
</Note>

## Response

Results come back in a page envelope:

| Field        | Type           | Description                                        |
| ------------ | -------------- | -------------------------------------------------- |
| `items`      | array          | The items on this page.                            |
| `totalItems` | integer        | Total items across all pages.                      |
| `totalPages` | integer        | Total number of pages.                             |
| `pageNumber` | integer        | Zero-based index of this page.                     |
| `pageSize`   | integer        | Items per page.                                    |
| `next`       | string \| null | URL for the next page, or `null` on the last page. |

```json theme={null}
{
  "items": [ /* ... */ ],
  "totalItems": 42,
  "totalPages": 2,
  "pageNumber": 0,
  "pageSize": 30,
  "next": "https://api.sand.etherfuse.com/ramp/orders?pageNumber=1"
}
```

## Iterating through pages

Start at `pageNumber: 0` and keep requesting until `pageNumber + 1 >= totalPages` (or until `next` is `null`):

```js theme={null}
let page = 0;
const pageSize = 30; // max 100
const all = [];

while (true) {
  const res = await fetch("https://api.sand.etherfuse.com/ramp/orders", {
    method: "POST",
    headers: { Authorization: apiKey, "Content-Type": "application/json" },
    body: JSON.stringify({
      pageNumber: page,
      pageSize,
      filters: { fromDate: "2026-01-01T00:00:00Z" },
    }),
  });
  const { items, totalPages } = await res.json();
  all.push(...items);
  if (page + 1 >= totalPages) break;
  page++;
}
```

<Tip>
  For real-time order tracking, prefer [webhooks](/webhooks) over polling these endpoints — newly created orders can take a moment to appear in list results.
</Tip>
