Skip to main content

Product Discounts - Basic Usage

Learn the essential parameters and structure for product discount events.

Event Structure

{
  "discount": "product_discount",
  "params": {
    "discount_type": "percentage",
    "value": 15,
    "message": "15% Off Sale"
  }
}

Required Parameters

discount_type

Specifies the type of discount to apply. Options:
  • "percentage": Percentage discount
  • "fixed_amount": Fixed dollar amount off
Example:
{
  "discount_type": "percentage"
}

value

The discount amount (numeric). For percentage:
  • Use whole numbers: 15 = 15%, 20 = 20%
  • Not decimals: 0.15
For fixed_amount:
  • Dollar amount: 10 = $10 off
  • Per item by default (see appliesToEachItem)
Examples:
// 25% off
{
  "discount_type": "percentage",
  "value": 25
}

// $5 off per item
{
  "discount_type": "fixed_amount",
  "value": 5
}

Optional Parameters

message

Customer-facing text displayed with the discount.
{
  "message": "VIP Member Discount"
}
Best Practices:
  • Keep it short and clear
  • Explain why they got the discount
  • Avoid technical jargon
  • Examples: “10% Off Sale Items”, “VIP Discount”, “Bulk Order Savings”

handles

Target specific products by their handle.
{
  "handles": ["cool-t-shirt", "awesome-jeans"]
}
Notes:
  • Handles are URL-friendly product identifiers
  • Find in Shopify admin or product URL
  • Case-sensitive
  • Multiple handles = OR logic (any matching product)

variant_ids

Target specific variants by ID.
{
  "variant_ids": [12345678, 87654321]
}
Notes:
  • Numeric IDs or GIDs both accepted
  • Most specific targeting method
  • Find in Shopify admin under product variants

vendors

Target all products from specific vendors.
{
  "vendors": ["Nike", "Adidas"]
}
Notes:
  • Exact match (case-sensitive)
  • Multiple vendors = OR logic
  • Vendor name must match exactly as stored in Shopify

variant_titles

Target variants by their option values.
{
  "variant_titles": ["Large", "X-Large"]
}
Notes:
  • Matches against variant option combinations
  • Case-sensitive
  • Useful for size/color-based discounts

Discount Types in Detail

Percentage Discount

Reduces price by a percentage.
{
  "discount_type": "percentage",
  "value": 20,
  "message": "20% Off"
}
Calculation:
  • Original Price: $100
  • Discount: 20%
  • Final Price: $80
Best for:
  • Sales (20% off everything)
  • Customer segments (VIP gets 15% off)
  • Promotional events

Fixed Amount Discount

Reduces price by a fixed dollar amount.
{
  "discount_type": "fixed_amount",
  "value": 10,
  "message": "$10 Off"
}
Default behavior (per item):
  • Original Price: $50 per item
  • Quantity: 2
  • Discount: $10 per item
  • Total Discount: $20
  • Final Total: $80
Best for:
  • Bulk discounts ($5 off each)
  • Clearance pricing
  • Fixed savings promotions

Complete Examples

Simple Percentage Discount

10% off all products:
{
  "rules": [
    {
      "conditions": {},
      "events": [
        {
          "discount": "product_discount",
          "params": {
            "discount_type": "percentage",
            "value": 10,
            "message": "10% Off Sitewide"
          }
        }
      ]
    }
  ]
}

Targeted Product Discount

$15 off specific product:
{
  "rules": [
    {
      "conditions": {},
      "events": [
        {
          "discount": "product_discount",
          "params": {
            "handles": ["premium-sneakers"],
            "discount_type": "fixed_amount",
            "value": 15,
            "message": "$15 Off Premium Sneakers"
          }
        }
      ]
    }
  ]
}

Conditional Vendor Discount

20% off Nike products for VIP customers:
{
  "rules": [
    {
      "conditions": {
        "customer.tags": { "includes": "VIP" }
      },
      "events": [
        {
          "discount": "product_discount",
          "params": {
            "vendors": ["Nike"],
            "discount_type": "percentage",
            "value": 20,
            "message": "VIP Special - 20% Off Nike"
          }
        }
      ]
    }
  ]
}

Multiple Product Discount

15% off specific products:
{
  "rules": [
    {
      "conditions": {},
      "events": [
        {
          "discount": "product_discount",
          "params": {
            "handles": ["t-shirt", "hoodie", "jacket"],
            "discount_type": "percentage",
            "value": 15,
            "message": "15% Off Apparel"
          }
        }
      ]
    }
  ]
}

Common Patterns

No Targeting = All Products

Omit targeting parameters to apply to entire cart:
{
  "discount": "product_discount",
  "params": {
    "discount_type": "percentage",
    "value": 10,
    "message": "10% Off Everything"
  }
}

Multiple Targeting Methods

Combine targeting (OR logic):
{
  "params": {
    "handles": ["t-shirt"],
    "vendors": ["Nike"],
    "discount_type": "percentage",
    "value": 20
  }
}
Applies to: products with handle “t-shirt” OR from vendor “Nike”.

Next Steps