How to connect a web shop to ERP: orders, stock, prices
How to connect a web shop to ERP: which data flows which way, how often to sync stock, the oversell problem, 4 ways to integrate and what to agree first.
Past a few dozen orders a day, someone ends up retyping every order into the ERP and fixing stock by hand. To connect a web shop to ERP well, first decide which system owns which data and how often it moves, then pick the method.
Quick answer
- The ERP owns products, prices and stock. They flow ERP -> shop.
- The shop owns orders, customers and payment status. They flow shop -> ERP.
- Shipping, tracking and the invoice come back to the shop and the customer.
- Stock needs the fastest sync: real time on every change, or every 5-15 minutes at most.
- Four ways to connect: a ready-made connector, middleware (iPaaS), a custom API integration, or scheduled CSV/XML files.
- Most problems come from SKU mismatches, duplicate customers, VAT rounding and returns, not from the code.
Which data flows which way
Every field needs one owner. Two-way sync on the same field is how integrations quietly break.
| Data | Direction | Recommended sync |
|---|---|---|
| Products, descriptions, categories | ERP -> shop | Hourly or nightly |
| Prices and discounts | ERP -> shop | Every 15-60 min, or on change |
| Stock levels | ERP -> shop | Real time, max 5-15 min |
| Orders and order lines | Shop -> ERP | Real time (on order created) |
| Customers and addresses | Shop -> ERP | With the order |
| Payment status | Shop -> ERP | Real time (from the payment gateway) |
| Shipping status, tracking number | ERP/WMS -> shop -> customer | On change |
| Invoice / eRačun | ERP -> customer | When issued |
B2B shops add customer-specific price lists - see our B2B web shop guide.
The order lifecycle after integration
- The customer pays and the shop creates the order.
- The order lands in the ERP as a sales document, with stock reserved.
- The warehouse (or WMS) gets a picking list and packs the parcel.
- The courier label and tracking number go back to the shop, which emails the customer.
- The ERP issues the invoice. For B2B buyers in Croatia that is now an eRačun - see our e-invoicing and fiscalization guide.
- The shop status changes to “shipped” without anyone touching it.
Returns run the same path backwards: return in the shop, storno in the ERP, stock back on the shelf.
Worked example: hours saved and the oversell risk
Illustrative numbers, not a client case. A shop with 40 orders a day where each order takes 4 minutes to retype into the ERP spends 160 minutes, about 2.7 hours a day. Over roughly 21.7 working days that is about 58 hours a month - a third of a full-time job spent copying data.
Now the stock side. Suppose stock syncs every 15 minutes and your best-seller sells 12 units an hour online. The last units go to a wholesale order in the ERP right after a sync. Until the next sync the shop still shows them, and it can sell up to 3 units that no longer exist (12 / 60 × 15). Each one is an apology and a refund.
Three fixes, from cheapest to best: shorten the interval to 5 minutes (max 1 unit), hold a safety buffer of 2-3 units on fast movers, or push stock from the ERP the moment it changes.
4 ways to connect a web shop to ERP
1. Ready-made connector or plugin. Common pairs (WooCommerce, Shopify, Magento with popular ERPs) often have one. Fastest when it covers your data; not enough with several warehouses, special price lists or custom order statuses.
2. Middleware / iPaaS. A layer that maps fields, queues messages and retries failures. Good when you connect more than two systems (shop, ERP, courier, CRM).
3. Custom API integration. Built for your exact process: real-time stock, multiple warehouses, B2B logic, your own error handling. More upfront work, full control. How APIs and webhooks work, and what they cost, is in our API integrations guide.
4. CSV/XML file exchange. A scheduled export and import. Cheap, reliable, often the only option for older ERPs without an API, but too slow for stock on busy items. Croatian systems differ a lot - our accounting integrations post covers Minimax, Synesis and Luceed, and ERP integrations covers SAP, Dynamics and Pantheon.
What goes wrong, and what to agree before building
- SKU mismatch. The shop and the ERP must use the same product code, including variants (size, colour). Clean this before writing any code.
- Duplicate customers. Guest checkouts create a new customer each time. Agree on a matching rule (email, OIB/VAT ID).
- VAT and rounding. The shop rounds per line, the ERP per document, and totals differ by a cent. Decide which system calculates.
- Returns and storno. Partial returns, exchanges and cancelled paid orders need explicit rules.
- Failed messages. A failed order must land in a visible queue with an alert, not only in a log.
- Ownership. Write down the owner of each field, the sync interval and who fixes failures.
If you are still choosing the ERP itself, start with what an ERP system is, and see what a web shop costs for the build side.
Frequently Asked Questions
Should stock sync in real time? For items that sell several times an hour, yes, or at most every 5 minutes. For a slow-moving catalogue a 15-60 minute schedule is fine. Use the oversell formula above: units per hour × interval in hours.
Can we start with CSV and move to an API later? Yes. Many shops start with files for products and prices and add real-time order and stock sync as volume grows. Keep the same SKU rules so the switch is painless.
Does the order go to the ERP before or after payment? Usually after the payment is confirmed, or as “pending” for cash on delivery and bank transfer. Agree how unpaid and cancelled orders are cleared in the ERP.
Who should own prices, the shop or the ERP? The ERP, in almost every case. Promotions created only in the shop must still reach the ERP or the invoice will not match the order.
Related Articles
- API integrations: how they work
- Accounting integrations for Croatian companies
- How much does a web shop cost in Croatia?
Thinking about connecting your shop to an ERP?
We build web shop, ERP and warehouse integrations as part of our Automation and Custom Development services - see selected work. Book a free Discovery call and we will map your data flows and recommend the simplest method that works.
Reach us at [email protected] or via the form on our homepage.