> For the complete documentation index, see [llms.txt](https://docs.yedric.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.yedric.ai/shopify/capabilities/discount-codes.md).

# Discount codes

Allow the Yedric assistant to offer single-use discount codes in situations you choose, with team approval by default before a code is sent.

Your assistant can offer a single-use discount code in the situations you allow, such as apologizing for a problem. By default it asks your team first instead of sending a code itself. Discount codes are off for a new store and available on every plan.

***

## Turning it on

1. Open **Capabilities > Discount codes** and turn on the switch.
2. Set the limits below.
3. Click **Save**. The first time, Shopify asks you to let Yedric create discount codes.

[image:Screenshot of the Yedric Discount codes capability page (Apps > Yedric > Capabilities > Discount codes) with the switch on and the settings visible: "Send codes without asking the team first", "Only for shoppers logged in to their account", the Discount, Minimum order and expiry fields, and the "When a discount may be offered" checkboxes. Spotlight the "When a discount may be offered" checkboxes.]

***

## Settings

* **Send codes without asking the team first**: Off by default. While it is off, the assistant tells the shopper a discount needs someone from your team and offers to connect them.
* **Only for shoppers logged in to their account (their codes work for them alone)**: Codes go only to logged-in shoppers and are tied to their account.
* **Discount**: The percentage off, from 1% to 50%. 10% by default.
* **Minimum order**: The smallest order the code works on.
* **Code expires after (hours)**: 48 hours by default.
* **When a discount may be offered**:
  * **To apologize for a problem**
  * **To finish an abandoned checkout**
  * **For a first order**
  * **For a returning customer**

The first two are on by default. Every code is single use, and the assistant offers at most one per conversation.

***

## What shoppers see

When a discount fits one of the situations you allowed, the assistant sends the code as a card with **Apply to cart**. One click applies it to the shopper's cart.

[image:Screenshot of the Yedric chat open on a Shopify storefront, where the assistant apologizes for a late order and shows a discount code card with the code, "10% off" and an "Apply to cart" button. Spotlight the "Apply to cart" button.]

***

## Related

* [Abandoned cart recovery](https://docs.yedric.ai/shopify/capabilities/abandoned-cart/) can suggest a discount with the checkout link, using these same rules.
