# Commission by category

> Give a category, a brand or a single product a different rate from the standard one – e.g. 0% on gift cards or more on high-margin products.

Your program has one standard rate that covers everything. On top of it you can add **exceptions**: a different rate for a category, a brand or a single product. Typical uses are 0% on gift cards, a lower rate on low-margin products or a higher rate on your own brand.

Exceptions are for programs that pay a percentage per sale. A program with a flat amount per sale or per lead always uses its flat amount.

## Setting it up

1. Open **Program** in the dashboard and find the **Commission by category** panel below the price.
2. Click **Add exception** and choose what it applies to: **Category**, **Brand** or **Product**.
3. Type the category or brand – the list suggests the ones we know from your catalogue – or search for the product.
4. Enter the rate as **Affiliate gets** or as **Your total price**. The other figure is calculated, exactly as for the standard rate.
5. Click **Save rates**.

The rate is the affiliate's rate, like the standard rate, and can be from 0 to 50%. The network fee is still 20% of your total price.

## Which rate applies to a product

- A **product** beats a **brand**, and a brand beats a **category**. Products without an exception earn the standard rate.
- A category also covers its subcategories: "Men" covers "Men > Shoes". If both "Men" and "Shoes" exist, the most precise one ("Shoes") wins.
- Upper and lower case and extra spaces don't matter. Category paths are written with `>` ("Men > Shoes").

Commission is calculated per line item. The sale's basis – the goods after discounts, excluding VAT and shipping – is split across the products by price, and each part is multiplied by its rate. A sale of DKK 1,000 excl. VAT with shoes for DKK 600 (Men, 15%) and a gift card for DKK 400 (0%) earns DKK 90 in commission. The sale detail – yours and the affiliate's – shows the commission per product.

## Where the category comes from

Rates are used on sales that arrive with line items. The category comes from the line item, otherwise from your catalogue, which we fetch under **Products**:

| Setup | Line items | Category and brand |
|---|---|---|
| Shopify app | Yes | From your catalogue (product type and vendor), looked up by product id |
| WooCommerce plugin | Yes | With the sale (path, all categories and brand) from version 1.16.0, otherwise from the catalogue |
| Google Analytics route | Yes, GA4's `items` | `item_category` to `item_category5` and `item_brand`, otherwise from the catalogue |
| Store API and the server snippets | Yes, `items` | `category`, `categories`, `brand` and `sku` on each line, otherwise from the catalogue |
| Sale line on the receipt | With `data-affilyflow-items` | As the store API |
| Stripe | No | The standard rate |

Categories from your catalogue arrive with the next catalogue fetch – click **Sync now** under Products if the list in the panel is empty. See [Products and feed](https://www.affilyflow.com/en/docs/store/products-and-feed).

The panel on Program shows how many of your products we know the category for, and how many line items in your recent sales could be placed in a category. If your sales arrive without line items, the panel says so, and the standard rate applies until they do. Subscriptions (Stripe, renewals) always use the standard rate.

## Changes are fair to affiliates

- A **higher** rate applies right away.
- A **lower** rate – including a new exception below what the products earned before, or removing an exception that was higher – applies **14 days** after you save. Joined affiliates are notified with the date.
- A decrease counts towards the rule of **at most one decrease per 30 days**, together with the standard rate.
- If no affiliate has a link yet, everything applies right away.

The rate is locked at the click: a sale is always calculated with the rates that applied when the customer clicked – just like the standard rate.

## Refunds

A partial refund reduces the commission in the same proportion as the basis, also when the products had different rates. See [Approval and refunds](https://www.affilyflow.com/en/docs/store/approval-and-refunds).

Source: https://www.affilyflow.com/en/docs/store/commission-by-category
