Configure Selling Products
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.
Scenario#
Businesses can have different selling requirements. They may sell:
- Physical or digital items.
- Items that don't require shipping or inventory management, such as selling digital products, services, or booking appointments.
- Items whose inventory is managed by an external system, such as an ERP.
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.
Configuring Shipping Requirements#
Product Shipping Requirement#
The Medusa application defines a link between the Product
data model and the ShippingProfile data model in the Fulfillment Module, allowing you to associate a product with a shipping profile.
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.
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.
Overriding Shipping Requirements for Variants#
A product variant whose inventory is managed by Medusa (its manage_inventory
property is enabled) has an inventory item.
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.
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):
- 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. - 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.
Shipping Requirements vs Shipping Options#
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.
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.
If you want to show the shipping options only if the cart has items that require shipping, you can either:
- Create a custom API route that checks whether the cart has items that require shipping.
- Perform this check in your storefront's frontend code, such as in the checkout page, and show or hide the shipping options accordingly.
Use Case Examples#
By combining configurations of shipment requirements and inventory management, you can set up your products to support your use case:
Use Case | Configurations | Example |
---|---|---|
Item that's shipped on purchase, and its variant inventory is managed by the Medusa application. |
| Any stock-kept item (clothing, for example), whose inventory is managed in the Medusa application. |
Item that's shipped on purchase, but its variant inventory is managed externally (not by Medusa) or it has infinite stock. |
| Any stock-kept item (clothing, for example), whose inventory is managed in an ERP or has infinite stock. |
Item that's not shipped on purchase, but its variant inventory is managed by Medusa. |
| Digital products, such as licenses, that don't require shipping but have a limited quantity. |
Item that doesn't require shipping and its variant inventory isn't managed by Medusa. |
|
|