Skip to main content

Overview

The Dev API currently uses two pagination models:
  • Cursor-based pagination for most resource lists
  • Page-based pagination for operational lists where page navigation is clearer
Most resource lists (products, invoices, orders) use cursor-based. Operational lists like webhook delivery logs use page-based.
Use cursor-based pagination for feed-style lists like products, invoices, orders, customers, and subscriptions.

Parameters


Basic Usage

First Request

Response:

Next Page

Use the next_cursor from the previous response:

Final Page

When there are no more items:

Code Examples

Fetch All Pages

Async Generator (Streaming)

TypeScript

Filtering with Pagination

Filters work alongside pagination:
Always include the same filters and sorts when following cursors. Changing them invalidates the cursor.

Cursor-Based Endpoints


Best Practices

Use Reasonable Limits

Fetching for a UI? 20-25 items is plenty. Background sync job? Crank it to 100. Larger limits increase response time.

Don't Store Cursors

Cursors are meant for immediate sequential use. They expire after 24 hours and become invalid if the underlying data changes significantly.

Handle Empty Results

An empty data array with has_more: false is valid - no items match your query.

Respect Rate Limits

When fetching all pages, add delays between requests to avoid rate limiting.