Academy › Build › Bookings and orders
The last unit, two people buying at the same time: who gets it
By the end, you'll know the last unit belongs to whoever completes payment first, not whoever clicks first from their phone, and what to do and say to the person who misses out if they were charged anyway.
By Yodai · Published on September 6, 2026 · Updated on October 12, 2026
It's eight o'clock at night and you've got one spot left for Saturday's workshop. Two people see it open on the site almost at the same second. Both hit "pay" within a blink of each other. Only one gets it, and in a few minutes you'll have to decide what to say to the one who's left without a spot.
If your store won't let someone buy what's already sold out, and subtracts the spot when payment goes through, without holding anything aside while someone's typing in their card, most cases sort themselves out: if Martha finishes paying two minutes before Julian tries, Julian already sees the spot as sold out and can't buy it. The real tie, the one that forces you to decide on a rule, only happens when both are paying at the same time: both saw the spot open, and neither has finished yet.
The rule that actually works
The temptation is to trust the clock: whoever clicked first wins. It sounds fair, and it's the first rule almost everyone thinks of. But it doesn't work. Martha's phone clock and Julian's phone clock aren't synced with each other, and each message takes a different amount of time to reach your server depending on their signal at that moment, or whether their bank asks for a confirmation code and the other person's doesn't. Julian could press the button a full second before Martha and still arrive at your system after she does.
The rule that actually works is different: whoever completes payment first wins, not whoever clicks first on their screen. That order doesn't depend on anyone's phone: every charge gets logged with a timestamp in your payment processor, and whoever's charge went through first keeps the spot. What that rule doesn't prevent is the second charge: if your store doesn't hold the spot while payment is processing, Julian's payment can still go through a few seconds later, and then you've got two charges for one spot and a refund to issue.
- Decided by each phone's clock
- Two clocks that don't match each other
- Depends on each buyer's signal when sending the request
- Decided by the order of arrival at a single system
- One single clock: the one that times charges in your payment processor
- Nobody's signal matters, only the order the two payments get processed in
Which one to pick: Always go with the second one. The first depends on devices you don't control; the second depends on a single point, yours, and with that record you know without question who gets the spot and who gets a refund.
Why checking then charging in two steps will burn you
Some stores work like this: they first check if there's a spot left, when the customer picks it, and subtract it once the charge goes through. Two steps, one after the other, the way you'd do it by hand in a shop with a notebook. The problem is what can happen between those two steps when everything's happening online in a matter of seconds.
If Martha and Julian check availability almost at the same time, they both see "one left." Both get through the first step with nothing stopping them. Then both get charged, because nothing has told either of them yet that the other one already got there first. You end up with two cards charged and only one real spot. It takes both of them paying at nearly the same moment, but with the last spot for something popular, it can happen. And since it's not something you can change from your end, what you can do is plan for it: know who gets the refund and what you'll say to them.
Between the checking step and the charging step there's a time gap where the other buyer slips in with nothing stopping them
What to tell the one who loses out
Once you've settled who wins, there's still the other side of the counter: what the person who loses the tie sees and feels. If they were charged, they got an order confirmation and believe the spot is theirs: every hour that passes without hearing from you, the more they believe it, and the worse the news lands when it finally comes.
The message has to reach them soon, and from you, before they come asking. And it can't be a plain "sold out": that slams the door shut and offers nothing in return for the minutes they spent deciding. Better to tell them, in those words, that it sold out by seconds, that you've already refunded them, and give them something concrete to do with that frustration: offer to notify them first if a spot opens up (jot it down on paper or in your phone) or offer them the next available date right away.
With that, the tie is settled: whoever's payment finishes first wins, not whoever's click reaches you first from a phone, and whoever loses gets refunded as soon as you spot it and gets something concrete handed to them instead of a closed door. Next, let's go one level deeper: what happens when it's not the whole product that sells out, but a specific size, color, or time slot within it.
- The tiebreaker rule is settled: whoever's payment finishes first wins, based on the charge timestamp in your payment processor
- If your store checks stock when an item is selected and subtracts it when payment goes through, two charges can slip through on the last unit, and you're prepared for it
- Whoever loses out gets refunded as soon as you spot it and hears from you right away, before they have to ask
- The notice message always comes with a concrete alternative, never just "sold out"
Test yourself
Answer before opening each one. If one gives you trouble, go back to the section that explains it.
1. A customer writes in upset because you charged them on Saturday and refunded them the next day saying there was no spot left after all.
It was a timing failure, not a rule failure. Two charges can slip through on the last spot; what can't happen is the person who loses finding out the next day. Fix it by checking charges as soon as something popular sells out, issuing the refund right away, and messaging them promptly with an alternative.
2. Two buyers say they hit the button in the same second according to their phones' clocks, but one took four seconds longer to fill in the card.
The spot goes to whoever's payment finished first according to your payment processor, not whoever "got there first" according to their own phone: the clocks on the two devices aren't synced with each other, and it wouldn't matter even if they were; the only thing that counts is the order in which the two charges finish in your payment processor.
3. You're thinking about telling the person who lost the tie with a simple "out of stock" and nothing else.
That's not enough: it shuts the door without offering any way out for the three minutes that person already spent deciding. Replace it with a message that acknowledges it sold out by seconds, plus a concrete alternative, like notifying them first if a spot opens up or offering the next available date, so you don't lose the sale entirely.
That tie gets resolved by unit, but only if you're truly counting unit by unit: size, color, or time slot, not the whole product lumped into a single number.
In Yodai the store comes with the Free plan, with a catalog, a cart and orders. See how to create your online store for free.
NextA counter for each size, color, or time slot, not one for the whole product