- Get Started
- Product
- Resources
- Tools & SDKs
- Framework
- Reference
- Get Started
- Product
- Resources
- Tools & SDKs
- Framework
- Reference
Inventory Module in Medusa Flows
This document explains how the Inventory Module is used within the Medusa application's flows.
Product Variant Creation#
When a product variant is created and its manage_inventory
property's value is true
, the Medusa application creates an inventory item associated with that product variant.
Add to Cart#
When a product variant with manage_inventory
set to true
is added to cart, the Medusa application checks whether there's sufficient stocked quantity. If not, an error is thrown and the product variant won't be added to the cart.
Order Placed#
When an order is placed, the Medusa application creates a reservation item for each product variant with manage_inventory
set to true
.
Order Fulfillment#
When an item in an order is fulfilled and the associated variant has its manage_inventory
property set to true
, the Medusa application:
- Subtracts the
reserved_quantity
from thestocked_quantity
in the inventory level associated with the variant's inventory item. - Resets the
reserved_quantity
to0
. - Deletes the associated reservation item.
Order Return#
When an item in an order is returned and the associated variant has its manage_inventory
property set to true
, the Medusa application increments the stocked_quantity
of the inventory item's level with the returned quantity.
Dismissed Returned Items#
If a returned item is considered damaged or is dismissed, its quantity doesn't increment the stocked_quantity
of the inventory item's level.