# Limit discounts by products and categories

You can limit the application of discount coupons and promotions to certain products and categories to create **product promos** or **category sales**.

{% hint style="info" %}
If you don't yet have an app for Ecwid API access, start with the following [instructions](https://docs.ecwid.com/discounts-and-tips/customize-discounts/spaces/uOzT5egoVTAjMJwRuMQT/pages/IhHAmacGKQdbD0Fe0IUw#step-2.-get-your-first-application).
{% endhint %}

### Set products and categories for promotion

If you have an existing promotion, you can make it affect only specific products and products from a specific category with the following API call:

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

{
    "targets": {
        "products": [102039482, 236754267],
        "categories": [0, 80056181]
    }
}
```

where `products` and `categories` are arrays of product and category IDs ([find product ID](/api-reference/rest-api/products/search-products.md), [find category ID](/api-reference/rest-api/categories/search-categories.md)).

Change `STOREID` with your store ID, `PROMOTIONID` with the promotion ID ([find promotion ID](/api-reference/rest-api/discounts/promotions/search-promotions.md)), and the `secret_token` with the secret access token of your app.

### Limit promotion by a specific product variation

You can also limit promotion by specific variation IDs to make offers like **10% off for XL blouses**:

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

{
    "targets": {
        "products": [102039482, 236754267],
        "combinations": [1006525572, 1086715627]
    }
}
```

where `combinations` is an array of product combination IDs ([find variation ID](/api-reference/rest-api/products/product-variations/search-product-variations.md)).

Change `STOREID` with your store ID, `PROMOTIONID` with the promotion ID ([find promotion ID](/api-reference/rest-api/discounts/promotions/search-promotions.md)), and the `secret_token` with the secret access token of your app.

### Set products and categories for discount coupon

If you have an existing discount coupon, you can make it work with specific products and products from a specific category 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

{
    "catalogLimit": {
        "products": [102039482, 236754267],
        "categories": [0, 80056181]
    }
}
```

where `products` and `categories` are arrays of product and category IDs ([find product ID](/api-reference/rest-api/products/search-products.md), [find category ID](/api-reference/rest-api/categories/search-categories.md)).

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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ecwid.com/discounts-and-tips/customize-discounts/limit-discounts-by-products-and-categories.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
