Fundamentals

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.

StyleParametersEndpoints
Offsetlimit, offsetInvoices, customers, refunds, credit notes, payment links, meters, webhook endpoints, entitlements and storefront products.
Pagelimit, pageProducts and subscriptions.
Cursorlimit, starting_after, ending_beforePrices, 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

ParameterTypeDefaultMaxDescription
limitinteger20100Number of items to return. A value outside 1-100 is rejected with 400.
offsetinteger0—Offset style: zero-based index of the first item to return.
pageinteger1—Page style: the page number, starting at 1.
starting_afterstring——Cursor style: the id of the last item you received. Returns the items after it.
ending_beforestring——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"
}
FieldTypeDescription
objectstringAlways list.
dataarrayCurrent page of items.
has_morebooleanWhether another page may exist. It can be true when the current page is exactly full, so the next request may return an empty page.
urlstringThe 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=100 is 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

Owner: david · Reviewed 12 Oct 2026 · Next review 11 Nov 2026

On this page