You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: www/apps/resources/app/commerce-modules/inventory/links-to-other-modules/page.mdx
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,6 +31,12 @@ Each product variant has different inventory details. Medusa defines a link betw
31
31
32
32
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.
33
33
34
+
<Notetitle="Tip">
35
+
36
+
Learn more about product variant's inventory management in [this guide](../../product/variant-inventory/page.mdx).
37
+
38
+
</Note>
39
+
34
40
### Retrieve with Query
35
41
36
42
To retrieve the product variants of an inventory item with [Query](!docs!/learn/fundamentals/module-links/query), pass `variants.*` in `fields`:
Copy file name to clipboardExpand all lines: www/apps/resources/app/commerce-modules/product/links-to-other-modules/page.mdx
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -90,6 +90,12 @@ Medusa defines a link between the `ProductVariant` and `InventoryItem` data mode
90
90
91
91
When the `manage_inventory` property of a product variant is enabled, you can manage the variant's inventory in different locations through this relation.
92
92
93
+
<Notetitle="Tip">
94
+
95
+
Learn more about product variant's inventory management in [this guide](../variant-inventory/page.mdx).
96
+
97
+
</Note>
98
+
93
99
### Retrieve with Query
94
100
95
101
To retrieve the inventory items of a product variant with [Query](!docs!/learn/fundamentals/module-links/query), pass `inventory_items.*` in `fields`:
In this guide, you'll learn about the inventory management features related to product variants.
17
+
18
+
## Configure Inventory Management of Product Variants
19
+
20
+
A product variant, represented by the [ProductVariant](/references/product/models/ProductVariant) data model, has a `manage_inventory` field that's disabled by default. This field indicates whether you'll manage the inventory quantity of the product variant.
21
+
22
+
The Product Module doesn't provide inventory-management features. Instead, the Medusa application uses the [Inventory Module](../../inventory/page.mdx) to manage inventory for products and variants. When `manage_inventory` is disabled, the Medusa application always considers the product variant to be in stock. This is useful if your product's variants aren't items that can be stocked, such as digital products, or they don't have a limited stock quantity.
23
+
24
+
When `manage_inventory` is enabled, the Medusa application tracks the inventory of the product variant using the [Inventory Module](../../inventory/page.mdx). For example, when a customer purchases a product variant, the Medusa application decrements the stocked quantity of the product variant.
25
+
26
+
---
27
+
28
+
## How the Medusa Application Manages Inventory
29
+
30
+
When a product variant has `manage_inventory` enabled, the Medusa application creates an inventory item using the [Inventory Module](../../inventory/page.mdx) and links it to the product variant.
31
+
32
+

33
+
34
+
The inventory item has one or more locations, called inventory levels, that represent the stock quantity of the product variant at a specific location. This allows you to manage inventory across multiple warehouses, such as a warehouse in the US and another in Europe.
35
+
36
+

37
+
38
+
<Notetitle="Tip">
39
+
40
+
Learn more about inventory concepts in the [Inventory Module's documentation](../../inventory/concepts/page.mdx).
41
+
42
+
</Note>
43
+
44
+
The Medusa application represents and manages stock locations using the [Stock Location Module](../../stock-location/page.mdx). It creates a read-only link between the `InventoryLevel` and `StockLocation` data models so that it can retrieve the stock location of an inventory level.
45
+
46
+

47
+
48
+
<Notetitle="Tip">
49
+
50
+
Learn more about the Stock Location Module in the [Stock Location Module's documentation](../../stock-location/concepts/page.mdx).
51
+
52
+
</Note>
53
+
54
+
### Product Inventory in Storefronts
55
+
56
+
When a storefront sends a request to the Medusa application, it must always pass a [publishable API key](../../sales-channel/publishable-api-keys/page.mdx) in the request header. This API key specifies the sales channels, available through the [Sales Channel Module](../../sales-channel/page.mdx), of the storefront.
57
+
58
+
The Medusa application links sales channels to stock locations, indicating the locations available for a specific sales channel. So, all inventory-related operations are scoped by the sales channel and its associated stock locations.
59
+
60
+
For example, the availability of a product variant is determined by the `stocked_quantity` of its inventory level at the stock location linked to the storefront's sales channel.
61
+
62
+

63
+
64
+
---
65
+
66
+
## Variant Back Orders
67
+
68
+
Product variants have an `allow_backorder` field that's disabled by default. When enabled, the Medusa application allows customers to purchase the product variant even when it's out of stock. Use this when your product variant is available through on-demand or pre-order purchase.
69
+
70
+
<Notetitle="Tip">
71
+
72
+
You can also allow customers to subscribe to restock notifications of a product variant as explained in [this guide](../../../recipes/commerce-automation/restock-notification/page.mdx).
73
+
74
+
</Note>
75
+
76
+
---
77
+
78
+
## Additional Resources
79
+
80
+
The following guides provide more details on inventory management in the Medusa application:
81
+
82
+
-[Inventory Kits in the Inventory Module](../../inventory/inventory-kit/page.mdx): Learn how you can implement bundled or multi-part products through the Inventory Module.
83
+
-[Inventory in Flows](../../inventory/inventory-in-flows/page.mdx): Learn how Medusa utilizes inventory management in different flows.
84
+
-[Storefront guide: how to retrieve a product variant's inventory details](https://docs.medusajs.com/resources/storefront-development/products/inventory).
0 commit comments