Order Management System (OMS) Recipe

This recipe provides an overview of Medusa's features and how to use it as an Order Management System (OMS).

Overview#

Building or integrating an OMS brings certain challenges: accepting orders from different sales channels, tracking inventory across the sales channels, integrating third-party fulfillment and payment providers with the OMS, and more.

Medusa's commerce modules and customization toolkit lets you integrate it within a larger ecosystem. The commerce modules provide features to allow businesses to accept orders from any sales channel, benefit from multi-warehouse inventory features, and integrate third-party services for fulfillment, payment, and more.


Source Orders into Medusa#

Sales channels in your commerce ecosystem must route their orders into the OMS.

Routing orders into Medusa OMS

Medusa's Store REST APIs let you integrate a checkout experience in any storefront. Alternatively, you can use Medusa's Draft Order APIs to place an order without direct involvement from the customer, such as when placing an order through a POS.

In addition, you can customize the Medusa application to accept orders through a third-party checkout system. This gives you more flexibility over adding orders to Medusa.

For example, you can support importing orders into Medusa through a custom API Route that allows batch-inserting orders. Another example is creating a scheduled job that runs at a specified interval and imports orders from a third-party service.

Store REST APIs
Learn how to use the Store REST APIs to create an order.
Create API Route
Learn how to create a custom API Route.
Create Scheduled Jobs
Learn how to create a scheduled job.

Route Orders to Third-party Fulfillment Services#

To integrate third-party fulfillment providers with the Medusa application, create a fulfillment module provider.

Medusa uses the Fulfillment Module whenever a fulfillment action is performed, such as when a fulfillment is created for items in an order. The module's main service's methods use the associated fulfillment module provider to handle the desired fulfillment actions.

Fulfilling orders with Medusa OMS

In addition, create a subscriber that listen to fulfillment-related events, such as the order.fulfillment_created event, to perform actions with the third-party fulfillment provider.

Coming soonEmitting of event order.fulfillment_created isn't implemented yet.
Create a Fulfillment Module Provider
Learn how to create a fulfillment provider in Medusa.
Create a Subscriber
Learn about create a subscriber

Process Payment with Third-Party Providers#

To integrate third-party payment providers with the Medusa application, create a payment module provider.

In addition, create a subscriber that listen to payment-related events, such as the order.payment_captured event, to perform actions in the third-party payment provider.

Coming soonEmitting of event order.payment_captured isn't implemented yet.
Create a Payment Module Provider
Learn how to create a payment module provider.
Create a Subscriber
Learn about create a subscriber

Track Inventory Across Sales Channels#

Medusa's Inventory, Stock Location, and Sales Channel modules allow merchants to track inventory levels tied to sales channels across stock locations.

When an order is placed, the item's quantity is reserved from the stock location associated with the order's sales channel. Once the item is fulfilled, the reserved quantity is deducted from the item's inventory quantity.

Inventory Module
Learn about the Inventory Module's concepts and features.
Stock Location Module
Learn about the Stock Location Module's concepts and features.
Sales Channel Module
Learn about the Sales Channel Module's concepts and features.

Handle Returns, Exchanges, and Changes#

Coming soonAll types of order changes are coming soon.

In Medusa, items in an order can be returned or exchanged; these can be created by the merchant or requested by the customer. A merchant can also edit an order to add, update, or delete items.

When changes are made to an order by any of the mentioned actions, the changes are reflected on the order's totals and associated inventory. The integrated fulfillment and payment module providers are used if fulfillment or payment actions are required, such as fulfilling exchanged items.

Medusa also emits events related to these actions, such as order.return_requested. So, you can create a subscriber that listens to these events and perform asynchronous actions, such as communicating with third-party services.

Coming soonEmitting of event order.return_requested isn't implemented yet.
Order Changes
Learn about how to use order changes.
Create a Subscriber
Learn about create a subscriber
Was this page helpful?
Edit this page