# Create a Cart Price Rule in Magento 2.x

An automation in Personal Discount needs a Cart Price Rule to which it will be adding coupon codes.

You can prepare a Cart Price Rule in your Magento admin panel.

Navigate to Marketing > Cart Price Rules and click on Add New Rule.

![Magento Cart Price Rules](https://3731721370-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LZdVZovthV0SPlgxS6Y%2F-L_keOpeQ-3zS9FpAaUB%2F-L_kg_VvCjMyFTxEQDVm%2Fimage.png?alt=media\&token=5501cccd-6a1c-49e1-9844-4391986bb03d)

Cart Price Rules in Magento provide a variety of options. The essential ones are:

**Rule Name** - will appear on the select list in Personal Discount

![](https://3731721370-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LZdVZovthV0SPlgxS6Y%2F-L_keOpeQ-3zS9FpAaUB%2F-L_kpf-wBAPM6rnTj_AH%2Fimage.png?alt=media\&token=f7105b4e-fcc7-44a0-b484-a44e80893ba5)

**Active** - yes

**Websites** - select all, unless you want to limit the coupon to specific website

**Customer Groups** - select all, unless you want to limit the coupon to a specific customer group

![](https://3731721370-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LZdVZovthV0SPlgxS6Y%2F-L_keOpeQ-3zS9FpAaUB%2F-L_kq4W4jYVcT4XkH0C-%2Fimage.png?alt=media\&token=6ca1d955-ab4a-4012-bd90-2a5179ae7c87)

&#x20;**Coupon** - Specific Coupon

&#x20;**Use Auto Generation** - checked, this is key for Personal Discount to work properly

![](https://3731721370-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LZdVZovthV0SPlgxS6Y%2F-L_keOpeQ-3zS9FpAaUB%2F-L_kqcTefeavzjT14vMo%2Fimage.png?alt=media\&token=ccffab00-e91f-4e6f-b219-792e537ee311)

**Uses per Coupon** - how many times a customer can use a coupon code

**Apply** - discount type, possible choices are:

* Percent of product price discount
* Fixed amount discount&#x20;
* Fixed amount discount for whole cart
* Buy X get Y

**Discount Amount**

![](https://3731721370-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LZdVZovthV0SPlgxS6Y%2F-L_keOpeQ-3zS9FpAaUB%2F-L_ksS1BEdW29bvrVi0J%2Fimage.png?alt=media\&token=d75d9c3d-ba7e-4a9d-88e6-7dfedfe52f0b)

Save the Price Rule and switch to Personal Discount automation settings. Now, you can select the newly created "Welcome 10% off" as a Cart price rule for your automation.

![](https://3731721370-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LZdVZovthV0SPlgxS6Y%2F-L_keOpeQ-3zS9FpAaUB%2F-L_kt-HlQQH4rb5YJ6ki%2Fimage.png?alt=media\&token=c4939d90-9265-4c32-8ce2-0d1a4c4992da)

The automation will start adding coupon codes to the selected Price Rule. You can find the generated coupons in the Manage Coupon Codes section of your Cart Price Rule:

![](https://3731721370-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LZdVZovthV0SPlgxS6Y%2F-L_keOpeQ-3zS9FpAaUB%2F-L_ku4gUJWH31k3C4-dg%2Fimage.png?alt=media\&token=09a57065-6e4f-4d4d-a54e-5668353e6e67)

{% hint style="info" %}
You won't see expiration date in the coupon codes table, because it's a limitation of Magento API. However, Personal Discount keeps track of when the coupon should expire and removes them at a right time.
{% endhint %}
