Skip to Content
Developers

Pagination

The list envelope, walking every page with a cursor, and syncing only what changed.

The list envelope

Every list answers the same shape:

{
  "object": "list",
  "data": [],
  "has_more": true,
  "next_cursor": "WzE3OTUyODcxMzA0MTIsIjBiNmYyYTRlLTVkMWMtNGY3YS05YTNlLTJjOGQxZTZmNGI5MCJd"
}
FieldMeaning
dataThe objects on this page.
has_moretrue when another page follows.
next_cursorSend it back as cursor to get the next page. null on the last page.

Parameters

ParameterValuesDefault
limit1 to 10025
cursorThe next_cursor of the page beforeLeave out for the first page
orderasc for oldest first, desc for newest firstdesc

Each list sorts on one time and then on the id:

ListSorted by
/customerscreated_at
/bookingsstarts_at
/paymentspaid_at

/services, /staff and /availability always fit on one page. They answer the same envelope with has_more: false and take no cursor.

A cursor points at the last object of a page, not at a page number. Objects added or removed while you walk the list do not shift the pages. Send the cursor back as it came, with the same filters and the same order. A cursor the API did not give out answers 400 with param: "cursor".

Walk every page

Ask for 100 objects a page and follow next_cursor until has_more is false.

const BASE = "https://api.weerom.com/v1";

async function* everyCustomer() {
  let cursor = null;
  do {
    const url = new URL(`${BASE}/customers`);
    url.searchParams.set("limit", "100");
    if (cursor) url.searchParams.set("cursor", cursor);

    const response = await fetch(url, {
      headers: { Authorization: `Bearer ${process.env.WEEROM_KEY}` },
    });
    if (!response.ok) throw new Error(`WeerOm answered ${response.status}`);

    const page = await response.json();
    yield* page.data;
    cursor = page.has_more ? page.next_cursor : null;
  } while (cursor);
}

for await (const customer of everyCustomer()) {
  console.log(customer.name);
}

A full walk of 10,000 customers is 100 requests. At 120 requests a minute for each key, it fits in one minute. If you walk more than one list at a time with the same key, read Rate limits.

Sync only what changed

/customers and /bookings take updated_after. It returns only objects that changed after that moment, so a sync job can ask for the changes since its last run instead of walking everything.

  1. On the first run, walk the whole list.
  2. Remember the highest updated_at you saw.
  3. On the next run, walk the list with updated_after set to that value, and update your copy with each object.
curl "https://api.weerom.com/v1/bookings?updated_after=2026-11-21T18:52:10.412Z&limit=100" \
  -H "Authorization: Bearer $WEEROM_KEY"

updated_after is strict: an object changed at exactly that moment does not come back. Every date filter takes a date, a time and an offset, such as 2026-11-01T00:00:00Z or 2026-11-01T01:00:00+01:00. A date without a time answers 400.

updated_after only filters. The list keeps its own sort, by created_at for customers and by starts_at for bookings, so take the highest updated_at from all pages, not from the last one.

For payments, filter on paid_after instead. Send payments to Billit shows that loop.

To hear about bookings and payments within seconds, without a schedule, use webhooks. A sync with updated_after once a day next to them catches any message your server missed.

On this page