Merlin ERP and WooCommerce integration: invoices, payments and accounts in one store

A WooCommerce trade store connected to Merlin Business Software, with invoices, balance payments, cash receipts and address changes moving between the two. Here’s what we built, how we tested it without touching live data, and what the real ERP taught us.

Wojciech Filipek
·
·
1 Dec 2026
Share

Photo: Annie Spratt / Unsplash+

In this article

Key takeaways

  • Merlin Business Software can exchange more with WooCommerce than orders and products. We added invoices, account balances, card payments on account, cash receipts and address changes.
  • Merlin stays the source of truth. The store reads from it live and stores almost nothing.
  • We built everything against a local mock of the ERP first, then tested on the client’s Merlin training environment. The real system differed from the mock in four ways within the first few hours.
  • Every feature has its own switch and is off by default, so installing the code changes nothing until someone turns a feature on.

Merlin ERP and WooCommerce can be connected so that a trade customer logs in to the store and sees the same account your accounts team sees: invoices, balance and delivery addresses, with card payments posted back to the ERP automatically. This guide describes one such integration we built for a UK distributor of heating parts, including the parts that didn’t go as planned.

If you run Merlin and a WooCommerce store, or you’re thinking about adding one, this should tell you what’s possible and what to ask for. For a price on your own setup, our cost calculator has an integration mode.

What Merlin is, and why it’s a special case

Merlin Business Software is a UK ERP for distribution and manufacturing. Its maker, based in Chesterfield, says it was founded in 1972, writes the software in-house and sells it directly, not through resellers. Its customers are trade suppliers. One of the industries it lists is plumbing and heating supplies, which is our client’s industry.

Merlin has its own website integration tools. Its site describes online orders flowing into sales order processing with the customer’s special pricing applied, and a customer portal where trade customers check stock and find archived invoices and proofs of delivery.

Two things make a Merlin integration different from connecting a store to a mainstream cloud ERP:

  • There’s no public API documentation. We worked from specifications the client passed on and from tests on the client’s own environment.
  • There’s no ready-made WooCommerce extension to buy. Whatever connects the two is built for that store.

So this is custom work, and the quality of it depends on how carefully it’s tested against the real system.

The starting point

The client is a UK distributor of parts for heating installations, biomass systems and heat networks. Most of its sales go to businesses with credit accounts.

  • The store runs on WordPress and WooCommerce, with 935 published products, most of them with variations.
  • Merlin holds customer accounts, balances, invoices and stock.
  • The store already had a custom plugin that sent orders and customer registrations to Merlin and synchronised products.

That existing connection matters. Orders, customers and products are the first layer of any ERP integration, and our guide to ecommerce ERP integration covers how to plan it. This project was the second layer: giving the customer access to their account.

The problems the client came with were ordinary ones for a trade business:

  • A credit customer couldn’t see invoices or a balance in the store, and couldn’t pay what they owed by card. All of it went through the accounts team by email and phone.
  • Card payments taken in the store had to be typed into Merlin by hand as receipts.
  • An address changed in the store never reached the ERP.

What we connected

Four features, each reading from or writing to Merlin.

FeatureDirectionWhat it does
Invoices in the customer accountMerlin to storeA list of documents with a preview and a PDF
Pay by cardStore to MerlinThe customer pays the whole balance or part of it
Cash receiptsStore to MerlinEvery successful card payment is posted to the customer’s account
Address changesStore to MerlinAn address edited in the account is sent to the ERP

Invoices in the customer account

WooCommerce lets you add your own pages to the My account area through endpoints. We added one called Invoices.

  • It appears only for customers who have their own account number in Merlin.
  • It shows unsettled documents, meaning invoices, credit notes and payments on account, with the number of days overdue. Below that is a history of up to 300 recent documents.
  • Each invoice opens in the browser and downloads as a PDF. The layout follows the invoice Merlin prints: logo, company details, addresses, lines, totals and bank details.
  • Company details and invoice lines are read live from the ERP. The store keeps nothing except a short cache.

Reading live was a deliberate choice. A copy of invoices in the store database would be a second set of financial records to keep correct, back up and protect. With a live read there’s one set, and it’s in the system the accountant already trusts.

Paying a balance by card

