When I add enteredDiscountCodes to the input and try to deploy it returns
Validation
• targeting.0.input_query: Input.enteredDiscountCodes is not available on cart.lines.discounts.generate.run
It also doesn’t work on dev. It never returns the updated query result. I checked on unstable, 2025-07 and 2025-04 versions. I also tried it in multiple apps.
Thanks for sharing this. Input.enteredDiscountCodes is only available on the cart.lines.discounts.generate.fetch and cart.delivery-options.discounts.generate.fetch targets. We’ll update our documentation to make this limitation clear.
Iodel, The documentation still does not make this clear. Can you explain the limitations here. Based on the documentations we had planned out a feature for our client which would enable them to specify a discount prefix and then have the discount apply, as a part of a larger discount engine, but now this seems impossible without being an enterprise client?
I believe you can use triggeringDiscountCode, which is available in the run target: Discount Function API
Appreciate there’s a possible misunderstanding of your use case. If you’re wanting a customer to enter any code, and then validate it within the function itself (for example).
I’d suggest instead creating a discount code, and generating multiple redemption codes for it - that would be the ‘clean’ way to implement something like this.