Skip to main content

discount_application

Information about the intent of a discount.

To learn about how to display discounts in your theme, refer to Discounts.

Properties

Anchor to
target_selection
string from a set of values

The selection method for line items or shipping lines to be discounted.

Note

Whether the selection method applies to line items or shipping lines depends on the discount's target type.

Possible valuesDescription
allThe discount applies to all line items or shipping lines.
entitledThe discount applies to a specific set of line items or shipping lines based on some criteria.
explicitThe discount applies to a specific line item or shipping line.
Anchor to
target_type
string from a set of values

The type of item that the discount applies to.

Possible values
line_item
shipping_line

The customer-facing name of the discount.

Anchor to
total_allocated_amount

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.

Tip

Use money filters to output a formatted amount.

Anchor to
type
string from a set of values

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 typeValue
fixed_amountThe amount of the discount in the currency's subunit.
percentageThe 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.

Tip

Use money filters to output a formatted price.

Anchor to
value_type
string from a set of values

The value type of the discount.

Possible values
fixed_amount
percentage
{
"target_selection": "explicit",
"target_type": "line_item",
"title": "Bloodroot discount!",
"total_allocated_amount": "2.50",
"type": "script",
"value": "2.5",
"value_type": "fixed_amount"
}
Was this section helpful?