Sales, discounts, and special offers drive people to your store and help to gain their loyalty. However, the smarter you manage them the more effective they turn out to be. 

Magento 2 coupon code is an integral part of every sale on your Magento 2 store. Those codes are applied via the cart price rules, and you can create them for certain customers, separate customer groups, specific products, and the entire catalogue. Besides, you can do that in bulk or separately. 

Sounds quite promising, right?

So, let's teach you how to create coupon codes in Magento.

How to Create Coupon Code in Magento 2?

To create a Magento coupon code take the following steps:

1. Navigate to Marketing > Promotions > Cart Price Rules and press the Add New Rule button.

2. Set the Name for the rule and add the Description.

3. Activate the rule and select the Websites the coupon code will apply on.

4. Specify the Customer Groups a coupon will work for.

New cart price rule

5. In the Coupon field, select a Specific Coupon and enter the Coupon Code in the next field.

6. Set the Uses per Coupon to define how many times the coupon code can be used. If there is no limit for the coupon code, leave this field blank.

7. Specify the Uses per Customer to define how many times the same registered user can apply this coupon code. Leave it blank to not set a limit.

Note: this setting doesn't apply to the guest customers (NOT LOGGED IN group) and customers who haven't signed in to make a purchase.

8. Add the From and To Date to specify the time during which the Magento coupon code will be valid.

9. Set the Priority of this coupon code.

Note: priority defines which rule (coupon code) will be applied if multiple rules fit the conditions. The lower the number, the higher the priority.

10. Choose whether to make the coupon Public in RSS Feed.

Create coupon in Magento 2

11. Set the Conditions the shopping cart should meet for the Magento coupon code to be applied. Correspondingly, the conditions are based on Cart Attributes only.

Magento coupon code conditions

12. Navigate to the Actions section.

  • Choose how to Apply the coupon code: Percent of product price discount, Fixed amount discount, Fixed amount discount for the whole cart, Buy X get Y (discount amount is Y).
  • Enter the Discount Amount.
  • Set the Maximum Qty Discount is Applied To field to specify the maximum number of the same product a customer can purchase to get a discount on the same purchase.
  • If you have chosen the Buy X get Y (discount amount is Y) discount, add the Discount Qty Step (Buy X).
  • Choose whether to apply the coupon code to the Shipping Amount to define how the discount will be applied: to cart items only or to subtotal (including shipping rates).
  • Choose if you want to Discard Subsequent Rules to avoid an unintended discount from multiple applied price rules.

Coupon code discount

  • Define the additional Conditions to apply the coupon code.
  • Choose if you want to add the discount to Free Shipping and how you want it to be applied to it.

Coupon Code Conditons

Once you finish, don't forget to Save the coupon code and check it on the storefront. Just add products to the cart to meet the conditions of the rule and apply the coupon.

Magento Shopping Cart

Special coupons are good for special occasions like certain holidays. However, if you don't want to be so specific about the text of Magento coupon code, you can generate coupon codes automatically.


Magento 2 Coupon Code Extension is a tool that allows you to generate coupon code links based on cart price rules and apply them automatically. It enables you to redirect customers to any of your store pages and...

one-time payment
Buy Now Live Demo

Create Multiple Coupon Codes in Magento

When creating automatically generated coupon codes in Magento you also have to set the conditions, discount amount, and other options we've just covered. The only thing is you select the Use Auto-Generation option which means you don't need to enter your custom coupon code.

Coupon codes auto generation

Except for the above-mentioned steps, there are a few more additional actions to take:

1. Go to the Manage Coupon Codes section.

2. Enter the Coupon Qty to specify how many coupon codes you want to generate.

3. Set the coupon Code Length.

4. Select the Code Format.

5. Enter the Code Suffix and Prefix to be included in the code. You may use it to distinguish auto-generated coupon codes from the other coupons.

6. Fill out the Dash Every X Character field and press the Generate button.

Manage coupon codes in Magento 2

Coupons are generated by cron and added to the queue, so it can take a while to generate them, especially if you want to create coupons in bulk. But, don't forget to Save the rule while you wait. 

Once the coupon codes are generated, you will see them in the grid.

Auto generated coupons in Magento

How to Apply Magento Coupon Codes Automatically?

Once you create coupon codes in Magento, the last thing to do is to provide them to your customers. 

However, what are the chances customers copy the code and paste your coupon on checkout or shopping cart? 

The easier it is to apply the coupons the more likely customers will do that. Any extra steps like copying, pasting, or entering coupon codes manually will only complicate the shopping process. 

Thus, you might want to allow your customers to apply coupon codes automatically or add products to their carts just as they apply the coupon. This allows you to improve customer experience in your store and boost your sales.