It's 11:59 p.m. on a Sunday night. You have exactly one of an item left in stock. At the exact same second, two different shoppers on two different phones both tap "Add to Cart." Both make it to checkout. Both type in their card number. Both expect to walk away with that item.
Only one of them can.
If you've never built or run an online store, this might sound like a rare, almost funny edge case. It isn't. It happens every single day, on every busy store, especially around sales and holidays. And how your store handles that split-second collision says a lot about whether the software behind your "buy" button was built carefully, or bolted together in a hurry.
I've spent years building this kind of software for clients, and this is one of the questions I get asked most: "It's just a shopping cart, how complicated can it really be?" The honest answer is: more than it looks. Let me walk you through what actually happens behind the scenes, in plain terms, no tech degree required.
What happens the instant someone clicks "Add to Cart"
Clicking "Add to Cart" feels like one simple action. Behind the scenes, it's really a short conversation between the shopper's browser and your store's software.
Your store has to answer a few questions instantly: Is this item still available? Does the size or color the shopper picked actually exist? Should this item be temporarily set aside for this shopper, or just noted as "interested"?
Most stores don't lock the item the moment it lands in a cart. If they did, one shopper could put your entire inventory in their cart and never buy, and nobody else could purchase anything. Instead, the cart is more like a shopping list. The item isn't truly yours until you finish paying for it. That's why an item can vanish from your cart between browsing and checkout — someone else finished first.
Keeping stock counts honest when everyone's shopping at once
This is the part non-technical owners underestimate the most. Your product page might say "3 in stock." But dozens of people could be looking at that page right now, from different devices, in different cities. How does the store make sure it doesn't sell more than it actually has?
The store keeps one single, official count of stock in one place — usually a database — and every sale checks against that same number, one at a time, in order. When a customer clicks "buy," the system briefly puts a hold on that single count, confirms there's still enough left, subtracts what was just bought, and releases the hold. It happens in a fraction of a second, but it has to happen in the right order, every time, even when hundreds of people are buying at once.
Skip this step, or build it carelessly, and you get overselling: ten people "successfully" buy the last five units. Now you owe five customers an apology, a refund, and possibly a discount code to make up for it. Good stores also build in a small buffer, holding back a unit or two as a safety margin, because syncing stock across a website, a warehouse, and maybe a physical store always has a tiny delay.
What actually happens when you click "Place Order"
Here's where a lot of business owners assume the money just moves instantly from the customer's card to their bank account. It doesn't work quite like that, and understanding the real sequence helps explain why orders sometimes need extra review.
When a customer submits payment, your store first asks the card network to check that the card is real, has enough available funds, and isn't flagged for anything suspicious. Think of this step like a restaurant holding a table for you when you call ahead: the table is set aside, but nobody has eaten yet. That's the "hold" step. It confirms the money is there and sets it aside, but it doesn't move it yet.
The actual transfer of money — the store gets paid — usually happens next, sometimes seconds later, sometimes only once the item ships. That's why you might see a pending charge on your bank statement before you get your confirmation email, and why a canceled order sometimes shows as a charge that simply disappears a few days later instead of a refund. Nothing was ever truly taken.
Why the confirmation screen isn't the finish line
Once payment is approved, your store still has work to do before that order is truly "done." It has to record the sale, update your stock count for real (not just the temporary hold), send a confirmation email, notify whoever packs the order, and often update your accounting or inventory tools too.
If any one of those steps fails quietly — say, the confirmation email service has a hiccup — a customer can pay successfully and never receive confirmation, which understandably makes them panic and email you asking if it worked. Well-built stores double check every one of these steps and retry the ones that fail, instead of assuming success and moving on.
Why most shoppers still leave without buying
Even when everything above works perfectly, most people who add something to a cart never finish checking out. Industry research consistently shows roughly seven out of ten online shopping carts get abandoned before purchase — surprise shipping costs, a checkout that asks too many questions, or simply getting distracted are the usual culprits. If you're seeing steady visitors but weak sales, the checkout mechanics covered here are rarely the cause; it's usually something in the shopping experience itself, which I cover in why your traffic is up but your sales aren't.
Why "just add a shopping cart" undersells the job
None of this means you need something wildly expensive. Plenty of proven, affordable platforms already handle stock locking and payment holds correctly, and for many small stores, that's the right starting point rather than custom-built software. What matters is knowing that "simple" storefront is quietly managing inventory locks, payment timing, and several automated follow-up steps every time someone checks out — and that the platform and hosting underneath it need to be solid too, which is worth understanding on its own, covered in how hosting and domains actually work.
The businesses that run into trouble are usually the ones who treated all of this as an afterthought — added a cart plugin, never checked how it handles two people buying the last unit, and found out the hard way during their biggest sale of the year.
If you're setting up a store, scaling one, or just trying to understand why last month's "glitch" happened, I'm happy to walk through it with you.