- Get Started
- Product
- Resources
- Tools & SDKs
- Framework
- Reference
- Get Started
- Product
- Resources
- Tools & SDKs
- Framework
- Reference
Links between Inventory Module and Other Modules
This document showcases the module links defined between the Inventory Module and other commerce modules.
Summary#
The Inventory Module has the following links to other modules:
ProductVariant
data model of Product Module <>InventoryItem
data model.InventoryLevel
data model <>StockLocation
data model of Stock Location Module. (Read-only).
Product Module#
Each product variant has different inventory details. Medusa defines a link between the ProductVariant
and InventoryItem
data models.
A product variant whose manage_inventory
property is enabled has an associated inventory item. Through that inventory's items relations in the Inventory Module, you can manage and check the variant's inventory quantity.
Retrieve with Query#
To retrieve the product variants of an inventory item with Query, pass variants.*
in fields
:
Manage with Link#
To manage the variants of an inventory item, use Link:
Stock Location Module#
Medusa defines a read-only link between the InventoryLevel
data model and the Stock Location Module's StockLocation
data model. This means you can retrieve the details of an inventory level's stock locations, but you don't manage the links in a pivot table in the database. The stock location of an inventory level is determined by the location_id
property of the InventoryLevel
data model.
Retrieve with Query#
To retrieve the stock locations of an inventory level with Query, pass stock_locations.*
in fields
: