Skip to content
Astera Technology

Resume a paged API read without skipping a page

Commit processed records and their continuation checkpoint together.

Advance after the page is committed

The Stripe list-API family documented on its pagination page uses object-ID cursors and has_more; another API family may use different parameters or continuation URLs. Follow that family’s actual contract without interpreting a continuation value yourself. This local sample saves its next reference only after every page item has a recorded disposition.

Synthetic cursor checkpoint
PageObservedSaved checkpoint
StartItems A/B; next token C1C1 after A/B committed
C1Items C/D; worker stops on DKeep C1 until page disposition is complete
Retry C1C already processed; D now completesAdvance to returned C2
Download editable CSV ↓

Store the query scope beside the token

Record filter, account scope and contract version with the checkpoint. A token from one query cannot safely be assumed valid for another. If the provider rejects an expired cursor, use its documented restart procedure and deduplicate retained records.

Can a failed page save its next token because half its rows succeeded?

Show the worked answer

Only if a deliberate per-row recovery design preserves every unfinished identity. Otherwise keep the current page checkpoint and make the repeated processing idempotent.

Related resources