Sync Salesforce opportunities to Xero invoices

CRMMarketingAccounting

What it does

When a Salesforce opportunity is created or updated, this automation checks if a draft invoice exists in Xero. If one does, it syncs the opportunity details to the invoice and updates the opportunity record.

Who it's for

Accounting teams who need Salesforce opportunities and Xero invoices to stay in sync without manual entry.

How teams use this

Keep invoices current with opportunities

When an opportunity amount or details change in Salesforce, the draft invoice in Xero updates automatically so accounting always has the latest figures without manual rework.

Sync campaigns to invoice line items

Pull campaign details from Salesforce into Xero line items so invoices show which campaign drove the deal. This gives finance visibility into revenue by campaign source.

Extend sync to closed opportunities only

Add a condition to filter and sync only opportunities with a closed status so draft invoices are created only for deals that have been won. This prevents invoices for open or lost deals.

Route invoices by opportunity owner

Include a step to check the opportunity owner in Salesforce and assign the Xero invoice to the matching team member so each person sees their own invoices.

How it works

  1. Monitor Salesforce opportunities. When a new or updated opportunity appears in Salesforce, this automation checks whether a draft invoice exists in Xero for that opportunity.
  2. Update invoice header in Xero. Update the bill or invoice header details in Xero with the opportunity information so the invoice reflects the current state of the deal.
  3. Retrieve campaign details. Get the details of the specific campaign linked to the opportunity in Salesforce to include in the invoice line items for tracking revenue source.
  4. Add or update line items. Upsert the line item to the bill or invoice in Xero so the invoice includes the latest opportunity and campaign details from Salesforce.
  5. Confirm sync in Salesforce. Update the opportunity record in Salesforce to mark that the invoice sync is complete and both systems are aligned.