I noticed today while creating a draft order and trying to apply a product discount code created via discountCodeAppCreate that it doesn’t apply, despite working fine in checkout.
It seems to work fine with regular product discount codes created within the Shopify Discounts page though. The discount code shows in the dropdown list but when clicked it just runs a spinner for a moment and then nothing, not even an error.
I’m not sure if this is a bug or if there’s a setting I’m missing within the API.
The function is currently 2024-04, and the GraphQL Admin API being used is 2025-04.
@kyle, I haven’t been able to reproduce this problem and will need a little more information.
Would you be able to share the X-Request-Id from the response header of the request URL containing operation=CalculateDiscounts&type=mutation that should have occurred as soon as you clicked on the app discount in the drop-down list? Also the one for the request URL containing operation=DiscountCodes&type=query if it gets that far. I will be able to use your request ids to look into our logs and maybe determine what is happening.
I’ve been able to reproduce the problem in my own shop and I believe it is a bug in our system.
Your app discount has a different title from its discount code. At checkout, you are able to enter the discount code, but on the draft order the drop-down shows (and attempts to apply) the discount title, which the server rejects because it is not a valid discount code.
I will open a ticket for this issue. In the mean time, you should be able to work around it by giving your app discount the same title and code.