How it works

Follow these 9 simple steps to automatically create Xero invoices from Shopify orders while managing customer contacts

Shopify logo icon

Order Created

App connector: Shopify • Time to complete: 0 minutes (Auto-configured)
Why this matters: This monitors your Shopify store for new orders and initiates the invoice creation process in Xero the moment a customer completes checkout.

When a customer places an order in Shopify, this trigger captures all order details including customer information, billing address, line items, and order totals. The workflow is set to trigger on "every" order by default.

Retrieve Shop

App connector: Shopify • Time to complete: 0 minutes (Auto-configured)
Why this matters: This fetches your Shopify store domain and settings needed to construct proper links back to orders in your Xero invoices.

The workflow retrieves your Shopify shop information, primarily to build the admin URL that appears in the Xero invoice. This allows you to click directly from Xero to the corresponding Shopify order for reference.

Get List of Contacts

App connector: Xero • Time to complete: 0 minutes (Auto-configured)
Why this matters: This checks if the Shopify customer already exists in your Xero contacts database, preventing duplicate contact creation.

The workflow searches Xero for a contact whose email address matches the Shopify customer's email. This lookup determines which processing path the workflow takes—using an existing contact or creating a new one.

Get List of Accounts

App connector: Xero • Time to complete: 2 minutes
Why this matters: This fetches your Xero chart of accounts to properly categorize invoice line items according to your accounting structure.

The workflow retrieves all accounts from your Xero organization, allowing you to specify which account code should be used for revenue recognition on invoice line items. This ensures proper accounting categorization for your sales.

What to configure: In the invoice creation steps (Steps 6 and 8), you'll select which Xero account should be used for line items. Common options include "Sales" or "Revenue" accounts.

To find your account ID: In Xero, go to Accounting → Chart of Accounts, click on your sales/revenue account, and find the Account Code or ID.

Shopify Customer Exists in Xero

App connector: Paths • Time to complete: 0 minutes (Auto-configured)
Why this matters: This creates two processing routes based on whether the customer exists in Xero, ensuring the correct invoice creation method for each scenario.

The workflow evaluates the email match from Step 3 and branches into two paths:

  • Path 1 (Shopify Customer Exists in Xero): Customer email matches an existing Xero contact
  • Path 2 (Shopify Customer Does Not Exist in Xero): Customer email doesn't match any Xero contact

What happens automatically: The workflow compares email addresses and routes to the appropriate path without manual intervention.

Create Invoice

App connector: Xero • Time to complete: 3 minutes
Why this matters: When the customer already exists in Xero, this creates an invoice linked to their existing contact record, maintaining clean accounting relationships.