Above the invoice list the customer sees their balance and chooses to pay all of it or any amount from £1 up to the balance.

We didn’t build a separate payment flow. The payment runs through an ordinary WooCommerce order with a single line called Payment on account, so the store’s existing card gateway handles it, along with its fraud checks, receipts and refunds. For the customer it looks like any other checkout, so there’s nothing new to learn.

Two rules keep the books right:

  • This order isn’t sent to Merlin as a sale. Only the payment goes across.
  • Once the payment is posted in Merlin, the order completes by itself. In WooCommerce, Completed means nothing more needs doing, which is true here.

Cash receipts for every card payment

The same mechanism covers normal orders. After a successful card payment, a receipt is posted to the customer’s account in Merlin with the store’s order number as the reference.

  • Guest orders go to a shared cash account.
  • Orders placed on credit are skipped, because nothing has been paid yet.

This replaces the manual step of typing each card payment into the ERP.

Address changes

When a customer edits an address in My account, the change goes to Merlin and the office gets an email with a table of the new values and the old ones beside every field that changed.

Only a deliberate edit in the account is sent. An address typed at checkout doesn’t change the customer’s master record, because people often ship one order somewhere unusual.

Building without access to the ERP

At the start, the client’s Merlin test environment was reachable only from inside the client’s network. Waiting for access would have stopped the project, so we worked in stages.

  1. A local copy of the store, with outgoing email blocked and no way to reach the production ERP.
  2. A local mock of the Merlin API that answered with sample data, built from the specifications. All four features were built against it.
  3. A staging copy of the production store, with every Merlin feature behind its own switch, off by default.
  4. The real Merlin training environment, opened by the client’s accountant at a public address, with a test account. First reading, then writing.
  5. Production, one feature at a time, each turned on with its own switch.

A mock has one job: letting you build the logic and the screens while access is being arranged. It can’t tell you how the real system behaves. Plan the real tests as a stage with its own time, not as a formality at the end.

What the real ERP taught us

Within a few hours of connecting to the real Merlin, four things turned out to be different from the mock.

What happenedWhyWhat we did
The invoice list worked, a single invoice returned a 404 errorThe query travels in the URL, and the server rejected addresses longer than about 2,000 charactersSplit one long query into two short ones
A £500 payment was missing from the list, and the total didn’t match the balanceMerlin stores a payment on account as a negative value in the goods column, with an invoice total of zeroRead the amount from the right column
Dates came back in two formatsThe same date arrives as 31/12/2025 or as 20251231, depending on the column typeNothing. The date parser already accepted both
A changed delivery address didn’t replace the old oneMerlin allows many delivery addresses per account and adds each change as a new oneA decision for the client: add to the list, or only notify the office

The URL length limit is worth a closer look, because it isn’t specific to Merlin. The HTTP standard recommends that software supports URLs of at least 8,000 bytes, but servers set their own limits. Microsoft’s IIS, for example, defaults to 2,048 bytes for a query string. Any API that takes its query in the URL can hit a limit like that, and the error you get back rarely says so. A 404 for a document that clearly exists is a typical sign.

The payment on account is the more important lesson. The data was all there and the request succeeded. The list was simply wrong by £500, and only a comparison with the balance on the account showed it. For anything financial, test against a figure the accountant can confirm, not against “the request returned 200”.

The delivery address question isn’t a bug. It’s a difference in how two systems think. WooCommerce has one shipping address per customer. Merlin has a list. Someone on the client’s side has to decide whether an edit in the store should add to that list or only notify the office.

Safeguards worth copying

These took little time and matter more than any single feature.

  • A switch per feature. Each one is turned on separately on a settings page, so a problem with receipts doesn’t force you to turn off invoices.
  • The environment is a setting. Production or training Merlin is chosen in the settings, with no code change, so the same build runs on staging and live.
  • Requests are scoped to the logged-in customer. Every invoice request includes that customer’s account number, so changing a number in the address bar returns “Invoice not found”.
  • Shared accounts are never treated as personal. A cash account used for guest orders belongs to many people, so nobody sees its documents.
  • A log of every API call, with the request and the response. When the accountant asks what was sent on Tuesday, there’s an answer.
  • An alert when money and books disagree. If a card was charged and the receipt didn’t reach the ERP, the office gets an email marked “Action needed” and can resend the receipt with one click from the order.
  • Safe retries. A resend must never create a second receipt. Stripe’s documentation on idempotent requests explains the principle, and it applies to any system that records money.

