The discount reject function works fine normally and rejects codes as expected for native discount codes, but when an app-generated discount code is applied, it breaks — it won’t remove the discount code, the code stays applied, and if the user reloads the page the discount code is gone. However, if they click on quick checkout or checkout, the discount stays.
Hey @websterapps , hope all’s well - thanks for reporting this. Based on what you’re describing, this might be related to how the discount rejection feature handles app-generated discount codes versus native ones.
Basically, when your automatic discount Function tries to reject an entered discount code, the platform checks a rejectable flag on each code in the enteredDiscountCodes input (more info on this here). For native Shopify discount codes, this flag is typically true, so your rejection works as expected. However, for app-generated discount codes (ones created through discountCodeAppCreate), this flag is could technically be false, which means the platform silently ignores the rejection attempt. That would explain the weird behaviour you’re seeing where the code looks like it should be removed but sticks around, especially when proceeding to checkout. The inconsistency between the cart view and the actual checkout session is because the frontend may reflect the rejection, but the backend never actually commits it since the code isn’t flagged as rejectable.
To confirm this, could you log the full enteredDiscountCodes input your Function receives when the app-generated code is applied and check whether the rejectable field on that code is true or false? Also, it would help to know how the app-generated discount code was created and whether the rejecting Function and the discount code are from the same app or different apps.
If it turns out that rejectable is set to false, this would be seem to be expected platform behaviour since one automatic discount Function generally can’t reject another app’s discount codes if that makes sense. In that case, you might want to look into alternative approaches like using a Cart and Checkout Validation Function to block checkout under certain conditions, or consolidating your discount logic into a single Function. And just to cover all bases, make sure you’re running on API version 2026-01 or later since the discount code rejection feature was released on that version. If the issue still pops up after checking that everything is set up correctly, just let me know and we can take a look ![]()
@Alan_G I’m seeing this issue even when the code is rejectable. My discount reject function also checks this on the code side and doesn’t attempt to reject codes that aren’t rejectable, so that part should be safe.
Shop: testz45.myshopify.com
Behavior:
- App generated discount code:
SAVE10- The reject action runs and shows a success message.
- However, the code still appears applied in the UI.
- After a page reload, the code is removed.
- Normally the code should disappear immediately, so it seems like it is being rejected but the UI doesn’t update until reload.
- Native discount code:
STAFF50- Reject works as expected.
I am having the same problem with native discount codes. I have a Shopify built-in discount and discount code added via the Admin API. My app is expected to reject the latest code in enteredDiscountCodes when a user adds more than one.
However, it is not working as intended. When my app returns the reject result, the system does not remove the discount code; it only shows an alert message. The rejected coupon code only disappears after the page is refreshed. I have checked the discount function’s input and output, all discount codes show as rejectable: true, and no errors are occurring.
We are currently delaying this feature update due to this bug. Please prioritize a fix for this issue.
Thanks for clarifying all. Looking into this internally for you, I’ll loop back with you once I have more info to share on my end.
Thanks @Alan_G for always coming to the rescue! ![]()
@Alan_G any update ?
Hey @webx47
- I still don’t have an exact timeframe on this, but we are looking into this as a bug. We do have a fix in progress though, I’ll let you know once that’s live on our side!
Hey @Alan_G — hope you’re doing well. I gave it a try today, and it looks like the discount reject is now able to properly reject app-created discounts.
Hey @webx47 - thanks for following up and glad to hear that this seems to be working. Can confirming we pushed a change a few days ago that should have fixed this. Let me know if you encounter any other issues!





