Blog

February 28, 2025·User stories

Integrating ERPs with Medusa: Two real-world approaches

Nicklas Gellner

Nicklas avatar

Oscar Tyrberg

Oscar avatar

Carla Böddeker

Carla avatar

Nicklas Gellner, Oscar Tyrberg and 1 other author

Explore real-world examples of how engineering teams are using Medusa’s modular architecture to build seamless, custom ERP integrations for their clients.

Image modal

Enterprise Resource Planning (ERP) systems are at the heart of most enterprise and B2B commerce operations, and a lot of major Medusa implementations involves ERP integration. From Heineken's integration with several distributor ERPs on their B2B platform to Mitsubishi's coordination of their spare parts inventory. These systems are crucial yet notoriously complex to integrate with modern commerce platforms.

This is one of the places where Medusa's architecture stands out - its workflow engine and modular design make it very well-suited to handle such complex integrations. Rather than forcing businesses to build complex middleware or maintain frail sync processes, Medusa allows direct integration through workflows that can gracefully handle the complexity of enterprise data flows while maintaining system reliability. At the same time, Medusa’s 16 commerce modules can even be replaced in areas where you would like the ERP to act as a source of truth instead.

In this blog post, we will cover the ERP integration implementations from two previous Magento merchants who opted for Medusa to power their B2B commerce.

ERP integration recipe

Visit our Docs recipe for a detailed guide on how to go about ERP integrations with Medusa.

How Medusa supports complex integration needs

Medusa's architecture is purposefully built to support complex custom integrations to systems like ERPs. The modular design allows developers to replace or customize specific commerce domains without affecting others. We have seen this taken to the extreme with VeVe, who used only Medusa's Cart Module while maintaining their own systems for everything else.

The Workflow Engine makes it easy to hook into existing commerce operations, ensuring data consistency through built-in rollback mechanisms and status tracking. Additionally, Medusa's framework tooling, including subscribers, scheduled jobs, and custom modules, significantly reduces the development time needed to build reliable ERP connections. This eliminates the need for complex middleware solutions that often introduce risks of data loss and require ongoing maintenance.

Two approaches to ERP integrations

Generally, businesses choose two different approaches when integrating Medusa with their ERP system. The first approach establishes two-way synchronization between Medusa and the ERP, where data exists in both systems and syncs through webhooks or API calls. EKI uses this approach to allow their ERP to manage orders and inventory alongside a custom configurator for product and pricing management, with Medusa orchestrating data between systems.

The second approach uses Medusa's workflow engine to create direct connections between the storefront and ERP for specific domains. Rather than duplicating data across systems, workflows handle authentication and data retrieval in real-time, pulling relevant data directly from the ERP when needed. Seeed uses this approach in their B2B implementations, where the storefront pulls order history and inventory levels directly from the ERP using Medusa’s workflow tooling.

Below are two examples of the different approaches used by B2B clients.

Medusa orchestrates data between ERP and other systems

We previously did a user story covering how rb2 migrated from Magento to Medusa to rebuild EKI’s B2B store. EKI already had Odoo as an ERP system in place, along with a custom-built system for price and product configurations. The team wanted to separate the commerce domain from the core business processes such that:

  • Odoo manages orders, customers, and specific shipping rules.
  • The custom configurator manages product and pricing calculations.
  • Medusa orchestrates data from other systems and manages carts and checkout.

The rb2 team integrated these systems with Medusa using webhook-based synchronization. Customer and order data flows bidirectionally between Odoo and Medusa, with Medusa pulling product and pricing information from the custom configurator at checkout.

Image modal

Integrating with Odoo

EKI uses external IDs to link entities between Medusa and Odoo. For better performance, Medusa caches data like customer shipping information locally, updating it only when changes occur in Odoo. This allows faster checkout by accessing cached data instead of querying Odoo.

Orders

Customers can order through EKI's webshop or by contacting a sales representative. Orders placed in the webshop are sent from Medusa to Odoo, while orders placed through sales representatives are created in Odoo and sent to Medusa. This ensures consistency across systems.

