Every list endpoint (payments, payment links, invoices and customers) returns the newest objects first, a page at a time, in one shape. Pass limit (1–100, default 25) and, for the next page, the previous page's nextCursor as cursor. When hasMore is false you have everything.
{
"object": "list",
"data": [
{
"object": "payment",
"id": "pay_7Hq2LmX9cR4tVb",
"…": "…"
}
],
"hasMore": true,
"nextCursor": "pay_7Hq2LmX9cR4tVb"
}| Field | Type | Meaning |
|---|---|---|
object | string | Always "list". |
data | array | This page's objects, newest first. |
hasMore | boolean | Whether there is another page after this one. |
nextCursor | string or null | The id of the last object on this page; pass it as cursor to get the next page. Null on the last page. |
Fetching the next page
curl "https://anytime-capital.com/api/v1/payments?limit=100&cursor=pay_7Hq2LmX9cR4tVb" \
-H "Authorization: Bearer $ANYTIME_API_KEY"A cursor is only valid for the list it came from and for your own business. An empty, over-long or unknown cursor answers 400 INVALID_INPUT with the message Invalid cursor.; a limit outside 1–100 answers the same code naming limit.
Reading every page
async function* listAll(path, params = {}) {
let cursor = null;
do {
const query = new URLSearchParams({ ...params, limit: "100", ...(cursor ? { cursor } : {}) });
const res = await fetch(`https://anytime-capital.com/api/v1${path}?${query}`, {
headers: { Authorization: `Bearer ${process.env.ANYTIME_API_KEY}` },
});
const page = await res.json();
if (!res.ok) throw new Error(`${page.error.code}: ${page.error.message}`);
yield* page.data;
cursor = page.hasMore ? page.nextCursor : null;
} while (cursor);
}
for await (const payment of listAll("/payments", { status: "paid", createdFrom: "2026-10-01" })) {
console.log(payment.id, payment.amountCents);
}