How to create automatic discount for amount off products in shopify using Graphql

Topic summary

A developer is attempting to create an automatic discount in Shopify that applies a fixed amount off specific products using the GraphQL API. They’ve tried modifying the discountAutomaticBasicCreate mutation, which is documented for amount-off-order discounts, but their attempts to adapt it for product-level discounts have failed.

Current Issue:

  • The existing mutation appears designed for order-level discounts (e.g., “$100 off orders over $500”)
  • Attempts to modify the JSON structure to target individual products instead of entire orders haven’t worked
  • The developer is seeking confirmation whether product-level automatic discounts are achievable through this API endpoint

Status:
The discussion remains unresolved with another user confirming they face the identical problem. No solutions or workarounds have been provided yet. The core question is whether Shopify’s GraphQL API supports automatic discounts at the product level, or if an alternative mutation/approach is needed.

Summarized with AI on October 28. AI used: claude-sonnet-4-5-20250929.

There is a option to create a automatic discount using API on shopify for amount off order. I want to create a automatic discount for amount off product using graphql

I tried to alter this JSON to apply the discount for products, but it didn’t work. is there any possibility to achieve this? https://shopify.dev/docs/api/admin-graphql/2024-07/mutations/discountAutomaticBasicCreate

{
“query”: “mutation discountAutomaticBasicCreate($automaticBasicDiscount: DiscountAutomaticBasicInput!) { discountAutomaticBasicCreate(automaticBasicDiscount: $automaticBasicDiscount) { automaticDiscountNode { id automaticDiscount { … on DiscountAutomaticBasic { startsAt endsAt minimumRequirement { … on DiscountMinimumSubtotal { greaterThanOrEqualToSubtotal { amount currencyCode } } } customerGets { value { … on DiscountAmount { amount { amount currencyCode } appliesOnEachItem } } items { … on AllDiscountItems { allItems } } } } } } userErrors { field code message } } }”,
“variables”: {
“automaticBasicDiscount”: {
“title”: “$100 off all orders over $500 for all customers”,
“startsAt”: “2024-01-01T00:00:00Z”,
“endsAt”: “2024-12-31T23:59:59Z”,
“minimumRequirement”: {
“subtotal”: {
“greaterThanOrEqualToSubtotal”: 500
}
},
“customerGets”: {
“value”: {
“discountAmount”: {
“amount”: 100,
“appliesOnEachItem”: false
}
},
“items”: {
“all”: true
}
}
}
}
}

1 Like

I have exactly the same problem.

Is there a solution?
thanks!