Coupon codes are an integral part of most promotions, discounts, and special offers in the eCommerce store. It allows your customers to avail the discounted prices. It also helps the owner store to retain customers, and they inevitably come back to your website again. You can generate single or bulk Coupon Codes for a particular customer or product, group, or anyone relying upon the purpose, requirement, or campaign.
Latest Update: Magesolution ’ve just released the version 2.0 of Claue Multipurpose Magento 2 Theme with a bunch of performance improvements and exclusive features. Claue is an excellent template for a modern and clean eCommerce store with 40+ homepage layouts and tons of options for shop, blog, portfolio, store locator layouts and other useful pages. Check this theme out now: Claue Magento Theme 2. 0
So, let’s get to the main topic, shall we?
What is a Coupon code in Magento 2?

Coupon codes are implemented with cart price rules to apply a discount when a set of conditions is met. For instance, a coupon code can be generated for a specific customer group, or for people who buy over a certain amount. To use the coupon code to purchase, the purchaser can enter the coupon code in the cart, or at the cash register of your brick and mortar store.
There are 2 types of coupon code: fixed coupon code used for all customers and auto-created coupon codes used for each customer. For the fixed coupon code, the admin can promote it by sending it to buyer’s emails with ease, showcasing it on the promotional popup, catalogs, banners, or printing it to give to the customers directly. At that time, the second type of coupon code is more personal, which will just be sent to buyers’ emails.
In Magento 2, coupon codes are generated and applied with Cart Price Rules – a set of conditions that the customers’ shopping cart must fulfill in order to have the discount.
How to Create a Specific Coupon

This method is used in the Cart Price Rule settings.
- At the
Rule Information
tab, underGeneral Information
, transferCoupon
toSpecific Coupon
. - Enter the
Coupon Code
- Restrict how many times the coupon can be redeemed in the Uses per Coupon and User per Customer. Leave them empty to set no restrictions.
- Uses per Coupon sets the number of times the coupon code is used.
- Uses per Customer sets the number of times the coupon code is used by the same buyer.
- If there are many cart price rules at the same time, you should set up the active time and priority to manage them effectively.
- Click
Save
to activate the coupon code.
How to create a batch of coupons
If you need to create a large number of coupons, for instance, 100 or more, you can utilize an auto-generation tool. For this, you also need to generate a new cart price rule and move to the Rule Information section, then do the following steps:
- View this article to create a shopping cart price rule.
- Under Coupon Code, choose the Use Auto Generation checkbox.
- To restrict the number of times each customer can use the coupon, enter the number of Uses per Customer.
- Scroll down and click the Manage Coupon Codes section. Then, do the following
- For Coupons Qty, enter the number of coupons that you want to create
- Enter the Code Length, not including the prefix, suffix, or separators.
- Set up the Code Format to one of the following:
Alphanumeric
Alphabetical
Numeric
- Enter a Code Prefix to be added to the beginning of the code (Optional)
- Enter a Code Suffix to be added to the end of the code (Optional)
- In the Dash Every X Characters field, enter the number of characters between each dash (Optional)
- When finished, click Generate.The list of generated codes appears below.
How to configure coupon codes?
With Magento 2, the configurations control the length and format of auto-generated coupons. You can configure Numeric, Alphabetical, or Alphanumeric format easily. Besides, you can use the dash to make code easier to read. Let’s see the guide to configure coupon codes.
- Move to Stores > Settings > Configuration.
- Open the Customers tab and select Promotions.
- Expand the Auto-Generated Specific Coupon Codes section.
- Enter the number of code symbols in the Code Length field.
- Select the needed format from the Code Format dropdown.
- If you need to include a prefix or suffix to your code, enter the needed value in the corresponding fields.
- To add separators to your code, specify the number of characters between each dash in the Dash Every X Characters field.
- Save the changes.
Still, If you need any assistance with that, connect with our Magento 2 Developers and check out our Magento 2 extensions and our Magento 2 themes to support your website.