Customers

Customer data initially syncs from Medusa to Odoo during the first checkout registration. With bidirectional sync, both systems can then update customer details. Organizational data, such as order history and shipping rules, is available in Odoo and included in a custom Medusa module.

Shipping

EKI maintains customer-specific shipping rules in Odoo, such as free shipping above certain order thresholds. These rules sync to Medusa automatically when customers create new orders in the webshop.

Inventory levels

Inventory levels are stored in Odoo and synchronized with the custom configurator, which provides estimates for delivery times during checkout.

Odoo example integration

Visit our example integration for Odoo in our Docs.

Integrating with EKI’s custom configurator

EKI's webshop manages over 20M product configurations through its custom-built product configurator. The system has two main parts: (i) a configurator service that handles customer interactions, product configurations, and pricing calculations and (ii) a Data Management Portal (DMP) that manages configuration rules and customer-specific pricing.

The configurator allows customers to customize product specifications in the storefront. The configurator service processes customer choices and works with the DMP to calculate pricing, applying volume discounts and customer-specific agreements.

When a product is added to cart, its configuration is stored in Medusa's line item metadata. The customer-specific pricing is validated against the customer ID in Medusa and stored in the order line item. The price is then stored in the Medusa order data and sent to Odoo using a webhook.

Using Workflows to connect the ERP and storefront directly

Seeed is leading a large-scale B2B migration from Magento to Medusa for a Canadian merchant managing over 800,000 individual products. Previously reliant on DDI as its ERP system, the merchant sought a commerce platform that could seamlessly work alongside DDI to replace some of their manual order processing. To achieve this, Seeed implemented a hybrid integration between Medusa and DDI, strategically distributing responsibilities between the two systems where:

  • Medusa manages commerce operations like cart management, pricing, and quotes.
  • DDI serves as the system of records for order history, inventory levels, and customer data.
Image modal

Integrating with DDI

Through Medusa workflows, the merchant retrieves order and inventory information directly from DDI without storing it in Medusa. Medusa acts as an authentication layer—users log in with their credentials, and the workflow includes their authentication token when making calls to DDI.

When an order is placed in Medusa, a workflow sends the information to DDI through an API request, updating both the order history and inventory levels in DDI.

Customer information

Users can access their profile and organizational information through a custom B2B Module upon logging in. The system also retrieves their historical data, including past orders, from DDI.

Order List

Users can access their complete order history, which is retrieved directly from DDI. A Medusa workflow triggers a GET request to DDI's API to display all past orders. Users can then filter these orders by date, SKU code, and status through another workflow that sends these filtering parameters to DDI's API.

Order page

When users click on a specific order, they can view order information including product details, order totals, shipping and billing information, and payment details. A Medusa workflow retrieves product, billing, and payment data by sending a request to the DDI API, while shipping details are pulled from a third-party API. The workflow then structures the data for display in the storefront.

Inventory information

In the storefront's product pages, Medusa directly provides core information like images and pricing. An external PIM system supplies additional product details, while DDI handles inventory levels, and delivery time estimates from historical orders.

Quote Management

Quotes are created in Medusa and then sent to DDI for processing, where they are approved or rejected, and priced. Once finalized, the updated quote is returned to Medusa and displayed on the storefront, giving users real-time access to its status and pricing.

Custom Pricing

Seeed built a workflow within Medusa to retrieve custom pricing for logged-in users directly from DDI, ensuring it aligns with the client’s specific requirements. This workflow dynamically fetches and displays real-time pricing in the storefront, reflecting any updates managed within the ERP.

No one-size fits all

While these two cases showcase real-life Medusa implementations, ERP integrations rarely follow a one-size-fits-all approach. If you are exploring an ERP implementation and would like to discuss your specific case, then feel free to reach out via medusajs.com/contact.

Alternatively, you can explore our ERP integration guides for more insights into setting up an ERP-to-Medusa implementation yourself.

Share this post

Ready to build your custom commerce setup?