Pricing
Miridia keeps two pricing concepts apart. The price history records what a product costs and is worth over time. A price list holds a rule or a set of prices for a specific context. With this separation, one product can have one price on the web store, a different price for a trade customer, and a third price at one branch. You do not copy the catalogue.
The price history
The price history is the default price of a product. Each change adds a new entry. Miridia never changes or deletes an entry. Read Products for the fields of an entry.
If no price list applies to an order line, Miridia uses the most recent selling price in the price history.
Price lists
A price list is a named rule that sets a different price for a context. It has:
- a title and a description
- a currency
- a status:
ActiveorInactive - an effective window, with a start date and an optional end date
- a product scope:
Selected("Selected products") orAll("All products") - a pricing mode:
Relative("Relative pricing") orFixed("Fixed pricing")
Product scope
The product scope decides which products the list prices.
- Selected products: the list prices only the products that you add to it. This is the default. If you have 500 products and 30 have a regional price, the list has 30 products, not 500. A list with no products prices nothing, and the portal warns you about it.
- All products: the list prices every product in the business, including a product that you add later. You do not add products to the list. You can exclude some products from it.
Pricing modes
- Relative pricing is the default. The list holds one rule that applies to the default price. The adjustment type is
PercentageorAmount. You can also set a rounding step, for example 0.50. When the default price changes, the list price changes with it. A product on a relative list has no price of its own. - Fixed pricing: each product on the list has its own amount. A fixed price does not follow the default price, so check the list when you change the default price.
An all-products list is always relative. A fixed list needs an amount for each product, so it cannot apply to products that nobody chose.
The mode and the product scope of a list cannot change after you create the list. To change either one, create a new list. The same rule applies in the API: a PUT request must send the real pricingMode and productScope of the list, or it returns 409.
A list can price a product only if the product has a default price in the currency of the list. Miridia does not convert between currencies.
To stop a list for a period, set its status to Inactive. You do not have to delete it.
Exclusions
An all-products list can exclude products. An excluded product is not priced by that list. It continues to the next list in the order below, or to the default price. An exclusion has no price. Exclusions apply to all-products lists only.
A different rule for some products
A list does not hold exceptions. When some products need a different rule, make a second list for them. For example, wholesale buyers get 10% off everything and 15% off popsicles. Make an all-products list at 10% off, and a selected-products list at 15% off with the popsicles. Assign both lists to the wholesale customer group. The popsicles list wins for the popsicles, because it names the product.
Add and exclude products in bulk
- Add products to a selected-products list one at a time, or send up to 1,000 at once. A product that is already on the list is skipped.
- Exclude products from an all-products list in the same way, up to 1,000 at once.
- The product table of an all-products list shows the default price, the list price, and the excluded products. It also names a selected-products list that prices the same product for the same buyers.
Scopes and assignments
You assign a price list to one or more scopes. An assignment is separate from the list. Thus one list can serve many scopes.
| Scope type | Example |
|---|---|
SalesChannel | The web store has a different price from the wholesale channel. |
Location | A coastal branch has higher freight costs. |
DeliveryZone | A region has a different price. |
CustomerGroup | Trade customers get a trade price. |
Customer | One customer has a contract price. |
Which price wins
More than one list can apply to an order line. Miridia resolves the price in this order:
- A selected-products list that holds the product and matches the buyer.
- An all-products list that matches the buyer and does not exclude the product.
- The default price, from the price history.
A list in step 1 always beats a list in step 2. For example, a customer-scoped all-products list loses to a group-scoped selected-products list for the products on the group list. To give that customer a better price on those products, put them on a selected-products list for the customer.
Inside one step, Miridia uses the more specific buyer first. The order is:
- A list assigned to the customer.
- A list assigned to the customer group.
- A list assigned to a sales channel, a location, or a delivery zone.
- The lower priority number of the assignment. The merchant sets this number.
- The older list.
Miridia skips a list when it has a different currency from the price that it resolves, when the product has no default price in the currency of the list, or when the rule gives a price below zero. The resolution then continues with the next list.
If no source has a price, the resolve endpoint returns 404.
A worked example
A business sells a notebook with a default selling price of R89.00. It has two selected-products lists that hold the notebook, and one all-products list.
| Price list | Scope | Assigned to | Priority | Notebook price |
|---|---|---|---|---|
| Gauteng | Selected products | Delivery zone "Gauteng" | 20 | R95.00 |
| Trade | Selected products | Customer group "Trade" | 10 | R80.00 |
| Staff | All products, 20% off | Customer group "Staff" | 10 | R71.20 |
- A retail customer in Cape Town pays R89.00. No list applies, thus the price history gives the price.
- A retail customer in Gauteng pays R95.00. Only the Gauteng list applies.
- A trade customer in Gauteng pays R80.00. Both selected-products lists apply. The Trade list is assigned to a customer group, and the Gauteng list to a delivery zone, so the Trade list is more specific.
- A staff member pays R71.20, because only the Staff list applies. If the staff member also belongs to the Trade group, the Trade list wins, because a selected-products list beats an all-products list.
To test a result, call the resolve endpoint with the product and the context. The endpoint also accepts salesChannelId, locationId, customerId, priceType, currencyCode, and asOf for a price on a past date. The response names the winning list in priceListId, priceListTitle, pricingMode, and productScope. Those fields are empty when the default price wins.
GET /api/v1/pricelists/resolve?productId={productId}&deliveryZoneId={zoneId}&customerGroupId={groupId}
Prices from a sales channel
A connected sales channel can report its own price. Miridia records the observed price. It never writes the observed price into your price history.
If you enable price sync on that connection, an observed change updates the price list that is assigned to that channel. Your own record of the product price stays under your control.
Tax and discounts
Each price history entry and each fixed price list item has tax data: a tax type (for example Vat or Sales), a tax rate, and a flag that tells if the price includes tax. Each can also have a discount of type Percentage or FixedValue.