A8gent
All articles

Industry

Oversold Order Automation: The Order You Cannot Fulfil

Everyone builds the back-in-stock notification. Almost nobody builds the harder one: the customer already paid, the pick failed, and somebody has to tell them. It is the worst message in ecommerce and it is usually sent late, by a person, in a bad mood, which is why it costs so much.

A8gentAutomation practiceAugust 5, 202612 min read
Contents
  1. The Worst Message in Ecommerce
  2. Why Oversells Happen, Precisely
  3. The Choice Architecture That Saves the Sale
  4. Building It
  5. A Worked Example, With the Arithmetic Shown
  6. Measuring It, and the Ways It Goes Wrong
  7. FAQ

The Worst Message in Ecommerce

There is a hierarchy of bad customer emails and this one sits at the top. The customer has chosen, paid, and started anticipating. Money has left their account. In many cases they bought it for a reason with a date attached - a birthday, a trip, a repair. And now you have to tell them that the thing they bought does not exist.

What makes it worse is how it usually gets handled. The pick fails on the warehouse floor at 11am. It sits in a pile of exceptions until somebody works through them in the afternoon. Someone types an apologetic email late in the day, or the system auto-cancels and refunds without asking anyone. The customer, who has been anticipating a delivery, finds out at 6pm that it is not coming - and the only thing they are offered is their money back.

That last part is the real error. A refund is the outcome that guarantees you lose the sale, and it is what most automated handling does by default because it is the safest thing to code. But a customer who wanted a thing on Tuesday and cannot have it on Tuesday has not stopped wanting it. They will very often accept a delay, a substitute, or a partial shipment - if asked, promptly, by someone who sounds like they have a plan.

So the automation here is not "notify the customer of a cancellation." It is get to the customer fast, with a real choice, before they have emotionally written off the order. That framing changes the whole build, and it is the opposite of what most stores implement.

The prevention side of this problem - not running out in the first place - is our reorder point automation article. This one is about what happens when prevention has already failed. For the broader picture see AI automation for ecommerce and retail and AI agents for ecommerce automation.

Why Oversells Happen, Precisely

Fix the message and you have treated a symptom. It is worth understanding the causes, because two of them are cheap to fix and the automation should report on which one it hit.

Shopify's inventory documentation is unusually clear about the model, and understanding it explains most oversells. Shopify documents these quantity states:

  • incoming - quantities expected to arrive
  • on_hand - "The total number of units that are physically stocked at a location"
  • available - units ready for sale
  • committed - "Only affected by the creation and fulfillment of a merchant's orders"
  • reserved - units set aside or temporarily unavailable
  • damaged - "Units from inventory count due to damage"
  • safety_stock - "Units being set aside to help guard against overselling"
  • quality_control - "Units that aren't sellable because they're currently in inspection"

And the relationship: "The on_hand state equals the sum of inventory quantities in the following states: available, committed, reserved, damaged, safety_stock, quality_control."

Read that carefully and the failure modes fall out of it:

1. Physical stock does not match on_hand. The unit was stolen, broken, mis-picked into another order, or never arrived despite being received on paper. No software model can be more accurate than the count it was given. This is a warehouse process problem and the only fix is cycle counting.

2. Something consumed stock outside the order flow. Note that committed is "Only affected by the creation and fulfillment of a merchant's orders." A unit taken for a photoshoot, a sample, a staff sale, a warranty replacement or a market stall is not committed to anything - it is simply gone from the shelf while the system still counts it as available. This is enormously common in small retail and almost never modelled.

3. Multi-channel latency. The same unit sells on your store, a marketplace and in a physical shop, and the sync between them has a delay. During that window two customers can buy one unit. This is the classic oversell and it is a design property of the architecture, not a bug you can fully eliminate.

4. Bundles and kits. A component is shared across several sellable products, and the decrementing logic is wrong or absent. Deceptively common and it produces oversells that look random.

5. Deliberate policy. Continuing to sell when stock hits zero, on the assumption that a delivery is imminent. Sometimes correct, frequently forgotten about, occasionally catastrophic when the delivery slips.

The prevention lever hiding in that list: Shopify's documented safety_stock state exists explicitly to "help guard against overselling." Holding back a small buffer on high-velocity or multi-channel lines converts an oversell into a slightly reduced sellable quantity, which is dramatically cheaper. It costs a little revenue and buys a lot of goodwill. Most stores never use it. If your oversell rate is meaningful, this is the highest-return change on this entire page and it involves no automation whatsoever.

The Choice Architecture That Saves the Sale

Given the failure has occurred, the message design is what determines whether you keep the order. Four options, presented in this order:

1. Wait, with a specific date. "It'll be with you by the 14th" is a real offer. "It's on backorder" is not. The specificity is the entire value, and it requires that your automation can read expected arrival - Shopify's incoming state, or your purchase order data. If you cannot supply a date, do not offer this option, because a vague wait that slips is worse than a refund and turns one bad message into three.

2. Substitute. The next size, the other colour, the equivalent product. Whether this can be automated depends entirely on whether your catalogue has real relationships between products. If it does not, a human picking a substitute is fine and often better. Sweeten it slightly - covering the difference on a marginally more expensive alternative usually costs less than losing the order and the customer.

3. Part-ship now, rest to follow. Only offer this if you will absorb the second shipping cost, and be aware it can double your fulfilment cost on that order. For a multi-line order where one line failed, it is frequently the best outcome - the customer gets most of what they wanted on time.

4. Refund. Always available, never the headline. Make it easy and unresented; a customer who gets a fast, gracious refund with no argument will consider buying again, and one who has to chase it will not.

Design constraints on the message itself:

  • Send it fast. Time-to-notify is the metric that matters most, because the value of every option above decays. A choice offered within an hour of the pick failure is a choice; the same message at 8pm is an apology.
  • Do not bury the lede. Lead with what happened and what you are doing about it. Two paragraphs of apology before the actual news reads as evasive.
  • Do not over-apologise. One clear apology. Excessive grovelling signals that something worse happened than actually did.
  • Make each option one tap. If choosing "wait" requires a reply email that a human then processes, you have built a slower version of the problem. Each option should be a link that executes.
  • Set a decision deadline and a sensible default. "If we don't hear from you by Thursday we'll refund you" is honest and prevents orders sitting in limbo. The default must be the customer-safe option, always.
  • Never offer an option you cannot honour. If the substitute is also short, or the incoming date is a guess, do not present it. This is the single most damaging failure mode - a second failed promise on an already-failed order is how you generate a chargeback and a public review.

On tone and generation: a language model can draft these well, and this is a case where the failure mode is meaningful, because the message contains commitments about dates and money. Template the facts - order number, item, date, amounts - as literal values pulled from the record, and let the model handle only the connective prose, if you use one at all. Never let it state a date it inferred. See hallucination and guardrails.

Building It

The trigger is the interesting design question, and most stores get it wrong by putting it too late.

Waiting until fulfilment fails means the customer finds out slowly, because pick failures batch up. Better triggers, in descending order of speed:

  • At order creation, a check that available stock genuinely covers every line - catching the multi-channel latency oversell within seconds rather than hours.
  • At pick, an explicit "short" action on the warehouse device that fires the workflow immediately rather than adding to a pile.
  • On a scheduled sweep of unfulfilled orders against current stock, catching anything the first two missed.

The first of those is cheap and catches the most common cause. The second requires a warehouse process change and is worth pushing for, because the delay between a picker discovering the problem and anyone acting on it is usually the largest component of time-to-notify.

State machine, not a message. Every affected order needs a state: detected, customer notified, awaiting customer decision, resolved-wait, resolved-substituted, resolved-part-shipped, resolved-refunded. With an age. Anything sitting in "awaiting decision" past the deadline resolves to the default automatically. Without this, orders sit in limbo and resurface as support tickets a week later.

Reliability details. Key every notification on order ID plus line item plus attempt - a duplicate "we can't fulfil your order" email is uniquely alarming to a customer who has already chosen to wait. Re-check state immediately before sending, because stock may have arrived between detection and dispatch. See idempotency.

Respect the API limits. A sweep across unfulfilled orders and inventory levels adds up. Shopify's GraphQL Admin API is metered in points per second by plan - 100 for Standard, 200 for Advanced Shopify, 1000 for Plus - on a leaky bucket, with a hard rule that "A single query may not exceed a cost of 1,000 points, regardless of plan limits," and throttling returns "a 429 Too Many Requests response." Paginate by design and back off properly. See rate limit, retry and backoff and polling vs webhook.

