xDiscount is coming soon to the Shopify App Store. See it working on the live demo store.
Docs

AI

Connect AI

Point your own MCP client at xDiscount on every plan, Free included, and review everything it creates as a draft before a discount reaches shoppers.

Letting an AI assistant run your discounts

What Connect AI does

Connect AI lets you point your own AI assistant at xDiscount and ask for discounts in plain language instead of filling in the discount form yourself.

The Settings screen says it in two lines:

Connect your own AI assistant to create and manage discounts. Anything it creates arrives as a draft, it can never publish a discount without you.

You bring your own assistant. We store no provider keys and charge nothing extra for it. Anything it creates arrives as a draft, so it can never publish a discount without you.

How it works, in short:

  1. xDiscount gives you a connection URL that is unique to your store.
  2. You add that URL to your AI client as a connector, which some clients call an “MCP server”.
  3. You approve the connection once, on a page inside your own Shopify admin.
  4. Your assistant can then search your catalogue, read your discounts and your performance figures, and create and change discounts. Anything it creates arrives as a Draft, whatever status it asked for.
  5. You review what it made in Discounts and set it to Active yourself.

Bring your own AI. xDiscount does not include an AI subscription and stores no AI provider keys. You use, and pay for, your own client: Claude, ChatGPT, or anything else that speaks MCP.

Which plans include it

FreeStarterGrowthScale
Price / monthFreeUSD 19USD 49USD 149
Connect AIIncludedIncludedIncludedIncluded

Connect AI is included on every plan, Free included. The Connect AI section in Settings always offers Generate a key. The plans differ on how many discounts can be active and how many discounted orders are included, never on this feature.

The plan is still checked when you ask for a key and on every tool call your assistant makes, so if a plan that withholds the feature is ever introduced, access stops straight away. Revoke is always available, whatever your plan.

Connecting your AI assistant

Where to find it: click Settings in the sidebar and open the Connect AI tab.

Step 1, copy your connection URL. Under Your connection URL you see an address ending in /mcp/your-store-name. It is unique to your store. Click Copy.

Step 2, add it to your AI client. Open your client’s Connectors, or MCP servers, settings, add a new connection, paste the URL and save it. The exact wording differs by client, Claude, ChatGPT and MCP Inspector each call this something slightly different, but the URL is the same for all of them.

Step 3, approve the connection. Your browser opens a page inside your Shopify admin headed Allow this AI to connect to your store?. It shows, in large type, the web address your store’s data will be sent to, the name the client calls itself, and what it will be able to do.

  • Check the address. For Claude it reads claude.ai. The name underneath is whatever the client declared about itself, so it is the address you trust, not the name.
  • Click Allow access to approve, or Deny if you did not just start this from your AI client. If that screen ever appears unexpectedly, deny it.

Approve promptly: the page counts down to the request’s expiry, a few minutes, for your security. If it expires, start the connection again from your AI client.

Step 4, you’re connected. The client now appears under Connected AI clients on the same tab, with the date it connected and when it last worked. Disconnect cuts it off on its very next request, whatever token it still holds.

A connection belongs to one store

A client connected to your store can only ever read and change that store’s discounts. The same client connected to another store is a separate connection there.

The key, for clients that take a bearer token

Some clients, such as Claude Desktop, Cursor and MCP Inspector, let you paste a token instead of approving in a browser. For those, the Connect AI tab also offers a key: click Generate a key, copy it, and give your client the connection URL above with the key as its bearer token. The key is shown once, only a hash is kept, and Revoke stops it on the next request.

Generating and managing your key

Generating a key

1

Open Settings

Click Settings in the sidebar.

Find Connect AI

Scroll to the Connect AI section, just below Plans and billing.

Generate a key

Click Generate a key.

Copy it straight away

The key appears immediately, in a warning banner headed Copy this now, it won’t be shown again. Copy it before you navigate away.

The key always starts with xdmcp_, so it is easy to recognise later in your client’s settings.

The banner tells you why the hurry:

Paste it into your MCP client as a bearer token. We only keep a hash, so we cannot show it to you later. If you lose it, generate a new one.

That is literal. xDiscount stores only a one-way hash of your key, not the key itself. Nobody, including support, can read it back to you. It is displayed exactly once, in your browser, and never again.

Paste it before you leave the screen

Put the key straight into your AI client’s connector settings before you leave the Settings screen. If you lose it nothing breaks, just click Generate a new key, but you will have to update your client.

