Export a trial balance
Xero trial balance CSV export reads Xero’s Trial Balance reporting API and produces consistent account, debit, credit and year-to-date columns. A balanced file is an input for review; it does not establish that the accounts are complete or correctly classified.
Use the released Python exporter, v0.1.15. The tool guide keeps the pinned installation commands and first export together. The repository’s default branch contains an unreleased Rust implementation with a different installation path.
What you need
- Python 3.11 or later, Git and a local working directory for the released exporter.
- A Xero developer app with the local callback configured as the installation guide specifies. Keep its client secret and token files on your own machine. Xero’s free Starter plan lets an app have up to 5 connections, at 1,000 API calls a day per organisation. Core allows up to 50 for A$35 a month excluding tax, including 10 GB of API data egress, then A$2.40 a GB. An integration an accountant or bookkeeper builds solely for their own practice or a single client is exempt from this pricing, as Xero determines.
- A Xero user able to grant the requested access to the organisation. Start with the Demo Company before using a live organisation.
- An as-at date, the intended organisation and a decision about accrual or cash basis. Check those choices against the report you expect.
For a trial without credentials, reproduce the trial balance integrity evaluation. It uses 3 fictional CSV fixtures at its declared historical release. It exercises the balance gate without connecting to Xero.
Read and write access
| Resource | Read | Write |
|---|---|---|
| Xero organisation | Trial Balance report through accounting.reports.trialbalance.read, after consent. | No ledger write access. |
| Local files | App configuration and the local token cache. | Authentication updates the token cache. Export writes a CSV and its provenance manifest after validation. |
| Excel or Power BI | You import the resulting CSV into your chosen application. | No direct connection to those applications is supplied. |
The exporter contacts Xero for authentication and the requested report. The resulting CSV contains organisation and account data; protect it and any copies you import into other systems.
Xero’s MCP server and Claude connector
For an AI agent that works inside Xero rather than on an exported file, Xero runs a hosted Developer Remote MCP Server at https://api.xero.com/mcp/v1. Xero has documented its setup for Claude Desktop, Claude Code, Cursor and VS Code. The user signs in through Xero’s OAuth 2.0 flow, which Xero recommends with PKCE, and the agent can then read and write accounting data in the organisations the user authorises.
Each tool needs the scope Xero lists for it, which the user approves when connecting the app; only get_connected_tenants needs none. list_trial_balance reads the trial balance with accounting.reports.trialbalance.read, the scope this exporter requests. Tools whose names start with create_, update_, authorise_ or void_ write to the organisation. They include create_payment, create_manual_journal and void_invoice, which need the write scopes accounting.payments, accounting.manualjournals and accounting.invoices.
Xero’s Remote MCP questions say these version 1 tools do not ask the user to confirm before writing; Xero advises asking the agent to confirm with you first. Xero logs each API call in the Developer Portal, but not the tool calls or prompts behind them. The documented tools cover no payroll or activity statements, and their journal tools handle manual journals only.
The server is included on Xero’s Core developer plan or above. Apps on the free Starter plan can use it with the demo organisation only, and Custom Connection apps cannot use it. An accountant or bookkeeper building an integration for their own practice or a client can apply for Xero’s API fee exemption, which includes this access.
Xero’s connector in Claude is a separate, read-only route for questions about live figures. Xero says Claude can’t create, edit, approve, reconcile or pay in Xero through it, and it needs an active Xero subscription and a Claude account but no developer setup.
This section follows Xero’s pages as read on 4 November 2026; neither route was tested for this guide. The trial balance exporter on this page remains separate and read-only.
Limits and evidence
Boundary: the exporter cannot post journals, edit transactions or lodge returns. A balanced trial balance still needs professional review.
The date is an as-at date. The API does not reproduce Xero’s separate Trial Balance by Date Range report. The guide explains the movement columns and the exporter’s refusals.
Check the release record, the worked outcomes and the fixed-release evaluation before relying on an export. The evaluation’s version differs from the current installation.
Return to Works with for the other supported software route.