docs
/
AI skills

Price lists, volume pricing and customer-group prices

Give wholesale customers, a customer group or one named account their own prices, or lower the price as the quantity goes up. Product price tiers, price lists and group benefits, which one wins, how they combine with variant prices, option prices and discounts, and how to check what a signed-in customer will really pay.

There are three ways to give someone a different price. All three apply only to a signed-in customer, and all are worked out on the server for every line, on product pages, in the cart and again at checkout. What the browser sends as a price is never used.

WayWhere it livesBest for
Product price tiersOn the product, data.tiersOne product: 10+ at $8, or a wholesale group's price for it
Price listssf_price_list, Storefront › PricingMany products at once: wholesale 25% off everything, a contract price for one account, a seasonal price for a category
Group benefitbenefit, Customers & Benefits › BenefitsA standing member perk: VIPs get 5% off everything, on top of the above

Discount codes and automatic discounts are separate: they come after this page's prices. See Discount codes and automatic discounts.

Price lists are staff only. Listing, reading, creating, changing and deleting them (storefront/pricing/price-lists…), and the two previews (preview/<sku>, preview-as-customer), need someone signed in to the business: Studio, or you acting for the signed-in person. The site and its shoppers get 403 This needs someone signed in to the business (tested through a site's /api). A shopper sees only their own price (pricing.controller.ts).

How a price is chosen

For each line, in this order:

  1. The starting price. The product's price. A variant's own price is used only when the line's options exactly match that variant (Product with variants). A gift card is always its face value, and nothing below changes it.
  2. Product tiers. If any tier fits, it sets the price, and price lists are skipped.
  3. Price lists, only when no tier fits. The live lists that reach this customer and this product are tried by priority, highest first. The first one that gives a price wins, even if a lower list would be cheaper.
  4. Group benefit. The customer's best benefit is taken off the price from step 2 or 3.
  5. Automatic discounts. On a product page they are folded into the unit price shown. In the cart they are taken once, off the whole cart, as discount lines.
  6. Option prices. +10, -5 or 10% on a chosen attribute option (Configurable products) is added last, and nothing above discounts it.

Example, tested: a $100 tee with a Wholesale group tier at $70 and a +10 XL option. A Wholesale member pays $80 for an XL, and any other shopper pays $110.

Who a customer is: the server reads the signed-in customer's groups (or the shared account's groups, when they buy for one), their id and their email. Groups sent in a request body are ignored. A customer added to a group gets its prices on their next request, without signing in again (tested). A new sign-up is in the group Customer.

Ask first

  • Who gets the price? A customer group (its exact name), some named customers (their emails), or everyone signed in.
  • Which products? One, some, a category, a brand, or everything.
  • The price. A fixed price per product, a percentage or amount off, or a price per quantity (1–9 $10, 10+ $8).
  • When? Always, or from a date to a date.
  • Variants or option prices? Say now if the products have variants with their own prices: see What it can't do yet.

Steps

1. Customers & Benefits: the group

Find the group by its exact name (repo_find on customer_group by data.name), or make it and put the customers in it: Add customers to a group. Prices find a group by its name, as it is in each customer's groups.

Stop: don't rename an existing group. Every tier and price list that names it stops matching.

Hands on: the group's name, spelled exactly. Check: open one member (/customers-benefits?openId=<sk>). Their groups include it.

2. Storefront › Products: price tiers on one product

Set data.tiers on the product (repo_update with the dot path data.tiers, never a whole data), or Details › Pricing › Price Tiers in the product editor (/product?openId=<sk>).

Tier fieldMeaning
minQuantity, maxQuantityThe quantity range. Leave maxQuantity empty for "and up"
priceThe price per unit in this range
discountPercentInstead of price: a percentage off the starting price
groupsOnly for customers in one of these groups. Empty: everyone
businessLocationsOnly for shoppers the site serves from one of these regions
[
  { "minQuantity": 10, "price": 8 },
  { "minQuantity": 1, "price": 7, "groups": ["Wholesale"] }
]