Pointing a token-based client at xDiscount

Every client words this differently, but all of them need the same two things:

What your client asks forWhat to give it
Server / endpoint URLYour connection URL from the Connect AI tab, which ends in /mcp/your-store-name
AuthenticationBearer token, the xdmcp_… key you copied

Nothing in the connection names your store beyond the URL: xDiscount works out which store is calling from the credential itself, so there is no way for a key to reach another merchant’s discounts.

Checking whether it is actually connected

Once a key exists, the Connect AI section shows a badge:

BadgeWhat it means
Key created, not used yetThe key exists, but no client has ever authenticated with it. Your client has not connected yet, so check the URL and the token
ConnectedA client has successfully used the key at least once

When the key has been used you also see Last used with the date. The badge deliberately does not say “Connected” just because a key was generated, otherwise you would go hunting for a fault in your assistant when setup simply was not finished.

Replacing or revoking a key

To replace it: click Generate a new key. There is only ever one key per store, so the new one immediately replaces the old. Any client still using the old key stops working, so update your client with the new value.

To revoke it: click Revoke, the red button beside it. Access stops on the very next request, and the badge, the created date and the last-used date are all cleared.

Neither button asks you to confirm

Revoke takes effect the moment you click it, and Generate a new key invalidates the previous one the moment you click it. There is no undo, but there is also nothing to lose beyond having to re-paste a key.

Revoke when:

  • You have stopped using that AI client
  • You pasted the key somewhere you should not have
  • You want AI access off for a while

What your assistant can do

There are fourteen tools. Your client lists them by name, and here is what each one actually does.

ToolWhat it doesNeeds your confirmation
readDiscountsLists your discounts with type, value, schedule, priority, conditions, gift products, the products each applies to, status and sync state, up to 100, optionally one status only. It also lists each discount’s steps, a cart spend discount’s steps included, its checkout label, whether the gift is added automatically and whether it combines with item discounts, and for a discount code, its code, limits and the progress of its extra codes. Each discount also says which Overlapping discounts choice your store follows, so your assistant can explain why one discount beat another. No tool changes that choice: only you do, in Settings. Each discount also says who can get it (audience) and what it leaves out (exclusions)No
readPerformanceReads your daily performance figures, up to 90 days, newest first. days narrows the window. It also gives each discount’s results over the same days, as the By discount table on Analytics shows them (byDiscount): discounted orders, amount given and order totalsNo
searchProductsFinds products in your store by name, vendor, type, tag or SKU, with their variants, prices and stock. This is how the assistant gets the product ids the other tools take. A product another live or draft discount already uses is marked as held by that discount, with who that discount is for: a product held by a discount for retail shoppers only is still free for one for B2B buyers only, and the other way roundNo
searchCollectionsFinds collections in your store by title, with their size. This is how the assistant gets the collection ids a collection discount takesNo
createProductDiscountCreates a discount with its type, value, schedule, priority, conditions, the products it applies to, at least one, and for Buy X get Y its gifts. Always as a Draft. It also takes how the discount applies, automatically or only with a code, with its usage limit and once per customer, steps in place of a single value, a checkout label, and collections or all products in place of a product list. For Buy X get Y, it takes whether a free gift is added to the cart automatically and whether it combines with item discounts. For a cart spend discount, it takes whether its steps take a percentage or an amount off, the steps, and whether items that already have a discount get it too. It also takes what a collection or all-products discount leaves out (exclusions) and who can get it (audience)No
updateProductDiscountChanges a draft or archived discount’s name, type, value, schedule, priority, gifts, gift quantity or out-of-stock skip. It can also change the checkout label, the steps, what the discount applies to, the automatic gift, a cart spend discount’s steps, and a discount code’s code, usage limit and once per customer. A discount’s method never changes. It can also change what the discount leaves out (exclusions) and who can get it (audience)No
createDiscountCodesCreates extra codes for a discount code in the background: how many, from 1 to 100,000, an optional prefix and how many random characters. readDiscounts shows the progressNo
setDiscountRulesReplaces a discount’s conditions: cart quantity, cart value or inventory, with the same bounds and joins the Conditions section offersNo
addTargetsAdds products, or chosen variants of them, to a discount. Refused for a product another live or draft discount holds, naming that discountNo
removeTargetsRemoves products from a discountNo
publishDiscountMakes a discount live. This changes what shoppers are charged. Refused until the discount is complete: at least one product, and for Buy X get Y at least one gift. For a cart spend discount, at least one step. A cart spend discount is also refused while another one is active, naming itYes
unpublishDiscountTakes a live or archived discount back to draftYes
archiveDiscountArchives a discount so it stops applying at checkout and frees its products for other discounts. It still shows in Discounts, with an ARCHIVED status badgeYes
deleteDiscountPermanently deletes a discount and its targetsYes

