Sync paid Xero invoices to Salesforce opportunity status

AccountingUtilitiesCRMMarketingSales

What it does

When an invoice is marked paid in Xero, this automation finds the corresponding Salesforce opportunity using the invoice reference ID. It updates the opportunity's payment status to Paid, or sends an email alert if the reference is missing or invalid.

Who it's for

Accounting teams who need Salesforce opportunities to reflect payment status from Xero without manual updates.

How teams use this

Close opportunities when invoices clear

Mark opportunities as paid in Salesforce the moment the invoice status changes in Xero, so the sales team knows which deals have been settled without checking two systems.

Route missing references to finance

When an invoice lacks a reference ID, send the alert to a specific finance email or Slack channel so the team can add the opportunity link before the next sync runs.

Add custom payment terms to the update

Set additional fields on the opportunity, such as payment date or terms, by mapping more Xero invoice fields into Salesforce when the payment status is updated. Requires custom fields in Salesforce opportunity.

Filter invoices by amount or customer

Only sync paid invoices above a certain threshold or from specific customers by adding conditions to the trigger, so high-value deals get priority attention. Requires filter condition on invoice amount or customer name.

How it works

  1. Monitor for paid invoices. Watch Xero for invoices marked as paid. The automation checks invoices updated in the past hour to find those with a reference ID linking to Salesforce.
  2. Verify the reference ID exists. Check whether the Xero invoice reference field contains a Salesforce opportunity ID. If the reference is blank, the next step sends an alert email instead of updating.
  3. Confirm the ID format. Verify the reference ID starts with 006, the prefix for Salesforce opportunities. IDs without this prefix are skipped to prevent updates to the wrong record type.
  4. Update opportunity payment status. Set the Payment Status field on the matching Salesforce opportunity to Paid so the sales team sees the invoice has been settled.
  5. Email the team when reference is missing. Send an email to the accounting team when a paid invoice has no reference ID, so someone can investigate and link it manually to Salesforce.