Getting Started
Paginating list endpoints
Last updated 14 September 2026
Every list endpoint in the Customer API is paginated the same way. Learn it once and it applies to accounts, transactions, payees and approvals.
The parameters
| Parameter | Type | Default | Notes |
|---|---|---|---|
| page | number | 0 | Zero-based page index. |
| limit | number | 10 | Items per page. Maximum 100 on accounts, transactions and payees; 50 on approvals. |
| excludeTotal | boolean | false | Skip the total count. Cheaper when you are walking every page anyway. |
The response is an object with total and results:
responsejson
{
"total": 231,
"results": [ { "xtid": "…", "amount": 120.5, "…": "…" } ]
}With excludeTotal=true the total field is omitted.
Walking a whole collection
list-all.jsjavascript
async function listAll(path, token, limit = 100) {
const results = [];
for (let page = 0; ; page += 1) {
const url = `https://customer-api.prod.xace.io${path}?page=${page}&limit=${limit}&excludeTotal=true`;
const res = await fetch(url, { headers: { Authorization: `Bearer ${token}` } });
if (!res.ok) throw new Error(`${res.status} on ${url}`);
const body = await res.json();
results.push(...body.results);
if (body.results.length < limit) return results;
}
}
const transactions = await listAll('/account/YOUR_XAID/transactions', token);Stop when a page comes back shorter than limit. Do not rely on total to decide when to stop; it can change between pages if new rows arrive.
Rows that move between pages
Page-based pagination over a live collection can skip or repeat a row if something is inserted while you are walking. Two habits make this harmless:
- Dedupe on the identifier.
xtidfor transactions,xpidfor payees,xaidfor accounts,reffor approvals. - Overlap your windows. When syncing transactions on a schedule, start each run a little before where the last one finished and let the dedupe absorb the overlap. See Syncing transactions for reconciliation.
Ask for the page size you need
The default page size is 10. A sync job that forgets to set `limit` makes ten times the requests it needs to.
Was this page helpful?
Suggest edits