# Discount links that apply a code automatically

> Share a Shopify link that applies a discount code automatically and lands on any page: /discount/CODE?redirect=/collections/summer, plus the QR code.

Page: https://lintelagency.com/resources/shopify-tricks/discount-links

## In short

A Shopify shareable discount link, your-store.com/discount/CODE, saves the code to the visitor’s cart and browser and opens the home page; the code applies at checkout. Add ?redirect=/collections/summer to land on another page. Get the link, with optional UTM tags and a QR code, from Discounts > the discount > Promote > Get a shareable link. It works for active discount codes on every plan.

## Facts

- **Format:** /discount/<CODE>?redirect=/<path>
- **Where:** Discounts > discount > Promote
- **Limit:** One discount per link
- **Plan:** Every plan
- **Last checked:** 2 November 2026

## How to use it

1. Create and save the discount code first; only active discounts get a link.
2. Open it under Discounts, click Promote and choose Get a shareable link; pick the landing page and, optionally, a marketing campaign for UTM tags.
3. To land somewhere else, change /discount/CODE to /discount/CODE?redirect=/collections/your-collection.
4. Test the link in a private window and check the code at checkout.

## Code

### discount-link-button.liquid

```liquid
{%- comment -%}
  A banner button that applies a code and lands on a collection or product.
  The code and target come from section settings (text + url), so marketing
  can change them without a code edit. Uses the documented /discount/<code>
  path with ?redirect=<relative path>.
{%- endcomment -%}
{%- assign code = section.settings.discount_code | strip -%}
{%- assign target = section.settings.target_url | default: routes.all_products_collection_url -%}
{%- if code != blank -%}
  <a class="button" href="/discount/{{ code | url_encode }}?redirect={{ target }}">
    Shop with {{ code }}
  </a>
{%- endif -%}
```

### links.txt

```text
# Shareable discount link: applies the code and opens the home page
https://your-store.com/discount/WELCOME10

# Same code, but land on a collection or product instead
https://your-store.com/discount/WELCOME10?redirect=/collections/summer
https://your-store.com/discount/WELCOME10?redirect=/products/example-product

# Get the link from the admin: Discounts > (discount) > Promote > Get a shareable link
# Optional: pick a marketing campaign there to add its UTM parameters.

# Need the cart filled too? Use a cart permalink with ?discount= instead
https://your-store.com/cart/12345678901234:1?discount=WELCOME10
```

## Limits and edge cases

- The code stays on the cart and in the browser until the customer removes it at checkout or clears cookies; opening the link again re-applies it.
- The link combines with other discounts only as your combination settings allow, and the 5-code limit per order still applies.
- Codes created by an app don’t get a shareable link in the admin; check the app.
- To fill the cart and apply a code in one link, use a cart permalink with ?discount=CODE.

## Questions

### How do I make a Shopify link that applies a discount code?

Use your-store.com/discount/CODE. Get it from Discounts > the discount > Promote > Get a shareable link.

### Can a discount link go to a specific product or collection?

Yes. Add ?redirect= with the path: /discount/CODE?redirect=/products/example-product.

### How does a customer remove a discount applied by a link?

They click Remove beside the code at checkout, or clear the store’s cookies and come back without the link.

### Does the discount link work with automatic discounts?

Shareable links are for discount codes. The code then combines with automatic discounts if both allow that combination.

## Shopify documentation

- [Promote a discount with a shareable link](https://help.shopify.com/en/manual/discounts/managing-discounts)
- [Cart permalinks: discount parameter](https://shopify.dev/docs/apps/build/checkout/create-cart-permalinks)

## Related

- [Discount combinations: what stacks and what doesn’t](https://lintelagency.com/resources/shopify-tricks/discount-combinations)
- [Cart permalinks: links that fill the cart](https://lintelagency.com/resources/shopify-tricks/cart-permalinks)
- [Add discount codes in bulk](https://lintelagency.com/resources/graphql/bulk-discount-codes)
- [Announcement bar Shopify section](https://lintelagency.com/resources/shopify-sections/announcement-bar)

License: MIT. Free to use in your own store and in client work.
