Create Xero invoices from Salesforce opportunities
Recipe ToolsCRMMarketingAccounting
What it does
When a Salesforce opportunity reaches Closed-Won, this automation creates a Xero invoice. It syncs the contact and products to Xero if missing, 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
Invoice closed deals without manual entry
Move Closed-Won opportunities to Xero as invoices automatically. Contacts and products sync as needed, and the invoice number updates in Salesforce so nothing is missed.
Route invoices to different Xero orgs
Redirect this automation to invoice into a different Xero organization based on the Salesforce opportunity region or business unit. The steps remain the same.
Add custom fields to the Xero invoice
Include Salesforce custom fields like project code or cost center on the Xero invoice line items. Set those fields during the invoice creation step.
Filter invoices by opportunity amount
Only create Xero invoices for Closed-Won opportunities above a minimum amount. Add a condition after the trigger to check the opportunity value.
How it works
- Detect a closed-won opportunity. Monitor Salesforce for opportunities that move to Closed-Won status and are ready to invoice.
- Gather opportunity and contact details. Search Salesforce for the opportunity, its products, and the related contact information needed to create the Xero invoice.
- Sync contact to Xero. Search Xero for the contact from Salesforce. If found, verify the record exists. If not, create the contact in Xero using the Salesforce account and contact data.
- Create invoice with line items. Create the Xero invoice with the opportunity products as line items. Add any missing products to Xero first so they are available on the invoice.
- Store invoice number in Salesforce. Update the Salesforce opportunity Next Step field with the Xero invoice number so the two records stay linked.