Skip to main content

Overview

The Pricing Module manages product pricing with support for multiple currencies, customer groups, regions, and dynamic pricing rules. It provides flexible price calculation based on context. Key Features:
  • Multi-currency pricing
  • Price lists with rules
  • Context-based price calculation
  • Customer group pricing
  • Region-specific prices
  • Time-based pricing (sales, schedules)
  • Bulk pricing rules
  • Price preferences

When to Use

Use the Pricing Module when you need to:
  • Set prices in multiple currencies
  • Create customer group discounts
  • Implement region-specific pricing
  • Run time-limited sales
  • Calculate context-aware prices
  • Support B2B and wholesale pricing
  • Configure minimum/maximum quantities
  • Handle complex pricing rules

Data Models

PriceSet

Groups prices for a product variant or other entity.
string
required
Unique price set identifier
Price[]
Individual prices in this set

Price

Represents a specific price with optional rules.
string
required
Unique price identifier
string
required
ID of the parent price set
BigNumber
required
Price amount
string
required
Three-letter ISO currency code
number
Minimum quantity for this price to apply
number
Maximum quantity for this price to apply
PriceRule[]
Pricing rules (region, customer group, etc.)

PriceRule

Defines conditions for price applicability.
string
required
Unique rule identifier
string
required
ID of the price
string
required
Rule attribute (e.g., “region_id”, “customer_group_id”)
string
required
Rule value
number
Rule priority for conflict resolution

PriceList

Groups prices for sales, promotions, or special pricing.
string
required
Unique price list identifier
string
required
Price list title
string
Price list description
PriceListType
required
List type: sale, override
PriceListStatus
required
Status: active, draft
DateTime
When price list becomes active
DateTime
When price list expires
PriceListRule[]
Rules defining when list applies

PriceListRule

Defines conditions for price list applicability.
string
required
Unique rule identifier
string
required
ID of the price list
string
required
Rule attribute
string[]
required
Allowed values for the attribute

PricePreference

Defines default pricing behavior.
string
required
Unique preference identifier
string
Preference attribute
string
Preference value
boolean
Whether prices include tax

Service Interface

The Pricing Module service is available at @medusajs/medusa/pricing.

Create Price Set

Create a price set for a product variant.
CreatePriceSetDTO | CreatePriceSetDTO[]
required
Price set data
CreatePricesDTO[]
Prices to create in this set
PriceSetDTO | PriceSetDTO[]
The created price set(s)

Add Prices

Add prices to an existing price set.
AddPricesDTO
required
Price data
string
required
ID of the price set
CreatePricesDTO[]
required
Prices to add

Calculate Prices

Calculate prices based on context.
PricingFilters
required
Filters to select price sets
string[]
Price set IDs to calculate
PricingContext
required
Pricing context
string
Currency code for calculation
string
Region ID for region-specific pricing
string
Customer group ID for group pricing
number
Quantity for quantity-based pricing
CalculatedPriceSet[]
Array of calculated prices with calculated_amount field

Create Price List

Create a price list for sales or special pricing.
CreatePriceListDTO | CreatePriceListDTO[]
required
Price list data
string
required
Price list title
string
Price list description
PriceListType
required
List type: sale, override
PriceListStatus
Status: active, draft
Date
When list becomes active
Date
When list expires
CreatePriceListRuleDTO[]
Applicability rules

Set Price List Prices

Add prices to a price list.

Remove Price List Prices

Remove prices from a price list.

Integration Examples

With Product Module

Create prices for product variants.

With Cart Module

Calculate prices for cart items.

With Customer Module

Customer group pricing.

With Region Module

Region-based pricing.

Pricing Strategies

Multi-Currency

Tiered Pricing (Quantity Discounts)

Customer Group Pricing (B2B)

Flash Sales

Best Practices

  1. Rule Priority: When multiple prices match the context, the module selects based on rule specificity. More specific rules (with more conditions) take precedence.
  2. Currency Codes: Always use lowercase three-letter ISO currency codes (“usd”, not “USD”).
  3. Quantity Ranges: Use min_quantity and max_quantity for tiered pricing. Ensure ranges don’t overlap.
  4. Price List Types:
    • sale: Reduces prices (used for promotions)
    • override: Replaces prices entirely
  5. Context Calculation: Include all relevant context when calculating prices (currency, region, customer group, quantity) for accurate results.
  6. Tax Inclusion: Use PricePreference.is_tax_inclusive to indicate if prices include tax. This affects tax calculations in other modules.