HelmHelm UniversityTrack 2 › Lesson 2.3

Lesson 2.3

Stock, and why you cannot oversell

The default is zero, the switch to turn tracking off exists, and the race that ruins live selling is closed in the database.

2 min readTrack 2, List Your ProductsFree, no account needed
Helm University track 2, List Your Products

Prefer to listen? This is the same lesson, word for word. The text below is the transcript.

This lesson prepares you to: Set stock correctly, choose whether to track it, and explain how Helm prevents two buyers taking the last item.

The default is zero

A new product starts with 0 in stock and stock tracking on. That combination means the listing is live and unbuyable. It is the single most common reason a new seller sees traffic and no orders.

Set a real number, or turn tracking off.

Turning tracking off

If you make to order, sell a digital item, or simply do not want to keep a count, switch stock tracking off. Helm then stops checking availability at checkout entirely and your listing can be bought any number of times.

That is the right setting for a lot of small sellers and the wrong one for anybody selling a limited run. Choose deliberately rather than by accident.

Two buyers, one item

This is the failure that ruins live selling on other platforms: the same last item sold twice because two people tapped buy in the same second.

It cannot happen here. Stock is taken with a single guarded database write that only succeeds if there is enough left, rather than by reading the number, thinking about it, and writing it back. The second buyer's write matches nothing and their checkout is refused. The migration that introduced it names this outright as the number one live shopping consistency failure, which is why it was designed in rather than patched later.

Stock is decremented atomically at checkout. There is no window in which two orders can both win.

When stock comes back

Stock is returned to you automatically in the cases where an order never completes:

  • The buyer's checkout session expires without payment.
  • The payment page could not be created at all.
  • A parent denies a minor's purchase.

Stock is held while a parent decides

When a kid or teen checks out and the purchase needs parental approval, your stock is taken straight away, before the parent has answered. If they approve, it stays taken. If they deny it, it comes back. There is no time limit on how long a parent can leave it, so a slow decision holds your stock indefinitely. Worth knowing if you sell one of something.

Variants hold their own stock

If a product has variants, each variant carries its own count and Helm takes stock from the variant rather than the product. Set them per variant or the numbers will not mean what you think.