Real-World Examples

This page gives complete discount configurations for common promotion scenarios. Each example includes the full JSON configuration, an explanation of the scenario, and notes on the configuration choices that matter.

All examples use the same JSON structure that the rule builder UI generates behind the scenes. You do not need to edit JSON directly. The JSON is here so you can read the underlying configuration and check that your UI settings produce the expected result.

1. Seasonal Flash Sale

Scenario: You are running a 48-hour flash sale offering 25% off all products tagged “flash-sale”. The discount should apply automatically at checkout with no code required.

{
  "version": "1.0",
  "strategy": "first",
  "productTags": ["flash-sale"],
  "ruleGroups": [
    {
      "id": "rg_001",
      "name": "Flash Sale 25% Off",
      "enabled": true,
      "conditionLogic": "and",
      "conditions": [
        {
          "type": "productTag",
          "operator": "hasAny",
          "tags": ["flash-sale"]
        }
      ],
      "targets": {
        "product": { "scope": "filtered" }
      },
      "discount": {
        "type": "percentage",
        "value": 25,
        "message": "Flash Sale -- 25% OFF"
      }
    }
  ],
  "rejectionRules": []
}

Key configuration choices:

ChoiceEffect
productTag condition with hasAnyOnly products you have explicitly tagged “flash-sale” receive the discount. Other items in the cart remain full price.
scope: "filtered"The discount targets only the lines that match the product-level condition, not every item in the cart.
Automatic discountThis is a time-limited promotion aimed at every visitor, so an automatic discount (no code required) gives it the widest reach. When the sale ends, disable the rule group or toggle enabled to false.
Top-level productTagsThe productTags array at the root level is required for Shopify’s input query. It tells the function which tags to request from Shopify’s GraphQL API during execution.

2. VIP Tiered Pricing

Scenario: Customers tagged “VIP” in Shopify receive escalating discounts based on the number of items in their cart: 15% off for 3+ items, 25% off for 6+ items, and 35% off for 10+ items. This uses the Tiered Discount function.

{
  "version": "1.0",
  "strategy": "first",
  "ruleGroups": [
    {
      "id": "rg_001",
      "name": "VIP Tiered Pricing",
      "enabled": true,
      "conditionLogic": "and",
      "conditions": [
        {
          "type": "customerTag",
          "operator": "hasAny",
          "tags": ["VIP"]
        }
      ],
      "thresholdType": "quantity",
      "thresholdScope": "all",
      "tiers": [
        {
          "threshold": 3,
          "discount": {
            "type": "percentage",
            "value": 15,
            "message": "VIP Tier 1 -- 15% OFF (3+ items)"
          }
        },
        {
          "threshold": 6,
          "discount": {
            "type": "percentage",
            "value": 25,
            "message": "VIP Tier 2 -- 25% OFF (6+ items)"
          }
        },
        {
          "threshold": 10,
          "discount": {
            "type": "percentage",
            "value": 35,
            "message": "VIP Tier 3 -- 35% OFF (10+ items)"
          }
        }
      ],
      "targets": {
        "product": { "scope": "all" }
      }
    }
  ],
  "rejectionRules": []
}

Key configuration choices:

ChoiceEffect
Tiered Discount functionThe discount value has to escalate with a threshold, which is what the Tiered function does.
customerTag conditionGates the entire rule group behind the “VIP” tag. Non-VIP customers receive no discount at all.
thresholdType: "quantity"Tiers are based on the total number of items in the cart, not the cart subtotal.
thresholdScope: "all"The threshold counts all items in the cart, not just filtered items.
Tier resolutionThe function resolves to the highest qualifying tier. A VIP customer with 8 items receives 25% off (tier 2), not 15% off (tier 1). Tiers are evaluated from highest to lowest, and the first match wins.
Billing requirementThe Tiered function requires the Pro plan or higher.

3. Buy 2 Get 1 Free Storewide

Scenario: A storewide promotion where customers buy any 2 items and get 1 item free. The free item is the cheapest qualifying item. This uses the Buy X Get Y function.

{
  "version": "1.0",
  "strategy": "first",
  "ruleGroups": [
    {
      "id": "rg_001",
      "name": "Buy 2 Get 1 Free",
      "enabled": true,
      "conditionLogic": "and",
      "conditions": [],
      "buyQuantity": 2,
      "getQuantity": 1,
      "maxSets": 1,
      "buyFilter": {
        "filterType": "all"
      },
      "getFilter": {
        "filterType": "all"
      },
      "discount": {
        "type": "percentage",
        "value": 100,
        "message": "Buy 2 Get 1 FREE"
      }
    }
  ],
  "rejectionRules": []
}

