Cursor pagination on the order listing
What's new
GET /v1/orders takes a new start_after_id query parameter, the id of the last order on the
page you just read. The next response starts with the order that follows it. offset still works
but is marked deprecated, and its description now points at the replacement.
limit is unchanged and sets the page size either way.
Impact
Offset paging counts from the start of the result set on every request, so an order created while you page through shifts the whole list down and one record comes back twice. A cursor is anchored to a record instead, so pages stay stable while the list grows underneath them.
Changes
| Resource | Change |
|---|---|
| get_orders | Added the optional start_after_id query parameter, which takes the id of the last order on the previous page |
| get_orders | Marked the offset query parameter deprecated in favor of start_after_id |
Upgrade
- Replace
offsetwithstart_after_idon get_orders. Read the first page withlimitalone, then pass theidof the last order in the response asstart_after_idon the next call. - Stop paging when a response comes back with fewer than
limitorders. offsetkeeps working, so the switch can wait, but treat it as on its way out.
Need help?
Contact our integration team at [email protected]