Use Xero’s own features first
Several jobs firms try to automate are already in Xero. Invoice reminders can be scheduled per organisation, bank rules handle recurring coding, and Xero Practice Manager, where the firm uses it, tracks jobs and deadlines across clients. n8n also ships a built-in Xero node with OAuth2 credentials for common operations on contacts and invoices, which is faster to set up than raw API calls.
Build this integration for the cross-client view Xero does not give you: one queue, owned by the firm, that shows which clients have new overdue receivables, voided invoices or unreconciled bank lines waiting for staff attention. The workflow reads from Xero and writes only to your queue. Staff decide what to do in Xero itself.
What Xero webhooks can and cannot do
Xero’s webhooks cover a small set of event categories, centered on contacts and invoices. Bank transactions, payments, manual journals and most other records produce no webhook, so those must be polled. Payloads are thin: each event carries a resource ID, the tenant ID of the organisation, an event category, an event type and a timestamp. Your workflow must call the API afterwards to read the record.
The integration contract
| Item | Decision |
|---|---|
| Event path | Xero webhook to an n8n Webhook node for invoice and contact events |
| Poll path | Scheduled n8n workflow reading bank transactions changed since the last run, per organisation |
| Identity | Every item carries the Xero tenant ID and the firm’s client ID; an unknown tenant stops processing |
| Writes | Queue items only; nothing is written back to Xero |
| Owner | Client service lead owns the queue rules; automation owner owns the n8n instance and connection |
Field mapping
| Xero source | Review queue field | Rule |
|---|---|---|
| events[].tenantId | client_id via tenant lookup | Lookup table maintained by a person; no match means no processing |
| events[].resourceId | xero_invoice_id | Used with the same tenant ID to read the invoice |
| Invoice.Type | direction | ACCREC goes to the receivables queue; ACCPAY to payables |
| Invoice.Status | xero_status | Only AUTHORISED past its DueDate, or VOIDED, creates an item; DRAFT is ignored |
| Invoice.AmountDue and CurrencyCode | amount_due | Kept as decimal with currency; never rounded or converted |
| Invoice.Contact.ContactID | counterparty_ref | Reference only; contact names are read for display, not stored |
| Invoice.UpdatedDateUTC | source_version | An older version than the stored one is discarded |
| BankTransaction.IsReconciled and Date | unreconciled_count | Counted per account; lines older than 30 days raise priority |
Events and triggers
- Intent to receive. When you register the webhook URL, Xero sends test deliveries and expects your endpoint to accept correctly signed ones and reject incorrectly signed ones before it activates the subscription.
- Signature. Each delivery carries an x-xero-signature header: a base64 HMAC-SHA256 of the raw request body, keyed with the webhook key. In n8n, enable the Webhook node’s raw body option; a parsed and re-serialized body will not match.
- Respond fast, process later. Return success immediately, then hand events to a second workflow. One delivery can contain several events from different organisations.
- Polling. Send the If-Modified-Since header on bank transaction reads so each run returns only what changed, and stagger organisations so no single one burns its daily call allowance.
- Use the production URL. Register the Webhook node’s production URL with Xero, not the test URL used while building.
Failure and recovery
| Failure | Symptom | Recovery |
|---|---|---|
| Signature mismatch on every delivery | Intent to receive never passes, or all events rejected | Hash the raw body exactly as received; check the webhook key was copied without whitespace |
| Wrong tenant ID on an API call | Data from one client appears under another | Take the tenant ID from the event itself, never from a workflow variable left over from a previous item |
| Client disconnected the firm’s app | Calls for that organisation fail with an authorization error | Mark the client “connection lost” in the queue and assign the client manager to reconnect |
| Rate limit reached | HTTP 429 with a retry-after value | Wait the stated time, then resume that organisation only |
| Events arrive out of order | A paid invoice reappears as overdue | Compare UpdatedDateUTC and keep the newest version |
| Endpoint down for hours | Xero stops delivering after repeated failures | Monitor delivery status in the Xero developer portal and backfill invoices changed since the outage |
Tests before go-live
- Authorise an invoice in the Xero demo company with a past due date: one receivables item appears with the right client.
- Void that invoice: the item updates to voided rather than creating a second item.
- Send a delivery signed with the wrong key: n8n rejects it and nothing reaches the queue.
- Deliver an event for a tenant that is not in the lookup table: processing stops and the automation owner is alerted.
- Add three unreconciled bank lines: the next poll shows a count of three for that account, and a second poll with no changes adds nothing.
Ownership
The client service lead decides which statuses and ages create queue items and reviews the queue daily. The automation owner keeps the Xero connection, webhook key and tenant lookup table current, reviews failed executions twice a week, and confirms quarterly that every connected organisation is still an active client.
Data notes
The FTC Safeguards Rule covers client ledger data handled in n8n. Where n8n runs, and how long execution data is kept, are part of that decision; see the hosting comparison linked below. Keep amounts and counterparty names out of notification emails.
This page describes an administrative process. It is not legal or tax advice; have a qualified professional review your firm’s policies.
Sources
- Xero: webhooks overview
- Xero Accounting API: invoices
- Xero: API limits
- n8n docs: Xero node
- n8n docs: Webhook node
Related guides
Queue items feed receivables aging follow-up and invoice and payment reconciliation. For the ledger and hosting decisions behind this build, read QuickBooks Online vs. Xero and n8n Cloud vs. self-hosted. Track lost connections and queue backlog in Operations Desk.
Sources and application notes
Timings, workload estimates and approval limits in this guide are proposed operating settings. Adapt them to your firm; binding duties come from the applicable rules.
- FTC Safeguards Rule compliance guide
- Xero: webhooks overview
- Xero Accounting API: invoices
- Xero: API limits
- n8n docs: Xero node
- n8n docs: Webhook node
U.S. tax and legal examples need jurisdiction-specific review. ABA model rules apply only as adopted. Sources describe requirements or product behavior; they do not certify this workflow.
Publisher: FirmWorkflows. Report a correction with the URL and statement concerned.
Published by FirmWorkflows · Published · Updated