New: Kinetic, our first Shopify theme. See it in action

How to Create Discount Codes and Automatic Discounts in Shopify

Learn how to create Shopify discount codes and automatic discounts: the four types, Buy X get Y, combinations, shareable links and common mistakes.

How to Create Discount Codes and Automatic Discounts in Shopify

You want to run a sale, reward email subscribers or clear old stock, and Shopify’s Discounts page offers you four discount types, two methods and a long form full of options. Pick the wrong combination and a customer’s code fails at checkout, or worse, two offers stack and you sell at a loss. The good news is that everything most small stores need is built into Shopify, no app required.

This guide explains how to create discount codes and automatic discounts in Shopify step by step, which type to use for which promotion, how combinations work, how to share a code as a link, and what to test before you announce the offer.

Discount codes vs automatic discounts

Comparison of Shopify discount codes and automatic discounts
Pick the method first: it cannot be changed after the discount is saved.

Every Shopify discount uses one of two methods, and you choose it when you create the discount. You cannot change the method later; Shopify’s documentation says you need to delete the discount and create it again.

  • Discount code: customers type a code such as WELCOME10 at checkout (or open a shareable link that applies it for them). Codes are best for targeted offers: a newsletter welcome, a code for one influencer, a thank-you for past customers. Because only people who have the code can use it, you control who gets the deal.
  • Automatic discount: applied by itself in the cart and at checkout as soon as the order meets the conditions. It has a Title that customers see instead of a code. Automatic discounts suit store-wide offers you want every visitor to get, such as “20% off all summer dresses” or “buy 2 get 1 free”, because nobody has to remember or find a code.

Two limits are worth knowing from the start. According to Shopify’s discount combinations guide, a store can have a maximum of 25 active automatic discounts, including discounts created by apps, and a customer can use up to 5 product or order discount codes plus 1 shipping discount code on a single order.

The four discount types

After clicking Create discount, Shopify asks you to select a discount type. Each one has a discount class (product, order or shipping), and the class decides how it combines with other offers later on.

Discount type What it does Typical use
Amount off products Percentage or fixed amount off selected products or collections A collection sale, a launch offer on one product
Amount off orders Percentage or fixed amount off the whole order A welcome code, “$10 off orders over $75”
Buy X get Y Discounted or free items when customers buy something first Buy 2 get 1 free, free gift with a purchase
Free shipping Removes the shipping cost for qualifying orders A weekend free-shipping promotion

Free shipping has its own settings and pitfalls, which we covered in detail in how to set up free shipping over a threshold in Shopify. The rest of this guide focuses on the other three types. For tiered or multi-step offers (“spend $50 save 10%, spend $100 save 20%”), Shopify points merchants to discount apps or custom apps, since the native types handle one rule per discount.

How to create a discount code in Shopify

Steps to create a discount code in the Shopify admin
The same form builds automatic discounts; only the Method changes.

The example below creates a 15% welcome code for the whole order. The steps follow Shopify’s amount off discounts guide.

Step 1: Choose the type and method

  1. From your Shopify admin, go to Discounts.
  2. Click Create discount.
  3. From the Select discount type menu, click Amount off orders (or Amount off products if the sale only covers some items).
  4. Under Method, select Discount code.

Step 2: Name the code and set the value

In the Discount code section, type a code customers can remember, such as WELCOME15, or click Generate code for a random one. Random codes are harder to guess and share on coupon sites, which is useful for one-off codes. In the Value section, select Percentage and enter 15, or select Fixed amount and enter a money value.

For a product discount, the Applies to setting lets you choose Specific products or Specific collections. Using a collection is usually easier to maintain: add new products to the collection and they are included automatically.

Step 3: Add requirements and limits

  • Minimum requirements: choose Minimum purchase amount or Minimum quantity of items. Shopify counts product prices only, not shipping or taxes.
  • Eligibility: choose All customers, Specific customers, Customer segments or Markets. Segments are handy for “customers who haven’t ordered in 6 months” style win-back offers.
  • Maximum discount uses: tick Limit number of times this discount can be used in total for a “first 100 customers” offer, and Limit to one per customer for welcome codes. Shopify tracks the per-customer limit by email address or phone number.

Step 4: Set combinations and dates, then save

In Combinations, tick the discount classes this code may combine with (more on this below). In Active dates, set a start date and, if the offer should expire, click Set end date. Times follow the time zone set in your admin, so check it before you schedule a midnight launch. Leaving the end date blank means the code never expires. Optionally add Tags to keep campaigns organised, then click Save.

How to create an automatic discount

The form is nearly identical. After choosing the discount type, select Automatic discount under Method, then enter a Title. Write the title for the customer, because it appears in the cart and at checkout: “Autumn sale: 20% off knitwear” explains itself, while “AUT-KNIT-20” does not.

Set the value, what it applies to, any minimum requirement, eligibility, combinations and active dates in the same way as a code, then click Save. There is no Maximum discount uses section for automatic discounts, so if you need a hard cap on redemptions, a code is the right tool.

If you sell in person, the form also offers an option to use the automatic discount on Point of Sale. Shopify notes that automatic discounts at retail locations need POS Pro; locations on POS Lite do not apply them.

Setting up a Buy X get Y offer

Flow of a Shopify Buy X get Y discount from cart to checkout
Shopify never adds the free item for the customer, so tell shoppers to add it.

