# Limit discounts to customer groups

You can limit discount coupons and promotions to certain customer groups to create more engagement for **new or regular customers only**.

{% hint style="info" %}
If you don't yet have an app for Ecwid API access, start with the following [instructions](https://app.gitbook.com/s/uOzT5egoVTAjMJwRuMQT/get-started/set-up-your-dev-environment-in-ecwid#step-2.-get-your-first-application).
{% endhint %}

### Set customer groups for promotion

If you have an existing promotion, you can make it available to specific customer groups with the following API call:

```http
PUT /api/v3/STOREID/promotions/PROMOTIONID
Host: app.ecwid.com
Content-Type: application/json
Authorization: Bearer secret_token

{
    "triggers": {
        "customerGroups": [0, 1006534]
    }
}
```

where `customerGroups` is an array of customer group IDs ([find customer group ID](https://app.gitbook.com/s/G9n5VxMY9T0Ob3D56PSD/rest-api/customers/customer-groups/search-customer-groups)).

Learn more about customer groups in [Help Center](https://support.ecwid.com/hc/en-us/articles/207807105-Customer-groups).

Change `STOREID` with your store ID, `PROMOTIONID` with the promotion ID ([find promotion ID](https://app.gitbook.com/s/G9n5VxMY9T0Ob3D56PSD/rest-api/discounts/promotions/search-promotions)), and the `secret_token` with the secret access token of your app.

### Set customer groups for discount coupon

If you have an existing discount coupon, you can limit its usage to **new or regular customers only** with the following API call:

```http
PUT /api/v3/STOREID/discount_coupons/DISCOUNTCOUPONID
Host: app.ecwid.com
Content-Type: application/json
Authorization: Bearer secret_token

{
    "applicationLimit": "NEW_CUSTOMER_ONLY"
}
```

where `applicationLimit` must be one of:

* `UNLIMITED` - no user application limits (use it to remove the limitation).
* `NEW_CUSTOMER_ONLY` - discount coupon can be applied only by customers without placed orders. Unique customers are defined by the email they enter at the checkout.
* `REPEAT_CUSTOMER_ONLY` - discount coupon can be applied only by customers who placed orders in the store before. Unique customers are defined by the email they enter at the checkout.

Change `STOREID` with your store ID, `DISCOUNTCOUPONID` with the discount coupon ID ([find discount coupon ID](https://app.gitbook.com/s/G9n5VxMY9T0Ob3D56PSD/rest-api/discounts/discount-coupons/search-discount-coupons)), and the `secret_token` with the secret access token of your app.