Escalate the ones that need a person. High-value orders, repeat customers, anything already delayed once, and anything where the customer replies with prose rather than clicking an option. Route those to a human with the full context attached. The cost of a human on a $400 order is trivial against the cost of losing the customer. See human-in-the-loop.

Feed the failure back. Every oversell should be logged with its cause from the taxonomy above. That log is what tells you whether you have a counting problem, a sync problem, a bundle problem or a policy problem - and those have four different fixes with four different owners. A store that handles oversells gracefully but never reduces them has automated a wound.

A Worked Example, With the Arithmetic Shown

Illustrative. We report no client results - use your own figures.

Baseline. A store ships 2,400 orders a month with an average order value of $76. Suppose 1.8 percent hit an oversell or short ship: 2,400 x 0.018 = 43.2 orders a month.

Current handling. Suppose today these are worked manually in an afternoon batch, notified a median of 6 hours after detection, and 80 percent end in a refund because that is the path of least resistance: 43.2 x 0.8 = 34.6 refunded orders a month, or 34.6 x $76 = $2,630 of monthly revenue cancelled. Each also consumes roughly 8 minutes of support time including the follow-up questions: 43.2 x 8 = 346 minutes, or 5.8 hours a month.

After. Suppose fast notification with a real choice cuts the refund share from 80 percent to 45 percent - the remainder split across wait, substitute and part-ship. Refunded orders: 43.2 x 0.45 = 19.4. Orders saved: 34.6 - 19.4 = 15.2 a month, at $76 = $1,155 of monthly revenue retained.

Convert to contribution, not revenue. A saved order still costs you the goods and the shipping. At a 40 percent contribution margin, 15.2 x $76 x 0.40 = $462 a month, or about $5,540 a year. Add the support time: if handling drops to 3 minutes per case, that is 43.2 x 5 minutes saved = 216 minutes, or 3.6 hours a month, worth roughly $79 at a $22/hour loaded rate - $950 a year.

Total modelled annual benefit: about $6,490. Against a build cost of, say, $3,000 plus $60/month - your quotes; see automation build cost - first-year cost is $3,720, and payback lands around 6.9 months.

Now the caveats, which matter here more than the number.

  • The 80-to-45 percent shift is the entire case and it is the input we cannot verify for you. If your customers refuse substitutions and your supply dates are unreliable, the shift will be much smaller. Test it manually for a month before building - handle every oversell personally with a real choice offered fast, and measure the actual save rate. That month of manual work is the cheapest possible validation and it is also immediately valuable.
  • None of this counts the retention effect, which is plausibly larger than the saved order and which we are not going to quantify because we cannot substantiate it. A customer whose failed order was handled well behaves differently from one who got a curt refund, but we would be making up a number if we put a figure on it.
  • Reducing the 1.8 percent beats improving the handling. If safety stock and better sync halve the rate, you have removed the problem rather than dressing it. Do that first.

Our ROI of AI agents piece covers building defensible cases, payback period the framing, and AI automation cost the budget ranges.

Measuring It, and the Ways It Goes Wrong

Four metrics, with different owners. Oversell rate as a percentage of orders, owned by operations - this is the number that should be falling. Median time from detection to customer notification, owned by whoever controls the trigger. Save rate, the share resolved as anything other than a refund, owned by whoever writes the message and designs the options. And repeat purchase rate among affected customers versus the store average, which is the number that tells you whether the handling is genuinely good or merely fast.

The failure modes, ranked:

  • Promising something you cannot deliver. Offering a substitute that is also short, or a date from a supplier estimate that has already slipped twice. A second broken promise on an already-broken order is how a recoverable situation becomes a chargeback and a one-star review. Validate every option against live data at the moment of sending.
  • Auto-refunding by default. The safest thing to code and the most expensive thing to do. If the customer does not respond, refunding is the right default - but it should be the fallback after a real choice, not the first message.
  • Duplicate notifications. Uniquely alarming on this particular message. Idempotency keys, and a state check before every send.
  • Notifying about an order that was already resolved because stock arrived, or a colleague fixed it manually. Re-check immediately before sending.
  • Orders stuck awaiting a decision. Without a deadline and an automatic default, these accumulate silently and resurface as angry tickets. Every state needs a timeout.
  • Automating the wrong tier. A $600 order to a repeat customer should get a person. Set a value and loyalty threshold above which the automation only drafts and alerts.
  • The silent stop. The sweep fails and no oversells are detected, which looks like an excellent month right up until the complaints arrive. Alert on zero detections over a period, not only on errors. See observability and error handling.

