Real-World Examples
This page provides complete, ready-to-use discount configurations for common promotion scenarios. Each example includes the full JSON configuration, an explanation of the scenario, and notes on key configuration choices.
All examples use the same JSON structure that the rule builder UI generates behind the scenes. You do not need to edit JSON directly — these are provided so you can understand the underlying configuration and verify 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:
productTagcondition withhasAny— Only 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 discount — Since this is a time-limited promotion meant to attract all visitors, an automatic discount (no code required) ensures maximum visibility. When the sale ends, disable the rule group or toggle
enabledtofalse. - Top-level
productTags— TheproductTagsarray 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:
- Tiered Discount function — This scenario requires escalating discount values based on thresholds, which is exactly what the Tiered function is designed for.
customerTagcondition — Gates 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 resolution — The 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 requirement — The 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:
- Buy X Get Y function — The BXGY function is purpose-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”, meaning any product in the store qualifies as both a buy item and a get item.buyQuantity: 2andgetQuantity: 1— The customer must buy 2 items to unlock 1 free item.maxSets: 1— Limits 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 discount — A 100% discount on the “get” items makes them completely free.
- Cheapest item allocation — The 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 array — No additional conditions are required. The only requirement is that the customer has 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:
- Bundle Discount function — The Bundle function validates that all required components are present in the cart before applying the discount. This is the only function that supports multi-component validation.
bundleItemsarray — Each entry defines a required component of the bundle with a label, quantity, and filter.- Collection-based filtering — Each bundle component targets a specific Shopify collection by ID. This lets you define broad categories (any cleanser, any toner, any moisturizer) rather than locking customers into specific products.
- Top-level
collectionIds— LikeproductTags, thecollectionIdsfield at the root level is required for Shopify’s input query so the function can check collection membership. - Component quantities — Each component requires exactly 1 item. You can increase the quantity for bundles that require multiples (e.g., buy 2 cleansers + 1 toner).
- All-or-nothing — If 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 requirement — The 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:
- Two conditions with AND logic — Both 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.
marketcondition — TheisAnyoperator 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 discount — A 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 only — Shipping 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:
- Separation of discount and rejection — The 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.
hasNoneoperator in the rejection rule — The rejection rule fires when the customer does not have the “staff” tag. This means any non-staff customer who enters a discount code will see the rejection message.- Rejection rule message — The
messagefield in the rejection rule is shown to the customer at checkout when their code is rejected. Make it clear and helpful. - Automatic discount for staff — The 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 requirement — Rejection 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:
- Fixed amount discount — Instead of a percentage, this uses
fixedAmountto give a flat $15 off. Fixed amounts are straightforward for customers to understand and give you precise control over the discount value. - Order target — The discount applies to the order subtotal. This is simpler than targeting individual products and works well for broad promotions.
- Single condition — Only one condition is needed: the cart subtotal must be $75+. The
conditionLogicis 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:
customerTotalSpentcondition — Shopify tracks each customer’s total lifetime spending. This condition checks that value against your threshold without requiring any external data.- Automatic discount — Loyal customers do not need to enter a code. The discount is applied as soon as they qualify, creating a seamless experience.
- Order-level target — The 10% applies to the entire order subtotal, keeping the promotion simple and easy for customers to understand.
- No product-level conditions — This promotion is purely customer-based. All products in the cart are included in the discount.
Next Steps
- Best Practices — Learn how to structure and manage your discount configurations effectively.
- Core Concepts — Review the foundational concepts behind rule groups, conditions, strategies, and discount values.
- Conditions Overview — Explore the full list of 18 condition types and their operators.