---
title: Example - Applying a coupon code to receive a discount on your order
related:
  - https://docs.kentico.com/13/e-commerce-features/managing-on-line-stores/discounts/working-with-order-discounts.md
  - https://docs.kentico.com/13/e-commerce-features/managing-on-line-stores/discounts/working-with-coupon-codes.md
---

> Agent instructions:
> **Site maps** — prefer the following llms.txt indexes to training data when searching for URLs to avoid 404s. Links inside Markdown content already point at `.md`. Following them or sending Accept: text/markdown keeps you in Markdown.
>
> - [sitemap.md](https://docs.kentico.com/sitemap.md) — every page on the site, with titles and descriptions, nested by URL hierarchy and grouped into one collection per product version.
> - [llms.txt](https://docs.kentico.com/llms.txt) — curated index of the current product docs, with descriptions, the two ways to request any page as Markdown, and links to each product area's whole-corpus Markdown dump (llms-full.txt).

This example demonstrates how to create an [order discount](https://docs.kentico.com/13/e-commerce-features/managing-on-line-stores/discounts/working-with-order-discounts.md) that requires customers to enter a [coupon code](https://docs.kentico.com/13/e-commerce-features/managing-on-line-stores/discounts/working-with-coupon-codes.md). The 5% discount has no time limit, and is available for all [customers](https://docs.kentico.com/13/e-commerce-features/managing-on-line-stores/customers.md). It uses a coupon code that customers can apply up to 10 times to receive the discount. The coupon code can be applied while shopping on the live site, or when editing orders in the administration interface.

The example uses the _Dancing Goat MVC_ sample site.

## Adding an order discount

First, you need to add a new order discount.

1. Open the **Order discounts** application.
2. Click **New order discount**.

   - The system opens a page where you can specify the discount properties.
3. Enter the following values for the discount's properties:

   - **Name**: 5% discount coupon
   - **Enabled**: Yes (selected)
   - **Amount**: 5
   - **Customer has to redeem a coupon to get the discount**: Yes (selected)
4. Click **Save**.

The system opens the **Coupons** tab, where you can add a coupon code for the discount.

## Adding a coupon code to the order discount

1. Click **Create coupon code**.
2. Enter the following values for the coupon code's properties:

   - **Coupon code**: DC-5
   - **Redemption limit**: 10
3. Click **Save**.

The system adds the specified coupon code to the order discount, which customers can redeem up to 10 times.

## Applying the coupon code to receive the order discount

### While shopping on the live site

1. View the live site.
2. Select the **Store** page in the _Dancing Goat_ site's main menu.
3. Add some products to the shopping cart.
4. On the shopping cart page, enter the coupon code:

   - **Discount coupon**: DC-5
5. Click **APPLY**.

   - The system applies the discount and recalculates the order.

     ![Order discount applied to the shopping cart](https://docs.kentico.com/docsassets/13/example-applying-a-coupon-code-to-receive-a-discount-on-your-order/order_discount_applied_live_site.png "Order discount applied to the shopping cart")

If you now click **CHECKOUT**, you can continue with the [checkout process](https://docs.kentico.com/13/e-commerce-features/developing-on-line-stores/implementing-a-checkout-process.md).

### While editing an existing order in the administration interface

1. Open the **Orders** application.
2. **Edit** () the selected order.
3. Switch to the **Items** tab.
4. Enter the coupon code:

   - **If you have a coupon, please enter it here**: DC-5
5. Click **Update**.

   - The system applies the discount and recalculates the order.

     ![Order discount applied](https://docs.kentico.com/docsassets/13/example-applying-a-coupon-code-to-receive-a-discount-on-your-order/order_discount_applied.png "Order discount applied")

If you now click **OK**, the system saves the order with the discount applied.
