API Reference
Pagination
Page through list endpoints with limit and cursor.
List endpoints — such as GET /customers,
GET /invoices, and
GET /payments — return one page at a time and page
forward with a cursor. Cursor paging is stable while rows are being inserted:
you never skip or repeat a record the way offset paging can.
Query parameters
Prop
Type
Some list endpoints add their own filters on top — for example customers
accepts q (a case-insensitive match on name or email), and catalogue endpoints
accept active=true to return only active records. See each endpoint's page for
the full parameter list.
Paging forward
Request the first page, then pass the id of the last row you received as the
cursor for the next request. When a page returns fewer rows than limit,
you've reached the end.
# First page
curl "https://payments.clocknext.com/api/v1/customers?limit=50" \
-H "Authorization: Bearer $CLOCKNEXT_API_KEY"
# Next page — cursor is the last id from the page above
curl "https://payments.clocknext.com/api/v1/customers?limit=50&cursor=cus_abc123" \
-H "Authorization: Bearer $CLOCKNEXT_API_KEY"// One page at a time
const page = await cnk.customers.list({ limit: 50, q: "ac" });
// Or let the SDK follow the cursor for you across every page
for await (const customer of cnk.customers.iterate()) {
console.log(customer.id);
}The @clocknext/sdk client exposes list() for a single page
and iterate() (an async iterator) that walks the whole set, so you rarely touch
the cursor by hand.
Keep limit modest (the default of 50 is a good start) and let the cursor walk
the full set, rather than requesting a huge page. The maximum is 200; anything
larger is clamped.