Pagination
The Flowlix API uses cursor-based pagination for list endpoints. This approach is more reliable than offset-based pagination because it handles concurrent inserts and deletions gracefully.How it works
List endpoints (likeGET /v1/payments) return a page of results along with a has_more boolean. To fetch the next page, pass the id of the last item as the starting_after cursor.
Response structure
| Field | Type | Description |
|---|---|---|
object | string | Always "list". |
url | string | The URL for this list endpoint. |
data | array | The page of results, sorted by creation date descending (newest first). |
has_more | boolean | true if there are more results after this page. |
Pagination parameters
| Parameter | Type | Description |
|---|---|---|
limit | integer | Number of results per page. Range: 1-100. Default: 10. |
starting_after | string | Fetch results after this payment ID (forward pagination). Must be a full payment ID returned by an earlier list response. |
starting_after references a payment that does not exist, the API
returns 400 Bad Request with code parameter_invalid. Always reuse a
cursor obtained from an earlier list response, never a hand-built one.
Forward pagination (next page)
To get the next page, pass theid of the last item in the current data array:
Iterating through all results
Here is a complete example of paginating through all payments:Combining with filters
You can combine pagination with filters. Filters apply to the full result set before pagination. Thecreated[gte] and created[lt] filters take
Unix epoch values in seconds (the same unit as response timestamps
such as created):
Tips
- Use the largest
limityou can (up to 100) to reduce the number of API calls. - Do not assume page sizes — the actual number of results may be less than
limiteven whenhas_moreistrue. - Store cursors, not offsets — cursor-based pagination is stable under concurrent inserts and deletions.
- Check
has_moreinstead of checkingdata.length < limitto determine if there are more pages.
