Table of Contents
If you’re using Magento 2 to run your online store, a great way to get more sales and customers is to offer coupon codes. Coupons can help you sell more items, get rid of old stock, and give customers a reason to come back.
In this article, we’ll guide you step-by-step through creating and managing coupon codes in Magento 2 — even if you have no experience with it!
Types of Coupon Codes in Magento 2
There are two main ways of creating coupons:
- Specific Coupon Code – You generate one code (e.g., SAVE20).
- Auto-Generated Codes – Magento creates a ton of unique codes for you.
Let’s go over how to create both.
Case 1: Create a Single Coupon Code
To create a single code manually:
- Go to your Admin Panel.
- Navigate to Marketing > Cart Price Rules.
- Click Add New Rule.
- Under the Coupon section, select Specific Coupon.
- Type your desired Coupon Code (like “EDYI20”).
- (Optional) Set how many times it can be used in total or by each customer.
- Make sure “Use Auto Generation” is unchecked.
That’s it! Now save your rule.
Case 2: Create Multiple Auto-Generated Coupon Codes in Magento 2
To let Magento create many unique codes for you:
- Redo steps 1–3 above (new Cart Price Rule).
- In the Coupon section, check the box for “Use Auto Generation”.
- Enter a number of times each coupon can be used.
- Save the rule, then go to the Manage Coupon Codes tab.
Now configure:
- Coupon Quantity – How many codes you want to generate
- Code Length – How long each code should be (e.g., 6 characters).
- Code Format – Choose from:
- Alphanumeric (letters and numbers, e.g., A1B2C3)
- Alphabetical (letters only, e.g., ABCDEF)
- Numeric (numbers only, e.g., 123456)
- Alphanumeric (letters and numbers, e.g., A1B2C3)
- Code Prefix – Optional word at the start of the code (e.g., SALE-).
- Code Suffix – Optional word at the end of the code (e.g., -2025).
- Dash Every X Characters – Adds dashes to increase the readability of long codes (e.g., ABCD-1234).
Once you’re done, click Generate.
You may see a list of all the new codes. You can export them (e.g. for embedding in emails), then save the Cart Price Rule.
How to View and Manage Coupon Code Reports
Want to track how your coupons are being used? Magento makes that easy too.
- In the Admin Panel, go to Reports > Sales > Coupons.
- If you have multiple stores, pick the Store View in the top-left corner.
- Click the yellow box to refresh the latest data.
- Set your filters:
- Date Range (From and To)
- Period (Day, Month, or Year)
- Order Status (like Complete, Processing, etc.)
- Cart Price Rule – Choose Any to see all coupons, or pick a specific rule to filter.
- Date Range (From and To)
- Click Show Report in the top-right corner.
- Your report will appear at the bottom — and you can download it as a CSV file.
Conclusion
With Magento 2, creating and handling coupon codes is simple. You can make just one discount code or a lot of different codes for a special promotion. The tools you need are already included in the platform. Follow this guide to enhance your marketing, reward your customers, and boost your sales!