Xero has a well-documented API and n8n has a native Xero node. The combination lets you connect Xero to almost any other system your business uses — pulling data out, pushing data in, and triggering actions in either direction based on events in the other.
This guide covers what the Xero API can and can't do, how to connect it to n8n, the rate limits you need to design around, and the three automation workflows that produce the most practical value for businesses running on Xero.
What the Xero API can do
Contacts
Create and update contacts (customers and suppliers) in Xero. Useful for syncing contacts from a CRM so that Xero always has current customer information without manual re-entry.
Invoices
Create, update, and retrieve invoices. This is the highest-value capability for most businesses — if something in your operations triggers a billable event (a job completed, a subscription renewed, a product shipped), that event can automatically create an invoice in Xero rather than requiring someone to create it manually.
Bills (Accounts Payable)
Create and update bills in Xero. If you receive supplier invoices in a structured format — via email, a supplier portal, or a document processing tool — those can be captured and created as bills in Xero automatically.
Bank Transactions
Retrieve bank transactions and bank statement lines. Useful for reconciliation workflows that need to check the status of specific transactions or pull transaction data for reporting.
Payments
Record payments against invoices and bills in Xero. If a payment is processed through a payment gateway (PayFast, Yoco, Stripe), that payment can be automatically recorded against the relevant Xero invoice rather than matched manually.
Reports
Pull financial reports — profit and loss, balance sheet, aged receivables, aged payables — as structured data. Useful for automated reporting workflows that need to deliver financial summaries to specific people on a schedule.
Accounts and Tax Rates
Retrieve your chart of accounts and tax rate codes — needed when creating invoices or bills to assign the correct account and tax treatment.
What the Xero API can't do
Initiate bank payments
The Xero API cannot instruct your bank to make a payment. Payment initiation requires a separate banking integration. The batch payment file approach described in the FNB–Xero guide is the practical workaround for South African businesses.
Access all data in real time
The Xero API is not a streaming API. It's a request-response API — you ask for data and it returns the current state. For real-time triggers, you use Xero webhooks, which notify your system when specific events occur.
Replace the Xero UI for complex accounting tasks
Complex accounting adjustments, period-end processes, and multi-currency revaluations are better handled inside Xero directly.
Xero API rate limits
- 60 API calls per minute — per Xero organisation
- 5,000 API calls per day — for standard connections (resets at midnight UTC)
- 10,000 API calls per day — for Xero Partner Programme members
Design principle: use Xero webhooks for event-driven triggers rather than polling the API on a schedule. Webhooks consume zero API calls while your system waits for an event. A polling workflow that checks every 5 minutes for new invoices uses 288 API calls per day doing nothing useful.
Connecting n8n to Xero
Step 1: Create a Xero OAuth2 app
Go to developer.xero.com and sign in with your Xero account. Create a new app — select "Web App" as the integration type. Provide a redirect URI (your n8n URL followed by /rest/oauth2-credential/callback). Copy the Client ID and Client Secret.
Step 2: Create the Xero credential in n8n
In n8n, go to Credentials → New Credential → Xero OAuth2 API. Enter your Client ID and Client Secret. Set the scopes your workflows need — at minimum: accounting.transactions, accounting.contacts, accounting.settings. Click Connect and authorise through Xero.
Step 3: Select the organisation in your workflows
When you use the Xero node in a workflow, select which organisation the operation applies to. For multiple entities, create separate credentials per organisation or manage organisation selection dynamically.
Three workflows that produce the most value
Workflow 1: Job completion → Xero invoice
- Trigger: webhook from your job management system when a job is marked complete
- Steps: pull job details, look up or create the customer contact in Xero, create an approved invoice with correct line items and tax rates, send to customer
- Result: invoices go out immediately on job completion, nothing falls through the cracks, Xero reflects actual business state in real time
Workflow 2: Payment gateway → Xero payment reconciliation
- Trigger: webhook from payment gateway (PayFast, Yoco, Peach Payments) when a payment is confirmed
- Steps: extract payment amount, reference, and customer identifier, find the matching invoice in Xero, record the payment against the invoice
- Result: invoices marked paid the moment payment clears, aged receivables stays accurate, cash flow reporting reflects reality
Workflow 3: CRM → Xero contact sync
- Trigger: webhook from CRM (HubSpot, Pipedrive, Salesforce) when a contact is created or updated
- Steps: check whether the contact exists in Xero, create or update accordingly
- Result: Xero always has current customer information, invoices go to the right address, both systems stay in sync automatically
When n8n is the right tool for Xero automation
n8n is the right choice when: you need to connect Xero to systems without pre-built integrations, the workflow involves multiple steps or conditional logic, you want to run automation on your own infrastructure, or you need full control over data transformation between systems.
If you want help building a specific Xero workflow, the process automation and systems integration pages cover how this kind of work is scoped and delivered.
Some links in this guide are affiliate links. If you sign up through them, Gainly may earn a commission — at no cost to you. We only recommend tools we'd recommend regardless.
Building a Xero integration and running into something specific?
Describe what you're working with and I'll come back with something specific — not a sales call.
Tell me what you're building →