Guide

Customer-specific pricing in B2B: how it works, with examples

Contract prices, account discounts and volume breaks are what make B2B pricing hard to maintain. This guide explains how a pricing engine models them as rules, how it decides which rule applies, and how the result reaches your applications.

On this page

What customer-specific pricing is

Customer-specific pricing means two buyers can pay different prices for the same product. In B2B this is the norm rather than the exception: distributors, manufacturers and wholesalers negotiate prices per account, and those agreements usually take a few common forms:

  • Contract prices — a fixed unit price for one customer on one product.
  • Account discounts — a percentage off list price for everything a customer buys.
  • Volume tiers — a lower price once an order reaches a minimum quantity.
  • General price adjustments — a discount that applies to every customer, such as a trade discount.

Kept in spreadsheets, each of these becomes another tab or file to update — and every system that shows a price (the B2B storefront, the quoting tool, the ERP) needs its own copy of the logic. A pricing engine keeps the agreements as data in one place and calculates the price on request.

Anatomy of a pricing rule

In PriceRules, every agreement above is a pricing rule with these fields:

  • Field
    type
    What it does
    fixed sets the final unit price; discount takes a percentage off the product's base price.
  • Field
    value
    What it does
    The unit price (fixed) or the percentage (discount).
  • Field
    customer code
    What it does
    Who the rule applies to. Empty means every customer.
  • Field
    SKU
    What it does
    Which product the rule applies to. Empty means every product.
  • Field
    minimum_quantity
    What it does
    The rule only applies when the requested quantity is at least this number.
  • Field
    priority
    What it does
    Breaks ties between rules that are otherwise equally specific. Higher wins.
  • Field
    status
    What it does
    Inactive rules are kept but never applied.

Which rule wins

Several rules can apply to the same request. PriceRules checks rule scopes from most to least specific and stops at the first scope that produces a price:

  1. This customer and this SKU — e.g. a contract price.
  2. This SKU, any customer — e.g. a product promotion.
  3. This customer, any SKU — e.g. an account discount.
  4. All customers and SKUs — e.g. a trade discount.

Within a scope, only rules whose minimum quantity is met are eligible, and the one with the highest qualifying minimum quantity wins. If that still leaves more than one, the higher priority wins, then the lower resulting price, then the most recently created rule. The response tells you which rule was applied and why (match_reason). If nothing matches, the base price is returned with NO_RULE.

Requests can also set mode: "best_price", which returns the lowest price among the eligible rules instead of the most specific one.

Quantity tiers

Volume breaks are rules with a minimum quantity. Take a sample customer, ACME-BUILD, with two rules on VLV-304 (base price $48.00): a contract price of $42.00 and a volume price of $39.50 from 100 units. The resolved unit price at different quantities:

  • Quantity
    1
    Rule applied
    Acme contract price
    Unit price
    $42.00
  • Quantity
    99
    Rule applied
    Acme contract price
    Unit price
    $42.00
  • Quantity
    100
    Rule applied
    Acme volume price 100+
    Unit price
    $39.50
  • Quantity
    250
    Rule applied
    Acme volume price 100+
    Unit price
    $39.50

Below 100 units only the contract price qualifies. From 100 units both qualify, and the rule with the higher minimum quantity wins. Prices are per unit; your application multiplies by the quantity.

Worked examples

The sample workspace has these rules:

  • Rule
    Acme volume price 100+
    Customer
    ACME-BUILD
    SKU
    VLV-304
    Effect
    fixed $39.50, 100+ units
  • Rule
    Acme contract price
    Customer
    ACME-BUILD
    SKU
    VLV-304
    Effect
    fixed $42.00
  • Rule
    Nordic account discount
    Customer
    NORDIC-FAB
    SKU
    All
    Effect
    10% off
  • Rule
    Trade discount
    Customer
    All
    SKU
    All
    Effect
    5% off

And these requests resolve as follows:

  • Customer
    ACME-BUILD
    SKU × qty
    VLV-304 × 120
    Rule applied
    Acme volume price 100+ (MOST_SPECIFIC_RULE)
    Base → unit price
    $48.00 → $39.50
  • Customer
    ACME-BUILD
    SKU × qty
    FAS-1001 × 20
    Rule applied
    Trade discount (DEFAULT_RULE)
    Base → unit price
    $24.00 → $22.80
  • Customer
    NORDIC-FAB
    SKU × qty
    VLV-304 × 20
    Rule applied
    Nordic account discount (CUSTOMER_LEVEL_RULE)
    Base → unit price
    $48.00 → $43.20
  • Customer
    (none)
    SKU × qty
    VLV-304 × 20
    Rule applied
    Trade discount (DEFAULT_RULE)
    Base → unit price
    $48.00 → $45.60

Try your own combinations in the interactive demo on the homepage.

Importing rules and calling the API

Customer- and SKU-specific rules can be imported from CSV once products and customers exist. Each row targets one customer and one SKU:

pricing-rules.csvCSV
name,code,sku,type,value,minimum_quantity,priority
Acme contract price,ACME-BUILD,VLV-304,fixed,42,,1
Acme volume price 100+,ACME-BUILD,VLV-304,fixed,39.5,100,1

Rules that apply to every customer or every product are created in the app, where a rule can also list several customers or SKUs. The CSV import reference lists every column and validation message.

Your application then asks for prices with a workspace API key:

RequestcURL
curl -X POST https://pricerules.app/api/v1/pricing/resolve \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "customer_id": "ACME-BUILD",
    "products": [
      {
        "sku": "VLV-304",
        "quantity": 120
      }
    ]
  }'

The response names the rule that won and why. For ACME-BUILD buying 120 × VLV-304:

ResponseJSON200 OK · excerpt
{
  "mode": "business",
  "success": true,
  "data": {
    "customer_id": "ACME-BUILD",
    "items": [
      {
        "sku": "VLV-304",
        "base_price": 48,
        "quantity": 120,
        "final_price": 39.5,
        "applied_rule": {
          "id": "rule_acme_vlv_100",
          "name": "Acme volume price 100+",
          "type": "fixed",
          "value": 39.5,
          "constraints": {
            "minimum_quantity": 100
          }
        },
        "match_reason": "MOST_SPECIFIC_RULE",
        "pricing_summary": {
          "savings": 8.5,
          "message": "Customer saved 8.50 due to active pricing rules"
        }
      }
    ]
  }
}

One request handles up to 500 SKUs for a customer; the bulk endpoint handles up to 10 customers at once. See the pricing API reference for the full response and error codes.

Alongside your ERP or ecommerce platform

A pricing engine doesn't replace your ERP. A common setup keeps the ERP as the system of record for products and customers, exports them to PriceRules as CSV, and manages the customer-specific rules in PriceRules. The storefront, customer portal or quoting tool calls the pricing API when it needs a price, so every channel uses the same rules.

PriceRules doesn't include native connectors for specific ERPs or ecommerce platforms today, so calling the API from those systems is integration work for your team. The getting started guide walks through the first request.

See all PriceRules features

Model your customer pricing as rules.

Start on the Free plan, import your products, customers and contract prices, and resolve prices through the API.