An AI shopping agent checked out without charging our mandatory fee - how do I stop that?

If a mandatory surcharge only lives in a checkout UI extension or cart-page script, any client that completes checkout through Shopify's APIs directly - including AI shopping agents - can skip right past it.

agentic-commercecheckoutfeesshopify-functionssurcharges

What's going on

A merchant charges a mandatory fee on certain orders - a bottle deposit, an environmental surcharge, a hazmat handling charge, whatever the business reason - and it shows up fine when customers check out through the regular storefront. Then an order comes in placed by an AI shopping agent or some other integration talking to Shopify's checkout APIs directly, and the fee is simply missing. The order completes, payment captures, and the merchant is left either eating the cost or chasing the customer after the fact - neither of which is a good look.

This is a checkout-architecture problem, not really an AI problem. Standard web checkout renders whatever checkout customizations a merchant has installed, and it's common - especially for fees added a while back - for the surcharge to live entirely in that client-side layer: a checkout UI extension, a piece of storefront JavaScript, or logic tied to the order confirmation page. None of that runs when an order is placed by a client that talks to Shopify's checkout or storefront APIs directly instead of loading a rendered checkout page, which is how agent-driven and other headless purchases typically work.

The result is a silent, order-by-order gap rather than one visible bug: most orders still look correct because most customers use a browser, but the subset coming through an agent or API-first integration quietly bypasses fee logic that was never enforced anywhere but the browser. Because nothing errors or fails, it can run for weeks before it shows up in the numbers.

Why it happens

Checkout is built in layers: a server-side engine that finalizes the order, and a client-rendered layer - checkout UI extensions, theme code, confirmation-page scripts - that most merchants use to customize what a customer sees and interacts with. Anything that lives only in that second layer is, by definition, optional from the engine's point of view: it's decoration and interaction, not enforcement.

AI shopping agent integrations and other agentic-commerce programs are built specifically to let a purchase complete without a person ever loading a rendered checkout page in a browser - that's the whole point of buying directly through a chat interface. These flows talk to Shopify's checkout and storefront APIs to build the cart and complete payment. If your mandatory fee was never expressed as something the checkout engine itself enforces, there's nothing for that API call to trigger, so the fee never gets attached to the order.

This same gap has always existed for any programmatic buyer - a custom mobile app, a B2B ordering integration, a third-party point-of-sale tool - that talks to Shopify's APIs instead of rendering the standard checkout. Agent-driven commerce just made the gap show up faster, because it's a new and fast-growing category of exactly that kind of client.

5 ways to fix it

1

Move the fee logic into a server-side Shopify Function, not a checkout UI extension or storefront script

If your mandatory fee currently exists as a checkout UI extension, a cart-page script, or something tied to the Thank You page, it only ever runs when a browser renders your storefront or checkout. Rebuild it as a Shopify Function instead - a checkout validation function that blocks the order until the fee is present, or a cart transform function that adds it as a real line item on the server. Functions run inside Shopify's checkout engine itself, so they apply no matter what client completes the purchase, whether that's a browser, a mobile app, or an AI shopping agent calling the API directly. This is the only fix that closes the gap for every channel at once, rather than patching one integration at a time.

2

Review which sales channels and integrations can complete checkout without your fee logic, and pause any you can't currently trust

Until the fee is enforced server-side, treat any channel that lets a purchase complete without loading your rendered checkout - an AI shopping agent integration, a custom app calling Shopify's checkout or storefront APIs, a headless storefront - the same way you'd treat a bug in a live payment flow. Check your connected sales channels in the Shopify admin and disable or restrict the ones you can't currently guarantee are charging the right amount.

3

Check your order history to see how big the problem actually is before you decide how urgently to fix it

Look at recent orders and identify which ones came in through a non-standard channel versus a normal storefront checkout, then compare what was actually charged against what should have been charged. Order records generally show where an order originated, so you can pull this from the admin or via the API. This tells you whether you're looking at a handful of test orders or an ongoing revenue leak, and gives you real numbers if you need to reconcile totals or follow up with customers.

4

Add a temporary manual check for high-risk orders while the real fix is in progress

If the fee exists for a compliance reason - an age restriction, a hazardous-materials surcharge, a bottle deposit - rather than pure margin, consider flagging orders from non-standard channels for manual review or a fulfillment hold until the server-side fix is live. It's not a permanent answer, but it limits your legal or regulatory exposure while you rebuild the logic properly.

5

If you use a fee or surcharge app, ask the vendor directly whether it's enforced server-side or only in the checkout UI

Not every "add a fee" app works the same way under the hood - some rely on Shopify Functions, others still rely on checkout UI extensions or theme-level code that only renders in a browser. Ask your vendor which approach they use and whether they've specifically verified it against API-driven or agent-driven checkout flows, rather than assuming any installed app already covers this.

Bottom line

This isn't really an "AI agents are cheating merchants" story - it's a reminder that anything enforced only in the browser-rendered checkout, such as a UI extension or a cart-page script, can be skipped by any client that completes checkout through Shopify's APIs directly, agents included. The durable fix is architectural: move mandatory fees into a server-side Shopify Function so the checkout engine itself enforces them, for every channel at once. A fee or surcharge app can be a reasonable way to get there without building it yourself, but treat that as an implementation detail, not a substitute for understanding why the gap exists in the first place.

Still Stuck?

Browse the rest of the problem library, run a free storefront scan to catch issues like this automatically, or email us and we'll work out a custom solution for it.