Backfill historical data for a new connection
When a user links a new account, you usually want their full history, not just what changes from today forward.
Page through each resource
Code
Check pagination.total_pages in the response and keep incrementing page until you've covered it. per_page maxes out at 100.
Repeat per resource type
There's no single endpoint that returns everything at once. Backfilling a connection means running the same paged loop against packages, plants, harvests, transfers, sales, and lab_results separately.
Switch to steady-state after
Once the backfill finishes, move to the ongoing sync pattern (either polling on a schedule, or webhooks for the events you care about) rather than re-running a full backfill.
Gotchas
There's no modified_since filter, so a full backfill is the only option. There's also no bulk export across resource types. Budget for the number of paged requests this takes on a facility with a lot of history.