Key configuration choices:

ChoiceEffect
Buy X Get Y functionThe BXGY function is built for buy/get promotions. It handles the allocation logic (which items are “bought” and which are “gotten”) automatically.
filterType: "all"Both the buy and get filters are set to “all”, so any product in the store qualifies as both a buy item and a get item.
buyQuantity: 2 and getQuantity: 1The customer must buy 2 items to unlock 1 free item.
maxSets: 1Limits the promotion to 1 set per cart. Without this limit, a customer with 6 items could get 2 free items (two complete sets). Set this to a higher number or omit it to allow multiple sets.
100% percentage discountA 100% discount on the “get” items makes them completely free.
Cheapest item allocationThe BXGY function always allocates the discount to the cheapest qualifying items first. In a cart with items priced at $30, $20, and $10, the $10 item is the free one.
Empty conditions arrayNo additional conditions are required. The customer only has to have enough qualifying items in the cart.

4. Complete Skincare Bundle

Scenario: Customers who buy one item from each of three collections (Cleansers, Toners, and Moisturizers) receive 20% off the entire bundle. This uses the Bundle Discount function.

{
  "version": "1.0",
  "strategy": "first",
  "collectionIds": ["gid://shopify/Collection/111", "gid://shopify/Collection/222", "gid://shopify/Collection/333"],
  "ruleGroups": [
    {
      "id": "rg_001",
      "name": "Complete Skincare Bundle",
      "enabled": true,
      "conditionLogic": "and",
      "conditions": [],
      "bundleItems": [
        {
          "label": "Cleanser",
          "quantity": 1,
          "filter": {
            "filterType": "collection",
            "collectionIds": ["gid://shopify/Collection/111"]
          }
        },
        {
          "label": "Toner",
          "quantity": 1,
          "filter": {
            "filterType": "collection",
            "collectionIds": ["gid://shopify/Collection/222"]
          }
        },
        {
          "label": "Moisturizer",
          "quantity": 1,
          "filter": {
            "filterType": "collection",
            "collectionIds": ["gid://shopify/Collection/333"]
          }
        }
      ],
      "discount": {
        "type": "percentage",
        "value": 20,
        "message": "Skincare Bundle -- 20% OFF"
      }
    }
  ],
  "rejectionRules": []
}

Key configuration choices:

ChoiceEffect
Bundle Discount functionThe Bundle function checks that all required components are present in the cart before applying the discount. This is the only function that supports multi-component validation.
bundleItems arrayEach entry defines a required component of the bundle with a label, quantity, and filter.
Collection-based filteringEach bundle component targets a specific Shopify collection by ID. You can define broad categories (any cleanser, any toner, any moisturizer) rather than locking customers into specific products.
Top-level collectionIdsLike productTags, the collectionIds field at the root level is required for Shopify’s input query so the function can check collection membership.
Component quantitiesEach component requires exactly 1 item. You can increase the quantity for bundles that require multiples (e.g., buy 2 cleansers + 1 toner).
All-or-nothingIf any bundle component is missing from the cart, the discount does not apply. The customer must have at least one item from each of the three collections.
Billing requirementThe Bundle function requires the Enterprise plan.

5. Free Shipping Over $50 for US and Canada

Scenario: Customers in the United States or Canada receive free shipping when their cart subtotal reaches $50 or more. This uses the Conditional Discount function with a shipping target.

{
  "version": "1.0",
  "strategy": "first",
  "ruleGroups": [
    {
      "id": "rg_001",
      "name": "Free Shipping US/CA $50+",
      "enabled": true,
      "conditionLogic": "and",
      "conditions": [
        {
          "type": "market",
          "operator": "isAny",
          "countryCodes": ["US", "CA"]
        },
        {
          "type": "cartSubtotal",
          "operator": "greaterThanOrEqual",
          "value": 50
        }
      ],
      "targets": {
        "shipping": { "scope": "all" }
      },
      "discount": {
        "type": "percentage",
        "value": 100,
        "message": "Free Shipping on orders $50+ (US & CA)"
      }
    }
  ],
  "rejectionRules": []
}

Key configuration choices:

ChoiceEffect
Two conditions with AND logicBoth conditions must be true: the customer’s market must be US or CA, and the cart subtotal must be $50+. If either condition fails, shipping remains at full price.
market conditionThe isAny operator checks whether the customer’s delivery country matches any of the listed country codes. This uses ISO 3166-1 alpha-2 codes.
Shipping target with scope: "all"The discount applies to all available delivery options, not just the cheapest one.
100% percentage discountA full 100% discount on shipping makes it free. You could use a lower percentage (e.g., 50%) for a partial shipping discount instead.
Cart-level conditions onlyShipping discounts only evaluate cart-level conditions. Product-level conditions (like productTag) are ignored when the target is shipping.

