Client project · ERP Integration

Real-Time Updates Between ERPNext and Every Online Store

How Wizard Labz connected a retailer's ERPNext to several online stores through RabbitMQ — so price and stock changes reach every store in seconds, and every order flows back into the ERP.

At a Glance

ERPNext connected to several online stores through one RabbitMQ message bus, with other systems subscribing to the same events

Orders from every store arrive as messages and become customers, addresses, sales orders and payments in the ERP

Price, stock, pricing-rule and product changes are pushed to every store when they are saved — no nightly sync, no polling

Durable queues and persistent messages: an outage delays work instead of losing it

Every incoming order payload is logged, linked to the order it created, and can be re-processed

Connection drops and processing errors alert the team's chat as they happen

The Business Problem

The client is a retailer that sells through several online stores, alongside physical points of sale. ERPNext is the system of record behind all of them: stock, prices, customers, orders and accounting live there.

That makes the ERP the one system everything else has to talk to. Every store needs to hand its orders to the ERP, and every store needs to hear, quickly, about what changes inside it: a new price, a promotion, the last unit sold.

Why Direct Connections Don't Hold Up

  • Scheduled syncs are always out of date — between runs a store sells stock that is gone or shows yesterday's price
  • The ERP becomes a single point of failure — if a store calls the ERP directly, an ERP restart or slow moment at checkout time means a failed or missing order
  • Every channel is its own integration — each new store or system adds another pair of point-to-point connections to build and maintain
  • Failures are silent — when a call fails halfway, nobody knows until a customer asks where their order is
  • No record to replay — once a failed request is gone, the order has to be re-entered by hand

The business needed its sales channels and its ERP to keep working independently of each other, and to be able to prove where every order went.

The Solution

Wizard Labz put a message bus between the ERP and the systems around it. Systems no longer call each other; they publish messages and consume messages, and RabbitMQ holds whatever has not been processed yet.

A Bus in the Middle

A RabbitMQ exchange with durable queues sits between ERPNext and the stores, one queue per store. Messages are published as persistent, so they survive a broker restart and wait for their consumer.

Routing Configured Inside the ERP

The ERP-side consumer reads a mapping kept in ERPNext itself: message type on one side, the handler that processes it on the other. Connection settings and mappings are edited from an ERPNext screen.

ERP Events Go Out Through the Same Bus

ERPNext's own webhooks are pointed at a small publishing endpoint that puts each event on the exchange with its routing key. Each store keeps only what applies to it: its own price list, sales channel and country.

A Consumer Built to Stay Up

A long-running worker processes one message at a time, acknowledges each one, and reconnects on its own when the connection or channel drops — announcing both the drop and the recovery to the team.

Real-Time Updates, Both Ways

A change is published when it is saved and applied when it arrives. Nothing waits for a schedule.

ERP → Stores

Prices and promotions

Item prices, wholesale prices and dated pricing rules for a product, category or brand. Rules carry their start and end dates, so a promotion begins and ends on time.

ERP → Stores

Stock levels

Quantity on hand per warehouse and country. Each store applies only the stock for its own sales channel.

ERP → Stores

Catalogue changes

New and edited products, images, attributes, category and tag changes, and discontinued products removed from sale.

ERP → Stores

Shipment tracking

When an order ships, the carrier and tracking number are added to the customer's order in the store.

Stores → ERP

Orders from multiple sites

Each store publishes its orders. The ERP matches or creates the customer and addresses, builds the sales order with the right taxes and shipping, and records the payment.

Stores → ERP

Follow-up on an order

Later information, such as a fraud-screening decision, arrives as its own message and updates the order that already exists.

How fast is it? There is no polling interval anywhere in the path, so the delay is a few short hops: the ERP's background job, the broker, and the store writing the change. Our engineering estimate is a few seconds end to end, against minutes or hours for a scheduled sync. The white paper breaks that estimate down hop by hop.

Other subscribers. The same events are available to any system that binds a queue. The client's point-of-sale system is a separate project of ours and consumes price, stock and product events the same way.

Architecture at a Glance

An order's path from a store into the ERP. The same pieces carry ERP events back out in the other direction.

Online Stores
Each publishes its orders as messages
RabbitMQ
Topic exchange, durable queue, persistent messages
ERP Consumer
Looks up the handler for the message type
ERPNext
Customer, addresses, sales order, payment
Log + Alert
Payload stored; errors go to team chat

Why This Works

Decoupling

A store only needs the broker to be reachable to take an order. The ERP can be restarted, upgraded or busy; messages wait in the queue and are processed when it is back.

Nothing Disappears Quietly

Every order payload is stored and linked to the sales order it produced. When processing fails, the error is recorded, the team is alerted, and the stored payload can be run again.

No Duplicates

Before creating anything, the handler checks for an existing customer and existing addresses, so repeat buyers and re-processed messages do not multiply records.

One Pattern for Every Channel

A new store gets its own queue and three settings. A new kind of message gets a handler and a mapping row. Neither needs another point-to-point integration.

Want the Full Technical Detail?

The white paper covers the architecture, every real-time update and what each store does with it, the order flow step by step, a hop-by-hop latency estimate, the open-source version, and an estimate of what it takes to adopt.

Download the White Paper (PDF)

Direct download, no email required — or have it sent to you:

We're Building an Open-Source Version

The bus described here proved the pattern in production. We are now building it as a general, open-source ERPNext app, so that any ERPNext site can publish and consume messages the same way. It is in active development.

Running ERPNext with online stores around it? Tell us about your setup.

Designed and Implemented by

Wizard Labz connects the systems a business already runs on — ERPs, online stores, points of sale and internal tools — so information moves between them reliably and people stop filling the gaps by hand.

Have a similar problem?

Tell us what is going on. We'll reply by email and say honestly whether we can help.