Skip to navigation

Paginate balance transactions

Walk a merchant's full ledger history page by page.

List endpoints return the Stripe list envelope — a data array, a has_more boolean, and the canonical url. Page forward by passing the last id you saw as starting_after, and stop when has_more is false. SDKs are not supported, so walk the cursor with plain HTTP:

curl
cursor=""
while :; do
page="$(curl -sS -G https://api.devfluveo.com/v1/balance_transactions \
-u "$FLUVEO_SECRET_KEY:" \
-d limit=100 \
${cursor:+-d starting_after="$cursor"})"
echo "$page" | jq -r '.data[] | [.id, .amount, .currency] | @tsv'
[ "$(echo "$page" | jq -r '.has_more')" = "true" ] || break
cursor="$(echo "$page" | jq -r '.data[-1].id')"
done

Cursors are merchant-scoped; an unknown or cross-merchant cursor returns invalid_request_error and never leaks another merchant’s rows. The same cursor pattern works for any list endpoint (/v1/refunds, /v1/customers, …).