Auto apply discount code at checkout doesn't work anymore

Topic summary

Shopify has removed the ability to auto-apply discount codes at checkout using the query parameter format https://store.myshopify.com/checkout?discount=DISCOUNT_CODE. This change was implemented for privacy reasons.

Workaround Available:
Users can now use an alternative URL structure:

https://store.myshopify.com/discount/DISCOUNT_CODE?redirect=/checkout

Impact:

  • Multiple merchants and discount management apps are affected
  • Several related threads have emerged over the past 2 weeks
  • The issue appears to be an intentional platform change rather than a bug

Solution Status:
A JavaScript code snippet is provided to implement the new redirect method, allowing automatic discount application to continue functioning with the updated URL format.

Summarized with AI on November 18. AI used: claude-sonnet-4-5-20250929.

We have a discount management app applying automatic discounts using discount codes at checkout.

It seems that, for some reason, we’re now unable to apply discount code at checkout using the “discount” query param in URL :

https://store.myshopify.com/checkout?discount=DISCOUNT_CODE

Is it a bug ? Did Shopify just removed this feature ?

It might be a bug. There have been a couple of threads opened lately related to this issue:

https://community.shopify.com/c/shopify-discussions/again-valid-discount-code-passed-as-a-query-parameter-to/td-p/2136102

https://community.shopify.com/c/online-store-and-theme/automatic-discount-application-for-direct-checkout/m-p/2153962

And probably a few more if you search for “discount,” sort by date, and go back through posts over the past 2 weeks or so.

Not sure what the cause is, but I’m pretty sure you’re not the only one.

2 Likes

Yes, Shopify removed this feature for privacy reasons. Instead, you can use a workaround:

https://store.myshopify.com/discount/DISCOUNT_CODE?redirect=/checkout

Here is my code for it:

var baseUrl = window.location.protocol + "//" + window.location.hostname;
checkout.attr('href', `${baseUrl}/discount/${discountCode}?redirect=/checkout`);
1 Like