The four confirmation tools are flagged to your client as destructive, so clients that support approval prompts ask you before running them. That prompt comes from your client, not from xDiscount, and a client with no approval step will not produce one.

How it picks products. The assistant searches your catalogue with searchProducts and passes the ids it finds to createProductDiscount or addTargets, so it never needs you to look up an id. A discount always needs at least one product, for the assistant as for you: a create without products is refused with “Choose at least one product for this discount to apply to.”

Two rules the form enforces apply to it as well. A product belongs to one live or draft discount, so a product another discount holds is refused with that discount’s name. Archive it, or remove the product from it, to free it. And every value it sends is checked by the same validator as the form, so a 150% discount, or an inventory condition joined with or, is refused with the same message you would see.

Collections and all products. Ask for “20% off the summer collection” and the assistant finds the collection with searchCollections and creates a collection discount, or an all-products discount when you ask for the whole store. The form’s rules apply: up to 100 collections, no product list, and no out-of-stock skip or Inventory condition on these discounts.

Leaving products out. Ask for “10% off everything except the Sale collection” and the assistant sends exclusions, here { "collectionIds": ["gid://shopify/Collection/2"] }, with createProductDiscount or updateProductDiscount. It takes productIds (up to 50 products, from searchProducts) and collectionIds (up to 10 collections, from searchCollections), the two pickers of the form’s Exclusions section. xDiscount looks each one up in your store and keeps its name. Each call replaces the whole list, and null leaves nothing out. The form’s rules apply: exclusions belong to a collection or all-products discount, a collection the discount applies to cannot be left out too, and moving a discount to specific products removes them. readDiscounts shows each discount’s exclusions.

How volume steps count. A discount with steps also takes tierCount: POOLED (all its items together, the default), PRODUCT (per product) or VARIANT (per variant, as Shopify’s volume pricing counts). Ask for “12% off from 6 of the same mug” and the assistant sends steps with VARIANT. Sending tierCount to a discount without steps is refused.

Cart spend discounts. Ask for “10% off orders over $100, and 15% over $200” and the assistant creates a cart spend discount with those two steps. It always covers the whole order and takes no products. The form’s rules apply: 1 to 5 steps, each with a higher amount and a bigger discount than the one before. Only one cart spend discount can be active at a time, on any given day, so publishing a second on some of the same days is refused with the name of the live one, in the words the form uses.

Names. When another discount already has the name the assistant chose, ignoring capitals and extra spaces, createProductDiscount and updateProductDiscount still save it and add the warning the form shows under Name, so the assistant can tell you and offer a different name.

Discount codes. Ask for “a code SPRING15 for 15% off the summer collection, usable 100 times” and the assistant creates a discount code. Without a code, it generates one. Ask for “500 codes starting with VIP-” and it creates them with createDiscountCodes, in the background. You download them from the discount’s page with Download codes. The form’s rules apply: letters, digits, dashes and underscores, at most 100,000 extra codes per discount, and a discount’s method never changes once it exists.

Who can get it. Ask for “15% off for customers tagged VIP” and the assistant sends audience, here { "tags": ["VIP"] }, with createProductDiscount or updateProductDiscount. It takes the rules of the form’s Who can get it section: buyer (RETAIL for retail shoppers only, B2B for B2B buyers only, ALL for both), channel (ONLINE for the online store only, POS for in store only on Shopify POS, ALL for both, the default), loggedIn (logged-in customers only), tags (customers with at least one of 1 to 10 tags), firstOrder (a customer’s first order), minSpent (customers who have spent at least this much in your store, in your store’s currency), countries (1 to 50 two-letter country codes, like ["FR", "BE"]) and skipMarkedDown (leave out items already marked down). Every rule sent must hold. A new discount is for retail shoppers only unless the assistant sends buyer, as in the form. Otherwise leave audience out, or send null, for everyone. Each call replaces the whole audience. The form’s rules apply, in the form’s words: a tag over 40 characters, the same tag twice, or a code that is no country is refused. readDiscounts shows each discount’s audience.

