> 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-codes-with-gwps.md).

# Discount codes with GWPs

Check whether a discount code can be used alongside a Gift with Purchase and why the gift may disappear.

A discount code can often be used with a GWP because the GWP adds a gift item instead of acting only as a visible discount line.

### Why a code can still break the GWP

The code may change the cart enough that the GWP no longer qualifies.

Most often, one of these happens:

* the code drops the cart below the GWP threshold
* the shopper no longer matches **Customer Eligibility**
* another promotion takes precedence

### Test it in the right order

{% stepper %}
{% step %}

#### Test the GWP without a code

Build a cart that clearly qualifies and confirm the gift appears.
{% endstep %}

{% step %}

#### Apply the code

Enter the code and check whether the cart still qualifies.
{% endstep %}

{% step %}

#### Recheck the threshold

If the GWP uses **Minimum Spend**, confirm the discounted cart is still above the required amount.
{% endstep %}

{% step %}

#### Recheck the customer

If the GWP uses member tiers, tags, or logged-in rules, confirm the customer still matches those settings.
{% endstep %}

{% step %}

#### Pause other promotions if needed

Retest with only the GWP active if results are inconsistent.
{% endstep %}
{% endstepper %}

### Common reasons the gift disappears

#### The code changes the subtotal

This is the most common cause with spend-based GWPs.

#### The GWP is restricted

If the GWP is limited to **Members**, **Logged in only customers**, or tagged customers, not every shopper will qualify.

#### Multiple offers are overlapping

If another promotion targets the same cart, checkout may choose a different outcome.

### Best setup for predictable results

Use a simple GWP rule.

A clear spend threshold is easier to test than several overlapping product rules.

Use **Customer Eligibility** to separate audiences rather than relying on overlapping discounts.

### If the GWP is members-only

Check that at least one membership tier is selected.

If no tier is selected, the GWP will not trigger for anyone.

### Related guides

* [Gift with Purchase](/discounts-and-gwp/using-gwp-and-discounts/gift-with-purchase.md)
* [GWP not showing at checkout](/discounts-and-gwp/troubleshooting/gwp-not-showing-at-checkout.md)
* [Discounts not applying correctly](/discounts-and-gwp/troubleshooting/discounts-not-applying-correctly.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-codes-with-gwps.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.
