Pagination
Iterate over list responses using limit with offset, page or a cursor
List endpoints in the RevKeen API use one of three pagination styles, and the style depends on the endpoint. Check the endpoint's reference for its parameters before you write the loop.
| Style | Parameters | Endpoints |
|---|---|---|
| Offset | limit, offset | Invoices, customers, refunds, credit notes, payment links, meters, webhook endpoints, entitlements and storefront products. |
| Page | limit, page | Products and subscriptions. |
| Cursor | limit, starting_after, ending_before | Prices, transactions, events, payment intents, webhook deliveries, and the customer portal's subscriptions and invoices. The usage events of an invoice line item take starting_after only. |
A few list endpoints, such as the lines of a credit note and usage events, take limit only.
Request parameters
| Parameter | Type | Default | Max | Description |
|---|---|---|---|---|
limit | integer | 20 | 100 | Number of items to return. A value outside 1-100 is rejected with 400. |
offset | integer | 0 | — | Offset style: zero-based index of the first item to return. |
page | integer | 1 | — | Page style: the page number, starting at 1. |
starting_after | string | — | — | Cursor style: the id of the last item you received. Returns the items after it. |
ending_before | string | — | — | Cursor style: the id of the first item you received. Returns the items before it. |
Defaults can differ by endpoint; each endpoint's reference lists its own. List endpoints may also expose resource-specific filters (for example status or search).
For prices and transactions, starting_after and ending_before are mutually exclusive: sending both is rejected with 400 parameter_invalid, and a cursor that names no item of yours is rejected with 400 resource_missing.
Response shape
The response shape depends on the API version and the endpoint.
With the current version, 2026-05-01 (the default), the core list endpoints -- including customers, invoices, products, prices, subscriptions, refunds, transactions, and webhook endpoints -- return a list object:
{
"object": "list",
"data": [
{ "id": "3f6c2a1e-8b4d-4c2a-9f1e-2d7b6a5c4e3f", "name": "Acme Clinic" }
],
"has_more": true,
"url": "/v2/customers"
}| Field | Type | Description |
|---|---|---|
object | string | Always list. |
data | array | Current page of items. |
has_more | boolean | Whether another page may exist. It can be true when the current page is exactly full, so the next request may return an empty page. |
url | string | The list endpoint path. |
Other list endpoints, and all list endpoints when you pin version 2026-01-15, return data with a pagination block:
{
"data": [ { "id": "3f6c2a1e-8b4d-4c2a-9f1e-2d7b6a5c4e3f" } ],
"pagination": { "limit": 20, "offset": 0, "total": 1 }
}Check the endpoint's reference for its exact shape.
Iteration pattern
Offset style. Advance offset by your limit and stop when a page returns fewer items than limit. This works with both response shapes. Advance by the page size, not by data.length.
Page style. Increase page by 1 and stop when a page returns fewer items than limit.
Cursor style. Pass the id of the last item in data as starting_after, and stop when has_more is false.
# Page 1
curl "https://staging-api.revkeen.com/v2/transactions?limit=100" \
-H "x-api-key: $REVKEEN_API_KEY"
# Page 2: use the id of the last item from page 1
curl "https://staging-api.revkeen.com/v2/transactions?limit=100&starting_after=$LAST_ID" \
-H "x-api-key: $REVKEEN_API_KEY"The examples below use the offset style.
# Page 1
curl "https://staging-api.revkeen.com/v2/customers?limit=100&offset=0" \
-H "x-api-key: $REVKEEN_API_KEY"
# Page 2
curl "https://staging-api.revkeen.com/v2/customers?limit=100&offset=100" \
-H "x-api-key: $REVKEEN_API_KEY"The Go module has a module-path limitation; check it before installing.
Choosing a page size
- The default (
limit=20) suits interactive UIs. limit=100is the right choice for batch workloads and exports.- For end-user-facing lists, page from the server rather than fetching all pages and slicing client-side -- latency and memory both scale linearly.
Stability across pages
Offset and page pagination are not snapshots. If items are created or deleted while you are iterating, an item can be skipped or appear twice. Sort order can differ by endpoint; see each endpoint's reference. De-duplicate by id when you need an exact set.
See also
Errors
Handle 400 invalid_request_error for a malformed limit, offset, page or cursor.
Idempotency
Mutations are idempotent; reads are safe to repeat.
API Reference
Per-endpoint parameter reference.
Owner: david · Reviewed 12 Oct 2026 · Next review 11 Nov 2026