Inline discounts for order line items
This article describes the purpose, usage, calculation logic, and implementation of inline discounts.
Purpose
You can apply discounts on order line items through specifying inline discounts.
Usage
The following fields on the Order Line Item object are used to apply inline discounts:
inlineDiscountType
: an enum value. Use this field to specify the inline discount type, which can bePercentage
,FixedAmount
, orNone
.inlineDiscountPerUnit
: a number value. Use this field in accordance with theinlineDiscountType
field, in the following manner:- If the
inlineDiscountType
field is set asPercentage
, this field specifies the discount percentage for each unit of the order line item. - If the
inlineDiscountType
field is set asFixedAmount
, this field specifies the discount amount on each unit of the order line item.
- If the
discount
: a number value. This field shows the total discount amount that is applied to an order line item after the inline discount fields above are set.
When creating or updating an order line item, you can specify the inlineDiscountType
and inlineDiscountPerUnit
fields through both the Zuora UI and API. See more information in Create an order line item.
In addition, the Zuora UI supports the automatic generation of values for the relevant discounting and pricing fields, including inlineDiscountPerUnit
, listPricePerUnit
, and amountPerUnit
. The logic is that when two of the previous fields are set, the remaining field is automatically generated in the UI.
Calculation logic
The following table uses an example to show the calculation logic of inline discounting and pricing for order line items:
Order Line Item | List Price Per Unit | Inline Discount Per Unit | Inline Discount Type | Amount Per Unit | Quantity | Discount | Amount |
---|---|---|---|---|---|---|---|
Order Line Item 1 | 50 | 10% | Percentage | 45 | 2 | 10 | 90 |
Order Line Item 2 | 50 | 10 | Fixed Amount | 40 | 2 | 20 | 80 |
Order Line Item 3 | 50 | 0 | None | 50 | 2 | 0 | 100 |
Implementation
The inline discount is implemented as a discount to specify directly through setting the inline discount fields. It is applied to the list price of an order line item, as the following formula shows:
Sale Price of Order Line Item = List Price - Inline Discount
Note that inline discounts on order line items are implemented differently from discounts on rate plan charges. The discount on a rate plan charge is implemented as a discount charge. It is applied to the sale price of a rate plan charge, as the following formula shows:
Subtotal of Rate Plan Charge = Sale Price of Rate Plan Charge - Discount