Discounts, Commitments
Product catalog Rate Cards allow to specify discounts (usage discounts and percentage discounts), but also minimum and maximum commitments.
The invocing engine applies these in the following order:
- Usage discount's value is deducted from the usage based line's measured quantity
- Pricing algorithm is invoked
- Percentage discounts are deducted
- Minimum and maximum spend is applied
- Taxes are applied
Usage discounts
Usage discounts are only valid for usage based lines (non-flat fee).
The discount intent is captured in the line's rateCard.discounts.usage
member.
The calculation result are available in the line's .discounts.usage
array. The
meter's raw value is available in the line's .meteredQuantity
.
When usage discounts and Progressive Billing is used together, the usage discount can spread multiple invoices. In that case the discount is consumed, until the total available amount is depleted.
For example, if a line has 500 usage discount, billed in 3 parts with quantities, 300, 250, 100, then:
- Invoice 1's line will have a quantity of 0, remaining discount amount is 200
- Invoice 2's line will have a quantity of 50, remaining discount amount is 0
- Invoice 3's line will have a quantity of 100
Percentage discounts
Percentage discount's actual effect (amount discounted) can be found in the
.discounts.amount
array of the line. The percentage discount's reason field
will be set to the same value as the rateCard.discounts.percentage
.
Minimum spend
Minimum spend is always presented as an additional detailed line. The line's
category is set to charge
.
In case of Progressive Billing, the minimum spend is only included on the invoice that contains the end of the line's period.
Maximum spend
Any spend for a line over the maximum spend yield an amount discount availble in
discounts.amount
. The reason field contains the type maximumSpend