How Developers Are Syncing Multiple Xero Organisations Into a Single Database
Accountants and developers managing multiple Xero organisations face a recurring challenge: Xero's API is designed around one organisation at a time, requiring separate logins and exports for each client. The platform's architecture uses unique tenant IDs per organisation, meaning every API call must specify which organisation it targets, making multi-org consolidation difficult by default. A practical workaround involves storing all organisations' data in a single PostgreSQL database, using a composite primary key of (id, tenant_id) so records from different organisations never collide. A dedicated xero_organisations table can store metadata such as trading names and currencies, replacing opaque GUIDs with readable client identifiers in consolidated queries. This approach replaces manual spreadsheet merges with straightforward SQL filtering and grouping across all connected organisations.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in