Pagination
All list endpoints use cursor-based pagination for efficient, consistent traversal of large datasets.
How It Works
bash
curl "https://api.ondayzero.com/api/v1/transactions?limit=25" \
-H "Authorization: Bearer dz_your_token_here" \
-H "x-business-id: YOUR_BUSINESS_ID"Response:
json
{
"items": [ ... ],
"next_cursor": "eyJpZCI6IjAxOTEyMzQ1LWFiY2QtNzAwMC04MDAwLTAwMDAwMDAwMDA1MCJ9", // pragma: allowlist secret
"has_more": true
}To get the next page, pass cursor:
bash
curl "https://api.ondayzero.com/api/v1/transactions?limit=25&cursor=eyJpZCI6..." \
-H "Authorization: Bearer dz_your_token_here" \
-H "x-business-id: YOUR_BUSINESS_ID"Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
limit |
integer | 50 | Items per page (1–1000) |
cursor |
string | null | Cursor from next_cursor |
direction |
string | next |
next or prev |
sort_by |
string | created_at |
Column to sort by |
descending |
boolean | true | Sort direction |
include_total_count |
boolean | false | Include total count (expensive) |
Tips
- Don't store cursors long-term — they encode a point-in-time position.
- Reset cursor when changing
sort_by— cursors are tied to sort order. - Avoid
include_total_counton large tables — it requires a full count query. - When
has_moreisfalse, you've reached the end.