> For the complete documentation index, see [llms.txt](https://docs.peakcommerce.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.peakcommerce.com/developers/api-reference/pagination.md).

# Pagination

List endpoints (`GET /api/v1/orders`, `GET /api/v1/subscriptions`, `GET /api/v1/payments`, `GET /api/v1/webhooks`, `GET /api/v1/accounts/{id}/invoices`, `GET /api/v1/accounts/{id}/subscriptions`, `GET /api/v1/accounts/{id}/payment-methods`) return arrays inside the `data` field together with a `nextActions` array.

```json
{
  "data": [ /* items */ ],
  "nextActions": [ /* ... */ ]
}
```

## Current behavior

The Agent API returns the full result set scoped to your tenant in a single response. There is no `limit`/`cursor` query parameter today and no `meta.nextCursor` in the response — list calls are intended for modest catalogs and short operational windows.

If a list endpoint accepts filters (for example, `accountId` on `GET /api/v1/subscriptions`), use them to narrow the result set before paging is needed.

## Recommendations for large tenants

* Use **filters** on list endpoints whenever possible to keep responses focused (e.g. `?status=active`, `?accountId=...`).
* For point-in-time work, fetch a list once and process the array client-side rather than re-fetching frequently.
* For change-detection, prefer [webhooks](/developers/api-reference/webhooks-overview.md) over polling — they push events as soon as they happen.

> **Heads up:** explicit cursor pagination is on the roadmap. When it ships, list endpoints will start accepting `limit`/`cursor` parameters and will return a `meta.nextCursor` field — both additive changes that won't break clients written against today's response shape.

## Ordering

Items are generally returned ordered by `createdAt` descending (newest first). Items with identical timestamps may appear in any order between calls, so don't rely on a strict tiebreaker — use the resource `id` if you need a stable client-side sort.

## Related

* [Errors](/developers/api-reference/errors.md)
* [Rate limits](/developers/api-reference/rate-limits.md)
* [Webhooks](/developers/api-reference/webhooks-overview.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.peakcommerce.com/developers/api-reference/pagination.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
