Skip to main content

Integration

Connect Shopify to Xero

A custom Shopify Xero integration that posts orders, shipping, refunds and Shopify Payments payouts into Xero, so your books match the store.

Shopify
Xero

Integration

What This Integration Does

A Shopify Xero integration turns every Shopify order into a Xero invoice and every Shopify refund into a Xero credit note, automatically, with line items, shipping, discounts and VAT broken out correctly. It keeps your ecommerce revenue in your accounting system without anyone re-entering order data, and it handles the complexity that makes Shopify-to-accounting sync difficult: multi-line orders, percentage and fixed-amount discounts, partial refunds, and separate tracking of shipping revenue.

For UK ecommerce businesses running Shopify as the storefront and Xero for the books, it removes the most tedious job in the finance week, which is copying sales data into accounting records by hand.

The Workflow

When a customer completes checkout on Shopify, the integration receives an orders/paid webhook and begins constructing the Xero invoice. The process starts with contact matching: the integration looks up the customer’s email in Xero’s contact list. For B2C businesses with high transaction volumes, orders can alternatively be grouped under a single “Shopify Sales” contact to avoid creating thousands of individual contacts in Xero. This is a configuration decision made during setup based on how your accountant prefers to work.

Each line item on the Shopify order becomes a line item on the Xero invoice, mapped to the appropriate revenue account. Products map to a “Product Sales” account, shipping charges map to a “Shipping Revenue” account, and any gift cards redeemed are handled as a separate payment type rather than a discount. Discounts are applied at the line-item level in Xero, preserving the gross-to-net breakdown that your accountant needs for accurate reporting.

Tax is mapped based on your Xero tax rate configuration. If you sell across multiple tax jurisdictions (common for UK businesses selling into the EU, or US stores with multi-state nexus), the integration reads the tax lines from Shopify and matches them to the correct Xero tax rates. This is configured once during setup and handles the variation automatically thereafter.

Refunds follow the order lifecycle. When a Shopify refund is issued, full or partial and with or without restocking, the integration creates a credit note in Xero linked to the original invoice. If the refund includes a restocking fee or excludes shipping, the credit note reflects only the refunded line items and amounts. Partial refunds on a single line item are handled as a reduced quantity or reduced amount, whichever matches the actual refund.

For businesses that need cost-of-goods tracking, the integration can also push Shopify’s cost-per-item data into Xero as a bill or journal entry against an inventory or COGS account, giving you margin visibility alongside the revenue data.

Shipping Charges and Carrier Costs

Shipping is where most Shopify and Xero setups go wrong, because it has two sides and the standard exports only carry one of them.

The first side is what the customer paid for delivery. Each order’s shipping line becomes its own line on the Xero invoice, coded to a delivery income account rather than buried in product sales. In the UK a delivery charge usually takes the VAT rate of the goods it delivers, so a basket mixing standard-rated and zero-rated items needs the charge split between them. Your accountant decides that rule once and the integration applies it to every order.

The second side is what delivery cost you. Labels bought through Shopify Shipping appear on your Shopify bill, while couriers you hold an account with invoice you separately. Where the carrier or shipping app exposes label costs through its API, the integration posts them to Xero as bills against a carriage account and tags each one with the order number. With both sides in Xero you can see what shipping earns or loses per order. Orders that qualified for free delivery are the ones to check first.

Shopify Payments Payouts and Bank Reconciliation

Shopify Payments doesn’t send each order to your bank. It sends a payout every few days, made up of many orders, with fees taken off and any refunds or chargebacks netted out. The bank feed in Xero shows a single deposit that matches nothing in your invoices, which is why so many Shopify stores carry a long list of unreconciled lines.

The integration reads each payout from Shopify and records it in Xero through a Shopify clearing account. Order payments go into the clearing account as invoices are paid, processing fees come out as an expense, and the payout total leaves for your bank account. When the deposit appears in the bank feed it matches one transaction to the penny, and the clearing account sits at zero once everything is settled. PayPal and gift card payments get their own clearing accounts so each payment route reconciles separately.

Xero’s Shopify App, A2X or a Custom Build

Off-the-shelf options exist and suit many stores. Xero’s own Shopify connection and apps such as A2X work at summary level, posting daily or per-payout totals rather than an invoice for each order. If you sell to consumers, use Shopify Payments and want clean monthly accounts, try one of those first, because it will cost less than a build.

