Create Xero invoice from Salesforce Closed-Won opportunity

CRMMarketingSalesAccounting

What it does

When a Salesforce opportunity moves to Closed-Won, this automation creates an invoice in Xero. It also creates the contact and items in Xero if they do not already exist, then stores the invoice number back in Salesforce.

Who it's for

Accounting teams who need invoices in Xero generated automatically when deals close in Salesforce.

How teams use this

Automate invoice creation on deal close

When a deal closes in Salesforce, the invoice is ready in Xero without manual data entry. Accounting can send it immediately and reconcile faster.

Sync new contacts across both systems

If the contact does not exist in Xero, this automation creates it from Salesforce account and contact data so the invoice has complete billing information.

Include custom fields on invoices

Add purchase order number or project code fields to the Xero invoice so each invoice includes the custom data tracked in Salesforce opportunities.

Route invoices to different Xero accounts

Filter opportunities by region or business unit so invoices are created in the correct Xero organization based on where the deal closed.

How it works

  1. Opportunity reaches Closed-Won stage. A Salesforce opportunity is created or updated with the Stage set to Closed-Won and the Next Step field is empty.
  2. Retrieve account and contact details. Search Salesforce for the account and contact linked to the opportunity so their information can be used in Xero.
  3. Check for existing contact in Xero. Search Xero for a contact matching the Salesforce account. If not found, create the contact in Xero using the account and contact details.
  4. Create items and invoice in Xero. Create line items in Xero for each opportunity product, then create the invoice with those items. Store the Xero invoice number in the Salesforce Next Step field.