Overview
The Xero Bills Connector reads approved bills, supplier contacts and tax rates from your Xero organisation and turns the bills into purchase invoices in Business Central. It only reads from Xero; it never changes anything there.
If several legal entities share one Xero organisation, each bill is tagged in Xero with a tracking option that says which company it belongs to. The connector uses that tag to send each bill to the right Business Central company.
What it does
- Downloads approved bills with their lines, supplier contacts and tax rates on a schedule you choose.
- Routes each bill to the right company and keeps bills with no company tag visible for review instead of dropping them.
- Creates missing vendors from Xero contacts, using your vendor templates.
- Creates purchase invoices and, if you choose, posts them straight away.
- Checks VAT and totals against Xero before posting, so a wrong tax mapping is caught before it reaches the ledger.
- Shows every bill's status in one list, with the reason for any error and a link back to the bill in Xero.
Two roles
| Role | What it does |
|---|---|
| Connected company | Holds the only Xero connection. Downloads bills, contacts and tax rates into a list every company can see, and decides which company each bill belongs to. |
| Processing company | Picks up its own bills from that list, creates vendors and purchase invoices, and records the result. It never connects to Xero. |
With only one company, it simply takes both roles.
Before you start
- Business Central: Business Central online, Essentials or Premium. All companies that receive Xero bills must be in the same environment.
- Xero access: a Xero user who can approve app connections for your organisation.
- Business Central permissions: the Xero Integration – Admin permission set for whoever sets up the connection, and Xero Integration – Processor for finance users and the job queue user in each company.
- Company tags in Xero: if you have more than one company, a tracking category (for example “Company Code”) filled in on every bill line.
- Chart of accounts: Xero account codes that exist as G/L account numbers in each company, or a translation table (see field mappings).
- VAT setup: VAT posting groups and VAT posting setup in each company for the tax rates you use in Xero.
Set up the connected company
Do this once, in the company you choose to hold the Xero connection.
-
Create an app in Xero
Sign in to the Xero developer portal, open My Apps and choose New app. Pick Web app, enter a redirect URI (any address you control, for example
https://localhost/xero), then generate and copy the Client ID and Client Secret. Xero shows the secret only once. - Fill in Xero Setup In Business Central, search for Xero Setup. Set Integration Role to Connected company, then enter the Client ID, Client Secret and the redirect URI exactly as registered in Xero, including https and any trailing slash.
-
Enter the scope
Copy this into the Scope field. It gives read-only access to bills, contacts and tax settings, and lets the connection renew itself.
offline_access accounting.invoices.read accounting.contacts.read accounting.settings.read -
Connect to Xero
Choose Authorize App. Sign in to Xero, select one organisation and choose Allow. Your browser opens the redirect URI; copy the value after
code=(up to the next&) into Authorize Code. Straight away, choose Get Access Token and then Get Tenants. The code expires within minutes. - Map company tags Open Xero Company Code Mapping and add one line per tracking option used in Xero, with the Business Central company it belongs to. Skip this if you have only one company.
- Download tax rates Open Xero Tax Rates and choose Pull Tax Rates. Each company then maps these to its own VAT setup.
- Load the field mappings Open Xero Mapping Sets, choose Load Default Mapping, then Check Mapping. The defaults work for most customers.
-
Schedule the jobs
Create these job queue entries in the connected company, and set up email alerts for them in Error Notification Setup.
Job Suggested frequency Refresh Access Token Every 20 minutes Pull Tax Rates Daily Xero Pull (contacts and bills) Hourly Xero Housekeeping Daily
Xero addresses
Most customers can keep the default addresses on the setup page. If you need to enter them by hand:
| Field | Value |
|---|---|
| Authorize App Url | https://login.xero.com/identity/connect/authorize?response_type=code&client_id=%1&redirect_uri=%2&scope=%3&state=%4 |
| Access Token Url | https://identity.xero.com/connect/token |
| Connection Url | https://api.xero.com/connections |
| Tax Rate Url | https://api.xero.com/api.xro/2.0/TaxRates |
| Invoice Line Url | https://api.xero.com/api.xro/2.0/Invoices/%1 |
| View Invoice URL | https://go.xero.com/AccountsPayable/View.aspx?InvoiceID=%1 |
Set up each company
Do this in every company that receives bills, including the connected company if it has bills of its own.
- Fill in Xero Setup Set Integration Role to Processing company. Enter the Company Code exactly as it appears in Xero, choose a Vendor Template, and decide whether to post automatically or create invoices for review first.
- Map tax codes Follow Map tax codes below.
- Test with a real bill Open Xero Test Mapping, pick one of your waiting bills and check the vendor, header and line values it would create. Nothing is saved.
- Schedule processing Add a job queue entry for Xero Bill Processor, hourly, about 15 minutes after the connected company's pull.
Process bills
Open Xero Bills. In a processing company you see only that company's bills; in the connected company you see all of them.
- Process All Ready processes every waiting bill now, the same as the scheduled job.
- Process Selected processes only the bills you mark.
- Open Purchase Invoice opens the Business Central document created from a bill.
- Open in Xero opens the original bill in your browser.
Each bill is processed on its own. If one fails, nothing is left half-created and the rest carry on.
What each status means
| Status | Meaning | What to do |
|---|---|---|
| Ready | Waiting for its company's next run | Nothing |
| Created | Purchase invoice created, not posted, because automatic posting is off | Review the invoice and post it |
| Posted | Posted in Business Central | Nothing |
| Unmapped | The bill has no company tag, or its tag isn't in the company mapping | Fix the tag in Xero, or add it to Xero Company Code Mapping, then choose Reprocess |
| Error | Processing stopped; the reason is shown on the bill | See Troubleshooting, fix the cause, then process the bill again |
| Skipped | Voided or deleted in Xero before it was posted | Nothing |
Bills changed in Xero after posting are flagged, not changed. Business Central never edits a posted invoice. If the change matters, correct it with a credit memo.
Map tax codes
Each company maps Xero tax rates to its own VAT setup, because VAT posting groups differ from company to company.
- Get the Xero tax ratesOpen Xero Value Maps, select TAX and choose Get Xero Values. Every tax rate used for expenses in Xero is added with the Business Central side blank.
- Choose a VAT group for eachPick a VAT Prod. Posting Group for each Xero tax type. Suggest fills in groups whose VAT % matches the Xero rate; check each suggestion before saving.
- Handle special casesFor reverse-charge or import tax types, also set a VAT Bus. Posting Group override that points at the matching VAT posting setup.
Rows where the Xero rate and the Business Central VAT % differ are highlighted. Bills that use them stop with an error until the mapping is fixed. If a new tax rate appears in Xero later, it's added to the list automatically and its bills wait until you map it.
To reuse another company's mapping, choose Copy from Company. Rows that point at VAT groups missing in this company are left out.
Change field mappings
The connector decides which Xero field fills which Business Central field using mapping tables, so you can change it without development. There are four sets: Vendor, Tax, Invoice header and Invoice lines.
- Open the setSearch for Xero Mapping Sets and open the one you want to change.
- Edit a lineChange the Xero field, the rule (for example copy as is, fixed value, or translate through a value map), or switch on one of the optional lines that ship turned off.
- Check itChoose Check Mapping. Processing won't run with a mapping that fails this check.
- Test itRun Xero Test Mapping against a real bill before the next scheduled run.
Optional mappings you can switch on
- Vendor country, second address line and default currency.
- Prices Including VAT, set from whether the Xero bill is tax-inclusive.
- Document date, your reference and the Xero exchange rate.
- Line discount, a G/L account translation table, and Xero tracking categories into dimensions.
Lines marked Locked are needed for the connector to work, such as the Xero ID and vendor number. You can change how they're filled, but not remove them. Mapping changes affect only bills not yet processed.
Troubleshooting
Connecting to Xero
| Message | Cause | Fix |
|---|---|---|
invalid_scope | An old or misspelled scope is in the Scope field | Use only the four scopes in step 3, then authorise again |
unauthorized_client | Wrong Client ID, wrong app type, or redirect URI doesn't match | Make sure the Xero app is a Web app and the redirect URI matches character for character |
invalid_grant | The authorisation code expired or was already used | Run Authorize App again and get the token immediately |
| 401 Unauthorized | The access token expired and wasn't renewed | Check the Refresh Access Token job is running; if it stopped for more than a few weeks, authorise again |
| 429 Too Many Requests | Xero's API limit was reached | No action needed; the next scheduled run carries on |
| No bills arrive | Wrong status filter or date window, or the connection is turned off | Check Invoice Status, the day limits and Enabled in Xero Setup, and the Integration Logs |
Processing bills
| Error on the bill | Fix |
|---|---|
| Tax type is not mapped | Fill in the new row in the TAX value map |
| Tax rate differs from Business Central | Correct the mapping or the VAT posting setup |
| Totals differ from Xero | Compare with the bill in Xero; check whether it's tax-inclusive, has discounts, or uses the wrong tax mapping |
| G/L account does not exist | Create the account, or add the Xero code to the G/L account translation table |
| Posting date is not within your allowed range | Open the period or adjust allowed posting dates for the job queue user |
| Vendor Invoice No. must have a value | Add a bill number in Xero; the bill is refreshed on the next pull |
| Mixed company codes | The bill's lines are tagged for more than one company; correct the tags in Xero |
FAQ
Does the connector change anything in Xero?
No. It uses read-only access and never creates, edits or approves anything in Xero.
Which Xero bills are imported?
Supplier bills (Accounts Payable) in the status you choose in Xero Setup, usually Authorised. Sales invoices are not imported.
Can a bill be posted twice?
No. Each bill is stored once using its Xero ID, and the connector checks for an existing posted invoice with the same ID before creating a new one.
Can our companies see each other's bills?
Processing pages show only the user's own company. Assign the Xero Integration – Admin and Viewer permission sets only to people who should see all companies.
We have one company. Do we still need company tags?
No. With one company it takes both roles, and every bill is processed there.
What happens if the Xero connection stops?
No new bills arrive, but nothing already imported is affected. The job sends an email alert, and you fix it once, in the connected company.
Where are the details of each Xero call?
In Integration Logs, with the address called, the result and Xero's response. Entries older than the retention period are removed automatically.
Get support
Need help setting up the connector, or stuck on an error? Our Business Central consultants can help. Help for all TSL Labs apps is in the Help Center.
Contact supportTerms of use
Your use of the Xero Bills Connector is governed by the TSL Labs Software Terms of Use, which cover the license, fees, your responsibilities for postings and tax mappings, warranty and limitation of liability. How the connector handles data is described in the TSL Labs Software Privacy Policy.