Xero and Shopify integration
Xero keeps your books. Shopify runs your storefront. Connecting the two lets you capture every online sale as an invoice without re-keying, sync customers into your contact list, and record order payments back into accounts receivable. ml-connector listens to Shopify order events in real time and writes the matching records into Xero with the correct accounts and customer references, so your financial records stay synchronized with your sales.
What moves between them
The main flow runs from Shopify into Xero. When a Shopify order is placed and marked paid, ml-connector captures it via webhook and writes a Xero invoice tied to the matching customer contact, allocated to the revenue accounts configured for each product category. Customer records created or updated in Shopify are synced to Xero contacts in near real time. Payment transactions from Shopify orders are recorded into Xero accounts receivable, indexed by order ID for full traceability. Xero contacts and accounts flow in the reverse direction as reference data so Shopify orders always map to valid Xero dimensions.
How ml-connector handles it
ml-connector stores OAuth2 credentials for both systems encrypted and refreshes access tokens as they expire: Xero tokens every 30 minutes, Shopify tokens on demand or at renewal. On the Shopify side, it registers and listens to webhooks for order lifecycle events (create, update, paid, cancelled) and customer changes, verifying each webhook signature with the client secret. When an order arrives, ml-connector looks up or creates the customer contact in Xero, retrieves the product-to-account mapping from configuration, builds a Xero invoice with line items allocated to the correct revenue accounts and tracking categories, and posts it. If a post fails or Xero returns 429 (rate limit), ml-connector backs off and retries with exponential jitter. Every order carries its Shopify order ID through the Xero invoice description and audit trail for full reconciliation. Xero's tenant-specific account requirements mean the integration stores the Xero organization ID per customer.
A real-world example
A small e-commerce business runs Shopify Plus for direct-to-consumer sales across apparel and digital goods, serving 500 to 2000 orders per month. Before the integration, the finance team exported Shopify orders weekly, manually created invoices in Xero, and entered payments by hand, creating a 3 to 5 day lag and frequent mismatches between Shopify order status and Xero invoice dates. Customers were duplicate records in both systems. With Shopify and Xero connected, each order instantly becomes an invoice allocated to the correct revenue account, customer records synchronize on the first order, and payment reconciliation is trivial. Month-end close no longer requires a manual order export or invoice re-entry step.
What you can do
- Capture Shopify orders as Xero invoices in real time via order/paid webhooks, allocated to configured revenue accounts.
- Sync Shopify customers as Xero contacts, keeping both systems aligned on customer names and email addresses.
- Map Shopify product categories and variants to Xero accounts and tracking categories so every invoice line item lands on the correct account.
- Verify Shopify webhook signatures and handle OAuth2 token refresh for both systems independently.
- Retry failed Xero posts on 429 rate limit and maintain a full audit trail of every order-to-invoice mapping for reconciliation.
Questions
- Which direction does data flow between Shopify and Xero?
- The primary flow is Shopify into Xero. Paid orders become invoices, and customer records sync from Shopify to Xero contacts. Reference data such as Xero accounts and Shopify product-to-account mappings flow in the reverse direction to ensure every invoice line item maps to a valid Xero account.
- What happens if a Shopify order cannot be written to Xero?
- ml-connector backs off and retries if Xero returns 429 (rate limit) or a transient error. Every record carries a full audit trail and can be replayed if a downstream call fails. Your support team can access the audit log to see the exact point of failure and the order ID.
- How does ml-connector handle Xero and Shopify authentication?
- OAuth2 credentials for both systems are stored encrypted in ml-connector. Xero access tokens expire every 30 minutes and are refreshed automatically. Shopify offline tokens are long-lived; ml-connector refreshes on demand. Every Shopify webhook signature is verified with the client secret before processing.
Related integrations
More Xero integrations
Other systems that connect to Shopify
Connect Xero and Shopify
Free to use. Add your credentials, ping your real systems, and see if we fit.
Get started