Shopify discount codes: how to create one and set it up properly

Creating a Shopify discount code takes two minutes. Most problems come later, from a setting you didn't think about. This guide walks through the screen field by field, then shows how to check the code the way a shopper will use it.

By Mark Barron, founder of CampaignCart QA ·

Short version: Shopify discount codes are created in your admin. Go to Discounts → Create discount, choose the type, keep the method on Discount code, set the value and what it applies to, then check four settings before saving: minimum requirements, eligibility, maximum uses and combinations. Then test it in a private browser window as a guest, on desktop and on your phone.

How to create a discount code in Shopify

  1. In your Shopify admin, open Discounts and click Create discount.
  2. Pick the type. For a sale code you'll usually want Amount off products (only some products) or Amount off order (the whole cart). The other types are Buy X get Y and Free shipping.
  3. Leave the method on Discount code and type the code, or use Generate random code. Customers have to type it at checkout unless you share a discount link.
  4. Set the value: a percentage or a fixed amount.
  5. For product discounts, choose what it applies to: specific collections or specific products.
  6. Work through the settings below, then click Save.

The settings that decide whether the code works

These are the fields on the Create discount screen. Each one is a common reason a code fails for some shoppers and not others.

SettingOptionsWhat goes wrong
Applies toSpecific collections or specific productsA promoted product isn't in the collection, or only one variant was picked. The shopper sees "isn't valid for the items in your cart".
EligibilityAll customers, markets, customer segments or specific customersA segment code fails for first-time buyers, and can disappear for a guest once they enter their email. A market-limited code fails for shoppers in another market. Options vary by discount type.
Minimum purchase requirementsNone, minimum amount, or minimum quantity"20% off" with a $50 minimum fails on a $30 cart, and shoppers read it as broken.
Maximum discount usesLimit total uses and/or one use per customerA capped code stops working mid-sale. A one-per-customer code fails for returning customers.
CombinationsWhich other product, order or shipping discounts it can combine withBy default a new discount won't combine with others. If an automatic discount is running, the code may be rejected or lose to the better offer.
Active datesStart date and time, optional end dateTimes follow your admin's time zone, not the shopper's. The sale can start or end hours off.

The troubleshooting guide covers each failure in more detail, and the error message pages explain exactly what each checkout message means.

Discount code or automatic discount?

An automatic discount applies itself when the cart qualifies. A code only applies when the shopper types it, or arrives through a discount link. Codes are better when you want to track a channel (an email, an influencer, a single ad). Automatic discounts are better when you don't want shoppers to miss out.

Running both at once is the setup most likely to give a result you didn't expect. If they're not set to combine, Shopify gives the shopper the better-value one and the other is dropped. We explain the rules in Shopify discount combinations.

Sharing the code

You can send the code itself, or a discount link that adds it for the shopper. A link means nobody has to type the code, so a typo can't cause "Enter a valid discount code". Keep codes to letters and numbers: Shopify warns that special characters may not carry through to a checkout link correctly.

How to test a Shopify discount code before you send it

The admin tells you the code exists. It doesn't tell you what a shopper sees. Before the email goes out:

  1. Open a private browser window, so you aren't logged in to your store.
  2. Go to a product you're promoting, add it to the cart and go to checkout.
  3. Enter the code and look at the discount line.
  4. Work out the number yourself: 20% of a $85.00 item is $17.00. Check it matches to the cent.
  5. Do the same on your phone.
  6. Stop before payment. You don't need to place an order.

The full checklist, including what to recheck the day before launch, is in how to test a Shopify discount code before launch.

Let the checkout check run itself

CampaignCart QA does the test above for you: a real guest checkout on desktop and mobile, the expected discount against the one checkout showed, and screenshots. It stops before payment. It currently works with US stores in USD and English, percentage codes and one-time products. There are 3 free checks per store.

See it on the Shopify App Store

Sources

Field names are as they appear in the Shopify admin in November 2026. Shopify does rename things, so if your screen looks different, the Help Center is the authority.