Skip to main content
Creates the discount in Shopify for real — in test mode.
Tool name: shopify_discount_publish · Previously: publish_discount · Writes to Shopify · Marked destructive, so most clients will ask before every call

When to use it

Only when the merchant has actually asked for the discount to be created, or wants to try it on the live storefront before opening it to shoppers. Draft a discount covers everything up to that point and touches nothing. A successful draft is not a reason to publish.

What “test mode” really means

It is not a dry run. The discount genuinely exists in Shopify, and Shopify genuinely evaluates it at checkout. What makes it safe is that AIOD attaches an email condition when creating it, so it only ever applies to the store’s test email address — returned to you as testModeEmail. Real shoppers are unaffected. It stays that way until a person opens it in the AIOD editor and switches it to active. No tool here can make that switch, activate a discount, or delete one.
Passing targetDiscountId overwrites. It replaces that discount’s rule in Shopify and re-creates it in test mode — so a discount that was live for shoppers stops applying. That’s why this tool is marked destructive. Confirm with the merchant, in words, before doing it.

Parameters

There is no mode parameter. Test mode is fixed in the server — nothing a caller sends can push a chat-authored discount live.

What comes back

When it works

When it’s rejected

If validation or simulation fails, nothing is created or changed.

What it checks first

Exactly the same gate as drafting — shape repair, field policy, empty tier check, then validation and cart simulation. An unverified configuration is never published. The rejection codes are the same too.

Things people ask that land here

  • “Create it — I want to test the BOGO on the storefront.”
  • “Go ahead and publish the free gift offer in test mode.”
  • “Replace the tier ladder on my volume discount with these three tiers.”

Getting it right

Report all three of these, every time:
  1. The discount is genuinely created in Shopify, in test mode.
  2. It only applies for testModeEmail. Real shoppers see nothing.
  3. The merchant must open url and switch it to active themselves. No tool can do it for them.
And remember this only covers AIOD’s automatic discounts — not discount codes, and not discounts created directly in Shopify or by another app.