Skip to main content
E-Commerce
S
l

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.

Shopifylexoffice

Results & Benefits

95%
Less manual data entry in accounting
3-5h
Time saved per week on invoice processing
0
Errors from manual data transfer
Real-time
Synchronization between shop and accounting

How it Works

1

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.

2

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.

3

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.

4

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.

5

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.

6

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?
That is the first decision in the project. With prepayment or purchase on account the document has to exist before the money arrives; with card payments the switch of financial_status to paid is the cleaner trigger. We define the trigger per payment method, because one rule for all methods reliably books either too early or too late.
How are partial refunds and returns handled?
Shopify supplies the affected line items and their tax share with every refund. That becomes a credit note in lexoffice mirroring exactly those lines. An invoice that has already been finalised is never edited retroactively. Where only shipping is refunded, the credit note follows the shipping tax rate and not the goods rate.
What happens when a webhook is delivered twice?
Shopify guarantees delivery, not uniqueness. Every inbound message is stored with its webhook identifier and order number before any document is created, so a repeat delivery is recognised and discarded. Without that lock, month end arrives with duplicate invoices sitting in the open items report.
How does the integration handle OSS and reverse charge?
It carries over the tax treatment Shopify calculated at the time of the order and maps it to a lexoffice tax rule. It does not decide tax liability. If the shop tax configuration is wrong, for example a missing OSS registration or an unverified VAT ID, the error is transported accurately rather than fixed.
How are gift cards treated?
Selling a gift card is a liability, not revenue; revenue arises on redemption. In Shopify the sale appears as its own order and the redemption appears as a payment method on a different order. Booking both as revenue reports the same turnover twice, so the treatment is defined explicitly before go-live.
What happens to Shopify Payments fees?
The bank payout is an aggregate net of fees. Bookkeeping stays gross: full revenue, the fee as a separate expense, and the difference through a clearing account. Booking the payout amount as revenue instead leaves reported turnover out of step with the VAT return, which surfaces at the worst possible moment.
Can existing orders be imported afterwards?
Yes, a backfill over a defined window is possible. First we establish which periods are already booked or closed by the tax office. Importing into a closed period creates duplicate entries that then have to be reversed line by line, so as a rule we start with the current month and leave historical data untouched.
How long does setup take and what does it cost?
A standard connection with one tax territory, one currency and one payment method is running within a few working days. Multiple countries, OSS, foreign currency or several legal entities push that to one to three weeks, because the mapping table has to be agreed and tested. An entry scope starts from 5,000 EUR, with ongoing tool costs of 50 to 200 EUR per month.
What happens if Shopify or lexoffice is unreachable?
The record stays in the queue and is retried with growing intervals. Only after repeated failures does an alert go to a named person rather than to a shared distribution list. The rule behind it matters more than the mechanism: no record is dropped, and no error is written only to a log nobody reads.
Which system owns the customer record?
That is decided before the build and not mixed afterwards. If Shopify owns customer data, every order overwrites the address in lexoffice. If lexoffice owns it, corrections made by your accounting team survive the next order. Without that decision the two systems overwrite each other in turn and nobody trusts either address.
How is this tested without producing real documents?
Shopify offers development stores and test orders. For lexoffice a separate test account is used, because documents created in a productive account cannot be removed without trace. Before go-live the credentials are swapped and the test account is locked, so no test document reaches the live books.
What does this integration explicitly not do?
It does not replace review by your tax adviser, and it produces neither the VAT return nor the OSS report. It does not correct wrong tax settings on products in the shop and does not migrate historical bookkeeping. It is not a certified interface, but a documented connection built on the public programming interfaces of both systems.

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.