Quick answer: In Shopify admin, create one discount, then use its option to generate a batch of unique codes, set each to one use, and export them as a CSV. If you need codes in a specific format, or want to plan them before setting up the discount, our free coupon code generator creates random codes in bulk with your own prefix and length.
A single public code like BLACKFRIDAY20 ends up on coupon sites within hours. Unique, single-use codes stop that, let you see which email or influencer drove a sale, and make one-per-customer offers actually one per customer.
When to use unique codes instead of one shared code
- Email and SMS welcome offers, so the code can't be shared publicly
- Influencer and affiliate campaigns, to track each partner
- Customer service apologies and win-back offers
- Printed inserts and event giveaways
- Black Friday early access for subscribers only
A shared code is still fine for a store-wide public sale. Better yet, use an automatic discount so nobody needs a code at all.
Option 1: Generate codes inside Shopify
- Go to Discounts and create the discount (amount off products, order, buy X get Y or free shipping).
- Set the value, eligibility, minimum purchase and dates.
- Under usage limits, limit each code to one use.
- Save, then use the option to generate codes for that discount. Set how many and, if offered, the length and prefix.
- Export the codes as a CSV and load them into your email tool or send them to partners.
Shopify's limits on how many codes you can generate per batch and per store change from time to time, so check the generate dialog in your admin. Email platforms like Klaviyo and Shopify Email can also create unique codes per recipient automatically.
Option 2: Use a coupon code generator
A generator is useful when you want to plan codes in a spreadsheet, need a specific format for print, or want to hand a list to a partner before the discount is live. Our coupon and promo code generator lets you set a prefix (like VIP-), length and characters, and avoids look-alike characters such as 0/O and 1/I.
Codes you generate outside Shopify still need to exist in Shopify to work at checkout. You can add them through the admin, an app or the Admin API.
Code formats that work
| Use | Example |
|---|---|
| Welcome email | WELCOME-7KQ9RT |
| Influencer | MAYA-X4P2 |
| Black Friday early access | BFVIP-2HW8ZN |
| Printed insert | THANKS-R6M3 |
A readable prefix tells you the source at a glance in reports. A random part of six or more characters makes codes hard to guess.
Stop codes leaking and protect your margin
- Limit each code to one use, and to one per customer where it makes sense.
- Set an end date. Old codes floating around are a common margin leak.
- Exclude products with thin margins or already on sale.
- Check whether discounts can stack with your automatic discounts.
- Watch your discount report for codes used far more than expected.
Before setting the discount value, work out what you can afford. Our Black Friday discount strategy guide and the profit calculator help you find the number.
Add urgency without fake timers
A real end date works better than a countdown that resets on every visit, which shoppers notice. If you add a timer, the countdown timer generator builds one tied to a fixed date. For the rest of your sale prep, see the Shopify Black Friday checklist.
Frequently asked questions
Can Shopify generate unique discount codes in bulk?
Yes. After creating a discount, you can generate a batch of unique codes for it and export them. Check your admin for the current limits per batch.
How do I make a discount code single-use on Shopify?
In the discount settings, limit the number of times the discount can be used in total, or limit it to one use per customer.
Can I upload my own list of codes to Shopify?
Not directly from a CSV in the standard admin. Apps or the Admin API can create codes from your list.
Is the coupon code generator free?
Yes. It's free, needs no sign-up and runs in your browser.
Related services
- Shopify Gift Cards, Store Credit & Promo Setup – discounts and promos set up without margin leaks
- Shopify Black Friday & Holiday Sale Readiness – your sale tested before traffic arrives
- Klaviyo Email & SMS Flows Setup – unique codes delivered automatically by email