How to Make a Discount Code on Shopify
Table of Contents
- Introduction
- The Native Framework for Shopify Discounts
- Core Discount Types and Technical Logic
- Understanding Platform Constraints and Limits
- Moving Beyond Native: The Power of Shopify Functions
- Choosing the Right Tool for the Job
- Step-by-Step: Implementing a Complex Tiered Discount
- Advanced Strategies: Preventing Discount Abuse
- Internationalization: Discounts in a Global Market
- The Role of AI in Discount Creation
- Pre-Launch Checklist for Shopify Discounts
- Measuring Impact and Iterating
- Conclusion
- Nextools Shopify App Suite (Quick Links)
- FAQ
Introduction
Scaling a high-volume Shopify store requires more than just basic percentage-off coupons. For Shopify Plus merchants, agencies, and developers, the real challenge lies in the transition from legacy Shopify Scripts to the modern Shopify Functions infrastructure. As the platform moves toward Checkout Extensibility, the standard methods for “how to make a discount code on Shopify” are being replaced by more robust, logic-driven architectures.
At Nextools, we specialize in bridging the gap between basic native features and complex, high-performance checkout logic. Whether you are managing global Markets, complex shipping zones, or tiered discount stacks that native Shopify settings can’t quite handle, understanding the technical underpinnings of Shopify’s discount engine is critical. This guide is designed for technical leads and growth-focused merchants who need to implement reliable, future-proof promotional logic.
Our approach follows the Nextools Playbook: first, we clarify the specific goal and constraints (such as Shopify plan or existing discount stacks); second, we confirm platform limits like the current capabilities of Shopify Functions; third, we choose the simplest durable approach—prioritizing Functions-first solutions like those found in the Nextools Shopify App Suite; fourth, we implement safely in staging environments; and finally, we measure the impact on AOV and conversion rates.
The Native Framework for Shopify Discounts
Before diving into advanced customization and Shopify Functions, it is essential to master the native discount architecture provided in the Shopify Admin. Shopify categorizes discounts into two primary methods: Discount Codes and Automatic Discounts.
Discount Code Basics
A discount code is a string of characters that a customer manually enters at checkout. This provides a sense of exclusivity and is highly effective for influencer marketing, email segmentation, and win-back campaigns.
To create a standard code:
- Navigate to Discounts in your Shopify Admin.
- Click Create discount.
- Choose your discount type (Amount off products, Amount off order, Buy X Get Y, or Free shipping).
- Select Discount code as the method.
- Define the code name (e.g., “SUMMER2024”) or generate a random string.
Automatic Discounts
Automatic discounts apply directly to the cart when the customer meets specific criteria. These are excellent for reducing friction and increasing conversion rates because they require no manual input. However, historically, Shopify limited the number of automatic discounts that could run simultaneously. While this has become more flexible with the introduction of discount classes and Shopify Functions, managing conflicts between multiple automatic discounts remains a key technical hurdle.
Core Discount Types and Technical Logic
When you determine how to make a discount code on Shopify, you must choose a logic type that aligns with your inventory goals.
1. Amount Off Products
This logic targets specific line items. You can apply a percentage or a fixed value. Technically, this is calculated at the line-item level, which is important for returns and partial refunds.
- Technical Tip: If you apply a discount to a specific collection, Shopify’s engine evaluates each item in the cart to see if its ID exists within that collection.
2. Amount Off Order
This applies to the entire subtotal. It is calculated after line-item discounts but before shipping and taxes (usually).
- Constraint: If your store uses multiple currencies via Shopify Markets, fixed-amount discounts are converted based on the exchange rate at the time of checkout.
3. Buy X Get Y (BOGO)
This is one of the most complex native logics. You must define the “Buy” requirements (quantity or purchase amount) and the “Get” reward (the discounted or free item).
- Implementation Note: To make BOGO work seamlessly, the “Y” item must often be in the cart already. Merchants frequently use apps like AutoCart to automatically add the gift item to the cart, ensuring the discount logic triggers correctly.
4. Free Shipping
This discount removes the shipping cost for specific countries or rates.
- Gotcha: If you are using a shipping app to generate dynamic rates, ensure that your free shipping discount is set to “Exclude shipping rates over a certain amount” if you want to avoid giving away expensive expedited shipping for free.
Understanding Platform Constraints and Limits
Every architectural decision in Shopify is governed by platform limits. Ignoring these can lead to “Item entitlements exceeded” errors or checkout performance degradation.
The 100-Item Limit
A single native discount code can only apply to up to 100 specific customers, products, or variants. If you are a large merchant trying to whitelist 500 specific SKUs for a “Flash Sale,” the native “Specific products” selector will fail.
- Solution: Use collections instead of individual products, or move to a Shopify Function-based approach using SupaEasy, which can handle much more complex selection logic.
The 20 Million Code Cap
Shopify permits a maximum of 20,000,000 unique discount codes per store. While this seems vast, stores using massive loyalty programs or unique one-time-use codes for every email signup can hit this limit over several years. Regular “hygiene” (deleting expired codes) is necessary.
Discount Combinations
One of the most frequent support tickets for Shopify developers involves discounts not stacking. Shopify uses “Discount Classes”:
- Product discounts
- Order discounts
- Shipping discounts
You must explicitly toggle the “Combinations” settings in the Shopify Admin to allow a product discount to stack with an order discount. However, you generally cannot stack two “Order” discounts together natively. To bypass this, you would traditionally need Shopify Scripts (now deprecated) or modern Shopify Functions.
Moving Beyond Native: The Power of Shopify Functions
For Shopify Plus merchants, the “how to make a discount code on Shopify” question often evolves into: “How can I build a discount that Shopify doesn’t support out of the box?”
Shopify Functions are the new standard for customizing backend logic. Unlike the old Ruby-based Scripts, Functions are written in WebAssembly (Wasm), making them faster and more scalable. They allow you to:
- Create tiered discounts (Spend $100 get 10%, Spend $200 get 20%).
- Apply discounts based on customer metafields or tags (e.g., “VIP” customers get an extra 5%).
- Discount based on payment method (e.g., 5% off if paying via bank transfer to avoid credit card fees).
Why Migrate from Scripts to Functions?
Shopify has announced the deprecation of Shopify Scripts. Migrating to Functions is not just about staying compliant; it’s about performance. Functions run on Shopify’s global infrastructure with virtually zero latency. If you are currently using complex Scripts to manage your promotions, tools like SupaEasy provide a “Scripts Migrator” and an “AI Functions Generator” to simplify this transition without requiring a dedicated DevOps team.
Choosing the Right Tool for the Job
Not every promotion requires a custom-coded Function. Use this decision matrix to determine your path:
| If you need to… | Use this approach |
|---|---|
| Create a simple 10% off code | Native Shopify Discounts |
| Create a “Buy 2 Get 1” auto-add | AutoCart |
| Stack multiple tiered discounts | Multiscount |
| Build custom logic with AI | SupaEasy |
| Prevent discounts for specific markets | Cart Block |
| Discount expiring or returned items | NoWaste |
By leveraging the Nextools Shopify App Suite, you can implement these complex behaviors while staying within the “Functions-first” architecture that Shopify recommends.
Step-by-Step: Implementing a Complex Tiered Discount
Let’s look at a real-world scenario: A merchant wants to offer a “Spend More, Save More” promotion that applies automatically.
Phase 1: Clarify Constraints
The merchant is on Shopify Plus and uses Shopify Markets to sell in the US and EU. They want to ensure the discount doesn’t stack with their “Welcome” code.
Phase 2: Confirm Platform Limits
Native Shopify automatic discounts don’t natively support multiple tiers (e.g., $50, $100, $150 thresholds) in a single rule. We will need a tool like Multiscount which uses Shopify Functions to handle this logic.
Phase 3: Implementation
- Install Multiscount: Access it via the Nextools Shopify App Suite.
- Define Tiers: Set up Tier 1 ($50 = 5%), Tier 2 ($100 = 10%), Tier 3 ($150 = 15%).
- Set Combination Rules: Ensure the “Product” class is selected so it can still stack with “Shipping” discounts but not other “Order” discounts.
- Market Targeting: Use the app settings to ensure the thresholds are appropriately localized for EUR and USD.
Phase 4: Safe Implementation (QA)
Before going live, use a development store or a Shopify Plus sandbox.
- Test Case A: Cart total $49.99 (Discount should be 0%).
- Test Case B: Cart total $101.00 (Discount should be 10%).
- Test Case C: Apply a manual “Welcome” code (Verify if stacking occurs as intended).
Phase 5: Measurement
Monitor the “Sales by discount” report in Shopify Analytics. Observe if the Average Order Value (AOV) increases as customers “stretch” their cart total to reach the next tier.
Advanced Strategies: Preventing Discount Abuse
Knowing how to make a discount code on Shopify also involves knowing how to block them. Discount abuse—such as stacking a high-value coupon with a clearance item—can erode margins.
Checkout Validation
With Shopify Plus and Checkout Extensibility, you can use Cart Block to create validation rules.
- Scenario: You have a “Black Friday” 40% off code, but you want to prevent it from being used if the cart contains “Refurbished” items.
- Logic: Cart Block can evaluate the cart’s contents and “Block discount codes” if specific conditions are met. This is a “Functions-first” way to protect your bottom line without manually checking every order.
Conditional Shipping and Payments
Sometimes, the best “discount” isn’t a price reduction, but a shipping incentive. Use HideShip to show or hide specific shipping rates based on whether a discount code was used. For example, if a customer uses a “DEEP-DISCOUNT-50” code, you might want to hide the “Free Express Shipping” option to preserve your margins.
Similarly, HidePay allows you to hide specific payment methods (like “Buy Now, Pay Later” providers with high fees) when a specific high-value discount code is applied.
Internationalization: Discounts in a Global Market
For stores operating in multiple countries, “how to make a discount code on Shopify” becomes a localization challenge.
Currency Conversion
Shopify handles the base currency conversion for discount codes. However, a code like “SAVE10” might feel less valuable in a currency where the nominal value of 10 is low.
- Nextools Strategy: Use CartLingo to translate the checkout descriptions of your discounts. A discount titled “Seasonal Savings” should be accurately localized to the customer’s language to ensure the value proposition is clear.
Market-Specific Discounts
You can now limit discounts to specific “Markets” within the native Shopify settings. This is crucial for regional holidays (e.g., Thanksgiving in the US vs. Chuseok in South Korea). Ensure your eligibility settings are set to “Markets” and select the appropriate regions.
The Role of AI in Discount Creation
The technical overhead of writing Shopify Functions can be high. This is why we integrated AI into SupaEasy. Instead of writing complex JSON schemas or Rust code, developers and agencies can use natural language prompts.
- Prompt Example: “Create a discount that gives 20% off all items in the ‘Summer’ collection only if the customer has the tag ‘VIP’ and is using a ‘Visa’ credit card.”
- Outcome: The AI generates the necessary Function logic, which can be deployed instantly to the store.
This “Wizard” approach reduces implementation time from days of custom development to minutes of configuration.
Pre-Launch Checklist for Shopify Discounts
Before you blast your “discount code” to your entire email list, run through this technical checklist:
- Check Expiration Dates: Ensure the “End date” is set correctly for your time zone.
- Verify Usage Limits: If it’s a “First 100 customers” deal, is the “Limit number of times this discount can be used in total” set to 100?
- Test “One per customer”: Does the logic correctly identify customers by email/phone number to prevent repeat usage?
- Confirm Combinations: Have you toggled the “Combines with” checkboxes for Product, Order, and Shipping classes?
- Review Cart Attributes: If using AttributePro, ensure any required cart attributes (like “Gift Message”) don’t interfere with the discount logic.
- Mobile QA: Test the checkout flow on mobile devices. Ensure the discount field is easy to find and the calculation updates in real-time.
Measuring Impact and Iterating
A successful discount strategy is data-driven. Use the “Sales by discount” report to track:
- Conversion Rate: Are users with a discount code more likely to complete the purchase?
- AOV (Average Order Value): Did your BOGO or tiered discount actually increase the total cart value?
- Net Margin: After the discount and shipping costs, was the sale profitable?
If the data shows that a 20% discount isn’t moving the needle but “Free Shipping” is, pivot your strategy. The flexibility of the Nextools Shopify App Suite allows you to swap logic types quickly without re-coding your entire store.
Conclusion
Mastering how to make a discount code on Shopify is a foundational skill for any eCommerce team, but for high-growth brands, it is only the beginning. The transition to Shopify Functions and Checkout Extensibility offers unprecedented power to create bespoke, high-performance promotional logic that was once only possible through brittle theme hacks or complex Ruby Scripts.
By following the Nextools Playbook, you ensure that every discount you create is durable, scalable, and safe:
- Clarify: Identify the exact goal (AOV growth vs. inventory clearance).
- Confirm: Understand the limits of native Shopify (100-item caps, stacking rules).
- Choose: Use the simplest tool—start with native, but move to SupaEasy or Multiscount for complex needs.
- Implement: Use sandboxes and a rigorous QA checklist.
- Measure: Iterate based on real sales data.
Ready to take your Shopify store’s promotional logic to the next level? Explore the full capabilities of our tools at the Nextools Shopify App Suite and start building a more profitable checkout experience today.
Nextools Shopify App Suite (Quick Links)
- SupaEasy — Shopify Functions generator + Script migration + AI
- SupaElements — Checkout + Thank You + Order Status customization
- HidePay — Hide/sort/rename payment methods
- HideShip — Hide/sort/rename shipping methods + conditional rates
- Multiscount — Stackable + tiered discounts
- Cart Block — Checkout validator (block/validate orders; anti-bot/fraud)
- AutoCart — Gift with purchase + auto add/remove + companion products
- ShipKit — Dynamic shipping rates (rule-based)
- Hook2Flow — Send webhooks to Shopify Flow (automation)
- AttributePro — Cart attributes + line properties (conditional logic)
- Formify — Custom checkout forms (drag & drop)
- CartLingo — Checkout translator (manual + AI)
- NoWaste — Discount & promote expiring/damaged/refurbished/returned items
- Hurry Cart — Countdown cart urgency timer
- Fatturify — Sync invoices/products with “Fatture in Cloud” (Italian market)
- PosteTrack — Tracking for Poste Italiane (Italian)
FAQ
Does my store need Shopify Plus to use advanced discount functions?
While basic discount codes are available on all Shopify plans, advanced customization via Shopify Functions or Checkout Extensibility (using apps like Cart Block or SupaEasy) is often optimized for Shopify Plus merchants. However, many Nextools apps offer powerful logic that works across all plans where Shopify allows app-based discount triggers.
How can I test my discount codes before a major launch like BFCM?
We always recommend using a Development Store or a Shopify Plus Sandbox. You can test your logic safely by creating “test” customer accounts with specific tags and simulating the checkout process. Tools in our App Suite are free to use in development stores, allowing for full QA without financial risk.
Can I migrate my old Ruby Shopify Scripts to the new Functions system?
Yes. Shopify is deprecating Scripts, and merchants should migrate to Functions as soon as possible. SupaEasy includes a dedicated Scripts Migrator tool and an AI-assisted generator to help you translate your old Ruby logic into the modern WebAssembly-based Functions framework.
Why is my Shopify discount code not stacking with another promotion?
Natively, Shopify requires you to explicitly enable “Combinations” for each discount. You must check the boxes for Product, Order, or Shipping discounts to allow them to work together. If you need to stack two discounts of the same class (e.g., two different Order-level discounts), you will likely need a Function-based solution like Multiscount.