# Create a pro rata discount

> Pro rata discounts are applied evenly among all eligible items in the cart.

> For the complete documentation index, see [llms.txt](https://docs.talon.one/llms.txt).

This can be useful for managing returns. For example, if a customer returns one of the
products they purchased, only the proportional part of the discount corresponding
to that product will be rolled back. In other cases, accounting regulations and laws may
require discounts to be applied pro rata.

Imagine a clothing store wants to
[create a campaign](/docs/product/campaigns/create-and-manage-campaigns.md#create-a-campaign-from-scratch)
that gives a total discount of €30 on all pairs of shoes in the cart. Assuming the customer
purchases three pairs worth €55, €60, and €115, the pro rata discounts are €7.17,
€7.82, and €15 respectively. This gives us a total discount value of
€29.99. The error is fixed by adding the deficit amount to the highest discounted item.

To do this, we use [cart item filters](/docs/product/rules/cart-item-filters/overview.md).

Let's create:

1. A cart item filter to filter items by category (in our example, shoes).
1. A [promotion rule](/docs/product/rules/overview.md#promotion-rules) to issue a pro rata discount
   on all pairs of shoes in the cart.

## Filter the cart items by item category

Let's filter the cart by product category to find all the shoes in it. This will allow
us to create rules on those items.

**Filter items by conditions**:

- Attribute is **Item category (Item)**.
- **Is equal to** `shoes`.
- **Save as** `shoesfilter`.

To the right of the filter name, you can see the kind of value assigned to our filter. In this
case, it is **list of cart items**. This means that this filter will be available wherever
other lists, such as the list of cart items, are available.

## Issue a pro rata discount on the selected items

Let's [create a rule](/docs/product/rules/create-and-manage-rules.md#create-a-promotion-rule) to
issue a €30 discount on all pairs of shoes in the cart. The discount will be applied to
each pair in direct proportion to its price.

Let's name the rule `30 euro pro rata on shoes`. It has one condition and one effect.

### Condition

**Always Trigger Effects**.

### Effect

**Discount individual items pro rata**:

- **List of items** is `shoesfilter`.
- **Discount name** is `30 pro rata`.
- **Discount value** is `30`.
- **Allow lower discount value if budget is insufficient** is `Application Default Settings`.

## Related pages

- [Create and manage rules](/docs/product/rules/create-and-manage-rules.md)
- [Create and manage item bundles](/docs/product/rules/create-and-manage-bundles.md)
