New discount function and settings extensions - missing docs?

Hi,
I am attempting to create a discount function (the new api),
with a discount function settings extension (block, ui extension).
Perhaps regardless to the new discount function api,
Using the example from the docs, i noticed it doesnt use the new discount api, but product discount.
When trying to save a new discount shopify showed an error:

Functions configured to use the discounts API type require the discountClasses field to be set.

The docs show that when using metafieldDefinitionCreate it accepts ownerType: "DISCOUNT",
but I couldn’t find something about discountClasses.

Hey @Daniel_Rashi :waving_hand: - I can’t say for certain what’s causing this, but I do know that this issue has popped up before when it comes to the new Discounts API. This thread here mentions a similar issue: discountAutomaticAppCreate mutation broken in all API versions prior to 2025-04

I’m wondering if the discount that was being used in your function there hadn’t had any classes defined. The classes field was added recently though (in API version 2025-04), so if you were using an earlier version, this could be why the initial classes input field didn’t pop up when the discount itself was created.

If you’re still encountering the issue, could you share an X-Request-ID from an API response header for an example of the error and I can take a look at our logs to see why the issue is popping up if it isn’t your configuration?

Hope this helps - let me know if I can clarify anything on my end here :slight_smile:

1 Like

Yup I ran into this same issue.

Either use the deprecated discount function types, or switch to the new general discount function API, but make sure you use the 2025-04 and later API versions to create the discount node.

It’s just an API change that is a bit confusing to work around.

Hi,
this is what i get in network :


Screenshot 2025-05-06 at 14.23.02

@Moshe_Cohen

As mentioned in this thread, you’ll need to use the 2025-04 Admin API in order to create a discount node of that type.

If you create a deprecated dedicated discount/product/shipping discount function, then those are compatible with the < 2025-04 Admin API when creating the discount node.

My solution was to only use the 2025-05 when creating the discount node, until I’m ready to upgrade the rest of my app.

1 Like

Hi @Daniel_Rashi - are you still seeing this issue after following the advice posted here, or can I mark this as solved?

The issue here is that when using the new discounts API, you must provide ‘discountClasses’, but the existing discount-function-settings UI extensions do not set this property.

To the best of my knowledge, changes for this are still in the process rolling out.

As @Dylan mentioned, you CAN use an older API + discount-function-settings UI extensions - but these APIs are now deprecated (as per the warnings in the docs).

My personal suggestion would be to wait for the Discounts team to finish rolling out the required changes.

Hi @Liam-Shopify
The solutions they offered me talk about the old way, I want to use the new function with the new setting UI, it seems there is no answer or solution at the moment?

No @Moshe_Cohen , you can still use the new Discount API in production now.

I was able to create the discount node using the 2025-04 API version which accepts the discountClasses argument.

The discountClasses property is not set when using function-settings ui extensions; you’ll get the error in the OP’s screenshot.