> 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/discount-codes-for-purchased-products.md).

# Discount codes for purchased products

Generate a unique discount code after a customer buys selected products or collections.

Use this trigger when a purchase should unlock a follow-up discount.

This is a strong fit for bounce-back offers, replenishment nudges, and cross-sell campaigns.

### Where to find it

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

### Choose the trigger

In **Trigger**, select **When specific products are purchased**.

Then choose the purchase scope:

* **Specific products or variants**
* **Specific collections**

Use **Specific products or variants** when the rule should match a tight SKU list.

Use **Specific collections** when the rule should stay aligned with a merchandised group.

### How to choose the purchase scope

#### Specific products or variants

Use this when precision matters.

This is best for hero products, seasonal SKUs, or exact bundles.

Leave the picker blank only if you intentionally want any product inside the selected scope to qualify.

#### Specific collections

Use this when the eligible set changes often.

This reduces maintenance because the generator follows collection membership instead of a fixed product list.

{% hint style="info" %}
Choose **Specific collections** when merchandising changes often.

Choose **Specific products or variants** when the reward must stay tightly controlled.
{% endhint %}

### Configure the discount

After the trigger, set the reward details:

* **Discount type** and **Discount value**
* **Code prefix**
* **Applies to**
* **Purchase Type**
* **Minimum spend**
* **Quantity limit**
* **Expires after**

Use a short prefix that makes reporting easier, such as `BOUNCE` or `CROSSSELL`.

### Choose delivery

Start with **Trigger a Klaviyo event**.

This keeps the reward email inside your Klaviyo flows and makes testing easier.

Use **Send mail via Roadmap** only when you want a simpler direct-send setup.

### When this trigger works best

Use it for offers like these:

* buy a starter product, then receive a code for accessories
* buy from a launch collection, then receive a code for a second purchase
* buy a replenishable item, then receive a follow-up incentive

### Related guides

* [Discount Code Generator](/discounts-and-gwp/using-gwp-and-discounts/discount-code-generator.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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
