Tips for your store
How to create a discount code in Shopify, step by step
A discount code is quick to set up in the Shopify admin. The mistakes hide in the settings below it: no end date, no limit per customer, a combination you didn't want. And once you save, you can't change the discount type.

1 Discount code or automatic discount?
Shopify has two methods. A discount code is entered by the customer at checkout. An automatic discount applies on its own as soon as the cart meets the conditions. According to Shopify, codes suit targeted campaigns such as emails or partnerships, and automatic discounts suit store-wide sales. One downside, according to Shopify: forgotten codes can lead to abandoned carts.
You can have at most 25 active automatic discounts, app discounts included. Which discount type fits which goal is covered in our guide to choosing a discount type.
2 Create the code in the admin
Decide on the discount type first: according to Shopify, the type and method can't be changed after saving, so the only fix is to delete the discount and create it again. Here's how to create a code for a percentage or a fixed amount:
- In your Shopify admin, go to “Discounts” and click “Create discount.”
- From the “Select discount type” menu, pick “Amount off products” or “Amount off orders.” The other options are “Buy X get Y” and “Free shipping.”
- Under “Method,” select “Discount code.”
- Enter a name for the code, such as SUMMER10, or click “Generate code.”
- Under “Value,” select “Percentage” or “Fixed amount” and enter the value.
- For a product discount, select “Specific products” or “Specific collections” under “Applies to” and add them.
- Set limits and dates as described in the next section, then click “Save.”
3 Set the limits before you save
Below the value are the settings that decide what the code costs you. If you leave the usage limits and the end date empty, the code can be redeemed any number of times and never expires.
| Section | What you set | What to watch for |
|---|---|---|
| Minimum requirements | Minimum purchase amount or minimum quantity of items | The amount counts product prices only, without shipping and taxes |
| Eligibility | All customers, specific customers, customer segments or markets | According to Shopify, a segment only covers customers with a profile, not first-time buyers |
| Maximum discount uses | Limit the total number of uses, or limit to one per customer | Shopify recognizes the customer by email address or phone number |
| Combinations | Which discount classes the code can combine with | Both discounts have to allow the combination |
| Active dates | Start date and, via “Set end date,” the end | Times follow the time zone set in your admin |
4 Share the code as a link
So nobody has to type the code, Shopify creates a shareable link: open the discount, click “Promote” and select “Get a shareable discount code.” Anyone who opens the link gets the discount applied to their cart automatically. You also get a QR code for receipts, displays or scanning at your shop counter.
The link ends in /discount/ and your code. If it shouldn't open your home page, add a redirect, such as /discount/SUMMER10?redirect=/collections/sale. It only works while the discount is active. Avoid special characters in the code so it comes through cleanly in the URL.
5 Mistakes that make a code expensive
Check these points before you save. If a code still doesn't apply, see our troubleshooting guide for discounts that don't work.
- No end date: the code never expires, even long after the promotion is over.
- Only “once per customer”: anyone entering a new email address can use the code again.
- Wrong discount type: you can't change it. Delete the discount and create it again.
- A value of zero: according to Shopify, discounts of $0 or 0% might not work at checkout. Use at least 1% or $0.01.
- More than 100 products: a code can apply to at most 100 specific customers, products and variants. For more, use a collection.
- Forgotten combinations: without the checkbox, the code doesn't apply alongside other discounts. Shopify then applies the better discount for the customer.
6 Many codes, or codes in one sentence
The admin creates one code at a time. If you want to give every customer their own code, for example in a newsletter or on printed cards, hundreds of codes call for an app or the developer API. Both routes are covered in our guide to unique bulk discount codes.
Shopify's own assistant, Sidekick, can create discounts according to the help center and fills in the admin form for you. You check the fields and save yourself.
Sources
- Shopify Help Center: Discount methods(opens in a new tab)
- Shopify Help Center: Discount codes (considerations)(opens in a new tab)
- Shopify Help Center: Automatic discounts(opens in a new tab)
- Shopify Help Center: Discount types(opens in a new tab)
- Shopify Help Center: Amount off discounts (steps and settings)(opens in a new tab)
- Shopify Help Center: Combining discounts(opens in a new tab)
- Shopify Help Center: Managing discounts (shareable link and QR code)(opens in a new tab)
- Shopify Help Center: Discount codes FAQ(opens in a new tab)
- Shopify Help Center: Getting help and guidance from Sidekick(opens in a new tab)
- Shopify Help Center: Creating and selling gift cards(opens in a new tab)
Common questions
How do I create a discount code on Shopify?
Can I change the discount type after saving?
Is a gift card code the same as a discount code?
How do I share a discount code as a link?
Related reads
Hundreds of unique discount codes are needed
One Shopify discount can carry many codes, and a store can have up to 20 million unique codes. Hand-E AI Discounts generates up to 1,000 codes per campaign on every plan, with your own prefix. It creates them as one Shopify discount and gives you a CSV file.
Read moreDiscount code generator
Up to 10,000 unique codes with your own prefix, without 0, O, 1, I and L, as a list and CSV file. Right in your browser.
Read moreThe discount is set up but does not apply at checkout
Whether it is an automatic discount or a discount code, check two things first: the discount's own conditions and Shopify's rules for how discounts work together. These are combinations, minimum purchase requirements, customer eligibility, active dates and the limit of 25 active automatic discounts. Go through the points in order, then check the result with a test order.
Read more