Skip to content

Commit 2e5b648

Browse files
authored
docs: add a section on shipping options and requirement + improvements (medusajs#12990)
1 parent 19ae4be commit 2e5b648

File tree

5 files changed

+97
-25
lines changed

5 files changed

+97
-25
lines changed

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

Lines changed: 35 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29553,41 +29553,64 @@ Learn more about workflows in [this documentation](https://docs.medusajs.com/doc
2955329553

2955429554
# Configure Selling Products
2955529555

29556-
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.
29556+
In this guide, you'll learn how to set up and configure your products based on their shipping and inventory requirements, their type, how you want to sell them, or your commerce ecosystem.
2955729557

29558-
The concepts in this guide are applicable starting from Medusa v2.5.1.
29558+
The concepts in this guide are applicable starting from [Medusa v2.5.1](https://github.com/medusajs/medusa/releases/tag/v2.5.1).
2955929559

2956029560
## Scenario
2956129561

29562-
Businesses can have different selling requirements:
29562+
Businesses can have different selling requirements. They may sell:
2956329563

29564-
1. They may sell physical or digital items.
29565-
2. They may sell items that don't require shipping or inventory management, such as selling digital products, services, or booking appointments.
29566-
3. They may sell items whose inventory is managed by an external system, such as an ERP.
29564+
1. Physical or digital items.
29565+
2. Items that don't require shipping or inventory management, such as selling digital products, services, or booking appointments.
29566+
3. Items whose inventory is managed by an external system, such as an ERP.
2956729567

29568-
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.
29568+
Medusa supports these different selling requirements by allowing you to configure shipping and inventory requirements for products and their variants.
29569+
29570+
This guide explains how these configurations work, then provides examples of setting up different use cases.
2956929571

2957029572
***
2957129573

2957229574
## Configuring Shipping Requirements
2957329575

29574-
The Medusa application defines a link between the `Product` data model and a [ShippingProfile](https://docs.medusajs.com/Users/shahednasser/medusa/www/apps/resources/app/commerce-modules/fulfillment/concepts#shipping-profile/index.html.md) in the [Fulfillment Module](https://docs.medusajs.com/Users/shahednasser/medusa/www/apps/resources/app/commerce-modules/fulfillment/index.html.md), allowing you to associate a product with a shipping profile.
29576+
### Product Shipping Requirement
29577+
29578+
The Medusa application defines a link between the `Product` data model and the [ShippingProfile](https://docs.medusajs.com/Users/shahednasser/medusa/www/apps/resources/app/commerce-modules/fulfillment/concepts#shipping-profile/index.html.md) data model in the [Fulfillment Module](https://docs.medusajs.com/Users/shahednasser/medusa/www/apps/resources/app/commerce-modules/fulfillment/index.html.md), allowing you to associate a product with a shipping profile.
29579+
29580+
![Diagram showcasing the link between a product and its shipping profile](https://res.cloudinary.com/dza7lstvk/image/upload/v1752827367/Medusa%20Resources/product-shipping-requirement_cpfpkz.jpg)
2957529581

2957629582
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.
2957729583

2957829584
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.
2957929585

2958029586
### Overriding Shipping Requirements for Variants
2958129587

29582-
A product variant whose inventory is managed by Medusa (its `manage_inventory` property is enabled) has an [inventory item](https://docs.medusajs.com/Users/shahednasser/medusa/www/apps/resources/app/commerce-modules/inventory/concepts#inventoryitem/index.html.md). 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.
29588+
A product variant whose inventory is managed by Medusa (its `manage_inventory` property is enabled) has an [inventory item](https://docs.medusajs.com/Users/shahednasser/medusa/www/apps/resources/app/commerce-modules/inventory/concepts#inventoryitem/index.html.md).
2958329589

29584-
Learn more about product variant's inventory in [this guide](https://docs.medusajs.com/Users/shahednasser/medusa/www/apps/resources/app/commerce-modules/product/variant-inventory/index.html.md).
29590+
The inventory item has a `requires_shipping` property that can be used to override the variant's 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.
2958529591

29586-
When a product variant is purchased, the Medusa application decides whether the purchased item requires shipping in the following order:
29592+
![Diagram showcasing the link between a product variant and its inventory item, and the inventory item's shipping requirement](https://res.cloudinary.com/dza7lstvk/image/upload/v1752828341/Medusa%20Resources/product-variant-shipping-requirement_ux5y44.jpg)
2958729593

29588-
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.
29594+
Refer to the [Product Variant Inventory](https://docs.medusajs.com/Users/shahednasser/medusa/www/apps/resources/app/commerce-modules/product/variant-inventory/index.html.md) guide to learn more.
29595+
29596+
When a product variant is purchased, the Medusa application decides whether the purchased item requires shipping based on the following conditions (in the following order):
29597+
29598+
1. If the product variant has an inventory item, the Medusa application uses the inventory item's `requires_shipping` property to determine if the item requires shipping.
2958929599
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.
2959029600

29601+
![Diagram showcasing the conditions that determine whether a product variant requires shipping](https://res.cloudinary.com/dza7lstvk/image/upload/v1752828969/Medusa%20Resources/shipping-requirement-check_fdh6lp.jpg)
29602+
29603+
### Shipping Requirements vs Shipping Options
29604+
29605+
The shipping options that you retrieve during checkout depend on the cart's shipping address. So, whether the items in the cart require shipping doesn't affect what shipping options are available at checkout.
29606+
29607+
This is a common misconception, where you expect to not receive any shipping options at checkout if the cart doesn't have any items that require shipping. However, the Medusa application always returns shipping options based on the cart's shipping address.
29608+
29609+
If you want to show the shipping options only if the cart has items that require shipping, you can either:
29610+
29611+
- Create a custom [API route](https://docs.medusajs.com/docs/learn/fundamentals/api-routes/index.html.md) that checks whether the cart has items that require shipping.
29612+
- Perform this check in your storefront's frontend code, such as in the checkout page, and show or hide the shipping options accordingly.
29613+
2959129614
***
2959229615

2959329616
## Use Case Examples

www/apps/resources/app/commerce-modules/product/selling-products/page.mdx

Lines changed: 37 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ tags:
55
- fulfillment
66
products:
77
- fulfillment
8+
- product
9+
- inventory
810
---
911

1012
import { Table } from "docs-ui"
@@ -15,49 +17,72 @@ export const metadata = {
1517

1618
# {metadata.title}
1719

18-
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.
20+
In this guide, you'll learn how to set up and configure your products based on their shipping and inventory requirements, their type, how you want to sell them, or your commerce ecosystem.
1921

2022
<Note>
2123

22-
The concepts in this guide are applicable starting from Medusa v2.5.1.
24+
The concepts in this guide are applicable starting from [Medusa v2.5.1](https://github.com/medusajs/medusa/releases/tag/v2.5.1).
2325

2426
</Note>
2527

2628
## Scenario
2729

28-
Businesses can have different selling requirements:
30+
Businesses can have different selling requirements. They may sell:
2931

30-
1. They may sell physical or digital items.
31-
2. They may sell items that don't require shipping or inventory management, such as selling digital products, services, or booking appointments.
32-
3. They may sell items whose inventory is managed by an external system, such as an ERP.
32+
1. Physical or digital items.
33+
2. Items that don't require shipping or inventory management, such as selling digital products, services, or booking appointments.
34+
3. Items whose inventory is managed by an external system, such as an ERP.
3335

34-
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.
36+
Medusa supports these different selling requirements by allowing you to configure shipping and inventory requirements for products and their variants.
37+
38+
This guide explains how these configurations work, then provides examples of setting up different use cases.
3539

3640
---
3741

3842
## Configuring Shipping Requirements
3943

40-
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.
44+
### Product Shipping Requirement
45+
46+
The Medusa application defines a link between the `Product` data model and the [ShippingProfile](../../fulfillment/concepts/page.mdx#shipping-profile) data model in the [Fulfillment Module](../../fulfillment/page.mdx), allowing you to associate a product with a shipping profile.
47+
48+
![Diagram showcasing the link between a product and its shipping profile](https://res.cloudinary.com/dza7lstvk/image/upload/v1752827367/Medusa%20Resources/product-shipping-requirement_cpfpkz.jpg)
4149

4250
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.
4351

4452
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.
4553

4654
### Overriding Shipping Requirements for Variants
4755

48-
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.
56+
A product variant whose inventory is managed by Medusa (its `manage_inventory` property is enabled) has an [inventory item](../../inventory/concepts/page.mdx#inventoryitem).
57+
58+
The inventory item has a `requires_shipping` property that can be used to override the variant's 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.
59+
60+
![Diagram showcasing the link between a product variant and its inventory item, and the inventory item's shipping requirement](https://res.cloudinary.com/dza7lstvk/image/upload/v1752828341/Medusa%20Resources/product-variant-shipping-requirement_ux5y44.jpg)
4961

5062
<Note title="Tip">
5163

52-
Learn more about product variant's inventory in [this guide](../variant-inventory/page.mdx).
64+
Refer to the [Product Variant Inventory](../variant-inventory/page.mdx) guide to learn more.
5365

5466
</Note>
5567

56-
When a product variant is purchased, the Medusa application decides whether the purchased item requires shipping in the following order:
68+
When a product variant is purchased, the Medusa application decides whether the purchased item requires shipping based on the following conditions (in the following order):
5769

58-
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.
70+
1. If the product variant has an inventory item, the Medusa application uses the inventory item's `requires_shipping` property to determine if the item requires shipping.
5971
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.
6072

73+
![Diagram showcasing the conditions that determine whether a product variant requires shipping](https://res.cloudinary.com/dza7lstvk/image/upload/v1752828969/Medusa%20Resources/shipping-requirement-check_fdh6lp.jpg)
74+
75+
### Shipping Requirements vs Shipping Options
76+
77+
The shipping options that you retrieve during checkout depend on the cart's shipping address. So, whether the items in the cart require shipping doesn't affect what shipping options are available at checkout.
78+
79+
This is a common misconception, where you expect to not receive any shipping options at checkout if the cart doesn't have any items that require shipping. However, the Medusa application always returns shipping options based on the cart's shipping address.
80+
81+
If you want to show the shipping options only if the cart has items that require shipping, you can either:
82+
83+
- Create a custom [API route](!docs!/learn/fundamentals/api-routes) that checks whether the cart has items that require shipping.
84+
- Perform this check in your storefront's frontend code, such as in the checkout page, and show or hide the shipping options accordingly.
85+
6186
---
6287

6388
## Use Case Examples

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5904,7 +5904,7 @@ export const generatedEditDates = {
59045904
"references/utils/enums/utils.PaymentCollectionStatus/page.mdx": "2025-04-11T09:04:53.005Z",
59055905
"app/recipes/erp/page.mdx": "2025-05-20T07:51:40.720Z",
59065906
"app/recipes/erp/odoo/page.mdx": "2025-05-20T07:51:40.720Z",
5907-
"app/commerce-modules/product/selling-products/page.mdx": "2025-02-13T13:27:09.270Z",
5907+
"app/commerce-modules/product/selling-products/page.mdx": "2025-07-18T08:56:24.231Z",
59085908
"references/js_sdk/admin/Admin/properties/js_sdk.admin.Admin.draftOrder/page.mdx": "2025-06-25T10:11:46.807Z",
59095909
"references/js_sdk/admin/Client/methods/js_sdk.admin.Client.throwError_/page.mdx": "2025-02-24T10:48:47.018Z",
59105910
"references/js_sdk/admin/CustomStorage/methods/js_sdk.admin.CustomStorage.getItem/page.mdx": "2025-02-24T10:48:47.069Z",

www/apps/resources/generated/generated-commerce-modules-sidebar.mjs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6102,6 +6102,14 @@ const generatedgeneratedCommerceModulesSidebarSidebar = {
61026102
"path": "https://docs.medusajs.com/resources/how-to-tutorials/tutorials/loyalty-points",
61036103
"children": []
61046104
},
6105+
{
6106+
"loaded": true,
6107+
"isPathHref": true,
6108+
"type": "ref",
6109+
"title": "Implement Pre-Orders",
6110+
"path": "https://docs.medusajs.com/resources/how-to-tutorials/tutorials/preorder",
6111+
"children": []
6112+
},
61056113
{
61066114
"loaded": true,
61076115
"isPathHref": true,
@@ -11477,6 +11485,14 @@ const generatedgeneratedCommerceModulesSidebarSidebar = {
1147711485
"path": "https://docs.medusajs.com/resources/examples/guides/custom-item-price",
1147811486
"children": []
1147911487
},
11488+
{
11489+
"loaded": true,
11490+
"isPathHref": true,
11491+
"type": "ref",
11492+
"title": "Implement Pre-Order Products",
11493+
"path": "https://docs.medusajs.com/resources/how-to-tutorials/tutorials/preorder",
11494+
"children": []
11495+
},
1148011496
{
1148111497
"loaded": true,
1148211498
"isPathHref": true,

www/apps/resources/generated/generated-tools-sidebar.mjs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -819,6 +819,14 @@ const generatedgeneratedToolsSidebarSidebar = {
819819
"path": "https://docs.medusajs.com/resources/how-to-tutorials/tutorials/first-purchase-discounts",
820820
"children": []
821821
},
822+
{
823+
"loaded": true,
824+
"isPathHref": true,
825+
"type": "ref",
826+
"title": "Implement Pre-Orders",
827+
"path": "https://docs.medusajs.com/resources/how-to-tutorials/tutorials/preorder",
828+
"children": []
829+
},
822830
{
823831
"loaded": true,
824832
"isPathHref": true,

0 commit comments

Comments
 (0)