# Discounts

> Create discount codes and automatic discounts for your online store: money off products or orders, buy X get Y, and free shipping.

Discounts lower what shoppers pay on your online store. A discount is either a **code** that shoppers type at checkout, like `SUMMER20`, or an **automatic** discount that applies by itself when the cart qualifies.

Open **Commerce → Discounts**. Anyone with Commerce access can view discounts; you need the `commerce.manage` permission to create or change them.

> **Note**
>
> Discounts apply to online store orders. The [Point of Sale](https://workstation.repzo.com/docs/pos) keeps its own discounts and doesn't use these yet.

## Create a discount

1. Click **Create discount**.
2. Pick a type. You can't change the type after the discount is created.

   | Type | Use it to |
   |---|---|
   | **Amount off products** | Discount specific products or collections. |
   | **Amount off order** | Discount the whole order. |
   | **Buy X get Y** | Discount products when customers buy something. |
   | **Free shipping** | Offer free shipping on an order. |

3. Choose the **Method**:
   - **Discount code**: enter a code, or click **Generate** for a random one. Codes use letters, numbers, `-` and `_`, at least 3 characters. They're saved in capital letters and must be unique in your workspace. The **Title** is optional and only you see it.
   - **Automatic discount**: give it a **Title**. Shoppers see the title in their cart and at checkout.
4. Fill in the value and conditions (below).
5. Set the **Status** to **Active**, or **Draft (not usable yet)**, and click **Save discount**.

The **Summary** card on the right describes the discount in plain words as you build it, for example "10% off 3 products · Minimum purchase of $50 · One use per customer".

## Discount value

For **Amount off products** and **Amount off order**:

- Choose **Percentage** (1 to 100) or **Fixed amount**.
- For a fixed amount off products, tick **Only apply the amount once per order** to take it off once. Otherwise it comes off each eligible item.
- Under **Applies to**, pick **All products**, **Specific products**, or **Specific collections**.

For **Buy X get Y**:

- **Customer buys**: a **Minimum quantity of items** or a **Minimum purchase amount**, from the products or collections you pick.
- **Customer gets**: how many of which items, and at what value: **Percentage off**, **Amount off each**, or **Free**. Customers must add these items to their cart themselves; the discount never adds items.
- Optionally, **Set a maximum number of uses per order**.

The cheapest qualifying units are the ones discounted.

For **Free shipping**:

- **Countries**: **All countries**, or **Selected countries**.
- Tick **Exclude shipping rates over a certain amount** to only cover cheaper rates.

Fixed amounts are set in your workspace's base currency. When a store sells in another currency, they're converted at your exchange rates. See [Markets](https://workstation.repzo.com/docs/online-store/markets).

## Conditions

| Section | Options |
|---|---|
| **Minimum purchase requirements** | **No minimum requirements**, **Minimum purchase amount**, or **Minimum quantity of items**. Only the items the discount applies to count toward the minimum. |
| **Customer eligibility** | **All customers**, **Specific customer segments**, or **Specific customers**. Segments come from [Segments](https://workstation.repzo.com/docs/marketing/segments). |
| **Maximum discount uses** | **Limit number of times this discount can be used in total**, and **Limit to one use per customer**. |
| **Combinations** | Which other discounts this one can be used with: **Product discounts**, **Order discounts**, **Shipping discounts**. |
| **Active dates** | **Start date** and **Start time**. Tick **Set end date** to add an end. |
| **Sales channels** | The sites this discount works on. Leave it empty to use it on every site. |

The shopper is recognized by their store account, or by the email or phone they give at checkout. That is how customer eligibility and "one use per customer" are checked.

## How the store applies discounts

Shoppers type codes in the **Discount code** field of the checkout's order summary. Automatic discounts are added by themselves. The cart and checkout show what each line saves and which discounts were applied.

Workstation follows these rules:

- Discounts apply in order: product discounts, then order discounts, then shipping.
- Each line gets one product discount, the best one for that line.
- Two discounts are used together only when each allows the other's type under **Combinations**. Otherwise the shopper gets whichever set saves them the most.
- An order can use up to 5 product or order codes and 1 shipping code.
- Totals never go below zero.

When a code can't be used, the shopper sees why, in English or Arabic. For example: "This discount code has expired" or "Your cart doesn't meet this discount's minimum yet". A code that isn't valid at all isn't kept on the cart. A code that could start working later, such as one waiting for a minimum, stays on the cart.

When two shoppers race for the last use of a limited discount, only one checkout gets it. The order shows the discounts it received, and its invoice keeps the discounted prices.

If an unpaid order is canceled, or a card checkout expires, the order's discount uses are given back, so they count toward usage limits again.

## Many codes for one discount

A code discount can have many codes, for example one per customer or a batch to hand out at an event. Save the discount first, then use the **Codes** card:

1. Click **Generate codes**.
2. Enter **How many codes** (up to 5,000 at a time), an optional **Prefix** like `SUMMER-`, and the number of **Random characters** (6 to 16).
3. Click to generate. A discount can hold up to 20,000 codes.

Every code works for the discount, and the usage limit counts all of its codes together. In the Codes card you can search codes, see each code's uses, delete selected codes, and **Export** them as a CSV file. A code discount always keeps at least one code; to remove the last one, delete the discount. Changing the main code in the form leaves the generated codes as they are.

## Manage discounts

The list shows each discount's **Title**, **Status**, **Method**, **Type**, **Used** count, and **Active dates**. Use the tabs to see **All**, **Active**, **Scheduled**, **Expired**, or **Draft** discounts, and search by title or code.

Open a discount to see its **Performance** in the Summary card: uses, orders, sales, total savings, and the top codes when it has many. From **More actions** you can:

- **Duplicate** it. The copy starts as a draft.
- **Deactivate** it to end it now. It moves to **Expired** and keeps its history.
- **Delete discount**. Shoppers can't use it any more, and orders that already got it keep their prices.

## Automate around discounts

Discounts send `discount` [webhooks](https://workstation.repzo.com/docs/administration/webhooks) when they're created, updated, or deleted. Fox can list discounts and draft a new one for you; creating it always asks for your approval first.

## Related pages

- [Products and collections](https://workstation.repzo.com/docs/online-store/products-and-collections)
- [Checkout and payments](https://workstation.repzo.com/docs/online-store/checkout-and-payments)
- [Shipping and delivery](https://workstation.repzo.com/docs/online-store/shipping-and-delivery)
- [Markets](https://workstation.repzo.com/docs/online-store/markets)
- [Segments](https://workstation.repzo.com/docs/marketing/segments)
- [Orders](https://workstation.repzo.com/docs/commerce/orders)
