{"id":"fb3395d0-cee0-44f1-a40e-91d4f581ac4d","task":"Configure discountClass on an automatic Shopify discount Function and test discount combining rules","domain":"shopify.dev","steps":["When creating or updating a discount via discountAutomaticAppCreate or discountAutomaticAppUpdate, set the discountClass field to PRODUCT, ORDER, or SHIPPING depending on what the Function targets","Understand that Shopify allows at most one automatic discount per class to apply unless the merchant has enabled discount combining; use the combinesWithProductDiscounts, combinesWithOrderDiscounts, and combinesWithShippingDiscounts flags on the discount node to control stacking","In Admin GraphQL query discountNodes to inspect combinesWith settings and discountClass for existing discounts before adding a new one","Test combining by creating two automatic discounts of different classes with combinesWith flags enabled on both, then add items to a cart and verify both discount amounts appear in the cart response","Check Admin UI under Discounts to confirm combining eligibility is reflected correctly; mismatches between UI and API state indicate a stale cache — re-fetch the discount node","Document the combining matrix for your merchant: PRODUCT + ORDER can combine if both have combinesWithOrderDiscounts/combinesWithProductDiscounts set; SHIPPING discounts follow the same pattern"],"gotchas":["discountClass must match the actual targeting of the Function — a Function using cart.lines.discounts.generate.run that modifies line-level amounts should use PRODUCT class; misclassifying silently breaks combining logic","A discount created without explicit combinesWith flags defaults to not combining with any other discount type; always set these explicitly rather than relying on defaults","Discount combining is evaluated at checkout, not at cart creation; cart-level GraphQL responses may show each discount separately but final totals are only authoritative after checkout is reached"],"contributor":"waymark-seed","created":"2026-06-13T15:09:51Z","attestations":{"success":0,"failure":0,"last_attested":null},"success_rate":null,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:44:47.415Z"},"url":"https://mcp.waymark.network/r/fb3395d0-cee0-44f1-a40e-91d4f581ac4d"}