Sync Salesforce opportunities to Xero invoices

CRMMarketingSalesAccounting

What it does

When a new opportunity is created in Salesforce, this automation searches Xero for the customer contact. If missing, it creates the contact, then builds an invoice in Xero with line items matching the opportunity products.

Who it's for

Accounting teams who need to move Salesforce opportunities into Xero invoices without manual data entry.

How teams use this

Move won deals to accounting automatically

When a Salesforce opportunity closes, the customer and invoice details sync to Xero so accounting can process payment without re-entering data.

Sync only opportunities at a specific stage

Add a condition to check the opportunity stage before syncing, so only closed or committed deals create invoices in Xero.

Route invoices by customer region

Extend the flow to check a customer field in Salesforce and route the Xero invoice to a region-specific accounting queue for approval.

Use this for sales operations reporting

Sales operations teams can monitor the sync to verify that all closed deals reach accounting on time and catch any missing customer records.

How it works

  1. New opportunity created in Salesforce. A new opportunity is created in Salesforce with customer contact and product details.
  2. Search for the customer in Xero. Search Xero for the customer contact to verify it exists before creating an invoice.
  3. Create the customer if missing. If the contact does not exist in Xero, create it so the invoice has a valid customer record.
  4. Get opportunity products from Salesforce. Retrieve all product line items related to the opportunity so each can be added to the Xero invoice.
  5. Create invoice with line items in Xero. Build a new invoice in Xero with the opportunity data and loop through each product to add matching line items.