Sync Salesforce opportunities to Xero invoices

CRMMarketingAccounting

What it does

When a new or updated opportunity arrives in Salesforce, this automation checks for specific conditions and creates an invoice in Xero. If the invoice creation succeeds, it also creates the item in Xero and updates the opportunity record.

Who it's for

Accounting teams who need to sync qualified Salesforce opportunities to Xero invoices without manual entry.

How teams use this

Convert qualified opportunities to invoices

When an opportunity meets the criteria, this automation creates the Xero invoice and line item in one flow. The team no longer has to open Xero or re-enter the data.

Sync only campaigns with approval

Retarget this automation to run only when the Campaign ID points to an approved campaign in Salesforce. The same steps run, but only for pre-qualified deals.

Add custom fields to the Xero invoice

Extend the automation to include additional Salesforce fields such as account name or deal stage on the Xero invoice. Set up field mappings so both systems stay in sync.

Filter invoices by opportunity amount

Add a condition to check the opportunity amount before creating the invoice in Xero. Only invoices above a threshold will sync, reducing clutter in the accounting system.

How it works

  1. Monitor for new or updated opportunity. Watch Salesforce for a new or updated opportunity. The automation checks if the Xero Status contains Request, Xero Confirmation is not present, and Campaign ID exists.
  2. Retrieve campaign details. Fetch the full campaign record from Salesforce so the invoice has the correct context and linked information for Xero.
  3. Create invoice with line item. Build and send the invoice to Xero with a single line item based on the opportunity and campaign data from Salesforce.
  4. Create the item in Xero. Add the line item to Xero's inventory so future invoices can reference it and keep both systems aligned.
  5. Update the opportunity record. Mark the opportunity in Salesforce with the Xero invoice details so the team knows the sync is complete.