Shopify Discount Codes: How to Create, Share and Auto-Apply Them

How to create a Shopify discount code, share it as a link, and show the right code to the right visitor.

Nikolett LorinczUpdated · 10 min read
In this article
  1. What is a Shopify discount code?
  2. The discount types in Shopify
  3. How to create a discount code in Shopify, step by step
  4. Shopify discount links: share a code that applies itself
  5. One shared code vs. unique codes vs. automatic discounts
  6. Combining discount codes and the limits to know
  7. How to show the right code to the right visitor
  8. How OptiMonk creates, hands out and applies Shopify codes
  9. Shopify discount code FAQ
  10. Put the right code in front of the right shopper

In short

Shopify discount codes give shoppers money off, a free item or free shipping when they enter the code at checkout. They matter because the right code turns a browser into a buyer. Create one under Discounts in your admin, then share it as a link or a popup.

Most discount codes fail long before the payment page. The shopper never saw the code, forgot it somewhere between the email and the cart, or found a bigger one on a coupon site.

Making the code is the easy part: it takes a couple of minutes in Shopify. The harder part is deciding who gets which code, and how it reaches them at the moment they're ready to buy.

What is a Shopify discount code?

A Shopify discount code is a word or string, like WELCOME10, that a shopper enters at checkout to get an amount off, a buy X get Y deal or free shipping. You create it in your Shopify admin under Discounts, then share it as a code, a shareable link or a popup.

Shopify gives you two ways to discount: a discount code, which the shopper types in, and an automatic discount, which applies itself when the cart meets your conditions. Codes work in your online store and in person with Shopify POS.

Discount codeAutomatic discount
How it appliesThe shopper enters it at checkoutApplies itself in the cart and at checkout when the conditions are met
Best forEmail campaigns, partners, popups, first-order offersSitewide sales, collection promos, bulk purchases
Watch out forForgotten codes; shared codes ending up on coupon sitesShoppers may not notice it; it can give a bigger discount than you meant
Store limitUp to 20,000,000 unique codes per storeUp to 25 active automatic discounts, app-based ones included

Sources: Shopify Help Center, discount methods, discount codes and automatic discounts.

The discount types in Shopify

Every Shopify discount, code or automatic, is one of these types. The type decides what the shopper gets; the settings decide who gets it and when.

TypeWhat it givesExample
Amount off productsA percentage or fixed amount off specific products or collections10% off one collection
Amount off ordersA percentage or fixed amount off the whole order, often with a minimum10% off orders above a set amount
Buy X get YA discount on some items once the shopper buys a set quantity or spends a set amountBuy two, get the third free
Free shippingFree shipping for orders that meet your criteria, with an option to exclude expensive ratesFree shipping above a set order value

Amount off discounts don't cover shipping costs; that's what the free shipping type is for. For the full setup, see our guide to free shipping on Shopify.

For tiered discounts or several conditions in one offer, Shopify points you to discount apps, or Checkout Blocks on Shopify Plus. Still choosing what to offer? Start with these common discount codes.

How to create a discount code in Shopify, step by step

Here's the desktop flow for an amount off code, with the field names your admin shows today (Shopify Help Center):

  • Go to Discounts in your Shopify admin and click Create discount.
  • Pick the type. In the Select discount type menu, click Amount off products or Amount off orders.
  • Choose the method. Under Method, select Discount code. (Automatic discount is the other option.)
  • Name the code, or click Generate code for a random one. Leave out special characters: the code goes into the checkout URL.
  • Set the Value. Choose Percentage or Fixed amount and enter the number.
  • Choose what it applies to. For a product discount, the Applies to section lets you pick Specific products or Specific collections.
  • Add Minimum requirements if you need them: Minimum purchase amount or Minimum quantity of items.
  • Set Eligibility: All customers, Specific customers, Customer segments or Markets. For a VIP code, pick Customer segments.
  • Limit the uses under Maximum discount uses: "Limit number of times this discount can be used in total" and "Limit to one per customer". For a first-order code, tick one per customer (Shopify tracks the email address or phone number).
  • Turn on Combinations only for the discount classes this code may stack with (more on that below).
  • Set the Active dates. Pick a start date, and click Set end date if the offer ends. The times follow your store's time zone.
  • Click Save.

Buy X get Y and free shipping codes start the same way. Only the middle differs: Buy X get Y asks what the customer buys and gets, and free shipping asks for countries and can exclude shipping rates over a set amount. One code can apply to up to 100 specific customers, products and variants.

A shareable discount link adds the code to the shopper's cart when they click it, so there's nothing to type. It's the simplest fix for the forgotten code.

