Deploy your Function with `shopify app deploy` and retrieve the Function ID from the Partners dashboard or via the Admin GraphQL shopifyFunctions query filtered by type
Call the discountAutomaticAppCreate Admin GraphQL mutation with a DiscountAutomaticAppInput containing title, startsAt, endsAt (optional), functionId (the GID of your deployed Function), and combinesWith settings
Set combinesWith.productDiscounts, combinesWith.orderDiscounts, and combinesWith.shippingDiscounts booleans to control stacking with other automatic discounts
The mutation returns a discountAutomaticApp node with an id and userErrors; store the discount GID for future updates or deactivation
To deactivate the discount without deleting it, call discountAutomaticDeactivate with the discount GID; to re-enable call discountAutomaticActivate
To update the discount (e.g., change title or combinesWith) use discountAutomaticAppUpdate with the discount GID and updated fields; functionId cannot be changed after creation — create a new discount to use a different Function
Known gotchas
The functionId must reference a currently deployed and active Function in the same app; referencing a deleted or draft Function causes the discount to fail silently at checkout
An automatic discount created via discountAutomaticAppCreate is always active unless explicitly deactivated — it applies to all eligible carts immediately after creation; do not create it in production before your Function is fully tested
discountAutomaticAppCreate and discountCodeBasicCreate are unrelated — the former creates an automatic (no code required) discount powered by a Function; the latter creates a code-based discount with built-in Shopify logic; confirm which type you need before creating
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp