How to disable discount codes on express checkout?

Hey there! I’d like to disable the use of certain discounts at checkout when using express checkout. I can already do this for the regular checkout, but it doesn’t seem to work for express checkout. Is there a way to disable these discounts or any documentation showing which functions and extensions are compatible with express checkout options?

I have a Plus Store exclusive public app, and recently about 5 or 6 users have asked me about this, so I’m eager to find a solution for them. Thanks for your help!

Hey @webx47 - thanks for reaching out. Just out of curiosity, how are you currently restricting discounts in the regular checkout? Is it via a Checkout UI Extension (e.g., intercepting discount code entry), or a Shopify Function (e.g., Cart/Checkout Validation or Payment Customization)? Just wanted to confirm the exact mechanism to see if I can look into some workarounds.

At the moment, Checkout UI Extensions don’t run in accelerated checkout (Shop Pay, Apple Pay, Google Pay), and Payment Customization Functions also don’t apply inside the Shop Pay popup (except for the native gift card field).

If you’re open to sharing a specific example (code/flow details; please redact any sensitive info), though, I can confirm expected behavior with you and discuss available options. Happy to move to DM if that’s easier, just ping me here!

Hey @Alan_G - Thanks for getting back to me. I’m going to try a few workarounds today to see if I can figure it out on my own. If not, I’ll reach out to you to chat about what I’ve tried so far, and then we can brainstorm some other possible solutions together.

No worries @webx47 - I’ll close this thread as solved for now, but feel free to ping me here if I can help out if needed and we can keep troubleshooting. :slight_smile:

Hey @webx47 , no worries! For DMs with Shopify staff, only staff are able to set up DMs, happy to set one up if you’d like though, just let me know! Right now, we don’t allow discount codes themselves to be surfaced through Checkout Validation Functions, which is generally how this would be approached (there’s a bit more info on that hereif you’d like to take a look.) The most important part is this though:

One approach is to use a Checkout UI extension to inject a field or selector for customers to choose which discount they want to apply, and then store that selection in a cart attribute. The Function can then read that attribute to determine how to apply or withhold the discount. For example, if a customer selects “BOGO Offer,” a cart attribute such as discount_type: bogo can be passed in and used within the function input to gate logic.

You could theoretically then use the discount attribute you created as a validator to block checkout if needed. It’s definitely not the most ideal workaround, but just wanted to share it as a possible avenue to look at - hope this helps!

@Alan_G this approach would work if checkout UI extensions could run on express checkout pages, but they currently don’t. So, as it stands, I’m unable to prevent the use of discount codes when buyers use express checkout with this UI extension method, correct?

Just to confirm—there’s no way to access the entered or applied discount codes on checkout through any checkout extension or function, right?

Hey @Alan_G , can you dm me i wanna ask you something related to blocking discounts on shop pay as i found an app which is able to do it but i’m not able to test it on my plusDevStore cause new devDashboard created stores don’t have test billing capabilities at the moment.

Hey @webx47 - happy to help. DMed you!

Hey @webx47 - just following up here as I was able to work with some folks internally on this. At the moment, we don’t currently support this, but my understanding is that we’re working on offering ways to allow discounts to be rejected within Shopify Functions logic.

I can’t guarantee an exact turnaround time on that feature/can’t confirm exactly what it will look like, but did want to let you know it’s something we have on our radar.

Hope this helps a little bit, let me know if I can help out with anything further on my end. Just wanted to reply publicly here since this info might help other folks in the future.

Hey @webx47, I wanted to close the loop on this thread here. I’m marking this thread as “solved”, but let me know if I can clarify anything on my end or help out further :slight_smile:

Hey @Alan_G , thanks for following up with the internal team and taking the time to look into this. Hopefully, the discount rejection function will make it to production someday.

1 Like