Pricing
Variant prices, price lists, and customer group pricing.
Every variant has a set of prices. The backend picks one for each request from the pricing context: currency, region, the customer's groups, and, in a cart, the quantity. You never send a price; you read the one it picks.
Base prices
- A variant has a price per currency, and optionally per region.
- A price can have
min_quantityandmax_quantity. These are quantity tiers: they apply in a cart, where the line quantity is known. Product routes send no quantity, so they only match prices withmin_quantityof 1 or less, or none. Show tiers on product pages yourself. - If a price for the region exists it wins over the plain currency price.
Price lists
A price list is a set of variant prices that apply only when its conditions match.
| Field | Meaning |
|---|---|
type | sale or override. See below. |
status | active or draft. Draft lists never apply. |
starts_at, ends_at | Optional window. Outside it the list doesn't apply. |
rules | Conditions, for example { "customer.groups.id": ["cusgrp_..."] }. A list with no rules applies to everyone. |
| Type | Calculated price | Original price |
|---|---|---|
sale | The list price, or the base price if that is lower | The matching override list price if one applies, otherwise the base price. Use it for a strikethrough. |
override | The list price, even if higher | The same as the calculated price |
When several lists match, the price with the most matching rules wins, and then the lowest amount.
B2B: company prices
Each Waylo Commerce company is linked to its own customer group. To give a company its own prices, create an override price list with a customer.groups.id rule for the company's group. Use override for contract prices, because buyers shouldn't see them as a discount. Add min_quantity to the list's prices for volume tiers.
Store routes add the signed-in customer's groups to the pricing context, so the buyer just signs in. Guests get base prices and rule-free lists.
Reading prices
Ask for *variants.calculated_price in fields, with region_id or a cart_id. The response has:
| Field | Use |
|---|---|
calculated_amount | What the buyer pays per unit. |
original_amount | The reference price. Show a strikethrough when it is higher. |
calculated_amount_with_tax | The price with tax, when country_code was sent. |
calculated_price.price_list_type | sale, override, or null. |
Cart lines are repriced whenever the cart changes, so a cart always reflects the current lists.
- Price lists and add or update list prices (admin)
- Customer groups (admin)