6. Staff Discount with Code Rejection

Scenario: Employees tagged “staff” in Shopify receive an automatic 40% discount on all products. Additionally, any discount code entered by a non-staff customer should be rejected to prevent code sharing. This uses the Conditional Discount function with a rejection rule.

{
  "version": "1.0",
  "strategy": "first",
  "ruleGroups": [
    {
      "id": "rg_001",
      "name": "Staff 40% Discount",
      "enabled": true,
      "conditionLogic": "and",
      "conditions": [
        {
          "type": "customerTag",
          "operator": "hasAny",
          "tags": ["staff"]
        }
      ],
      "targets": {
        "product": { "scope": "all" }
      },
      "discount": {
        "type": "percentage",
        "value": 40,
        "message": "Staff Discount -- 40% OFF"
      }
    }
  ],
  "rejectionRules": [
    {
      "id": "rej_001",
      "name": "Block non-staff codes",
      "enabled": true,
      "conditionLogic": "and",
      "conditions": [
        {
          "type": "customerTag",
          "operator": "hasNone",
          "tags": ["staff"]
        }
      ],
      "message": "This discount is for staff members only."
    }
  ]
}

Key configuration choices:

ChoiceEffect
Separation of discount and rejectionThe rule group handles the discount (40% off for staff), while the rejection rule handles code blocking (reject codes for non-staff). These are independent mechanisms.
hasNone operator in the rejection ruleThe rejection rule fires when the customer does not have the “staff” tag. Any non-staff customer who enters a discount code sees the rejection message.
Rejection rule messageThe message field in the rejection rule is shown to the customer at checkout when their code is rejected. Say why the code was refused.
Automatic discount for staffThe rule group itself works as an automatic discount. Staff members receive 40% off without entering a code, and non-staff customers are blocked from using any code associated with this discount function.
scope: "all"The staff discount applies to all products in the cart, not just filtered items.
Billing requirementRejection rules require the Pro plan or higher.

7. Weekend Sale with Minimum Cart Value

Scenario: A promotion offering $15 off any order with a subtotal of $75 or more. This uses a fixed amount discount at the order level, commonly used for weekend or holiday sales.

{
  "version": "1.0",
  "strategy": "first",
  "ruleGroups": [
    {
      "id": "rg_001",
      "name": "Weekend Sale $15 Off",
      "enabled": true,
      "conditionLogic": "and",
      "conditions": [
        {
          "type": "cartSubtotal",
          "operator": "greaterThanOrEqual",
          "value": 75
        }
      ],
      "targets": {
        "order": {}
      },
      "discount": {
        "type": "fixedAmount",
        "value": 15,
        "message": "Weekend Sale -- $15 OFF orders $75+"
      }
    }
  ],
  "rejectionRules": []
}

Key configuration choices:

ChoiceEffect
Fixed amount discountInstead of a percentage, this uses fixedAmount to give a flat $15 off. Customers read a fixed amount at a glance, and you keep exact control over the discount value.
Order targetThe discount applies to the order subtotal. This is simpler than targeting individual products and works well for broad promotions.
Single conditionOnly one condition is needed: the cart subtotal must be $75+. The conditionLogic is set to "and", but with a single condition, the logic mode has no effect.

8. Loyalty Reward with Spending History

Scenario: Customers who have spent $500 or more in previous orders (lifetime value) receive 10% off their entire order. This rewards long-term customers automatically.

{
  "version": "1.0",
  "strategy": "first",
  "ruleGroups": [
    {
      "id": "rg_001",
      "name": "Loyalty Reward 10% Off",
      "enabled": true,
      "conditionLogic": "and",
      "conditions": [
        {
          "type": "customerTotalSpent",
          "operator": "greaterThanOrEqual",
          "value": 500
        }
      ],
      "targets": {
        "order": {}
      },
      "discount": {
        "type": "percentage",
        "value": 10,
        "message": "Loyalty Reward -- 10% OFF"
      }
    }
  ],
  "rejectionRules": []
}

Key configuration choices:

ChoiceEffect
customerTotalSpent conditionShopify tracks each customer’s total lifetime spending. This condition checks that value against your threshold without requiring any external data.
Automatic discountLoyal customers do not need to enter a code. The discount is applied as soon as they qualify.
Order-level targetThe 10% applies to the entire order subtotal, so the promotion stays simple for customers to understand.
No product-level conditionsThis promotion is purely customer-based. All products in the cart are included in the discount.

Next Steps