Connect Shopify to lexoffice: Automated Invoicing
Shopify orders become contacts, invoices and credit notes in lexoffice. Line items, tax lines, billing and shipping addresses, payment status, returns and partial refunds all move across. This page documents the reference architecture: which data objects travel, which edge cases break in practice, and which decisions have to be made before anything is built.
Results & Benefits
How it Works
Receive the Shopify Event
The webhook on the paid order state delivers the order with line items, tax lines, addresses and transactions. The webhook identifier is recorded before anything else happens. Shopify redelivers events, and without that lock every retry produces a second invoice in lexoffice.
Reload the Order Instead of Trusting the Payload
Between trigger and processing the order may have been cancelled, refunded or edited. Processing re-reads the current state from the Shopify API and works from that. Event ordering then stops mattering, which removes an entire class of intermittent failures from the system.
Apply Tax and Account Mapping
Each line is mapped to a lexoffice tax treatment by tax rate, delivery country and customer type, as are shipping and discount lines. Any combination missing from the mapping table stops processing. A guessed tax treatment costs far more later than a record left waiting for a human.
Find or Create the Contact
The contact is looked up by the stored Shopify reference, falling back to the normalised email address. Billing and shipping addresses are carried across separately. On a match, the address is only overwritten if Shopify was defined up front as the system of record for customer master data.
Create the Document in lexoffice
The invoice or credit note is created and lexoffice assigns the document number. The Shopify order number is written as an external reference so any document can be traced in both directions. A comparison of net, tax and gross totals then confirms that shop and books show the same amount.
Reconciliation, Alerting and Catch-Up
A nightly run compares the orders paid that day against the documents created and reports every gap to a named person via Slack or email. lexoffice rate limits are handled with waiting and retry rather than by skipping the record and moving on.
Use Cases
Invoice From the Paid Order, Not the Placed Order
The trigger is the change of financial_status to paid, not order creation. Line items, shipping, discounts and the tax lines become a lexoffice invoice with the same net, tax and gross totals as the shop. If the totals differ by rounding cents, the record is held for review rather than booked.
Contacts Without Duplicates
Guest checkouts carry no customer number, only an email address. The matching key is therefore the normalised address plus a Shopify reference stored on the lexoffice contact. Without that reference every guest purchase creates a new contact, and the open items report fills with dozens of shells of the same buyer.
Partial Refunds and Credit Notes
A finalised invoice cannot be edited in lexoffice. Every return, partial refund and after-the-fact discount correction becomes its own credit note carrying the tax split of the original lines. If Shopify refunds only the shipping charge, the credit note must follow the shipping tax rate rather than the goods rate.
VAT Across Borders
B2C deliveries to other EU countries fall under the One-Stop-Shop at the destination rate, while B2B deliveries with a verified VAT ID are zero-rated as an intra-community supply. The integration carries over the treatment Shopify actually applied and reports any combination that has no mapping defined.
Payment Matching and Aggregated Payouts
The bank statement shows an aggregated payout net of fees, never the individual order. The Shopify Payments balance is therefore modelled as a clearing account: invoices settle against the balance, the payout settles against the bank, and the processing fee is booked as its own expense.
An Error Queue Instead of a Silent Wrong Booking
Records that cannot be mapped, such as an order with an unknown tax combination or a lexoffice call rejected for rate limiting, land in a review queue with a plain-language reason and are replayed after correction. Nothing is guessed, and nothing disappears quietly between the two systems.
Frequently Asked Questions
What triggers the invoice: the order or the payment?
How are partial refunds and returns handled?
What happens when a webhook is delivered twice?
How does the integration handle OSS and reverse charge?
How are gift cards treated?
What happens to Shopify Payments fees?
Can existing orders be imported afterwards?
How long does setup take and what does it cost?
What happens if Shopify or lexoffice is unreachable?
Which system owns the customer record?
How is this tested without producing real documents?
What does this integration explicitly not do?
Connect Shopify + lexoffice?
We set up your integration — tailored to your processes. First, five minutes to check whether the process is worth automating at all.