discountAutomaticAppCreate API incorrectly adds “ORDER” to discountClasses when only “PRODUCT” is specified (API 2025-07)
Problem Description
I’m experiencing an issue with the discountAutomaticAppCreate GraphQL mutation in API version 2025-07 where specifying discountClasses: ["PRODUCT"] results in the discount being created with discountClasses: ["PRODUCT", "ORDER"] instead.
Expected Behavior
When creating an automatic discount with discountClasses: ["PRODUCT"], the discount should be created with only ["PRODUCT"] in its discountClasses array.
Actual Behavior
The discount is created with ["PRODUCT", "ORDER"] in the discountClasses array, even though I only specified ["PRODUCT"].
Impact
This causes my discount to fail to combine with other product discounts that have combinesWith.orderDiscounts = false. These other discounts reject combination with my discount because Shopify treats it as being compatible with order discounts due to having “ORDER” in its discountClasses.
Steps to Reproduce
1. Create an automatic discount using the following mutation:
graphql
mutation CreateDiscount($discount: DiscountAutomaticAppInput!) {
discountAutomaticAppCreate(automaticAppDiscount: $discount) {
automaticAppDiscount {
discountId
discountClass
}
userErrors {
field
message
}
}
}
Variables:
json
{
"discount": {
"title": "Product Only Discount",
"functionId": "YOUR_FUNCTION_ID",
"startsAt": "2025-10-29T00:00:00Z",
"discountClasses": ["PRODUCT"],
"combinesWith": {
"productDiscounts": true,
"orderDiscounts": false,
"shippingDiscounts": true
}
}
}
2. Query the created discount to check its discountClasses:
graphql
query {
discountNode(id: "DISCOUNT_ID") {
discount {
... on DiscountAutomaticApp {
discountClass
}
}
}
}
3. Result: The discountClass returns ["PRODUCT", "ORDER"] instead of ["PRODUCT"]
Additional Context
-
My Shopify Function only returns
productDiscountsAddoperations (no order or shipping discount operations) -
My function targets only
cart.lines.discounts.generate.run -
I do not have a UI extension for this discount (creating programmatically via API only)
-
Important: When querying existing custom automatic discounts in my store, I can see other discount nodes that have only
["PRODUCT"]in their discountClasses, which confirms this configuration should be possible
Environment
-
API Version: 2025-07
-
Function Target: cart.lines.discounts.generate.run
-
Creation Method: API only (no UI extension)
Question
How can I create an automatic discount via the API that has only ["PRODUCT"] in its discountClasses array? Is this a known issue or is there a specific way to achieve this configuration?
Any help would be greatly appreciated!