Xero and Salesforce integration
Xero runs accounting for small and medium businesses. Salesforce runs sales and customer relationships. Connecting the two keeps your customer master data and invoice records aligned across both platforms. New contacts created in Xero flow into Salesforce accounts and contacts, and invoices synced from Xero update linked Salesforce opportunity or order records with payment status and amounts due. ml-connector handles the different API shapes, the OAuth2 credential refresh, and every sync is audited so you can replay a record if something goes wrong downstream.
What moves between them
Data flows primarily from Xero into Salesforce. Xero contacts are created or updated via webhook or poll, then mapped to Salesforce Account and Contact records. Xero invoices sync into Salesforce as linked invoice records tied to the matched Account, carrying invoice number, amount, due date, and payment status. Credit notes and payments also sync, updating the payment status on linked Salesforce records. The sync happens on a schedule you set, or immediately when Xero webhooks are received. Salesforce does not push data back to Xero; the connection is one-way from Xero to Salesforce.
How ml-connector handles it
ml-connector stores the Xero OAuth2 refresh token encrypted and automatically refreshes the access token when it nears expiry or when a call returns 401. Each Xero organization is identified by its tenant ID, which ml-connector includes in the Xero-tenant-id header on every request. When Xero webhooks arrive, ml-connector decodes the webhook signature and immediately fetches the full record from Xero, since webhook payloads contain metadata only. For reliability, ml-connector backs off and retries when hitting Xero rate limits (429 or backoff header), and it respects the per-minute and per-day quotas by batching reads and spacing them out. Contacts are mapped first, and their Xero contact ID is stored on the Salesforce Account or Contact record as an external ID so future updates find the matching record. Invoices link to their matched Account, and payment status updates keep the two in sync. Every contact, invoice, and payment carries a full audit trail and can be replayed if a write to Salesforce fails.
A real-world example
A mid-sized B2B services firm uses Xero to manage invoices, payments, and accounting, and Salesforce to track clients and opportunities. Previously, the sales team maintained client lists in both systems by hand, and invoice status was checked manually in Xero during deal reviews. With Xero and Salesforce connected, each new customer created in Xero as a contact flows automatically into Salesforce as an Account with contact details, and invoices tied to that Account appear in Salesforce with due dates and payment status. The sales team sees invoice aging directly on the Account record and can chase overdue amounts without logging into Xero, and the finance team knows which customers have open opportunities, cutting blind spots in collections planning.
What you can do
- Sync Xero contacts into Salesforce accounts and contacts, with external ID matching to prevent duplicates.
- Push Xero invoices into Salesforce with invoice number, amount, due date, and payment status linked to the matched Account.
- Automatically handle Xero OAuth2 token refresh and per-tenant API headers on every request.
- Receive Xero webhook notifications and fetch full records immediately, with fallback to polling for redundancy.
- Audit every contact, invoice, and payment sync and replay failed writes if downstream errors occur.
Questions
- Which direction does data flow between Xero and Salesforce?
- Data flows from Xero into Salesforce. Contacts and invoices are pushed from Xero to Salesforce, where they are matched to existing Accounts and Contacts by external ID or created new. Payment status updates in Xero also sync to Salesforce. Salesforce does not push data back into Xero; the connection is one-way.
- How does ml-connector handle Xero webhooks and the fact that they only contain metadata?
- When a Xero webhook arrives, ml-connector decodes and validates the webhook signature, then immediately follows up with a GET request to fetch the full record from Xero, since the webhook payload includes only the resource ID. This ensures Salesforce always receives complete invoice and contact data. ml-connector also polls as a fallback if webhooks are missed.
- What happens when Xero rate limits are hit or OAuth tokens expire?
- ml-connector tracks token expiry and refreshes the OAuth2 access token before it expires, using the 60-day refresh token. When Xero returns a rate limit response (429) or backoff header, ml-connector exponentially backs off and retries. The integration respects the 5 concurrent call limit and 60-per-minute quota by spacing out batch reads.
Related integrations
More Xero integrations
Other systems that connect to Salesforce
Connect Xero and Salesforce
Free to use. Add your credentials, ping your real systems, and see if we fit.
Get started