Which tiers count: the most specific ones that reach this customer. Tiers for one of their groups and their region come first, then their group's tiers, then region tiers, then tiers for everyone. Only that one set is used. In the example, a Wholesale member pays $7 even for 12, because the 10+ tier is for everyone, and the Wholesale set wins. Within the set, the highest minQuantity that fits wins. When a group's set has nothing for the quantity (say its only tier starts at 5 and they buy 2), price lists are tried next, not the tiers for everyone.

Online, the quantity is the quantity on the line, not the product's total in the cart.

The editor's Add tier button starts every tier at quantity 1 and the product's price, for everyone. Saved as it is, that tier fits every purchase: variant prices stop showing (every variant costs the product's price) and no price list ever applies to the product. Change the new tier or remove it before saving. A product with no tiers is fine.

Hands on: the product's sku and its tiers. Check: call_appengine GET storefront/pricing/preview/<sku>?quantities=1,5,10,25 lists the price at each quantity for a shopper in no group.

3. Storefront › Pricing: a price list

Create the sf_price_list (repo_create, or Storefront › Pricing › Price Lists, /pricing?tab=price-lists; open one with /pricing?openId=<sk>).

FieldValue
nameUnique; shown to staff as the rule that priced a line
statusactive; scheduled with startDate (and endDate) to run for a time; inactive to switch it off
priorityHigher wins. Give every list a different number
customerGroupsGroup names. A customer in any of them gets the list
customersCustomer emails (or ids). With no customerGroups and no customers, the list is for every customer
applyToall, products (with products: skus), categories (with categories), brands (with brands)
pricingMethoddiscount (with discountType percentage or amount and discountValue), fixed (only the prices in productPrices) or markup (markupPercentage on the product's cost)
productPrices[{ sku, price, tiers: [{ minQuantity, maxQuantity, price }] }]: a set price per product, by the product's own sku
tieredPricing, tierstrue, with [{ minQuantity, maxQuantity, discountType: "percentage" | "amount" | "fixed_price", value }] for every product the list covers
minimumQuantityThe line needs at least this many
businessLocationsOnly for shoppers served from these regions
autoApply, eligibilityWith autoApply: true: only customers with minOrderCount orders, minTotalSpent spent, or an account minAccountAgeDays old

Inside one list, the first that fits gives the price: the product's tiers in productPrices, then its price there, then the list's tiers, then pricingMethod. A fixed list gives nothing for a product it has no price for, so the next list is tried.

Wholesale, 25% off everything:

{ "name": "Wholesale", "status": "active", "priority": 10,
  "customerGroups": ["Wholesale"], "applyTo": "all",
  "pricingMethod": "discount", "discountType": "percentage", "discountValue": 25 }

A contract price for one account:

{ "name": "Acme contract", "status": "active", "priority": 20,
  "customers": ["[email protected]"], "applyTo": "products", "products": ["CAP"],
  "pricingMethod": "fixed",
  "productPrices": [{ "sku": "CAP", "price": 11, "tiers": [{ "minQuantity": 10, "price": 9 }] }] }

markup without a cost on the product takes 60% of its price as the cost, so a list can price above the list price. type (retail, wholesale…), eligibility.requiresApproval and eligibility.customerTiers are saved but nothing reads them.

Stop: a live list changes prices on the website at once. Show the person who gets it, what it covers and the prices at two or three quantities (step 5), and wait for yes. Make it inactive until then.

Hands on: the list's name and sk. Check: call_appengine GET storefront/pricing/price-lists lists it with its status and priority. Studio's Pricing overview shows which lists are active and scheduled.

4. Customers & Benefits: a group benefit (optional)

A benefit with perks: { discount: 5, discountType: "percentage" } (or "fixed", an amount off each unit) and customerGroups: ["VIP"], status: "active", at Customers & Benefits › Benefits (/customers-benefits?view=benefits). Members of a smart (dynamic) group get it too. A customer with several benefits gets the best one, and a percentage is preferred.

It is taken off after the tier or price list: a VIP buying at a $15 list price pays $14.25. perks.freeShipping isn't applied in the cart.

Hands on: the benefit's sk. Check: the step 5 quote names group_benefits as the rule.

5. Site: what the customer will pay

Ask the server as that customer. Never work it out yourself.

CallAnswers
POST storefront/admin/order/quote (staff) with the cart body and "customerId": "<sk>"The whole cart, priced as that customer: lines, discounts, totals
POST storefront/pricing/preview-as-customer (staff) with { sku, quantity, customerId }One product's price for that customer
GET storefront/pricing/preview/<sku>?quantities=1,10,25 (staff)One product at several quantities, for a shopper in no group
POST storefront/pricing/calculate with { sku, quantity }One product for whoever is signed in
POST storefront/pricing/calculate-cart with { productItems: [{ sku, quantity, options }] }The cart for whoever is signed in; 401 without sign-in
GET storefront/pricing/customer-price-listsThe lists and groups that reach the signed-in customer

Each priced line gives originalPrice, finalPrice, discount, discountPercent and appliedRule / appliedRuleType (product_tier, group_pricing, price_list, price_list_product, group_benefits). The rule tells you which way won.

On pages:

  • The built-in store. The product page shows the signed-in customer's price when it is lower, but goes back to the list price once a variant is picked. Product cards show the list price. The cart and checkout always show the customer's price.
  • Your own pages. product.list and product.get rows (data-source or appmint.product.list()) carry data.calculatedPrice { originalPrice, finalPrice, discount, discountPercent, appliedRule } for the signed-in customer, at quantity 1. Bind data.calculatedPrice.finalPrice, not data.price (the list price for everyone). See Catalog pages from products. For the cart, appmint.cart already shows server prices.

Hands on: the prices for a member and for a non-member at two or three quantities. Check: sign in on the site as a test member and as a test non-member and add the product to the cart. Each cart shows the price the quote gave.

When it's done

Tell the person:

  • who gets which prices, on which products, from when to when;
  • the price at two or three quantities for a member and for everyone else;
  • which rule wins where two could apply (tiers before lists; the higher priority list);
  • anything from What it can't do yet that touches their products.

Open Storefront › Pricing.

What it can't do yet

These were all found by testing. Check the quote before telling anyone a price.

  • Price lists ignore variant prices. A list prices a variant from the product's own price, not the variant's. Tested: 25% off a variant that costs $60 gave $30 (75% of the product's $40). For products whose variants have their own prices, use product tiers, or productPrices per product.
  • minimumOrderValue switches a list off. A list with any minimum order value, even $1, never applies in the cart. Use minimumQuantity instead, or leave it empty.
  • Category lists on listings. A list for categories applies in the cart, but listings and product.get can show the full price for a product whose categories are set only on its page post.
  • Quantity is per line. Two lines of 5 of the same product don't reach a 10+ tier online. The point of sale counts the product's total.
  • The highest priority wins, not the lowest price. A customer in two groups gets the higher priority list even when the other is cheaper.
  • Smart groups. Tiers and price lists only see the groups a customer was put in, not smart (dynamic) groups. Benefits see both.
  • Saved but not used: sf_customer_tier records, the price list type, eligibility.requiresApproval, eligibility.customerTiers, and the product's pricing.groupPricing from the product pricing settings.
  • A product the server can't find is priced at 0 and listed with the lines the store can't sell, and checkout refuses the order ("Nothing was charged"). Every line must be a real sku (discount.service.ts calculateCart).
  • Subscription plans are always their plan's price; nothing here changes them (Subscription plans).

Don'ts

  • Don't put a price in the browser or page code and send it as the price. The server re-prices every line.
  • Don't save the editor's default tier (quantity 1 at the product's price).
  • Don't use price lists for products whose variants have their own prices.
  • Don't set minimumOrderValue on a price list.
  • Don't give two lists the same priority.
  • Don't rename a group that prices name.
  • Don't make a list live before the person said yes to the quoted prices.
  • Don't bind data.price on a page that should show customer prices.