List response format
Every list endpoint returns a consistent envelope:Pagination parameters
Usepage and limit query parameters to navigate through results.
Basic pagination example
Navigating pages
Use thehas_more field to determine when to stop paginating:
Filtering
Most list endpoints support query parameters for filtering results. The available filters depend on the resource type.Payment Links
Checkout Sessions
Transactions
Sorting
List endpoints that support sorting acceptsort and order parameters.
Payment Links sort fields
Auto-pagination example
For convenience, you can build an async iterator that handles pagination automatically:Counting results
Usetotal_count from any page to get the total number of matching resources without fetching all pages:
limit=1 minimizes the response payload when you only need the count.
Best practices
Use limit=100 for bulk operations
Use limit=100 for bulk operations
When you need to fetch all records (e.g., for data export or sync), use the maximum
limit=100 to minimize the number of API calls and stay within rate limits.Use has_more instead of total_count for pagination loops
Use has_more instead of total_count for pagination loops
has_more is the authoritative signal for whether to fetch the next page. Avoid computing page counts from total_count as the total can change between requests.Cache total_count for UI pagination controls
Cache total_count for UI pagination controls
When building pagination UI (e.g., “Page 3 of 8”), fetch
total_count once and cache it for the session. Re-fetch only when the user refreshes or applies new filters.Combine filters with pagination
Combine filters with pagination
Apply filters before paginating to reduce the result set. This is more efficient than fetching all records and filtering client-side:
Respect rate limits during bulk fetches
Respect rate limits during bulk fetches
If you are paginating through a large dataset, be mindful of the 120 requests/min rate limit. For very large datasets, add a short delay between page requests:
HypeDuel