Storefront

Updated 11 July 2026

Quantity pricing rules are configured in Admin, but customers see the results on your storefrontcart, and checkout. This chapter explains what to build and what customers should experience.

Note The plugin does not automatically change cart line items. Your storefront or custom cart workflow must call the Store API and apply the returned unit_price.

Product detail page

What customers should see

Storefront

Fetch tiers on page load

GET /store/quantity-pricing?product_id=prod_01XXX&variant_id=variant_01XXX¤cy_code=usd

Returns quantity_prices array – render as a table.

Live price when quantity changes

GET /store/quantity-pricing?product_id=prod_01XXX¤cy_code=usd&quantity=6&base_unit_price=24

Returns calculated_price with unit_priceline_total, and rule_id.

Cart behavior

On add to cart and quantity update:

Checkout

Tip Re-validate tier price at checkout – quantity may have changed since the product page.

API parameters reference

B2B logged-in customers

When using customer groups (via Admin API):

Storefront integration checklist

Customer-facing help text (copy-paste)

Why did my price change when I added more items?

> We offer volume discounts – the more you buy, the lower the per-unit price.

Which price applies?

> The price shown for your current quantity in the tier table applies to your entire line quantity.

Developer helper (optional)

For custom cart workflows, use the exported helper:

import { resolveQuantityUnitPrice } from "@webbycrown/medusa-quantity-pricing-rules"

const unitPrice = await resolveQuantityUnitPrice(container, {
  product_id: "prod_01...",
  variant_id: "variant_01...",
  quantity: 25,
  currency_code: "usd",
})