Problem
A wholesale store sells the same physical stock as the company's retail store, and partners order large quantities. Without a shared count, two buyers could put the last units in their carts at the same time. Wholesale also needs minimum and maximum quantities per product, and the owner needed a way to close the store to outsiders.
Solution
I built a small Node.js and Express API that holds temporary reservations for items in a cart and expires them after a set time. The theme checks it when a product is added, when a quantity changes and in the cart, and shows a countdown timer. Products are matched between the two stores by handle and variant title, so a reservation in one store reduces what the other can sell. I added min/max rules with a VIP exception, a delivery widget in the cart page and drawer, and a theme setting that locks the store and lets only listed emails in.
Key decisions
Chose a separate reservation service over theme-only checks
Why Shopify does not hold stock for a cart, so a server has to be the single source of truth for what is reserved.
Chose to match products by handle and variant title across the two stores
Why Product and variant IDs differ between stores, but handles and variant titles are the same in both.
Chose a lockdown switch in theme settings over a password page
Why The owner can close the store and edit the allowed emails and banner text without a developer.
Results
- Cart reservation API with automatic expiry, a countdown timer in the cart and checks on product page, quick add and cart quantity changes.
- Minimum and maximum order quantity rules, including a VIP exception, shown on product cards, product pages and the cart.
- A delivery widget in the cart page and drawer with a warehouse or courier choice, passed on to the order as cart attributes.
- A store lockdown setting with an allowed-email list and an optional banner message.

