# How to create discount codes

Offering discounts can be a marketing strategy that you use to drive sales in your Shopify store. To offer discounts, you can create discount codes, set up automatic discounts, or set sale prices for individual products.

You can create codes for a dollar value discount, a percentage discount, a buy X get Y discount, or a free shipping discount. Customers can enter discount codes online at checkout, or in person if you're using [Shopify POS](https://help.shopify.com/en/manual/sell-in-person/shopify-pos/discount-management).

When you offer a discount on an order, the discount is applied to the subtotal of the order before taxes. Discounts apply to the price of the product being sold in the order. Sales tax is always applied to the order subtotal after an order discount is applied.

You can update and manage existing discounts from the **Discounts** page in Shopify. Before you update a discount, check if another staff member might also be making changes to the same discount.

**Learn how to create discount codes:**

{% embed url="<https://www.youtube.com/watch?v=xPh847CVqy8>" %}

You might want to use discounts as a way to promote sales and special offers, or as customer loyalty rewards. You can create discounts for orders, products, or shipping. The following discount types are available:

* You can create a discount code or an automatic discount to offer [buy X get Y](https://help.shopify.com/en/manual/discounts/discount-types/buy-x-get-y)
* You can create a discount code or an automatic discount to offer an [amount off](https://help.shopify.com/en/manual/discounts/discount-types/percentage-fixed-amount)
* You can create a discount code or an automatic discount to offer [free shipping](https://help.shopify.com/en/manual/discounts/discount-types/free-shipping)

\
**When you create a discount code, you can configure the following details:**

* The dates for which the code is valid
* The number of times that a code can be used
* A minimum order amount before the code can be used
* Which products, collections, or variants the discount can be applied to
* If the discount combines with other discount classes

Your customers can redeem discount codes in your online store and in person if you're using [Shopify POS](https://help.shopify.com/en/manual/sell-in-person/shopify-pos/discount-management).

All Shopify plans include discount codes.

After your discount codes are set up, you can use the [**Sales by discount**](https://help.shopify.com/en/manual/reports-and-analytics/shopify-reports/report-types/default-reports/sales-report#sales-by-discount) report to find out how often your discount codes are being used.

**Tip**

You can duplicate an existing discount from the Shopify admin, or from the Shopify app on a mobile device:

* From your Shopify admin, select the discount, and then click **Duplicate**.
* From the Shopify app on a mobile device, tap the discount, and then tap **...** > **Duplicate discount**

#### Considerations for creating discount codes <a href="#considerations-for-creating-discount-codes" id="considerations-for-creating-discount-codes"></a>

Before you create a discount code, review the following considerations:

* A discount code can apply to up to 100 specific customers, products, and variants.
* There's a limit of 20,000,000 unique discount codes for each store.
* To ensure that discount code names are added correctly to your store's checkout URL, avoid using special characters in the name of the discount code.
* Collections can't contain individual variants. If you add a product variant to a discounted collection, then the discount applies to every version of the product.
* If you create a discount with a start and end time, then the time is based on the [time zone that you selected in your Shopify admin](https://help.shopify.com/en/manual/intro-to-shopify/initial-setup/setup-business-settings#set-or-change-your-store-time-zone). For example, if your store’s time zone is Eastern Standard Time (EST) and you select a start date of November 26, then your discount starts at 12:00 a.m. EST on November 26.
* A discount with the maximum use of one per customer applies only to that specific discount. If you delete that discount and then add in a duplicate with the same maximum use restriction, then customers who used the previous discount can also use this new discount one time.

<br>


---

# 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://nutmegstudio-co.gitbook.io/shopify/chapter-4-creating-discounts/how-to-create-discount-codes.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.
