New arrivals: 14 Scout case studies

Medusa Explained · Pricing · 3/4

Medusa’s Pricing module: organising customer pricing

The Pricing module does more than store the public price of each variant: it can also hold pricing reserved for certain customers. This article shows how a price list applies negotiated amounts to a reseller group without changing the base prices.

4 November 2026
In this article

Negotiated pricing across several variants

A brand sells its trainer to the public for 90 EUR in every size. It also works with resellers, who have been offered 75 EUR for this trainer and a few other models. These resellers are grouped in Medusa in a customer group called “Revendeurs”.

A PriceRule, the rule attached to a price, could set the “Revendeurs group” condition on each 75 EUR price. But it would be repeated on every variant, and changing the scope of the pricing would require updating all these prices individually. What is needed here is a pricing scheme : a set of amounts activated together for a category of customers.

A price list is not a price set

The two names sound similar, but they organise prices along different lines.

  • A PriceSet belongs to a resource: it is the set of prices for one variant, across all currencies and conditions.
  • A PriceList spans several sets: it brings together prices from several variants around the same commercial intent.

Here is the reseller price list, reduced to its relevant fields:

{
  "id": "plist_revendeurs",
  "title": "Tarifs revendeurs",
  "type": "override",
  "status": "active",
  "rules_count": 1
}

And one of its prices:

{
  "id": "price_rev_42",
  "amount": 75,
  "currency_code": "eur",
  "price_set_id": "pset_basket_42",
  "price_list_id": "plist_revendeurs"
}

Fields omitted: description, dates, quantity bounds, technical timestamps.

This price has two associations. Through price_set_id, it belongs to the variant’s set, alongside the public 90 EUR price. Through price_list_id, it belongs to the reseller pricing scheme. The price is not copied: it is a single row viewed from two sides.

VariantPriceSetPublic pricePrice in plist_revendeurs
Basket 41pset_basket_4190 EUR75 EUR
Basket 42pset_basket_4290 EUR75 EUR
Basket 43pset_basket_4390 EUR75 EUR

Public prices do not change.

Two associations for the same price

PriceSetThe prices of a single variant
Price75 EURprice_set_id : its setprice_list_id : its list
PriceListReseller pricing across several variants
A set groups a resource’s prices. A list brings together the prices of a commercial policy across several sets.

The condition for accessing the list

We still need to specify who this pricing is for. That is the role of the PriceListRule, a condition on the entire list:

{
  "id": "prule_rev",
  "price_list_id": "plist_revendeurs",
  "attribute": "customer.groups.id",
  "value": ["cusgrp_revendeurs"]
}

Where a PriceRule applies to a single price, the PriceListRule makes every price in the list available or unavailable at once. Its value contains the list of authorised group IDs. It is enough for one of the customer’s groups to appear in this value for the condition to be satisfied. If the list has several conditions, all must be satisfied, just as with price rules.

Two settings complete the list. Its status is active or draft : a draft list is never applied. It can also have a start date, starts_at , and an end date, ends_at, outside which it is ignored. Our permanent reseller pricing does not need them.

Creating and changing the pricing

The service Pricing offers a method for each action. Creating the list can include its condition and prices from the outset:

await pricingModuleService.createPriceLists([
  {
    title: "Tarifs revendeurs",
    description: "Tarifs négociés pour les revendeurs",
    type: "override",
    status: "active",
    rules: { "customer.groups.id": ["cusgrp_revendeurs"] },
    prices: [
      { amount: 75, currency_code: "eur", price_set_id: "pset_basket_41" },
      { amount: 75, currency_code: "eur", price_set_id: "pset_basket_42" },
    ],
  },
])

As with prices, rules is an input parameter; the module derives the PriceListRule objects from it and keeps rules_count up to date. Each price specifies its price_set_id : this is how it joins its variant’s set.

Then:

  • addPriceListPrices adds prices to an existing list, such as the forgotten size 43;
  • setPriceListRules changes the condition. It replaces the values of the supplied attributes and leaves the others in place; removePriceListRules removes a condition.

Who belongs to the group

The module compares groups; it does not know who the customer is. The Store routes establish that: when the customer is authenticated, the backend loads their account and groups, then places them in the calculation context. The browser does not send “I am a reseller” itself; otherwise anyone could claim it.

In the context, the group arrives in a nested form that the module flattens into customer.groups.id :

{
  "currency_code": "eur",
  "customer": { "groups": { "id": ["cusgrp_revendeurs"] } }
}

Calculating with pricing of type override

For a customer in the Revendeurs group, two prices for the size 42 trainer are candidates: the public 90 EUR price and the 75 EUR list price. The list is active and its condition is satisfied. The response from calculatePrices, abridged:

{
  "calculated_amount": 75,
  "original_amount": 75,
  "is_calculated_price_price_list": true
}

Two amounts appear here. calculated_amount is the unit amount selected for this customer. original_amount is the reference price, against which this amount can be compared; displaying it is up to the store. With an overridelist, both are 75: the negotiated price is not a displayed discount; it becomes this customer’s normal price. The store has nothing to cross out.

For a customer outside the group, the list condition fails: its price is excluded, and the calculation returns 90 and 90.

A override can also be higher than the public price. The list replaces the amount; it does not look for the cheapest one.

Another use: the list type sale

The second type meets a different need. Imagine, independently of resellers, that the brand is clearing an old colourway of its trainer, sold for 90 EUR. It creates a list of type sale, with no group condition, and a price of 70 EUR for this variant.

For any customer, the calculation then returns:

{
  "calculated_amount": 70,
  "original_amount": 90
}

This time, the reference price remains 90. The store can show 90 EUR crossed out alongside 70 EUR: this is the purpose of a salelist, which highlights the difference from the usual price. Two clarifications prevent misunderstandings. The 70 EUR is an entered amount, not a calculated discount: the module applies no percentage. And a sale price is selected only if it is less than or equal to the reference price; otherwise, the reference applies.

When several lists apply to the same customer, the module ranks them and then takes their type into account. This combined case is described in the price calculation documentation ; the two examples above cover everyday use.

In the application

A Medusa application generally does not create lists by calling the service directly. It uses createPriceListsWorkflow, which the Admin creation route calls. Input is supplied by variant: the workflow checks that each variant has its own price set, then calls the module.

In the Admin, the Price Lists menu opens this same flow. The creation form has three steps: Details, where you choose the Sale or Override type, title, status, optional dates and relevant customer groups; Products, where you select products; and Prices, where you enter amounts.

Details step of the Create Price List form in the Medusa Admin: Sale or Override type selection, “Tarifs revendeurs” title, Active status, optional dates and customer group selection

The screenshot shows this first step filled in on a demo store, without saving: it shows the title, status and, at the bottom, the control restricting the list to customer groups. Since no list exists in this store, the screen shows no 75 EUR price.

What lists do not do

A list sets amounts; percentage discounts and promotional codes belong to the Promotionmodule. A seasonal campaign can use either, since a list can also be bounded by dates.

What we can do now

A PriceList brings together prices from several variants, each still linked to its variant’s PriceSet . A PriceListRule restricts access, for example to a customer group identified by the backend. With override, the negotiated price becomes the customer’s normal price; with sale, a lower amount can be displayed against the reference price. An entire customer pricing scheme can thus be organised, activated or suspended through its status or dates, without changing the variants’ public prices.

Sources

Something to dig into? Add this article to your office hours discussion.

See my discussion