Links between Pricing Module and Other Modules

This document showcases the module links defined between the Pricing Module and other Commerce Modules.

Summary#

The Pricing Module has the following links to other modules:

First Data Model

Second Data Model

Type

Description

ShippingOption in Fulfillment Module

PriceSet

Stored - one-to-one

Learn more

ProductVariant in Product Module

PriceSet

Stored - one-to-one

Learn more


Fulfillment Module#

The Fulfillment Module provides fulfillment-related functionalities, including shipping options that the customer chooses from when they place their order. However, it doesn't provide pricing-related functionalities for these options.

Medusa defines a link between the PriceSet and ShippingOption data models. A shipping option's price is stored as a price set.

A diagram showcasing an example of how data models from the Pricing and Fulfillment modules are linked

Retrieve with Query#

To retrieve the shipping option of a price set with Query, pass shipping_option.* in fields:

To manage the price set of a shipping option, use Link:


Product Module#

The Product Module doesn't store or manage the prices of product variants.

Medusa defines a link between the ProductVariant and the PriceSet. A product variant’s prices are stored as prices belonging to a price set.

A diagram showcasing an example of how data models from the Pricing and Product Module are linked. The PriceSet is linked to the ProductVariant of the Product Module.

So, when you want to add prices for a product variant, you create a price set and add the prices to it.

You can then benefit from adding rules to prices or using the calculatePrices method to retrieve the price of a product variant within a specified context.

Retrieve with Query#

To retrieve the variant of a price set with Query, pass variant.* in fields:

To manage the price set of a variant, use Link:

Was this page helpful?
Ask Anything
FAQ
What is Medusa?
How can I create a module?
How can I create a data model?
How do I create a workflow?
How can I extend a data model in the Product Module?
Recipes
How do I build a marketplace with Medusa?
How do I build digital products with Medusa?
How do I build subscription-based purchases with Medusa?
What other recipes are available in the Medusa documentation?
Chat is cleared on refresh
Line break