Skip to content

Commit 3f2dcb2

Browse files
authored
docs: document different ways of selling products (#11446)
* docs: document different ways of selling products * add llms
1 parent 75da151 commit 3f2dcb2

File tree

12 files changed

+17176
-16948
lines changed

12 files changed

+17176
-16948
lines changed

www/apps/book/public/llms-full.txt

Lines changed: 16982 additions & 16924 deletions
Large diffs are not rendered by default.

www/apps/resources/app/commerce-modules/inventory/concepts/page.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ The `InventoryItem` data model mainly holds details related to the underlying st
1414

1515
![A diagram showcasing the relation between data models in the Inventory Module](https://res.cloudinary.com/dza7lstvk/image/upload/v1709658103/Medusa%20Resources/inventory-architecture_kxr2ql.png)
1616

17+
### Inventory Shipping Requirement
18+
19+
An inventory item has a `requires_shipping` field (enabled by default) that indicates whether the item requires shipping. For example, if you're selling a digital license that has limited stock quantity but doesn't require shipping.
20+
21+
When a product variant is purchased in the Medusa application, this field is used to determine whether the item requires shipping. Learn more in [this documentation](../../product/selling-products/page.mdx).
22+
1723
---
1824

1925
## InventoryLevel
Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
---
2+
sidebar_label: "Product Shipping Requirement"
3+
tags:
4+
- concept
5+
- fulfillment
6+
---
7+
8+
import { Table } from "docs-ui"
9+
10+
export const metadata = {
11+
title: `Configure Selling Products`,
12+
}
13+
14+
# {metadata.title}
15+
16+
In this guide, you'll learn how to set up and configure your products based on their shipping and inventory requirements, the product type, how you want to sell them, or your commerce ecosystem.
17+
18+
<Note>
19+
20+
The concepts in this guide are applicable starting from Medusa v2.5.1.
21+
22+
</Note>
23+
24+
## Scenario
25+
26+
Businesses can have different selling requirements:
27+
28+
1. They may sell physical or digital items.
29+
2. They may sell items that don't require shipping or inventory management, such as selling digital products, services, or booking appointments.
30+
3. They may sell items whose inventory is managed by an external system, such as an ERP.
31+
32+
Medusa supports these different selling requirements by allowing you to configure shipping and inventory requirements for products and their variants. This guide explains how these configurations work, then provides examples of setting up different use cases.
33+
34+
---
35+
36+
## Configuring Shipping Requirements
37+
38+
The Medusa application defines a link between the `Product` data model and a [ShippingProfile](../../fulfillment/concepts/page.mdx#shipping-profile) in the [Fulfillment Module](../../fulfillment/page.mdx), allowing you to associate a product with a shipping profile.
39+
40+
When a product is associated with a shipping profile, its variants require shipping and fulfillment when purchased. This is useful for physical products or digital products that require custom fulfillment.
41+
42+
If a product doesn't have an associated shipping profile, its variants don't require shipping and fulfillment when purchased. This is useful for digital products, for example, that don't require shipping.
43+
44+
### Overriding Shipping Requirements for Variants
45+
46+
A product variant whose inventory is managed by Medusa (its `manage_inventory` property is enabled) has an [inventory item](../../inventory/concepts/page.mdx#inventoryitem). The inventory item has a `requires_shipping` property that can be used to override its shipping requirement. This is useful if the product has an associated shipping profile but you want to disable shipping for a specific variant, or vice versa.
47+
48+
<Note title="Tip">
49+
50+
Learn more about product variant's inventory in [this guide](../variant-inventory/page.mdx).
51+
52+
</Note>
53+
54+
When a product variant is purchased, the Medusa application decides whether the purchased item requires shipping in the following order:
55+
56+
1. The product variant has an inventory item. In this case, the Medusa application uses the inventory item's `requires_shipping` property to determine if the item requires shipping.
57+
2. If the product variant doesn't have an inventory item, the Medusa application checks whether the product has an associated shipping profile to determine if the item requires shipping.
58+
59+
---
60+
61+
## Use Case Examples
62+
63+
By combining configurations of shipment requirements and inventory management, you can set up your products to support your use case:
64+
65+
<Table>
66+
<Table.Header>
67+
<Table.Row>
68+
<Table.HeaderCell>Use Case</Table.HeaderCell>
69+
<Table.HeaderCell>Configurations</Table.HeaderCell>
70+
<Table.HeaderCell>Example</Table.HeaderCell>
71+
</Table.Row>
72+
</Table.Header>
73+
<Table.Body>
74+
<Table.Row>
75+
<Table.Cell>
76+
Item that's shipped on purchase, and its variant inventory is managed by the Medusa application.
77+
</Table.Cell>
78+
<Table.Cell>
79+
- Product has a shipping profile, or variant inventory item's `requires_shipping` property is `true`.
80+
- Product variant's `manage_inventory` property is `true`.
81+
</Table.Cell>
82+
<Table.Cell>
83+
Any stock-kept item (clothing, for example), whose inventory is managed in the Medusa application.
84+
</Table.Cell>
85+
</Table.Row>
86+
<Table.Row>
87+
<Table.Cell>
88+
Item that's shipped on purchase, but its variant inventory is managed externally (not by Medusa) or it has infinite stock.
89+
</Table.Cell>
90+
<Table.Cell>
91+
- Product has a shipping profile.
92+
- Product variant's `manage_inventory` property is `false`.
93+
</Table.Cell>
94+
<Table.Cell>
95+
Any stock-kept item (clothing, for example), whose inventory is managed in an ERP or has infinite stock.
96+
</Table.Cell>
97+
</Table.Row>
98+
<Table.Row>
99+
<Table.Cell>
100+
Item that's not shipped on purchase, but its variant inventory is managed by Medusa.
101+
</Table.Cell>
102+
<Table.Cell>
103+
- Product doesn't have a shipping profile, or variant inventory item's `requires_shipping` property is `false`.
104+
- Product variant's `manage_inventory` property is `true`.
105+
</Table.Cell>
106+
<Table.Cell>
107+
Digital products, such as licenses, that don't require shipping but have a limited quantity.
108+
</Table.Cell>
109+
</Table.Row>
110+
<Table.Row>
111+
<Table.Cell>
112+
Item that doesn't require shipping and its variant inventory isn't managed by Medusa.
113+
</Table.Cell>
114+
<Table.Cell>
115+
- Product doesn't have a shipping profile, or variant inventory item's `requires_shipping` property is `false`.
116+
- Product variant's `manage_inventory` property is `false`.
117+
</Table.Cell>
118+
<Table.Cell>
119+
- Digital products, such as eBooks, that don't require shipping and don't have a stock quantity.
120+
- Services, such as appointments, that don't require shipping and don't have a stock quantity.
121+
</Table.Cell>
122+
</Table.Row>
123+
</Table.Body>
124+
</Table>
125+

www/apps/resources/app/commerce-modules/product/variant-inventory/page.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ In this guide, you'll learn about the inventory management features related to p
1717

1818
## Configure Inventory Management of Product Variants
1919

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.
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 in the Medusa application. You can also keep `manage_inventory` disabled if you manage the product's inventory in an external system, such as an ERP.
2121

2222
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.
2323

@@ -80,5 +80,6 @@ You can also allow customers to subscribe to restock notifications of a product
8080
The following guides provide more details on inventory management in the Medusa application:
8181

8282
- [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+
- [Configure Selling Products](../selling-products/page.mdx): Learn how to use inventory management to support different use cases when selling products.
8384
- [Inventory in Flows](../../inventory/inventory-in-flows/page.mdx): Learn how Medusa utilizes inventory management in different flows.
8485
- [Storefront guide: how to retrieve a product variant's inventory details](https://docs.medusajs.com/resources/storefront-development/products/inventory).

www/apps/resources/generated/edit-dates.mjs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export const generatedEditDates = {
2828
"app/commerce-modules/fulfillment/page.mdx": "2025-01-09T13:41:05.614Z",
2929
"app/commerce-modules/inventory/_events/_events-table/page.mdx": "2024-07-03T19:27:13+03:00",
3030
"app/commerce-modules/inventory/_events/page.mdx": "2024-07-03T19:27:13+03:00",
31-
"app/commerce-modules/inventory/concepts/page.mdx": "2024-10-08T15:11:27.634Z",
31+
"app/commerce-modules/inventory/concepts/page.mdx": "2025-02-13T12:37:28.918Z",
3232
"app/commerce-modules/inventory/inventory-in-flows/page.mdx": "2025-01-08T12:21:12.157Z",
3333
"app/commerce-modules/inventory/page.mdx": "2025-01-09T13:41:05.212Z",
3434
"app/commerce-modules/order/_events/_events-table/page.mdx": "2024-07-03T19:27:13+03:00",
@@ -5901,7 +5901,7 @@ export const generatedEditDates = {
59015901
"references/core_flows/Order/Steps_Order/variables/core_flows.Order.Steps_Order.updateOrderChangesStepId/page.mdx": "2025-01-27T11:43:49.278Z",
59025902
"app/commerce-modules/payment/account-holder/page.mdx": "2025-01-31T09:37:41.595Z",
59035903
"app/troubleshooting/test-errors/page.mdx": "2025-01-31T13:08:42.639Z",
5904-
"app/commerce-modules/product/variant-inventory/page.mdx": "2025-02-03T12:19:45.706Z",
5904+
"app/commerce-modules/product/variant-inventory/page.mdx": "2025-02-13T12:31:51.593Z",
59055905
"app/examples/guides/custom-item-price/page.mdx": "2025-02-07T09:21:11.170Z",
59065906
"references/core_flows/Cart/Steps_Cart/functions/core_flows.Cart.Steps_Cart.validateShippingStep/page.mdx": "2025-02-11T11:36:39.235Z",
59075907
"references/core_flows/Cart/Steps_Cart/variables/core_flows.Cart.Steps_Cart.validateShippingStepId/page.mdx": "2025-02-11T11:36:39.228Z",
@@ -5932,6 +5932,7 @@ export const generatedEditDates = {
59325932
"references/types/types/types.BasePaymentCollectionStatus/page.mdx": "2025-02-11T11:36:50.377Z",
59335933
"references/utils/enums/utils.PaymentActions/page.mdx": "2025-02-11T11:36:54.941Z",
59345934
"references/utils/enums/utils.PaymentCollectionStatus/page.mdx": "2025-02-11T11:36:54.928Z",
5935+
"app/commerce-modules/product/selling-products/page.mdx": "2025-02-13T13:27:09.270Z",
59355936
"references/js_sdk/admin/Admin/properties/js_sdk.admin.Admin.draftOrder/page.mdx": "2025-02-24T10:48:44.721Z",
59365937
"references/js_sdk/admin/Client/methods/js_sdk.admin.Client.throwError_/page.mdx": "2025-02-24T10:48:47.018Z",
59375938
"references/js_sdk/admin/CustomStorage/methods/js_sdk.admin.CustomStorage.getItem/page.mdx": "2025-02-24T10:48:47.069Z",

www/apps/resources/generated/files-map.mjs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -555,6 +555,10 @@ export const filesMap = [
555555
"filePath": "/www/apps/resources/app/commerce-modules/product/page.mdx",
556556
"pathname": "/commerce-modules/product"
557557
},
558+
{
559+
"filePath": "/www/apps/resources/app/commerce-modules/product/selling-products/page.mdx",
560+
"pathname": "/commerce-modules/product/selling-products"
561+
},
558562
{
559563
"filePath": "/www/apps/resources/app/commerce-modules/product/variant-inventory/page.mdx",
560564
"pathname": "/commerce-modules/product/variant-inventory"

www/apps/resources/generated/sidebar.mjs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3225,6 +3225,8 @@ export const generatedSidebar = [
32253225
"type": "category",
32263226
"title": "Concepts",
32273227
"initialOpen": false,
3228+
"autogenerate_tags": "concept+fulfillment",
3229+
"autogenerate_as_ref": true,
32283230
"children": [
32293231
{
32303232
"loaded": true,
@@ -3265,6 +3267,14 @@ export const generatedSidebar = [
32653267
"path": "/commerce-modules/fulfillment/links-to-other-modules",
32663268
"title": "Links to Other Modules",
32673269
"children": []
3270+
},
3271+
{
3272+
"loaded": true,
3273+
"isPathHref": true,
3274+
"type": "ref",
3275+
"title": "Product Shipping Requirement",
3276+
"path": "/commerce-modules/product/selling-products",
3277+
"children": []
32683278
}
32693279
]
32703280
},
@@ -10588,6 +10598,14 @@ export const generatedSidebar = [
1058810598
"title": "Variant Inventory",
1058910599
"children": []
1059010600
},
10601+
{
10602+
"loaded": true,
10603+
"isPathHref": true,
10604+
"type": "link",
10605+
"path": "/commerce-modules/product/selling-products",
10606+
"title": "Selling Use Cases",
10607+
"children": []
10608+
},
1059110609
{
1059210610
"loaded": true,
1059310611
"isPathHref": true,

www/apps/resources/sidebars/fulfillment.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ export const fulfillmentSidebar = [
2222
type: "category",
2323
title: "Concepts",
2424
initialOpen: false,
25+
autogenerate_tags: "concept+fulfillment",
26+
autogenerate_as_ref: true,
2527
children: [
2628
{
2729
type: "link",

www/apps/resources/sidebars/product.mjs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ export const productSidebar = [
2525
path: "/commerce-modules/product/variant-inventory",
2626
title: "Variant Inventory",
2727
},
28+
{
29+
type: "link",
30+
path: "/commerce-modules/product/selling-products",
31+
title: "Selling Use Cases",
32+
},
2833
{
2934
type: "link",
3035
path: "/commerce-modules/product/links-to-other-modules",

www/packages/tags/src/tags/concept.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ export const concept = [
33
"title": "Inventory Kits",
44
"path": "/commerce-modules/inventory/inventory-kit"
55
},
6+
{
7+
"title": "Product Shipping Requirement",
8+
"path": "/commerce-modules/product/selling-products"
9+
},
610
{
711
"title": "Product Variant Inventory",
812
"path": "/commerce-modules/product/variant-inventory"

0 commit comments

Comments
 (0)