Skip to main content
All list endpoints in the AnySpend Platform API return paginated responses. This page covers how to navigate large result sets, filter data, and sort results.

List response format

Every list endpoint returns a consistent envelope:

Pagination parameters

Use page and limit query parameters to navigate through results.

Basic pagination example

Use the has_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.

Checkout Sessions

Transactions

Sorting

List endpoints that support sorting accept sort and order parameters.

Auto-pagination example

For convenience, you can build an async iterator that handles pagination automatically:

Counting results

Use total_count from any page to get the total number of matching resources without fetching all pages:
Setting limit=1 minimizes the response payload when you only need the count.

Best practices

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.
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.
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.
Apply filters before paginating to reduce the result set. This is more efficient than fetching all records and filtering client-side:
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: