Ecommerce ERP Integration: A Senior Engineer's Guide to Getting It Right
How to integrate your ecommerce platform with NetSuite, SAP, or Dynamics 365 without losing inventory, duplicating orders, or breaking your finance team's month-end close.
ERP integrations are where ecommerce projects go to die. They look simple in the architecture diagram — a line between two boxes — but the implementation is full of edge cases that only surface in production.
We've built ERP integrations for 40+ ecommerce clients across NetSuite, SAP Business One, Microsoft Dynamics 365, and Sage. Here's what we've learned about getting them right.
Why ERP integrations are hard
The core challenge is that your ecommerce platform and your ERP have different data models, different update cadences, and different definitions of "truth."
Data model mismatches: Shopify thinks a product has variants. NetSuite thinks it has item records with matrix attributes. Magento thinks it has configurable products with simple child products. These aren't just naming differences — they represent fundamentally different data structures that must be mapped bidirectionally.
Timing conflicts: A customer places an order on your website. Simultaneously, a warehouse worker adjusts inventory in the ERP. Which system has the correct stock count? The answer depends on your sync frequency, your conflict resolution strategy, and whether you're using real-time webhooks or batch processing.
Error amplification: A single bad field mapping can corrupt thousands of records. We once inherited an integration where a timezone mismatch caused every order to be dated one day in the future, breaking the client's revenue recognition for an entire quarter.
The five data flows you must get right
Every ecommerce-ERP integration has five core data flows. Get any one wrong and your operations suffer.
1. Product and inventory sync (ERP → Ecommerce)
The ERP is usually the source of truth for product data and inventory levels. Changes in the ERP need to propagate to your storefront.
Key decisions:
- Sync frequency: Real-time (webhook on every change) or batched (every 5/15/60 minutes)? Real-time sounds better but creates more complexity and more points of failure. For most stores, 15-minute batch sync is sufficient.
- Field mapping: Which ERP fields map to which ecommerce fields? Product name, description, price, weight, dimensions, category, images, metafields — each needs an explicit mapping.
- Inventory allocation: If you sell on multiple channels (website, Amazon, wholesale), how do you allocate inventory? A common approach: total stock in ERP, with channel-specific buffers.
Common mistakes:
- Not handling SKU format differences (ERP uses dashes, ecommerce uses underscores)
- Ignoring inventory for products with assemblies or kits
- Not accounting for warehouse-specific stock when you have multiple locations
2. Order sync (Ecommerce → ERP)
When a customer places an order, it needs to reach the ERP for fulfillment, accounting, and inventory deduction.
Key decisions:
- When to sync: On order placement, on payment capture, or on a schedule? Most B2C stores sync on payment capture. B2B stores with net terms may sync on order creation.
- Customer matching: Does the customer already exist in the ERP? Match by email, phone, or a custom ID? What if there's no match — create a new record or use a generic "web customer"?
- Tax handling: Your ecommerce platform calculates tax at checkout. Your ERP also calculates tax. These must match, or your finance team will spend hours reconciling.
Common mistakes:
- Not handling partial payments or split payments
- Creating duplicate customer records because of inconsistent email formatting (john@example.com vs John@Example.com)
- Not syncing discount codes and their associated amounts
3. Fulfillment sync (ERP → Ecommerce)
When the warehouse ships an order, the tracking information needs to flow back to your storefront so the customer gets their shipping notification.
Key decisions:
- Partial shipments: If an order ships in multiple packages, how do you communicate that? Each shipment needs its own tracking number.
- Tracking carrier mapping: The ERP might call it "UPS Ground." Shopify needs the carrier slug "ups." These need mapping.
Common mistakes:
- Not handling split shipments (sending one tracking email for a multi-package order)
- Not updating order status when the ERP marks an order as shipped
4. Returns and refunds (bidirectional)
Returns are the most complex flow because they affect inventory, accounting, and customer records simultaneously.
Key decisions:
- Where are returns initiated? Customer self-service on the storefront, or manually in the ERP?
- Restocking: Does the returned item go back into available inventory immediately, or does it go through inspection first?
- Refund processing: Does the refund happen in the ecommerce platform (Shopify processes the refund to the original payment method) or in the ERP (accounting creates a credit memo)?
5. Price and promotion sync (ERP → Ecommerce)
If the ERP manages pricing (common in B2B), price changes need to reach the storefront. This includes:
- Base prices
- Customer-specific pricing (B2B)
- Volume discounts and tier pricing
- Promotional pricing with date ranges
Architecture patterns
Pattern 1: Direct API integration
Your ecommerce platform talks directly to the ERP's API (and vice versa).
Pros: Simplest architecture, fewest moving parts. Cons: Tight coupling. If the ERP API changes, your integration breaks. No transformation layer. Best for: Simple integrations with few data flows and a stable ERP API.
Pattern 2: Middleware / iPaaS
A middleware platform (Celigo, MuleSoft, Boomi, or custom n8n/Airflow) sits between your ecommerce platform and ERP.
Pros: Decoupled systems, transformation layer, logging, error handling, and retry logic built in. Cons: Additional cost and complexity. Another system to monitor. Best for: Most mid-market integrations. This is our default recommendation.
Pattern 3: Event-driven with message queue
Both systems publish events to a message queue (RabbitMQ, AWS SQS, Kafka). Consumers process events asynchronously.
Pros: Most resilient. No data loss if one system is down. Scales independently. Cons: Most complex to build and monitor. Requires event-driven thinking from your team. Best for: High-volume stores (1,000+ orders/day) or integrations where downtime tolerance is zero.
Our integration checklist
Before we write code, we work through this checklist with every client:
- Which system is the source of truth for each data entity?
- What's the acceptable sync latency for each data flow?
- What happens when a sync fails? Who gets notified?
- How do we handle conflicts (simultaneous updates to the same record)?
- What's the rollback strategy if bad data propagates?
- How do we test the integration without affecting production data?
- What monitoring and alerting do we need?
- Who maintains the integration after launch?
Planning an ERP integration? [Book a free discovery call](https://calendly.com/codifier-info/30min) and we'll scope the integration based on your specific ERP and ecommerce platform. We've built 40+ ERP integrations and know where the landmines are.