discount_ application
Information about the intent of a discount.
To learn about how to display discounts in your theme, refer to Discounts.
Properties
The selection method for line items or shipping lines to be discounted.
NoteWhether the selection method applies to line items or shipping lines depends on the discount's target type.
Possible values Description all The discount applies to all line items or shipping lines. entitled The discount applies to a specific set of line items or shipping lines based on some criteria. explicit The discount applies to a specific line item or shipping line. The type of item that the discount applies to.
Possible values line_item shipping_line The total amount of the discount in the currency's subunit.
The value is output in the customer's local (presentment) currency.
For currencies without subunits, such as JPY and KRW, tenths and hundredths of a unit are appended. For example, 1000 Japanese yen is output as 100000.
TipUse money filters to output a formatted amount.
The type of the discount.
Possible values automatic discount_code manual script The value of the discount.
How this value is interpreted depends on the value type of the discount. The following table outlines what the value represents for each value type:
Value type Value The amount of the discount in the currency's subunit. percentage
The percent amount of the discount. For currencies without subunits, such as JPY and KRW, tenths and hundredths of a unit are appended. For example, 1000 Japanese yen is output as 100000.
TipUse money filters to output a formatted price.
{
"target_selection": "explicit",
"target_type": "line_item",
"title": "Bloodroot discount!",
"total_allocated_amount": "2.50",
"type": "script",
"value": "2.5",
"value_type": "fixed_amount"
}