Pricing Concepts

In this guide, you’ll learn about the main concepts in the Pricing Module.

Price Data Model#

The Price data model represents a specific price for a resource. For example, the price of a product variant in the USD currency.

The Price data model has an amount property that represents the monetary value of the price. It's stored as an integer in base or major units. For example, $20.00 is stored as 20, and $20.5 is stored as 20.5.

The Price data model belongs to other data models like PriceSet and PriceList to provide a variety of pricing features, as explained below.


Price Set#

A PriceSet represents a collection of prices that are linked to a resource. For example, a product variant can have a price set that includes prices in multiple currencies, such as USD and EUR.

Each of these prices is represented by the Price data model.

A diagram showcasing the relation between the price set and price


Price List#

A PriceList is a group of prices that are only enabled when their conditions and rules are satisfied. For example, you can apply special prices to customers in the VIP group.

When the conditions are met, the prices in the price list can override the default prices in a price set. Learn more in the Price Calculation guide.

A price list has optional start_date and end_date properties that indicate the date range in which a price list can be applied.

Its associated prices are represented by the Price data model.


Multi-Currency Support for Prices#

The Price data model has a currency_code property that represents the currency of the price. For example, usd for US Dollars and eur for Euros.

This adds support for multi-currency pricing, allowing you to associate a resource with a price set that contains prices in multiple currencies.

For example, Medusa links a product variant from the Product Module to a price set that contains prices in multiple currencies. A variant's price set would be similar to the following:

Example Price Set with Multiple Currencies
1{2  "id": "pset_123",3  "prices": [4    {5      "id": "price_123",6      "amount": 20,7      "currency_code": "usd"8    },9    {10      "id": "price_124",11      "amount": 18,12      "currency_code": "eur"13    }14  ]15}

When the customer views and purchases a product, Medusa selects the price based on the customer's currency.


Multi-Region Support for Prices#

The Price data model has a relation to the PriceRule data model that allows you to define prices that are applied based on specific conditions, such as the customer's region.

For example, Medusa allows you to specify prices for a product variant that are applied only when the customer is in a specific region. The price would be similar to the following:

Example Price with Region Rule
1{2  "id": "price_123",3  "amount": 25,4  "currency_code": "usd",5  "price_rules": [6    {7      "id": "pricerule_123",8      "attribute": "region_id",9      "value": "reg_123",10      "operator": "eq"11    }12  ]13}

When the customer views and purchases a product, Medusa selects the price based on the customer's region.

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