To get one (Shopify Help Center):

  • In Discounts, click the name of the discount you want to promote.
  • Click Promote, then Get a shareable link. (In the Shopify mobile app, it's Get a shareable discount code.)
  • Choose the page, product or collection the link should open.
  • Optional: pick a marketing campaign, and Shopify adds its UTM parameters to the link.
  • Click Copy link, or download the QR code.

The link uses the format yourstore.com/discount/CODE. To send shoppers to a different page, you can also edit the link by hand: change /discount/CODE to /discount/CODE?redirect=/collections/sale, with the path of the page you want.

A few limits to know:

  • One discount per link, and only for active discounts.
  • No link for app-created codes. If a third-party app made the discount, the admin can't give you a link for it.
  • It sticks. The discount stays in the cart and the browser until the shopper clicks Remove discount at checkout.

Use discount links in emails, SMS, social posts and influencer bios, or as a QR code in the package. OptiMonk doesn't send emails or SMS; your email or SMS tool carries the link.

One shared code vs. unique codes vs. automatic discounts

Use an automatic discount when everyone should get the deal, one shared code when you want to know where the sale came from, and a unique code when the offer is meant for one shopper only.

SituationUseWhy
A sitewide sale everyone should getAutomatic discountNobody has to find or type anything
A newsletter, influencer or partner codeOne shared code, plus its linkEasy to say out loud, and the Sales by discount report shows its use
A first-order welcome offerA unique, single-use codeIt can't be passed around
An exit-intent or cart-saving offerA unique code with a short expiryThe deadline is real for each shopper
Lucky wheel or scratch card prizesOne code per prizeEach slice or card gives exactly what it shows

A shared code is easy to remember, which is the problem: once it's on a coupon site, anyone can use it. A unique code works once, so passing it on is worth nothing.

In the Create discount flow, you type or generate one code per discount. For a different code for every shopper, you need an app. A popup can also create them, one per visitor (see below).

What are unique single-use coupon codes? Codes that belong to one shopper and stop working after one order. For ways to use them, see these coupon examples.

Combining discount codes and the limits to know

Shopify lets shoppers stack discounts only if you allow it on each discount, and only up to a limit. Each discount has a class: product, order or shipping (Shopify Help Center).

  • Up to 5 product or order discount codes and 1 shipping discount code can go on the same order. That limit counts codes from shareable links too.
  • Combining is set per discount. In its Combinations section, tick the classes it may combine with. Two discounts stack only if each allows the other's class.
  • If two discounts can't combine, the shopper gets the better one.
  • Product discounts come first. Order discounts are then taken off the subtotal.
  • Store limits: up to 25 active automatic discounts and 20,000,000 unique discount codes per store.

Three settings protect your margin on every code:

  • A minimum purchase amount, so small orders don't get the discount.
  • Limit to one per customer, so a welcome offer stays a welcome offer.
  • An end date, so an old code doesn't keep working.

For the bigger picture, see our discount strategy guide and how to offer online coupons without killing your profits.

How to show the right code to the right visitor

A code only earns its cost when the right person sees it at the right moment. A popup can wait for a trigger, pick its audience and show the matching code.

First-time visitors

Show a welcome popup a few seconds into the first visit, and hide it from people who already subscribed. Give a unique, single-use code with one use per customer, so the first-order offer stays first-order only. More in our guide to welcome popups.

Shoppers about to leave

Use exit intent, on desktop and on mobile, to catch shoppers as they leave. A unique code with a short expiry gives them a real reason to finish now. For offer ideas, see these abandoned cart coupon code ideas, and for the whole recovery flow, our guide to abandoned cart recovery on Shopify.

Carts under a threshold

Target by cart value and show the offer only to shoppers below your goal. Free shipping or an amount off orders code with a minimum purchase amount pulls the order over the line.

Building the popup itself? Our step-by-step guide to a discount popup for your Shopify store covers it.

Discount code popups from the OptiMonk Popup Library

These popups come from the OptiMonk Popup Library, each designed by the OptiMonk agent for a real brand. Under each, you'll find the Shopify settings its offer needs. More are in the welcome discount collection.

The Immersive Try-On (designed for Warby Parker)

Welcome popup designed for Warby Parker with the headline "Your first pair is waiting.", 10% off the first order, an email field, a "Reveal my code" button and a "No thanks" link

A classic first-order offer: 10% off for an email, and a button that says what happens next, "Reveal my code". In Shopify, use a unique, single-use code with Limit to one per customer. More buttons like it: CTA button examples.

See this popup

The Typographic Statement (designed for Everlane)

Exit-intent popup designed for Everlane with the headline "Wait, Don't Go.", 10% off for newsletter sign-ups, an "Enter email for your code" field, a "Claim 10% Off" button and a "Maybe later" link

"Wait, Don't Go." is built for exit intent, and the field label promises the code right away. Pair it with a unique code that expires soon after the shopper sees it, so the offer can't wait for next month.

See this popup

The Typographic Statement (designed for Paul Evans)

Newsletter popup designed for Paul Evans with the headline "Hand-painted luxury. Now within reach.", a fixed amount off the first order above a minimum spend, a "Redeem my code" button and a "Continue browsing" link

The offer is $50 off a first order, but only above a set spend, and the popup says so in one line. In Shopify, that's Amount off orders with a Fixed amount and a Minimum purchase amount.

See this popup

The Immersive Switch (designed for Blueland)

Welcome popup designed for Blueland with the headline "Cleaning looks better in glass.", a 10% off code for any starter kit, a "Redeem 10% off" button and an "I'm just browsing" link

The code works on starter kits only, and the popup says so up front. In Shopify, that's Amount off products with Applies to set to Specific collections, so the code can't be used on the rest of the store.

See this popup

Editorial Minimalist (designed for DedCool)

Welcome popup designed for DedCool with the headline "Smell like yourself.", 15% off the first scent, an email field, a "Get the code" button and a "No thanks" link

One offer, one field, one button. Keep the Shopify side just as simple: one discount at 15% off, and auto-apply on, so the shopper never has to copy the code.

See this popup

How OptiMonk creates, hands out and applies Shopify codes

OptiMonk is an agentic popup builder for online stores. On a connected Shopify store, three features handle the code side of a discount popup.

Discount codes

Discount codes shows a code in the popup, usually on the thank-you step after sign-up. Ask for it in your one-sentence brief ("A welcome popup with 10% off for first-time visitors.") and the code appears in the Coupon step, where you can change it.

The discount has to exist in your store. On Shopify, OptiMonk checks whether the code exists, has expired or has hit its usage limit, and if it's missing, you can click Create it in Shopify. A/B variants can use different codes, and a lucky wheel or scratch card has its own prize table with a code per prize.

Unique codes

Unique codes gives every visitor their own code. Upload a pool of codes (.txt or .csv), or on Shopify choose Shopify coupon: a single-use code is created in your Shopify store when the popup is shown.

You set the discount, an optional prefix like BLACKFRIDAY, and an expiry counted from the moment the visitor sees the code. If an uploaded pool runs out, the campaign stops showing, or visitors see your text instead.

Auto-apply codes

Auto-apply codes puts the code on the order at checkout by itself, so the shopper doesn't have to remember or paste anything. Turn on Automatic redemption in the Coupon panel. With a fixed code, the switch appears once the code is confirmed to exist in Shopify.

It works with fixed codes and Shopify-generated codes on connected Shopify stores. It isn't available for scratch cards. The goal is the same as a shareable link's, nothing to type, but here the code comes from the popup instead of an email.

OptiMonk Coupon step with the Fixed code option selected (WELCOME15), plus the Unique codes and Shopify coupon options, next to the desktop and mobile versions of a 15% off sign-up popup

Describe the popup, the agent builds it

You describe the popup in one sentence, for example:

"Show first-time visitors a popup with a unique 10% code that expires 48 hours after they see it, after 5 seconds, not to subscribers, and auto-apply it at checkout."

The agent designs the popup on brand, writes the copy, builds a separate mobile version and sets the targeting. Then you can test it: A/B test 10% off against free shipping, or the whole design, and run a holdout test to see whether the popup adds orders at all.

For how codes fit into personalized offers, see our guide to ecommerce personalization; for sign-up offers, lead capture; for prize games, gamified popups.

Shopify discount code FAQ

How do I create a discount code on Shopify?

In your Shopify admin, go to Discounts, click Create discount and pick the type, such as Amount off products. Under Method, select Discount code, enter or generate the code, set the value, limits and dates, and click Save.

Can I create a Shopify discount link?

Yes. Open the discount, click Promote, then Get a shareable link, and copy the link or download the QR code. The link looks like yourstore.com/discount/CODE, and adding ?redirect=/collections/sale sends shoppers to a specific page.

What are unique single-use coupon codes?

They're codes made for one shopper that work only once, so they're worth nothing on a coupon site. They suit welcome offers, exit-intent offers and game prizes.

Can customers use more than one discount code on Shopify?

Yes, if you allow it. Customers can use up to 5 product or order discount codes and 1 shipping discount code on the same order, and only when each discount's Combinations setting allows the other's class. If two discounts can't combine, Shopify applies the better one.

What's the difference between a discount code and an automatic discount in Shopify?

A discount code works only when the shopper enters it at checkout, so you decide who gets it. An automatic discount applies itself in the cart and at checkout when the conditions are met, so everyone who qualifies gets it.

Put the right code in front of the right shopper

Create the code in Shopify, or let OptiMonk create a unique one when the popup shows. Then tell the agent in one sentence who should see it and when.

Free to start. No credit card.

Written byNikolett LorinczMore from Nikolett

Keep reading

All articles
OptiMonk monk meditating in lotus pose

Your first popup is
one sentence away.

Free to start. No credit card.