A custom integration earns its cost when the summary approach stops fitting the business. Common reasons:

  • Trade or wholesale customers who need a proper Xero invoice per order, on account terms
  • Several Shopify stores, or several currencies, feeding one Xero organisation
  • Account codes that depend on product type, sales channel or customer group
  • Cost of goods and stock values that need to reach Xero alongside revenue
  • Order data that also has to reach a warehouse system, CRM or reporting dashboard

Before and After

Before: Someone on the team exports Shopify orders weekly or monthly, opens the CSV in a spreadsheet, and manually creates invoices in Xero. Discounts and refunds require cross-referencing against the original order. Multi-tax-rate orders are a headache because the export lumps tax into a single figure. Shipping revenue gets miscategorised or forgotten entirely. The Xero profit and loss report is only as accurate as the last manual entry, which means management decisions are based on numbers that are always slightly behind and often slightly wrong.

After: Every Shopify order is in Xero within minutes of payment, with line items, discounts, shipping, and tax broken out correctly. Refunds and credit notes appear automatically. The profit and loss report reflects actual trading performance in near-real-time, and your accountant can see gross margin by product category without building a separate spreadsheet. Month-end accounting moves from a multi-day reconciliation exercise to a quick review.

Who Needs This

This integration suits ecommerce businesses selling through Shopify that have outgrown manual bookkeeping. Stores processing more than thirty to fifty orders per week are the typical starting point, where the volume makes manual Xero entry impractical. It is especially valuable for businesses selling across multiple tax jurisdictions, running frequent promotions with varied discount structures, or needing cost-of-goods visibility in their accounting system. The common trigger is a growing order volume combined with increasingly complex refund and discount patterns that make the manual process error-prone. If your store runs on WooCommerce instead, the WooCommerce and Xero integration covers the same accounting flow for that platform.

How We Build This

We build this on Shopify’s Admin API and webhooks, paired with the Xero API over OAuth 2.0. The integration runs in your own infrastructure, so account mapping, contact handling, tax rate matching and discount treatment are all yours to change. Webhook events go through a queue with retries, so an order that arrives while Xero is unavailable is posted when it comes back rather than lost.

Xero allows each connected organisation 60 API calls a minute and 5,000 a day. A store posting invoices, payments, credit notes and carrier bills one call at a time can reach the daily limit during a sale, so we batch invoices and payments into bulk requests and keep a log of every order posted, skipped or retried. Your bookkeeper can see from that log why an order isn’t in Xero without asking a developer. This is the same API integration work we do for other platforms, and the rest of the pairings we build are on the integrations overview, including Stripe and Xero for subscription and invoice payments.

Get Shopify and Xero Talking

If month-end still involves exporting Shopify orders and re-keying them into Xero, or a bank feed full of payouts nobody can match, tell us how your store and books are set up. Send the number of orders a month, the payment methods you take and how you ship, and we’ll tell you whether a summary app will do or a custom Shopify Xero integration is worth building.

Written by

Alex

CEO

I’m a software developer and CEO of Digital Royalty, helping growing teams scale their SaaS platforms without losing quality, visibility, or control. I focus on building structured, maintainable systems with clear processes, reporting, and accountability. With over a decade of experience across agency and in-house roles, I specialise in delivering long-term, scalable solutions that support complex, evolving products.

Portrait of Alexander De Sousa, founder of Digital Royalty
Founder-led
“I’ve put everything I know into how this company works — the standards, the method, the care on every project. It runs through the whole team, and I hold us all to it.”

Alexander De Sousa · Founder LinkedIn

Featured on BBC Radio Solent

Get started

Tell us what you need

A few quick questions, then a straight answer from a real person — usually within a few hours.

What happens next

  1. 1 We reply A real person reads your answers and gets back to you, usually within a few hours.
  2. 2 Questions or a short call If anything isn't clear, we ask by email or book a short call. Before any call we audit your website and make the quick fixes it finds, free.
  3. 3 Your fixed quote A clear, fixed price in writing, within 48 hours of any call. There is no obligation to go ahead.

Tell us what you're working on

Whether it's a new site, a platform, or a process that shouldn't be manual any more — we'll tell you honestly if we can help.