Pricing Model

View as Markdown

Two fields — billingType and pricingType — combine to produce six pricing models. The examples below use tiers 1–5 = $1, 6–10 = $2, 11–15 = $5 at quantity 14.

Simple pricing

Flat

FLAT_PRICE — Fixed amount every invoice. No events needed. The simplest model — customer pays the same every period regardless of usage.

Unit

UNIT_PRICE — Price × total events reported. Simple P×Q. The most common usage-based model. Requires an event to track.

Tiered pricing — the 2×2 matrix

Tiered pricing crosses two axes: how the tier is applied (pricingType: VOLUME vs TIERED) and what it produces (billingType: FLAT vs UNIT).

Tier Flat (billingType: FLAT)Tier Unit (billingType: UNIT)
Volume (pricingType: VOLUME)Find the single bucket qty falls into. Charge that bucket’s flat fee once. No multiplication.

Qty 14 → tier 3 (11–15) → $5
Find the single bucket qty falls into. Charge rate × total qty.

Qty 14 → tier 3 rate $5 → 14 × $5 = $70
Graduated (pricingType: TIERED)Every tier the qty passes through gets hit. Each hit tier adds its flat fee once. No multiplication.

Tiers 1+2+3 all hit → $1+$2+$5 = $8
Every tier gets hit. Multiply units in that tier × that tier’s rate, then sum them all.

(5×$1)+(5×$2)+(4×$5) = $35

Key rule for tiered and unit billing: usage-based models (billingType: UNIT, or pricingType: VOLUME/TIERED) should specify an event type to track.

Example at quantity 14

ModelFieldsResultCalculation
Volume flatbillingType: FLAT, pricingType: VOLUME$5Qty 14 → tier 3 (11–15) → flat $5
Volume unitbillingType: UNIT, pricingType: VOLUME$70Qty 14 × $5 = $70
Graduated flatbillingType: FLAT, pricingType: TIERED$8tier 1: +$1, tier 2: +$2, tier 3: +$5 = $8
Graduated unitbillingType: UNIT, pricingType: TIERED$35(5×$1=$5) + (5×$2=$10) + (4×$5=$20) = $35