Offers for companies. Choosing companies, and companies by how long they have been customers, is done in the form only, since the assistant has no way to look a company up yet. On a discount that has either rule, the assistant can still change everything else, but a change to audience is refused with “This discount has company rules (chosen companies, or how long a company has been a customer), which a connected assistant cannot change yet. Change who can get it on the discount’s page in xDiscount.” Without it, the change would drop the company rules and reach more buyers than you chose.

Results by discount. Ask “which discount brought the most orders this month?” and the assistant reads readPerformance. Its byDiscount part gives each discount’s discountedOrders, amountGiven (what it took off) and orderTotals, in your store’s currency, most discounted orders first, from Shopify’s own order data, as the By discount table adds them up. An order that used two of your discounts counts under both. Orders placed before the table was added to xDiscount are not in it, and countedFrom says the day of the first one counted.

Gifts. For a Buy X get Y, the assistant names the gift products and, optionally, which of their variants the shopper may choose. xDiscount looks each gift up in your store and completes it, title, image, handle and default variant, so the storefront gift window works exactly as it does for a gift you picked yourself. It can also ask for the gift to be added to the cart automatically, which is allowed only for a free gift, on any of the three scopes, as in the form. And it can untick Combine with item discounts on an automatic gift, so checkout gives either the gift or the item discounts, whichever saves the shopper more.

Examples of what to ask:

  • “What discounts do I have, and which ones are live?”
  • “Create a 15% off discount on all the bikes, running from 1 December to 24 December.”
  • “Free shipping when the Heritage tee is in the cart.”
  • “Spend $100, get 10% off the whole order, and 15% from $200.”
  • “15% off for customers tagged VIP, on the whole store.”
  • “10% off everything except the Sale collection and the gift card.”
  • “Buy two candles, get a matching gift box free, and let shoppers pick the colour.”
  • “Add a condition so it only applies when the cart has at least 3 items.”
  • “Show me the last 30 days of performance.”
  • “Unpublish the summer sale.”

The guardrails

Everything an assistant creates is a Draft

A discount your assistant creates arrives as a Draft, so it does nothing at checkout until you say so. Open it in Discounts, choose the products it applies to, check the value, schedule and conditions, then set Status to Active and click Save.

This is forced on the way in. Whatever status the assistant asks for, a discount it creates is written as a Draft. Making one live is a separate tool, publishDiscount, flagged to your client as destructive, so publishing is always a deliberate step of its own, and your client prompts you first if it supports approvals.

A live discount must be unpublished before an assistant may edit it

If you ask your assistant to change a discount that is currently ACTIVE, it is refused with:

This discount is live. Unpublish it first. Editing an active discount would change what shoppers are charged without anyone approving it.

This covers every editing tool: updateProductDiscount, setDiscountRules, addTargets and removeTargets. The fix is exactly what the message says. Unpublish it, make the change, publish it again, so nothing shoppers are charged changes without a deliberate step.

Your plan limits still apply

The AI route uses the same save path as the admin screens: the same validation, the same 10,000-byte payload guard, the same plan limit. Asking an assistant to publish one discount too many gets the same refusal you would get by clicking Save:

Your Free plan includes 3 active discounts, and you have 3. Pause or archive one, or upgrade your plan to add more.

Drafts are never blocked by the limit. Only what is live at checkout counts.

One store, always

No tool accepts a store name or ID. The store is resolved from your key and re-checked on every record that is read or written, so a tool call can only ever touch discounts belonging to the store whose key made it.

Messages you may see

Message starts withWhat happenedWhat to do
PLAN_LIMITYou are at your plan’s active-discount limitArchive or unpublish one, or upgrade under Plans and billing in Settings
MUST_UNPUBLISHThe discount is liveUnpublish it, edit it, publish it again
NOT_FOUNDNo such discount on this storeAsk for the discount list again, the ID may be stale
INVALIDA required value was missingGive the assistant the missing detail
FAILEDSomething else went wrong, and the real reason follows the codeCheck Discounts to see whether the change landed
That credential is not valid. It may have been revoked.The key was revoked or replacedGenerate a new key and update your client
Connect AI is available on … You’re on ….Your subscription is on a plan the app does not recogniseUse Refresh plan under Plans and billing in Settings, and if it persists, tell us

Check your work after an AI session

Open Discounts and check the Status and Sync columns. A discount your assistant created still has to reach Shopify. A FAILED or TOO_LARGE sync badge means it is not applying at checkout, whoever created it.