- Get Started
- Product
- Resources
- Tools & SDKs
- Framework
- Reference
- Get Started
- Product
- Resources
- Tools & SDKs
- Framework
- Reference
Links between Product Module and Other Modules
This document showcases the module links defined between the Product Module and other commerce modules.
Summary#
The Product Module has the following links to other modules:
Product
data model <>Cart
data model of Cart Module. (Read-only).ProductVariant
data model <>InventoryItem
data model of Inventory Module.Product
data model <>Order
data model of Order Module. (Read-only).ProductVariant
data model <>PriceSet
data model of Pricing Module.Product
data model <>SalesChannel
data model of Sales Channel Module.
Cart Module#
Medusa defines read-only links between:
- The
Product
data model and the Cart Module'sLineItem
data model. This means you can retrieve the details of a line item's product, but you don't manage the links in a pivot table in the database. The product of a line item is determined by theproduct_id
property of theLineItem
data model. - The
ProductVariant
data model and the Cart Module'sLineItem
data model. This means you can retrieve the details of a line item's variant, but you don't manage the links in a pivot table in the database. The variant of a line item is determined by thevariant_id
property of theLineItem
data model.
Retrieve with Query#
To retrieve the line items of a variant with Query, pass line_items.*
in fields
:
line_items.*
in fields
.Inventory Module#
The Inventory Module provides inventory-management features for any stock-kept item.
Medusa defines a link between the ProductVariant
and InventoryItem
data models. Each product variant has different inventory details.
When the manage_inventory
property of a product variant is enabled, you can manage the variant's inventory in different locations through this relation.
Retrieve with Query#
To retrieve the inventory items of a product variant with Query, pass inventory_items.*
in fields
:
Manage with Link#
To manage the inventory items of a variant, use Link:
Order Module#
Medusa defines read-only links between:
- the
Product
data model and the Order Module'sOrderLineItem
data model. This means you can retrieve the details of a line item's product, but you don't manage the links in a pivot table in the database. The product of a line item is determined by theproduct_id
property of theOrderLineItem
data model. - the
ProductVariant
data model and the Order Module'sOrderLineItem
data model. This means you can retrieve the details of a line item's variant, but you don't manage the links in a pivot table in the database. The variant of a line item is determined by thevariant_id
property of theOrderLineItem
data model.
Retrieve with Query#
To retrieve the order line items of a variant with Query, pass order_items.*
in fields
:
order_items.*
in fields
.Pricing Module#
The Product Module doesn't provide pricing-related features.
Instead, Medusa defines a link between the ProductVariant
and the PriceSet
data models. A product variant’s prices are stored belonging to a price set.
So, to add prices for a product variant, create a price set and add the prices to it.
Retrieve with Query#
To retrieve the price set of a variant with Query, pass price_set.*
in fields
:
Manage with Link#
To manage the price set of a variant, use Link:
Sales Channel Module#
The Sales Channel Module provides functionalities to manage multiple selling channels in your store.
Medusa defines a link between the Product
and SalesChannel
data models. A product can have different availability in different sales channels.
Retrieve with Query#
To retrieve the sales channels of a product with Query, pass sales_channels.*
in fields
:
Manage with Link#
To manage the sales channels of a product, use Link: