Shopify Discount Function API Input Query error

Hello Community

I’m trying to use enteredDiscountCodes attribute/property in a GraphQL query, and it works as expected — even the type generation completes successfully. However, when I try to deploy the function to the development environment, I encounter the following error:

Validation errors
targeting.0.input_query: Input.enteredDiscountCodes is not available on cart.lines.discounts.generate.run

Since this is part of the latest release candidate (2026-01), there appears to be an issue with the function input. Could you please let us know when this is expected to be resolved?

Thanks

Hi, the enteredDiscountCodes property is only available when used with fetch targets.

The discount codes that customers enter at checkout, excluding gift cards. Codes aren't validated in any way other than to verify they aren't gift cards. This input is only available in the cart.lines.discounts.generate.fetch and cart.delivery-options.discounts.generate.fetch extension targets.

If your function does not include fetch targets, you won’t be able to query enteredDiscountCodes in the run targets of your function.

This is a runtime check, so building the function will work, but the deploy will not. Let me know if this helps.

Hi @TomAtShop

I’ve got a working sample

Thanks