> ## Documentation Index
> Fetch the complete documentation index at: https://docs.moshi.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Discount codes

> Offer a discount in a flow, learn how shoppers get their codes, and track code use.

A flow can offer shoppers a discount.
Moshi creates each discount code in your Shopify store.
The shopper gets the discount in the conversation or by email or text.

## Before you start

You need a connected Shopify store. See [Shopify](https://docs.moshi.ai/integrations/shopify.md).
Without a connected store, Moshi uses a sample code that checkout does not accept.

## Set up a discount

**1. Open the Incentives stage**

Open the flow in the flow builder, then go to the Incentives stage.

**2. Choose the type and amount**

Under Type, select Percentage or Fixed amount.
Enter the Discount amount.

**3. Choose when to show the discount**

Select an option under When to show. The table below describes each option.

**4. Choose the delivery channel**

For After contact captured, select Email, Text, or both under Delivery channel.

**5. Set subscriptions**

Turn on Apply to subscriptions if the code must work on subscription orders.

| When to show | What happens |
| - | - |
| Immediately in conversation | The product cards in the chat include the discount. |
| After contact captured | The shopper shares an email address or phone number. Moshi sends the code by email, text, or both. |
| After goal completed | The shopper completes the flow's goal. Moshi sends the code by email and text. |
| After product recommendation finished | The shopper finishes the recommendation survey. The product cards in the chat then include the discount. This option shows only for flows with a recommendation survey. |

A flow can have an immediate discount and a larger contact discount.
The agent then tells the shopper about the larger offer.
For example, the shopper gets 10% now, or 15% after sharing an email address.

Moshi does not create free-shipping codes.
A Moshi code can combine with a free-shipping discount in your store.

## How shoppers get a code

For a discount in the chat, the product cards include the discount.
The agent does not write the code in the chat.
Moshi creates the code when the shopper taps a product card.
The card link applies the code to the cart.

For a discount that Moshi sends, the shopper gets an email or text with the code.
The message has a link to shop with the discount applied.
The code shows in the chat after the shopper taps that link.
Until then, the agent asks the shopper to check their inbox.

In both cases, the shopper does not need to type the code.
Each conversation gets one code for each discount. Moshi reuses that code.

## Code rules

| Setting | Value |
| - | - |
| Format | `MOSHI-10OFF-B7KL6` for a 10% code. The last five characters are random. |
| Uses | One use in total. After that, the code does not work. |
| Customers | Any customer can use the code. |
| End date | None. The code works until a shopper uses it. |
| Products | The products in the flow. Other products in the same cart pay full price. |
| Combines with | Shipping discounts only. It does not combine with other product or order discounts. |
| Minimum order | None. |
| Subscriptions | With Apply to subscriptions on, the code covers one-time purchases and the first subscription order. |

When Apply to subscriptions is off, the code covers one-time purchases only.
Moshi ignores Apply to subscriptions when the flow's products have no Shopify subscription plan.

Codes stay active when you pause or end a flow.
To stop an unused code, deactivate it in Shopify admin.

Simulator conversations create real codes in your store.
Each code works only once, so unused test codes do not affect your orders.

## Find Moshi codes in Shopify

In Shopify admin, open Discounts and search for `MOSHI`.
The title of each Moshi code is the code itself.
Shopify shows how many times each code was used.

Shopify's sales by discount report lists orders and sales for each code.
Use it to compare Moshi codes with your other codes, such as Klaviyo welcome codes.

## Track discounts in Moshi

Open the flow's [results](https://docs.moshi.ai/operate/results.md).
For a purchase flow, the Analytics card shows Purchases, Revenue, and ROAS.
These show the higher of Moshi's chat orders and Meta's pixel count, and say which.

Select Show more to see the activity counts.

| Count | Meaning |
| - | - |
| Incentives created | Codes that Moshi created for this flow. |
| Incentives delivered | Codes that Moshi sent by email or text. Discounts in the chat do not count here. |

Rows with a zero count do not show.
Open a lead in [Leads](https://docs.moshi.ai/operate/leads.md) to see the discount codes on that lead's purchases.
Moshi does not show a report of use for each code. Use Shopify for that report.

## Purchases with a different code

Moshi links a purchase to its conversation through the Moshi link or cart.
The discount code is a backup signal.
A shopper can check out with a different code, such as a welcome code.
Moshi still counts the purchase when the shopper came through the Moshi link or cart.

A Moshi code does not combine with a welcome code.
The shopper can use only one of the two codes.
To keep your sign-up popup offer away from Moshi shoppers, hide the popup from them.
See [Klaviyo](https://docs.moshi.ai/integrations/klaviyo.md) and [Alia](https://docs.moshi.ai/integrations/alia.md).

## Troubleshooting

| Symptom | What to do |
| - | - |
| The code does not apply at checkout | Check that the cart has a product from the flow. Check in Shopify admin that the code is unused. For a subscription, check Apply to subscriptions. |
| Another discount replaced the Moshi code | The shopper entered a product or order discount, such as a welcome code. Hide sign-up popups from Moshi shoppers. |
| Shopify has many unused `MOSHI` codes | Moshi creates a code when a shopper taps a discounted product card or Moshi sends a code. Simulator tests also create codes. Unused codes are normal. |
| A fixed-amount code name shows a large number | The name shows the amount times 100, so \$5 off shows as `500OFF`. The discount value is correct. |
| A code still works after you pause the flow | Codes have no end date. Deactivate the code in Shopify admin. |
| An order with a Moshi code is missing from Moshi results | Send the Moshi team the order number and the code. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.