Waylo Commerce
Commerce

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_quantity and max_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 with min_quantity of 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.

FieldMeaning
typesale or override. See below.
statusactive or draft. Draft lists never apply.
starts_at, ends_atOptional window. Outside it the list doesn't apply.
rulesConditions, for example { "customer.groups.id": ["cusgrp_..."] }. A list with no rules applies to everyone.
TypeCalculated priceOriginal price
saleThe list price, or the base price if that is lowerThe matching override list price if one applies, otherwise the base price. Use it for a strikethrough.
overrideThe list price, even if higherThe 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:

FieldUse
calculated_amountWhat the buyer pays per unit.
original_amountThe reference price. Show a strikethrough when it is higher.
calculated_amount_with_taxThe price with tax, when country_code was sent.
calculated_price.price_list_typesale, override, or null.

Cart lines are repriced whenever the cart changes, so a cart always reflects the current lists.

On this page