Data freshness (how x0 cache works)
x0 keeps a local copy of your Xero data so Excel, Power Query, and API clients stay fast and do not burn through Xero’s daily rate limits.
Short version
- After you connect Xero, x0 downloads tables into a cache.
- Normal refreshes in Excel read that cache — they do not call Xero every time.
- When you need the absolute latest numbers (e.g. you just posted a transaction), ask for a refresh (see below).
- On refresh, x0 asks Xero only for rows that changed since the last snapshot — that is how we protect your daily API quota.
- Large tables can lag behind Xero by design; small tables (like Accounts) stay fresher.
Why we cache
| Without cache | With cache |
|---|---|
| Every Excel refresh hits Xero | Excel hits x0 (fast) |
| Easy to hit Xero rate limits | Xero calls are batched and scheduled |
| Large ledgers can take minutes | You get the last completed snapshot immediately |
What “up to date” means
x0 stores a snapshot per table (Accounts, Contacts, Invoices, …), with a timestamp of the last successful download from Xero.
- Small / reference tables (e.g. Accounts, organisation settings) — we aim to refresh often; a forced refresh usually completes quickly.
- Large / high-volume tables (e.g. Invoices, CreditNotes, PurchaseOrders, bank transactions, journals) — a full pull can take a long time and many API pages. After the first fill, later refreshes send Xero an
If-Modified-Sinceheader and merge only changed rows. x0 serves the last good snapshot while a refresh runs in the background.
If you need a figure that must match Xero right now, use a forced refresh and wait for the sync to finish. The dashboard Data cache table shows last fetched time, how many rows changed, and how many Xero API calls that refresh used. Data schema (same page) shows those counts on the ER diagram — see data-schema.md.
Forcing a refresh
From the portal (easiest)
On Dashboard, next to each connected Xero organisation, click Refresh data (or Refresh all organisations).
- Small tables (Accounts, settings) update immediately.
- Large tables refresh in the background — reload the dashboard a minute later to see status in Data cache.
- Then refresh Excel / Power Query as usual (no special URL needed once the cache is updated).
From the API / OData URL
Pass a query parameter:
?refresh=true
(Also accepted: refresh=1 or refresh=force.)
- Use this after you enter data in Xero and want Excel to pick it up without using the portal.
- Do not put
refresh=trueon every scheduled Power Query refresh — that defeats the cache and can slow you down or hit limits. - x0 may skip a forced refresh if the same table was fetched very recently (cooldown); response header
X-X0-Sync: cooldownmeans you still have the latest snapshot we hold. - Small tables (e.g. Accounts) refresh in the request. Large tables may keep serving the last snapshot while a refresh runs (
X-X0-Sync: refreshing).
Response headers (when present): X-X0-Cache, X-X0-Fetched-At, X-X0-Sync, X-X0-Stale.
Automatic refresh (TTL)
When a snapshot is older than its time-to-live, x0 treats it as stale and will refresh from Xero (usually in the background) on the next access or via a scheduled job.
Typical defaults (subject to change; see portal release notes):
| Kind of data | Example | Typical freshness target |
|---|---|---|
| Reference | Accounts, settings | About 1 hour |
| Medium | Contacts, items | About 6 hours |
| Large ledgers | Invoices, journals, bank lines | About 24 hours |
Webhook notifications from Xero (where Xero supports them, e.g. some contact/invoice events) may mark a table dirty sooner than the TTL — then the next refresh pulls only the changed rows without waiting for the clock.
Incremental sync (quota saver)
x0 does not re-download the whole ledger every time it talks to Xero.
| Refresh | What x0 sends to Xero | What happens to cache |
|---|---|---|
| First connect / empty table | Full pagination | Replace snapshot |
| Normal TTL / dirty / portal Refresh | If-Modified-Since (changed rows only) |
Upsert by record ID |
| About weekly (full reconcile) | Full pagination | Replace snapshot (catches Xero fields that do not bump UpdatedDateUTC) |
| Journals, organisation settings | Full pagination | Always a complete pull — Xero’s modified-since header is unsafe or unsupported |
Dashboard Data cache → Last refresh shows Incremental · N changed · M API calls or Full · M API calls. A quiet day often costs one Xero call per table (empty page).
What you should expect day to day
| Situation | What x0 does |
|---|---|
| Working hard in Excel / AI on yesterday’s books | Served from cache — fast, stable |
| Slow-moving data, no changes in Xero | Cache is fine until TTL or you refresh |
| You posted one invoice and hit Refresh in Excel | Add refresh=true (or portal refresh) so x0 goes back to Xero |
| First connect / empty cache | x0 fills from Xero; large orgs may take a while |
Tips for Excel
- Keep your normal Power Query refresh without
refresh=true. - Duplicate a query or add a parameter only when you need a live pull after posting in Xero.
- Prefer the x0 OData entities you need; avoid pulling every large table on every workbook open.
- Check connection / docs links from the X0 entity card in the feed when available.
Related
- Documentation index · Glossary
- OData — endpoints and filters
- Excel desktop — setup checklist
- Date transform — Xero dates on serve
- AI agents — HTTP clients