Create Xero Invoices for New Shopify Orders

15 min setup
No coding required
Runs automatically

Whenever a new order is placed in your Shopify store, this workflow automatically creates a matching invoice in Xero, complete with customer details and line items. If the customer isn’t already in Xero, the workflow adds them first, then generates the invoice. This eliminates manual data entry and ensures your ecommerce orders flow directly into your accounting system, keeping your financial records accurate and up to date.

Shopify logo icon
Order Created
Retrieve Shop
Get List of Contacts
Get List of Accounts
Shopify Customer Exists in Xero
Create Invoice
Shopify Customer Does Not Exist in Xero
Create or Update Contacts
xero logo icon
Create Invoice

You're in good company

"MESA has been a game changer for us. And, if you ever get stuck, their support team is always super helpful."

  • Ico star
  • Ico star
  • Ico star
  • Ico star
  • Ico star
PetFriendly

"It's like Zapier but exactly designed for Shopify. I have been able to complete all the workflows that I've needed."

  • Ico star
  • Ico star
  • Ico star
  • Ico star
  • Ico star
Zailys

"The MESA team has been amazing at helping us set up our automations. We would highly recommend this app!"

  • Ico star
  • Ico star
  • Ico star
  • Ico star
  • Ico star
Rothy's

How it works

9 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.

Ready to set this up? It only takes 15 minutes.

Our support team will even help you personalize this workflow for free.

Get started →

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.

Common questions

What happens if a customer's email changes between orders?

Can I create invoices in draft status instead of automatically approving them?

How are line items handled for orders with multiple products?

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

7-day free trial • 15 min setup • Cancel anytime

Need help? Our automation experts will help you personalize this workflow for free. Contact support