For customers with existing Xero contacts, the workflow creates an invoice using their stored contact ID. The invoice includes:

  • Invoice type: Accounts Receivable (ACCREC)
  • Invoice date: Shopify order creation date
  • Reference number: Shopify order name (e.g., #1001)
  • URL: Direct link to Shopify admin order page
  • Line items: All products from the order with descriptions, quantities, and prices
  • Contact: Links to the existing Xero contact

What to configure:

  • Account ID: Specify which Xero account should be used for line items (from Step 4)
  • Line item mapping: Customize which order fields map to invoice descriptions

Current mapping:

  • Description: Product names from order
  • Quantity: Product quantities
  • Unit Amount: Product prices

Shopify Customer Does Not Exist in Xero

App connector: Paths • Time to complete: 0 minutes (Auto-configured)
Why this matters: This identifies orders from customers who don't exist in Xero yet, triggering contact creation before invoice generation.

When the email comparison from Step 3 shows no match, the workflow enters this path to create both the contact and the invoice. This ensures every Shopify customer has a corresponding Xero contact.

Create or Update Contacts

App connector: Xero • Time to complete: 3 minutes
Why this matters: For first-time customers, this creates a complete Xero contact record with billing information before generating the invoice.

The workflow creates a new Xero contact using information from the Shopify order, including:

  • Contact name: From billing address
  • Email address: Customer email
  • Billing address: Full address fields (line 1, line 2, city, state, zip, country)
  • Phone number: Customer phone from order

What to configure:

  • Address mapping: Verify that Shopify billing address fields map correctly to Xero address structure
  • Additional contact fields: Add custom fields if needed (tax number, account number, etc.)
  • Branding theme: Select which Xero branding theme should be applied to invoices for this contact

Current mapping:

  • AddressLine1: {{shopify.billing_address.address1}}
  • AddressLine2: {{shopify.billing_address.address2}}
  • City: {{shopify.billing_address.city}}
  • Region: {{shopify.billing_address.province}}
  • PostalCode: {{shopify.billing_address.zip}}
  • Country: {{shopify.billing_address.country}}
xero logo icon

Create Invoice

App connector: Xero • Time to complete: 2 minutes
Why this matters: After creating the new contact, this generates the invoice and links it to the freshly created Xero contact record.

The workflow creates an invoice identical in structure to Path 1, but references the newly created contact ID from Step 8. The invoice includes all the same fields: order date, reference number, Shopify URL, and complete line item details.

What to configure:

  • Line item mapping: Same customization options as Step 6
  • Invoice defaults: Consider setting default payment terms, due dates, or status (draft vs. submitted)

Note: This step does NOT require an Account ID to be specified, unlike Step 6. However, you may want to add one for consistent accounting categorization.

Make it your own

Customize this workflow even further:

Add order tags or notes to invoice line items
Include Shopify order tags, notes, or custom fields in the Xero invoice description or line item details. For example, append gift message text, order source (online vs. POS), or fulfillment instructions to invoice notes. This provides additional context for accounting teams reviewing invoices in Xero.
Filter orders by financial status or fulfillment
Add a filter after the Shopify trigger to only create invoices for paid orders or fulfilled orders, rather than every order created. This prevents draft invoices for unpaid checkouts or abandoned carts. Use filters like "financial_status equals paid" or "fulfillment_status equals fulfilled" to control when invoices generate.
Include shipping and tax as separate line items
Modify the line items section to add shipping costs and taxes as distinct entries rather than incorporating them into product prices. Create separate line items using {{shopify.total_shipping_price_set.shop_money.amount}} and {{shopify.total_tax}} with appropriate Xero account codes for shipping revenue and tax liability accounts.
Send Slack notification when invoices are created
Add a Slack notification at the end of both paths to alert your accounting team when new Xero invoices are generated. Include order number, customer name, invoice total, and a direct link to the Xero invoice. This enables immediate review of high-value orders or flagging of potential issues before month-end close.

Frequently asked questions

What happens if a customer's email changes between orders?
If a customer uses a different email address for a new order, the workflow treats them as a new customer and creates a separate Xero contact. This can result in duplicate contacts for the same person with different email addresses. To prevent this, you could modify the workflow to search Xero by customer name in addition to email, or manually merge duplicate contacts in Xero periodically.
Can I create invoices in draft status instead of automatically approving them?
Yes, you can modify the invoice creation steps (Steps 6 and 9) to set the invoice status. Add a "Status" field to the invoice body with value "DRAFT" instead of leaving it as default (which typically creates submitted/approved invoices). Draft invoices allow you to review orders before officially issuing invoices to customers, useful for wholesale or custom orders requiring verification.
How are line items handled for orders with multiple products?
The workflow uses Liquid array syntax ({{shopify.line_items[].name}}) to iterate through all products in an order. Each product becomes a separate line item in the Xero invoice with its own description, quantity, and unit price. Shopify order line items map directly to Xero invoice line items, maintaining the same structure. If you have complex products with variants or customizations, these details appear in the description field.
What is a template?
MESA templates are fully pre-configured workflows built and vetted by Shopify Experts. Unlike competitor templates that provide basic scaffolds requiring extensive setup, MESA templates come with all data variables properly mapped, required fields configured, and steps ready to activate. You can turn them on immediately and start automating.
Can I customize a template?
Absolutely! While our templates work out-of-the-box, every step can be personalized to match your exact business requirements. Add conditional logic, integrate additional apps, or build more sophisticated workflows. MESA's templates provide a solid foundation that you can expand as needed.
Are templates free?
Yes! Our entire library of expert-built, production-ready templates is free to use. Unlike platforms that charge for premium templates or provide only basic scaffolds, MESA gives you access to hundreds of fully-configured, vetted workflows at no additional cost.

Ready to automatically create Xero invoices from Shopify orders while managing customer contacts?

Join thousands who've automated their work and saved an average of 3.5 hours every week.

Start with this template — It's free
7-day free trial • 15 min setup • Cancel anytime