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.
| Page | Observed | Saved checkpoint |
|---|---|---|
| Start | Items A/B; next token C1 | C1 after A/B committed |
| C1 | Items C/D; worker stops on D | Keep C1 until page disposition is complete |
| Retry C1 | C already processed; D now completes | Advance to returned C2 |
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.