Create Xero invoice from Salesforce closed opportunity
CRMMarketingSalesAccounting
What it does
When an opportunity stage changes to Closed Won in Salesforce, this automation searches Xero for a matching contact. It creates the contact if missing, then generates an invoice in Xero and updates Salesforce to show the invoice was synced.
Who it's for
Accounting teams who need to turn closed deals in Salesforce into Xero invoices without manual data entry.
Apps used
How teams use this
Automate invoice creation from deals
When a deal closes in Salesforce, an invoice is automatically created in Xero with all account details. The team no longer needs to manually enter closed deals into the accounting system.
Track invoice payments across systems
Store the Xero invoice reference in a Salesforce custom field so the sales team can check payment status without leaving Salesforce. This requires setting up a Reference custom field on opportunities.
Prevent duplicate invoices on updates
If an opportunity is updated multiple times after closing, the automation checks the description for Xero and stops, so only one invoice is created per deal. No manual deduplication is needed.
Notify teams when invoices are created
Add email notifications to alert the accounting or sales team when a new invoice is generated in Xero. This keeps both teams informed without checking either system.
How it works
- Monitor for closed opportunities. When an opportunity stage changes to Closed Won in Salesforce and the description does not already contain Xero, this automation runs.
- Search for the contact in Xero. Search Xero for a contact using the account name from the Salesforce opportunity so a duplicate contact is not created.
- Create the contact if missing. If the contact does not exist in Xero, create it using the account name, billing address, email, and fax from Salesforce.
- Create the invoice in Xero. Create an invoice in Xero with the contact name from Salesforce, set status to Authorized, and due date one month after the close date.
- Update the opportunity record. Update the Salesforce opportunity description with the Xero invoice number and store the reference number in a custom field for payment tracking.