← Lessons

quiz vs the machine

Platinum1780

System Design

Price and Promotion Engine Deep Dive

Computing the right price from base cost, rules, and coupons.

6 min read · advanced · beat Platinum to climb

What a pricing engine does

The final price is rarely just the list price. A pricing engine layers base price, customer segment, quantity breaks, promotions, coupons, and taxes into one final number, consistently and explainably.

Ordering matters

  • Promotions and discounts must apply in a defined order so results are deterministic.
  • Decide whether discounts stack or whether only the best one applies.
  • Resolve conflicts with explicit priority so two rules do not silently fight.

Correctness concerns

  • Round at the right step to avoid penny drift.
  • Produce a price breakdown so support and the buyer can see why the total is what it is.
  • Cache stable parts but recompute promotion eligibility per cart.

Key idea

A pricing engine layers base price, segment, promotions, coupons, and tax in a defined order with explicit stacking rules, producing a deterministic and explainable final total.

Check yourself

Answer to earn rating on the learn ladder.

1. Why must promotion application order be defined?

2. Why produce a price breakdown?

3. What does a stacking rule decide?