GET /events and
GET /orders return one page at a
time and a cursor for the next page.
The loop
- Make the first request without
cursor. - If the response has a
next_cursor, pass it unchanged ascursoron the next request, with the same filters. - Stop when there is no next cursor.
Write your loop to stop on “no usable cursor” and it handles both:
Cursor rules
- Cursors are opaque. Do not parse, build or modify them.
- Reuse a cursor only with the filters that produced it. Changing
event_idorstatusmid-loop gives you a page you didn’t ask for. - A malformed cursor is
400:invalid_cursoron events (also for a cursor from another organization),validation_failedon orders. - Cursors are for walking a list now, not bookmarks to keep for later.