Quick overview
This workflow triggers on new Shopify orders, finds or creates the matching customer in Xero, converts the order line items and shipping into an AUTHORISED accounts receivable invoice, and optionally records a payment when the order is marked paid, with failures reported to Slack and email.
How it works
- Triggers when a new order is created in Shopify.
- Loads configuration values for your Xero tenant, account codes, tax type, and line amount handling.
- Searches Xero Contacts for a match on the Shopify customer email and creates a new contact in Xero if none exists.
- Maps Shopify line items, discounts, and shipping lines into a Xero invoice payload using your configured account codes and tax type.
- Creates an AUTHORISED ACCREC invoice in Xero via the Xero Accounting API.
- If the Shopify order financial status is paid, creates a payment in Xero against the invoice using the configured bank/clearing account code.
- If any Xero or API step fails, formats the error details and sends notifications to Slack and via SMTP email.
Setup
- Add Shopify Admin API credentials (access token) with scopes including read_orders and read_customers, then enable the Shopify “orders/create” trigger.
- Add a Xero OAuth2 credential with scopes including accounting.transactions and accounting.contacts, and set your Xero tenant ID in the Config step.
- Update the Config values for sales/shipping account codes, tax type, line amount type (Inclusive/Exclusive), and the payment account code used to receive Shopify payouts.
- Add a Slack credential and set the target channel ID and/or add an SMTP credential and set the from/to email addresses for error notifications.
- Create a Shopify test order to validate contact matching, invoice creation, and payment posting before activating the workflow.