targetDiscountId — raising a threshold, extending an end date, swapping the gift, re-shaping a tier ladder.
Tool name:
shopify_discount_draft · Previously: save_discount_draft · Writes nothing to ShopifyWhen to use it
This is the default. Because it touches nothing, it covers building an offer all the way up to the moment the merchant looks at it. Create in test mode is the tool that makes a real discount, and it only applies once the merchant has actually asked for that.Parameters
About config
Shapes come from Read the discount schema and are checked strictly.
Creating needs a template id. Editing needs only the fields that change — they’re merged onto the stored configuration, not swapped in for it, which is why you should read the discount first.
What comes back
When it works
url exactly as it comes — it’s a direct link into the AIOD editor in their Shopify admin. The config comes back enriched with product titles and thumbnails, so it reads the way the editor will render it.
When it’s rejected
schemaReference (the template’s contract) or fieldSyntaxReference (exact condition and reward syntax) — one or the other, never both, to stay within the response budget. Use it instead of fetching the schema again.
The rejection codes are listed on the tools overview.
What it checks before staging
Every draft goes through the same gate, in order:- Shape repair. Common near-misses — object-wrapped conditions, string operators — are fixed automatically before anything is validated.
- Field policy. For an edit, the saved discount’s template decides which fields you may change, not the one you sent. Anything outside that allowlist is dropped.
- No-op check. A patch that merges back to an identical rule is rejected — it means the change you meant to make wasn’t actually in there.
- Empty tier check. A tier left with nothing meaningful in it is rejected rather than staged silently.
- Validation and cart simulation. Errors or a failed simulation reject the draft. Warnings alone don’t.
Things people ask that land here
- “Set up 20% off the Summer collection for July.”
- “Draft a buy 2 get 1 free on t-shirts so I can look at it.”
- “Raise the free-shipping threshold on my existing offer from 75.”
- “Extend the Black Friday discount through Cyber Monday.”
Getting it right
- Always say the draft isn’t live and that the merchant has to open the link and save.
- Fix only what the rejection names. Don’t rewrite the whole configuration.
- Never retry a
template_field_out_of_scoperejection with the same fields. That setting genuinely isn’t editable for that template — say so instead. - Put the merchant’s own words in
userMessage, not a paraphrase of your plan. It’s stored and shown back to them.