What to test before go-live

A checklist that fits any integration that touches money:

  • Reading first. Compare the invoice list for a test account with what the accountant sees in Merlin, document by document, and check that the list adds up to the balance.
  • Access. Log in as a second customer and try to open the first customer’s invoice. The answer should be “Invoice not found”.
  • A real £1. Post one small receipt and watch the balance. In our test it went from £453.77 to £452.77, and the receipt appeared in the ERP with the store’s order number as its reference.
  • The nominal account. Ask the accountant to confirm where that £1 landed in the ledger.
  • Reversal. Change a billing address and change it back, and read the email the office receives both times.
  • Failure. Make the ERP unreachable, take a test payment and confirm that the alert arrives and the resend works once, not twice.
  • The whole path with the payment gateway in test mode, clicked through in a browser as a customer would.

What an integration like this costs

The four account features took 13 hours of development: 6 for invoices, 3 for address changes, 2 for cash receipts and 2 for the card payment. That number is small for a reason. The store already had a working connection to Merlin for orders, customers and products, the client supplied specifications, and their accountant gave us a test environment and a test account.

Starting from nothing is a different project. In our pricing model, connecting a store, an ERP and a warehouse in both directions, with monitoring and a screen for fixing failed syncs, costs about $14,000 to $24,000, and a legacy or on-premise ERP adds 60 to 120 hours. An ERP without public API documentation belongs in that last group until proven otherwise.

Upkeep is part of the cost too. We budget 10 to 20 hours a month for monitoring and for the day the ERP or the store changes something.

When Merlin’s own tools are enough

Merlin sells website integration and a customer portal of its own. Before paying for custom work, ask them what their tools cover. You probably don’t need us if:

  • You’re building a new trade site and are happy to use the portal Merlin provides.
  • You only need orders to arrive in sales order processing with customer pricing applied.
  • You don’t have a WooCommerce store with content, search traffic and customers you want to keep.

Custom work makes sense when the store already exists and earns its place, and you want account features inside it, in your design, next to everything else your customers already use. Our comparison of B2B ecommerce platforms covers that choice in general terms.

If you’re planning this

  1. Decide what Merlin owns. For most distributors that’s accounts, balances, invoices, prices and stock.
  2. Ask Merlin, or whoever supports your installation, for API specifications and a training environment with a test account.
  3. Get your accountant involved from the first test. They’re the one who can say whether a receipt landed on the right nominal account.
  4. Start with reading. Invoices and balances can’t damage anything. Add writing, such as receipts and address changes, once reading is proven.
  5. Put every feature behind a switch and go live one at a time.
  6. Test every money feature against a balance, with a real £1.

None of these steps needs the store to be offline, and each feature can be reversed by turning its switch off.

The same order of work applies to stock and orders, which we cover in our guide to ecommerce inventory and order management.

If you run Merlin and WooCommerce and want your customers to manage their account online, tell us what you have today and what’s still done by hand. We’ll tell you what’s realistic and give you a fixed quote. You can also read about our API integration services.

Frequently
asked questions

Yes. Orders, customers and products can be exchanged, and so can account data: invoices, balances, card payments posted as cash receipts and address changes. There’s no ready-made extension, so the connection is built for each store.

Merlin’s website describes integration tools and partner integrations but doesn’t publish API documentation. In our project we worked from specifications supplied by the client and tested on the client’s Merlin training environment.

Yes. We added an Invoices page to the WooCommerce account area that lists unsettled documents and recent history, read live from Merlin, with a preview and a PDF for each invoice. It’s shown only to customers with their own account number in the ERP.

After a successful card payment, the store posts a cash receipt to the customer’s account in Merlin with the order number as the reference. If the posting fails, the office is alerted and can resend it from the order.

It depends on what already exists. Adding four account features to a store that already exchanged orders and products with Merlin took 13 hours of development. An integration built from nothing, with stock, orders and monitoring, typically takes several weeks.

Don’t. Use the ERP’s training or test environment with a dedicated test account, block outgoing email on the staging site, and keep every feature behind a switch that’s off by default.