Buy X get Y is the type merchants most often set up wrong, because the customer has to do more of the work. Following Shopify’s Buy X get Y guide:

  1. Go to Discounts > Create discount and choose Buy X get Y.
  2. Choose Discount code or Automatic discount under Method, then enter the code or title.
  3. In Customer buys, select Minimum quantity of items or Minimum purchase amount, enter the threshold and add the qualifying products or collections.
  4. In Customer gets, enter the quantity and add the products or collections that will be discounted.
  5. Under At a discounted value, select Percentage, Amount off each or Free.
  6. Optionally tick Set a maximum number of uses per order so a customer cannot fill the cart with free items.
  7. Set eligibility, combinations and active dates, then click Save.

The crucial detail: Shopify never adds the free or discounted item to the cart for the customer. If your offer is “buy any hoodie, get a cap free”, the shopper must add both the hoodie and the cap. Say this clearly on the product page and in the cart, for example “Add a cap to your cart and it’s free with any hoodie”. Also keep the “get” item in stock; if it sells out, the discount can no longer be used.

How discount combinations work

Combinations decide whether two offers can apply to the same order. Each discount belongs to one class, product, order or shipping, and in the Combinations section you tick which classes it may combine with. According to Shopify, every store can combine:

  • order discounts with shipping discounts,
  • product discounts with shipping discounts,
  • product discounts with other product discounts on different items.

Product + order and order + order combinations are available to eligible stores (Shopify lists exceptions such as stores with checkout.liquid customisations), and multiple product discounts on the same line item are a Shopify Plus feature. Two shipping discounts never combine.

Both sides have to agree. An automatic discount and a code only stack if each is set to combine with the other’s class. If they cannot combine, Shopify applies the best discount for the cart, and a customer who tries to add a code that doesn’t combine sees a message at checkout that the discount couldn’t be used with existing discounts.

The order of calculation also matters: product discounts apply first, then order discounts on the reduced subtotal, then shipping discounts. That is why a product sale can push a basket under the minimum of an order discount or free shipping offer. Decide before launch whether that is acceptable.

Combinations work on the Online Store, the Storefront API and Shopify POS. Shopify notes that external checkouts on channels such as Facebook, Instagram and Google don’t support them.

Share a code as a link or QR code

Example shareable discount link URL with a redirect parameter
Add a redirect so the link applies the code and opens the right collection.

Typing codes loses customers, especially on mobile. Shopify can turn any active discount code into a link that applies it automatically:

  1. Go to Discounts and open the discount code.
  2. Click Promote, then select Get a shareable discount code.
  3. Choose the page, product or collection the link should open, and optionally attach a marketing campaign for tracking.
  4. Click Copy link, or download the QR code for printed inserts and in-store signs.

By default a shareable link opens your home page. To send customers somewhere else, Shopify’s managing discount codes article explains that you can add a redirect parameter to the URL:

https://your-store.com/discount/WELCOME15?redirect=/collections/sale

Use the link in emails, social posts and popups. If you collect emails with a popup, our overview of Shopify discount popup apps shows how stores deliver a welcome code at the moment of sign-up.

Show the offer on your storefront

An automatic discount that nobody knows about doesn’t change behaviour; it just lowers your margin on orders that would have happened anyway. Announce every promotion where shoppers make decisions:

  • Announcement bar: in Online Store > Themes > Customize, edit the announcement bar with the offer and link it to the sale collection.
  • Collection page: create a collection for the sale items and link to it from the home page and menu.
  • Product pages: add a short text block near the price explaining the offer, especially for Buy X get Y.
  • Seasonal landing page: for bigger campaigns, a dedicated page with the offer, the products and the end date works better than a banner. Our Halloween discount roundup shows how theme shops present seasonal deals.

A page-builder template makes these promotional sections quicker to build. Fashionify, a T-shirt template built with PageFly, has room for a sale strip and collection blocks that suit “buy 2 get 1” offers on lower-priced items, and Coatify, a coats and jackets template, gives seasonal clearance sales a clean product-grid layout.

Common mistakes and how to fix them

  • Using a 0% or $0 discount as a placeholder. Shopify warns these may not work correctly; use at least 1% or $0.01.
  • Wrong method. You built a code but wanted it automatic. The method can’t be changed, so delete the discount and recreate it.
  • No end date on a “limited” sale. A blank end date means the code works forever, including after the code leaks to coupon sites.
  • Unplanned stacking. A 20% product sale plus a 15% welcome code plus free shipping can wipe out the margin. Review the Combinations of every active discount before a campaign starts.
  • Buy X get Y item not in the cart. Customers expect the free item to appear. It won’t, so tell them to add it.
  • Time zone surprises. A sale meant to start at midnight in New York starts at midnight in whatever time zone your admin uses.

Before announcing, test every offer: add qualifying and non-qualifying products to the cart, go to checkout, try the code with and without the automatic discount active, and check that the totals match what your banner promises. You can see the discount applied before you reach the payment step.

Wrap-up: your next step

Start with two discounts that cover most stores’ needs: a WELCOME code limited to one use per customer for new subscribers, and one automatic discount for your current seasonal sale with a clear title and an end date. Set their combinations on purpose, share the code as a link instead of plain text, and add the offer to your announcement bar and product pages. After the campaign, open Analytics to compare sales and average order value with the weeks before, and keep the offers that brought new orders rather than just cheaper ones. If you want to raise order values further, pair discounts with bundles; our list of Shopify product bundle apps is a good place to start.