A closing argument for sequencing. Handle the message well, yes - but the honest hierarchy is prevention first, detection speed second, message quality third. A store with a 4 percent oversell rate and beautiful apology emails has a worse business than one with a 0.5 percent rate and adequate ones. Start with safety_stock on your multi-channel lines, cycle counting on your top sellers, and proper reorder points. Then build this.

If you want a second opinion on that sequencing, the free automation audit works through it, and automation services explains how we scope. On the general boundary of what to trust an agent with, see what AI agents can do reliably.

FAQ

Should the system just cancel and refund automatically?
No - refund should be the fallback, not the first message. A refund is the one outcome that guarantees the sale is lost, and it is what most automated handling does by default because it is the easiest thing to code. A customer who wanted something on Tuesday still wants it; offered a specific new date, a substitute or a part-shipment quickly, a substantial share will take one. Make refund easy and unresented, but do not lead with it.
Why do oversells happen if the system tracks inventory?
Usually because something consumed stock outside the order flow, or because sync across channels has latency. Shopify documents that the committed state is "Only affected by the creation and fulfillment of a merchant's orders" - so a unit taken for a photoshoot, a sample, a staff sale or a market stall is gone from the shelf while still counting as available. Add physical shrinkage, shared components in bundles, and deliberate sell-through-zero policies, and you have the full taxonomy. Log which cause each incident had, because they have four different fixes.
What is the cheapest way to reduce overselling?
Shopify documents a safety_stock inventory state described explicitly as "Units being set aside to help guard against overselling." Holding back a small buffer on high-velocity and multi-channel lines converts a would-be oversell into a slightly smaller sellable quantity, which is dramatically cheaper than a failed order. It costs a little revenue, requires no automation at all, and most stores never turn it on. If your oversell rate is meaningful, do this before building anything.
How does Shopify's inventory model actually work?
Shopify documents on_hand as "The total number of units that are physically stocked at a location," and states that "The on_hand state equals the sum of inventory quantities in the following states: available, committed, reserved, damaged, safety_stock, quality_control." Understanding that decomposition is what lets you diagnose an oversell - if physical stock does not match on_hand you have a counting problem, and if available was overstated you have a sync or an off-system-consumption problem.
When should the workflow trigger?
As early as possible. A check at order creation that available stock genuinely covers every line catches multi-channel latency oversells within seconds. An explicit "short" action on the warehouse picking device fires immediately rather than adding to an afternoon pile. A scheduled sweep of unfulfilled orders catches the rest. Most stores trigger only at fulfilment failure, which is why their median time-to-notify is measured in hours - and every option you can offer decays over those hours.
Can AI write these messages?
It can write the connective prose, and it should not be trusted with the facts. The message contains commitments about dates, substitutions and money, so template the order number, item, expected date and amounts as literal values pulled from the record and let the model handle only the wording. Never let it state a date it inferred or an option it has not verified against live data - a second broken promise on an already-broken order is how you generate a chargeback.
Which orders should not be automated?
High-value orders, repeat customers, anything that has already been delayed once, and any customer who replies in prose rather than clicking an option. Set a value and loyalty threshold above which the automation drafts and alerts rather than sending. The cost of a person handling a $600 order from a returning customer is trivial next to the cost of losing them, and these are exactly the cases where a slightly wrong automated message does the most damage.
How do I know if the handling is actually good?
Track repeat purchase rate among affected customers against the store average. Save rate and time-to-notify tell you whether the workflow is fast and persuasive; only the repeat rate tells you whether customers came away thinking you handled it well. Before building anything, spend a month handling oversells personally with a real choice offered quickly and measure the save rate you actually achieve - that is the input the entire business case rests on, and it is the one nobody can supply for you.

If this resonated

Module 02 is the long version of this post.

Eval set, refusal pattern, kill switch. Build it in a weekend.

All postsLast verified 2026-08-05

Done for you

Want this built for your business?

Tell us the workflow. We scope, build, and ship the agent with guardrails and the numbers to prove it worked. The scoping call is free.

Free scoping call. You own the code.

Request a scoping call