Sync new/updated FreshBooks invoice to Xero

AccountingUtilities

What it does

When a new invoice is created or updated in FreshBooks, this automation searches Xero for a matching invoice. It creates or updates the invoice, syncs the contact, and applies line items and taxes so both systems stay current.

Who it's for

Accounting teams who use FreshBooks and Xero and need invoices to stay synchronized across both platforms.

How teams use this

Keep invoices synced between systems

Create new invoices in Xero whenever someone creates one in FreshBooks, and update status when an invoice is marked sent or paid. Both systems stay current without manual entry.

Prevent duplicate invoices with reference tracking

Store the FreshBooks invoice ID in the Xero reference field so the automation can match invoices on future runs. Do not delete this reference or the sync will break and create duplicates.

Sync contacts only when missing

Search Xero for a contact by email first, then by name if no email exists. Create the contact in Xero only if no match is found so the invoice attaches to the right customer.

Apply tax codes to line items

Check if each FreshBooks line item is taxable, then apply the tax code name specified in the setup to that line item in Xero. Skip tax if the invoice is set to non-taxable.

How it works

  1. Monitor FreshBooks for new invoices. This automation runs on a schedule and picks up any invoice created or updated in FreshBooks since the last check.
  2. Search Xero for matching invoice. Look for an existing Xero invoice by checking the reference field for the FreshBooks invoice ID to avoid creating duplicates.
  3. Create or update invoice. If no match is found, create a new invoice in Xero with the FreshBooks details. If a match exists and the status has changed, update the Xero invoice status and due date.
  4. Sync contact and line items. Search Xero for the FreshBooks contact by email or name. Create the contact if needed, add each line item to the invoice, and apply the tax code if the line item was taxable in FreshBooks.