page and per_page query parameters and return a meta object next to the results.
Each endpoint has its own page size and response key:
GET /orders has no default sort order. Always send sort_by and sort when you page through it, or rows can
move between pages.Iterating safely
- Stop when
last_pageistrueornext_pageisnull, rather than comparingcurrent_pagewithtotal_pages. - Use a stable sort (
sort_byplussort, where the endpoint supports it) when you page through data that changes while you read it, and filter by a date range (channel_created_at,shipping_date) to keep the set bounded. - For near-real-time sync, prefer webhooks over polling every page.