Pagination
One uniform list model — every list returns { items, nextCursor } and pages with limit + before.
Every list endpoint uses the same model. There is one envelope and one way to page — no offset,
no page numbers anywhere:
{
"items": [ /* … */ ],
"nextCursor": "eyJpZCI6IjAxSlgwUTdBQiIsInRzIjoxNzE5NzkyMDAwMDAwfQ"
}items— this page's rows.nextCursor(response) — an opaque cursor the API returns. Send it back asbeforeto get the next page. When it comes backnull, you've reached the last page.limit(query) — caps how many items a page returns.before(query) — the cursor for the next page. Omit it for the first page.order(query) —asc|descsort direction.
Some settled-history lists (reconciliation, refunds, conversions) additionally return a total
alongside items/nextCursor. Small reference lists (networks, templates, options, plans,
balances) return everything in one page as { items, nextCursor: null }.
Don't build or parse the cursor
nextCursor is opaque — treat it as a black box. Just echo the exact value back as before.
It stays stable even as new items arrive, so you won't skip or double-read rows mid-scan.
Page through everything
let before: string | undefined;
do {
const page = await ap.checkouts.list({ limit: 50, before, order: "asc" });
for (const item of page.items) handle(item);
before = page.nextCursor ?? undefined; // null → stop
} while (before);before = None
while True:
page = ap.checkouts.list(limit=50, before=before, order="asc")
for item in page["items"]:
handle(item)
before = page.get("nextCursor")
if not before: # null → stop
breakq := absolutepay.PageQuery{Limit: 50, Order: "asc"}
for {
page, err := ap.Checkouts.List(ctx, q)
if err != nil {
log.Fatal(err)
}
for _, item := range page.Items {
_ = item
}
if page.NextCursor == nil {
break
}
q.Before = *page.NextCursor
}# First page:
curl "https://api.absolutepay.io/v1/checkouts?limit=50" \
-H "Authorization: Bearer $APP_TOKEN" $(sign GET "/v1/checkouts?limit=50" "")
# Next page: pass the previous response's nextCursor as ?before=
curl "https://api.absolutepay.io/v1/checkouts?limit=50&before=eyJpZCI6IjAxSlgwUTdBQi…" \
-H "Authorization: Bearer $APP_TOKEN" $(sign GET "/v1/checkouts?limit=50&before=eyJpZCI6IjAxSlgwUTdBQi…" "")Paginated endpoints
Every list below returns { items, nextCursor } and pages with limit + before:
GET /v1/checkouts·ap.checkouts.list()GET /v1/invoices·ap.invoices.list()GET /v1/depositsand/v1/deposits/addresses·ap.deposits.list()/ap.deposits.addresses()GET /v1/refunds·ap.refunds.list()— carriestotalGET /v1/conversions·ap.conversions.list()— carriestotalGET /v1/reconciliation/paymentsand/v1/reconciliation/withdrawals— carrytotalGET /v1/subscriptions·ap.subscriptions.list()GET /v1/giftcards·ap.giftcards.list()GET /v1/offramp/orders·ap.offramp.orders()
Reference lists — GET /v1/balances, /v1/deposits/chains, /v1/payouts/options,
/v1/subscription-plans, /v1/giftcards/templates, /v1/offramp/countries, /v1/offramp/banks —
use the same shape but return one page with nextCursor: null.
Next
- Balances & reconciliation — the settled history lists.
- Payment links —
ap.checkouts.list(), the list you'll page most often. - Errors — a long paged scan should back off on
429and resume from the same cursor. - API reference — each list endpoint's exact params and the
nextCursorfield.