Why Cursor-Based Pagination
Offset-based pagination (e.g.?page=2) shifts when records are created or deleted between requests, causing you to skip or repeat items. Cursors are anchored to a specific position in the dataset, so iterating through pages of payments or transactions always produces a complete and consistent result set.
Query Parameters
Every list endpoint accepts the following pagination parameters as query string arguments:The number of results to return per page. Must be between
1 and 100 inclusive. Defaults to 20.An opaque cursor string returned in the previous response’s
pagination.cursor field. Omit this parameter to fetch the first page. Pass it on subsequent requests to retrieve the next page.The sort order for results. Accepts
asc (oldest first) or desc (newest first). Defaults to desc.Response Format
Every list response wraps your results in a top-level object with two fields:data containing the array of resource objects, and pagination containing the metadata you need to continue iterating.
An array of resource objects for the current page. Each element is a full resource representation (for example, a payment object). The array is empty when there are no results matching your query.
Metadata describing the current page and how to fetch the next one.
Treat cursors as opaque strings. Do not parse, store long-term, or construct cursor values manually — their internal format may change without notice. They are only valid for 24 hours after being issued.
Iterating Through All Pages
When you need to retrieve the complete result set (for example, to export all payments or reconcile transactions), loop untilpagination.has_more is false.
Fetching a Single Page
If you only need the first page — for example, to display the ten most recent payments in a dashboard widget — omit thecursor parameter and set your desired limit:
Filtering and Sorting
Most list endpoints support additional query parameters that narrow results before pagination is applied. Thetotal in the response reflects the filtered count, and cursor iteration stays within the filtered result set.
Common filter parameters available on list endpoints:
| Parameter | Type | Description |
|---|---|---|
created_after | ISO 8601 timestamp | Return only records created after this time |
created_before | ISO 8601 timestamp | Return only records created before this time |
status | string | Return only records with the specified status (e.g. completed, pending) |