Scope and the ownership question
This article is limited to Stripe v1 list and search traversal. The supplied material identifies a separate pagination model for the /v2 namespace, so this decision model does not extend to that interface.
A page is not a complete traversal merely because the first request succeeded. Assign responsibility for obtaining later pages before processing begins: use a client-library iterator where it fits, or have application logic issue each next request explicitly.
Choose one continuation owner
Stripe client libraries provide automatic pagination facilities for list and search results. By contrast, curl emits an HTTP request but does not itself advance through later pages. That distinction makes ownership clear: a selected helper can drive continuation, while a raw-HTTP or curl design needs application-controlled sequencing.
The actions in this article are an architectural recommendation, not a provider-prescribed application design. Keep one component accountable for reading the continuation signal, obtaining the next cursor, and deciding whether another request is needed.
Four-case decision table
| Endpoint family | Caller mechanism | Pagination owner | Continuation evidence | Cursor source | Stopping condition | Assumption to reject | Bounded application-owned action |
|---|---|---|---|---|---|---|---|
| List | Client-library auto-pagination | Selected library helper | has_more signals that more list elements are available. | List-response continuation state, managed by the selected helper. | has_more becomes false. | A hand-written request loop is required when the helper is selected. | Let this owner coordinate object handling; do not add a competing page loop. |
| List | Raw HTTP or curl with manual pagination | Application request logic | has_more signals another list page. | Take the final returned object ID and send it as starting_after. | has_more becomes false. | curl will retrieve later pages without another request. | Read the page, retain its final ID, and make the next request when indicated. |
| Search | Client-library auto-pagination | Selected library helper | has_more signals that more search results are available. | The response's next_page/page continuation state, managed by the selected helper. | has_more becomes false. | Reject the assumption that a list cursor can replace the search next_page/page token. | Let this owner coordinate result handling; do not add a competing page loop. |
| Search | Raw HTTP or curl with manual pagination | Application request logic | has_more signals another search page. | Use the response's next_page value as the next request's page. | has_more becomes false. | curl will retrieve later pages without another request. | Read the returned token and issue the next search request when indicated. |
When selected, an auto-pagination helper performs later requests for both list and search traversal.
Hypothetical first-page failure
Consider a hypothetical team that sends a curl request, expects it to continue automatically, and processes only its initial response. If that response has has_more set to true, additional results remain beyond the page already handled; curl has not fetched them on its own.
The correction is a design decision rather than a claimed incident result: either move to an appropriate documented client-library helper, or give the application a manual loop. For a list request, that loop uses the last returned ID with starting_after; for a search request, it carries next_page into page. In either case, it ends when has_more is false.
Boundaries and limitations
Cursor-family validation and durable recovery are outside this article's design boundary. It also offers no execution claim, test result, performance result, or collection-consistency guarantee.
The supplied excerpts support automatic traversal at a capability level, but they do not establish one identical helper API for every programming language. Confirm the library-specific call surface separately before adopting a helper.
Review this choice when the relevant source material changes or a version retirement or incompatible release affects the integration.
“One continuation owner” should not also imply one owner for per-object effects. Stripe’s auto-pagination is documented as making API calls until
has_moreis false, while yielding each object to caller-provided work; that establishes traversal ownership, not completion ownership for the work performed on an object. Stripe’s pagination documentationConsider an iterator that fetches page 2, then a handler creates an external side effect for one object and fails before recording that object as complete. The traversal helper may correctly continue or be restarted, but it cannot determine whether replaying that object is safe. Conversely, making the processor retain and advance the page cursor creates a competing continuation owner.
Define two boundaries explicitly:
The handoff needs an observable durable boundary: record enough identity to distinguish a delivered object from a completed one, and stop or surface a processing failure rather than silently treating page advancement as proof of completed work. This preserves the article’s single continuation owner while preventing cursor progress from being confused with successful per-object processing.