The tools
Find discounts
Lists the store’s discounts. Start here — every other tool needs an id from this one.
Read a discount
The full setup of one discount. Answers “why isn’t this applying?”
Discount performance
Orders, revenue, and margin given away, for a date range.
Read the discount schema
AIOD’s templates and field shapes. Read before building anything.
Search the docs
Setup, widgets, stacking, POS, troubleshooting.
Draft a discount
Builds an offer and returns a review link. Writes nothing to Shopify.
Create in test mode
Creates a real Shopify discount that only applies to your test email.
At a glance
Every read tool is marked read-only, so most clients allow them without asking.
shopify_discount_publish is marked destructive, which means well-behaved clients will ask you before every single call.
Why is creating a discount “destructive”? Because of its update path. Creating a new discount is harmless. But passing an existing discount’s id replaces that discount’s rule and forces it back into test mode — so a discount that was live for shoppers stops applying. That is destructive, and it deserves a prompt.
Things that apply to every tool
Discount ids
Every store-scoped tool needs an AIOD discount id, and the only place to get one is Find discounts. It is not a Shopify discount GID. Never build one by hand.Configurations are sparse
Both write tools take aconfig object containing only the fields you are setting.
- Creating — the config must name a
template. - Editing — send only what changes. It is merged onto the stored configuration, not swapped in for it. So read the discount first: you cannot safely change a field without knowing its current value.
Rejections are useful, not fatal
When a tool returns a4xx, that is not a broken connection. It is a result to read.
A rejected draft or publish comes back with an issues list naming the exact fields at fault, and it carries the relevant reference material inline — so you can fix those fields and call again without starting over or re-fetching the schema.
And the HTTP statuses:
If AIOD’s session for the store breaks — usually after an uninstall — every tool returns an error asking you to reconnect, rather than failing opaquely.

