# Discount Codes Provide specific Cart Discounts to eligible customers with Discount Codes. Discount Codes, also known as promo codes or coupon codes, are alphanumeric sequences of characters offered to specific Customers to receive a [Cart Discount](/merchant-center/cart-discounts.md). The related discount is applied as soon as the Discount Code is added to a Customer's Cart. Discount Codes are subject to a [limit](/api/limits.md#discount-codes) in a Project. If the default fields available for configuring Discount Codes do not fit your business needs, you can extend the [DiscountCode](/urn?urn=ctp%3Aapi%3Atype%3ADiscountCode) model using the [Custom Fields API](/api/projects/custom-fields.md). The Merchant Center supports editing the values of Custom Fields configured for Discount Code. Learn more about Discount Codes in our self-paced [Discount Codes](/learning-price-and-discount-your-products/discount-codes/overview.md) module. ## Create a Discount Code 1. Go to **Discounts > Discount code list**. 2. Click **Add discount code**. 3. In the **General Info** section, follow these steps: 1. Optional: For **Discount code name**, enter the localized names for the Discount Code. 2. Optional: For **Discount code description**, enter the localized descriptions for the Discount Code. 3. Optional: For **Discount code key**, enter a unique key to identify the Discount Code. 4. Optional: For **Valid from**, select the date and time from when the Discount Code is valid. 5. Optional: For **Valid until**, select the date and time until when the Discount Code is valid. 6. Optional: For **Max applications**, enter the total number of times the Discount Code can apply (across all Carts). 7. Optional: For **Max applications per customer**, enter the total number of times a Customer can use the discount (across all Carts). A Discount Code can be applied only once on the same Cart. If applied, a Discount Code application is counted every time an Order is created, and is not restored if the Order is canceled. If both **Max applications** and **Max applications per customer** are set, the per-customer usage is included in the **Max applications** count. 8. For **Code**, enter a unique value for the Discount Code. The value cannot be updated after creation. 9. Optional: For **Groups**, enter one or more values for the Discount Code, which can be used as tags to group and find relevant Discount Codes in the Discount code list easier. 4. Optional: In the **Condition** section, if the text box is left empty, the Discount Code (when applied) will be effective on all Carts. If you define a predicate condition, the Discount Code (when applied) will only be effective on Carts matching the defined condition. For more information on the syntax, see [Predicate syntax](/api/predicates/predicate-operators.md#predicate-syntax). 5. In the **Cart discounts** section, add the Cart Discounts that should take effect on the Cart when the Discount Code is applied. Stores are determined by the selected Cart Discount. To apply the Discount Code to another Store, select a Cart Discount associated with that Store. Only 10 Cart Discounts can be added. The Cart Discount with the higher rank (closer to 1) takes precedence. For more information, see [Create a Cart Discount](/merchant-center/cart-discounts.md#create-a-cart-discount). 6. Click **Save**. By default, new Discount Codes are inactive and must be [activated](/merchant-center/discount-codes.md#activate-discount-codes) to be applicable on a Cart. 7. Optional: If a Custom Field is defined for the Discount Code, select it from the drop-down on the **Custom Fields** tab, and depending on the field type, enter or select the value for it. ## Generate Discount Codes 1. Go to **Discounts > Generate discount codes**. 2. In the **General information** section, follow these steps: 1. For **Quantity of Discount Codes**, enter the number of Discount Codes to generate. 2. Optional: For **Discount code case**, choose the character casing for the Discount Codes. By default, the Discount Codes are generated in mixed case. 3. For **Total number of characters for each code**, enter the number of characters the Discount Codes should have. 4. Optional: For **Prefix for each code**, enter the prefix that each Discount Code should have. The characters in the prefix contribute to the total character count of the Discount Code. To prevent duplicates, use at least 10 characters for each code and a unique prefix for each batch; for example, `SUMMER26-00000`. 3. In the **Discount code fields** section, follow these steps: 1. Optional: For **Discount code name**, enter the localized name for the Discount Codes. 2. Optional: For **Discount code description**, enter the localized description for the Discount Codes. 3. Optional: For **Discount code status**, choose whether the Discount Codes should be active or inactive. 4. Optional: For **Valid from**, select the date and time from when the Discount Codes are valid. 5. Optional: For **Valid until**, select the date and time until when the Discount Codes are valid. 6. Optional: For **Max applications**, enter the maximum number of times each Discount Code can be used (across all Carts). 7. Optional: For **Max applications per customer**, enter the maximum number of times each Discount Code can be used by a single Customer (across all of their Carts). 8. Optional: For **Cart condition (Predicate)**, enter a condition to apply the Discount Codes only on Carts matching the defined condition. For more information, see [Predicate syntax](/api/predicates/predicate-operators.md#predicate-syntax). If a predicate condition is not defined, the Discount Codes can be applied on all Carts. 4. In the **Cart Discounts** section, link the Discount Codes to the Cart Discounts. Only Cart Discounts that have a key, require a Discount Code, and match your [Cart Discount permissions](/merchant-center/user-permissions.md#cart-discounts) are available for selection. You can add up to 10 Cart Discounts for each Discount Code. 5. Click **Next**. You can preview or download the generated Discount Codes. 6. To save the generated Discount Codes, click **Next** and then click **Start import**. ## Import Discount Codes For more information about importing resources into the Merchant Center, see [Import data](/merchant-center/import-data.md). 1. Go to **Discounts > Discount code list**. 2. Click the **Actions** drop-down and select **Import discount codes**. 3. In the **Import discount codes by CSV** window, choose a CSV file on your computer to upload, and click **Upload and preview**. 4. After the file is uploaded and validated, verify the rows and columns to be imported, and click **Continue**. 5. Click **Start import** to confirm the import process. As the import process is a background task, you do not need to wait for it to complete. To check the import status, go to **Operations > Import**. ## Export Discount Codes See [export Discount Codes](/merchant-center/export-data.md#export-discount-codes). ## Activate Discount Codes 1. Go to **Discounts > Discount code list**. 2. Select the Discount Codes, and in the **Actions** drop-down, select **Activate** and then click **Confirm**. ## Search and filter Discount Codes You can search for available Discount Codes by the their code, name, or discount group. The search is case-sensitive and looks for exact or partial matches. To enable partial search in your Project, contact the [commercetools support team](https://support.commercetools.com/). To narrow your search results, use filters by clicking **Filters** and selecting any of the available filters in the sidebar: - **Status**: filters Discount Codes that are activate or deactivate. - **Store**: filters Discount Codes by their Store association. To view and access Stores, you must have the [appropriate permissions](/merchant-center/user-permissions.md#discount-codes). For better performance, the following filters are available for lists with less than 300,000 entries: - **Discount schedule**: filters Discount Codes based on whether a validity period is defined or not. - **Date created**: filters Discount Codes created on a specified date or within specified dates. - **Date modified**: filters Discount Codes last modified on a specified date or within specified dates. - **Created by**: filters Discount Codes created by you or by anyone else. - **Max code applications**: filters Discount Codes by the specified number of times that a specific Discount Code can be redeemed. - **Max code applications per customer**: filters Discount Codes by the specified number of times a Customer can redeem a specific Discount Code. You can also combine all the above filters using **AND** or **OR** operators. However, note that the resulting list can change based on the selected filters and operator (**AND** or **OR**). ## Related pages - [Area overview page with navigation](/merchant-center.md) - [Previous page: Cart Discounts](/merchant-center/cart-discounts.md)