BETTERBOOKS / DEVELOPERS
API pagination and decimal precision
Handle API pagination and decimal precision by reading every page of a population and preserving exact decimal amounts and currency rather than floating-point values.
Read the collection contract
Use the deployed endpoint schema rather than assuming every list has the same response shape. For the accounts collection, read items, totalCount, page and pageSize. Apply the same authorized book and filters throughout pagination.
Plan for changing data
A sequence of paginated requests is not automatically a point-in-time snapshot. Record the reporting cutoff, avoid changing filters mid-read and reconcile the resulting population. Use a supported export or snapshot workflow where the endpoint provides one.
Preserve monetary precision
Avoid using binary floating-point arithmetic to calculate authoritative money totals in a client. Preserve the API’s documented decimal representation, currency and sign. Round only under the applicable contract and accounting policy.
Keep missing evidence visible
Null, unavailable, unsupported and zero have different meanings. Do not coerce an absent source balance, exchange rate or settlement application into an accounting zero.