The discount_application object

The discount_application object captures the intent of a discount applied on an order. The object can be accessed on customer order and notification templates. Shopify Plus merchants can also access properties of the discount_allocation object in the checkout.liquid layout file.

The discount_application object has the following attributes:

discount_application.target_selection

Describes how a discount selects line items in the cart to be discounted. target_selection has the following possible values:

  • all: The discount applies to all line items.
  • entitled: The discount applies to a particular subset of line items, often defined by a condition.
  • explicit: The discount applies to a specifically selected line item or shipping line.

discount_application.target_type

Describes the type of item that a discount applies to. target_type has the following possible values:

  • line_item
  • shipping_line

discount_application.title

The customer-facing name of the discount. For example, Welcome10 or CBBWQQAKYBYY.

discount_application.total_allocated_amount

The total amount that the price of an order is reduced by the discount. This amount is in the customer's local (presentment) currency.

discount_application.type

The type of the discount. type has the following possible values:

  • automatic
  • discount_code
  • manual
  • script

discount_application.value

The value of the discount. This value is in the customer's local (presentment) currency.

discount_application.value_type

The value type of the discount. value_type has the following possible values:

  • fixed_amount
  • percentage

Ready to start selling with Shopify?

Try it free