Skip to content
injuid

Guide / Automation

Integrating with Xero, done properly.

Most Australian small businesses run their money through Xero and their work through something else. The gap between the two is where the Friday re-keying lives. Closing it is one of the highest value automations there is, and one of the easiest to get subtly wrong.

Read time
Seven minutes
Sections
5

01, What the Xero API lets you do

What the Xero API lets you do

Xero exposes most of what you see in the product. Contacts, invoices, bills, payments, credit notes, items, bank transactions, and reports can all be read and, for most of them, written. Authentication is OAuth 2.0, which means a business authorises the integration through Xero's own login screen and can revoke it there too.

That authorisation is the first thing to get right. It should be granted by an account the business owns, not the developer's personal Xero login. If the developer moves on and their access is removed, an integration authorised on their account stops the same day.

02, When a connector is enough

When a connector is enough

If the job is one direction, one object, and low volume, an off-the-shelf connector will probably do. New form submission creates a contact. Paid invoice posts a message somewhere. Zapier, Make, and Power Automate all have Xero connectors, and for that kind of job they are cheaper than code.

Code earns its place when the job involves matching. A job system that needs to find the right existing contact rather than create a duplicate. An invoice that needs line items from three places with the right tax rate on each. A reconciliation between what the job system says was billed and what Xero says was paid. Connectors do these badly because they cannot hold enough logic, and the failures are quiet.

03, The limits that catch people out

The limits that catch people out

Xero rate limits every connected organisation to 60 calls a minute and 5,000 a day, with a small number of concurrent calls at once. That is plenty for day to day sync and not nearly enough for a naive first import of five years of history, which is exactly what most integrations try on day one. Bulk work has to be batched and spread, and the integration has to handle being told to wait.

Tokens expire and have to be refreshed. Organisations can disconnect the app. Xero has scheduled maintenance. An integration that assumes the connection is always there will fail on the first Tuesday it is not, and if nothing is watching, nobody finds out until the invoices are wrong.

04, The mistakes that put wrong numbers in your accounts

The mistakes that put wrong numbers in your accounts

These are the ones that cost money, and they are all avoidable if someone has seen them before.

  • Duplicate contacts, because the integration matched on name instead of on a stable identifier
  • GST rounding differences between the job system and Xero, so the totals disagree by cents on every invoice and by dollars at the end of the quarter
  • Two systems both allowed to write the same field, so a change in one silently overwrites the other
  • A sync that ran twice and posted every invoice twice, because nothing checked whether it had already happened
  • Secrets for the integration pasted into a spreadsheet script or a client-side app, readable by anyone who looks
  • No log of what was sent, so when the accountant asks why a figure is wrong there is no answer

05, What a good integration looks like from the outside

What a good integration looks like from the outside

It runs on an account the business owns. It logs every record it touches. It never posts the same thing twice. It tells someone when it could not run. And it comes with a page that says, in plain words, which system is the source of truth for each field.

It is also scoped as its own fixed-price job. Most businesses do not need a whole new system to get Xero talking to the work. They need the one integration, done properly, and someone watching it.