> For the complete documentation index, see [llms.txt](https://docs.roadmap.so/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.roadmap.so/discounts-and-gwp/using-gwp-and-discounts/discount-code-generator.md).

# Discount Code Generator

Automatically generate unique Shopify discount codes after review, purchase, birthday, or member-promotion events.

Use **Discount Code Generator** when Roadmap should create a unique discount code after a customer event.

This setup works well for post-review rewards, birthday offers, tier-promotion rewards, and post-purchase follow-up offers.

### Where to find it

In Roadmap, open **Discounts / GWPs**, click **Create a new discount**, and choose **Discount Code Generator**.

### When to use it

Use the generator when you need all three:

* a unique code per reward event
* Shopify discount rules managed in Roadmap
* event-based delivery through Roadmap or Klaviyo

Use [Klaviyo coupons](/discounts-and-gwp/using-gwp-and-discounts/when-to-use-roadmap-shopify-or-klaviyo-for-discounts.md) instead when Klaviyo should both generate and send the coupon.

### Delivery options

Choose how the reward reaches the customer.

#### Trigger a Klaviyo event

Use this first.

Klaviyo keeps reward emails inside your existing lifecycle program. You keep flow logic, design, testing, and reporting in one place.

This is usually the best option when you already run retention email in Klaviyo.

#### Send mail via Roadmap

Use this for a simpler setup.

This works when you want Roadmap to send the reward email directly and do not need a Klaviyo flow around it.

{% hint style="info" %}
If both options could work, start with **Trigger a Klaviyo event**.

It gives you more control and scales better.
{% endhint %}

### Available triggers

The generator supports four trigger types.

Use the links below to open the full setup guide for each trigger:

* [Discount codes for reviews](/reviews/managing-reviews/review-rewards-and-limits/discount-codes-for-reviews.md)
* [Discount codes for purchased products](/discounts-and-gwp/using-gwp-and-discounts/discount-code-generator/discount-codes-on-member-promotion.md)
* [Birthday discount codes](/discounts-and-gwp/using-gwp-and-discounts/discount-code-generator/discount-codes-for-purchased-products.md)
* [Discount codes on member promotion](/discounts-and-gwp/using-gwp-and-discounts/discount-code-generator/birthday-discount-codes.md)

#### When review is published

Use this to reward a customer after a review is published.

This trigger has its own review-specific settings such as **Reward frequency**.

Read [Discount codes for reviews](/reviews/managing-reviews/review-rewards-and-limits/discount-codes-for-reviews.md).

#### When specific products are purchased

Use this to reward a customer after they buy selected products or collections.

This works well for bounce-back offers and post-purchase cross-sell incentives.

Read [Discount codes for purchased products](/discounts-and-gwp/using-gwp-and-discounts/discount-code-generator/discount-codes-on-member-promotion.md).

#### On member birthday

Use this to send a birthday reward based on the member's stored birthday.

Choose the timing based on the buying behavior you want to influence.

Read [Birthday discount codes](/discounts-and-gwp/using-gwp-and-discounts/discount-code-generator/discount-codes-for-purchased-products.md).

#### On member promotion

Use this to reward a member when they move into a new tier.

This works well for tier celebration and immediate next-purchase activation.

Read [Discount codes on member promotion](/discounts-and-gwp/using-gwp-and-discounts/discount-code-generator/birthday-discount-codes.md).

### Shared configuration

All generator setups use the same core sections:

* **Name** and **Status**
* **Trigger**
* **Discount Code**
* **Customer Eligibility**
* **Mail Template**

Most setups also need decisions on:

* what the discount applies to
* whether it supports one-time, subscription, or both
* minimum spend, quantity limits, and expiry

### Related guides

* [Discount codes for purchased products](/discounts-and-gwp/using-gwp-and-discounts/discount-code-generator/discount-codes-on-member-promotion.md)
* [Birthday discount codes](/discounts-and-gwp/using-gwp-and-discounts/discount-code-generator/discount-codes-for-purchased-products.md)
* [Discount codes on member promotion](/discounts-and-gwp/using-gwp-and-discounts/discount-code-generator/birthday-discount-codes.md)
* [Discount codes for reviews](/reviews/managing-reviews/review-rewards-and-limits/discount-codes-for-reviews.md)
* [When to use Roadmap, Shopify, or Klaviyo for discounts](/discounts-and-gwp/using-gwp-and-discounts/when-to-use-roadmap-shopify-or-klaviyo-for-discounts.md)
* [How to integrate Roadmap with Klaviyo](/reviews/integrations/klaviyo-review-integration/how-to-integrate-roadmap-with-klaviyo.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.roadmap.so/discounts-and-gwp/using-gwp-and-discounts/discount-code-generator.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
