Product stock
You can set a stock limit on each product to tie your sales on Byl to your inventory. Every purchase decrements the stock automatically, a paying customer's items are held for them while they pay, and you're notified when stock runs low.
This is a sales limit on Byl, not a warehouse system — there are no variants, multiple locations, or syncing with external systems.
Setting the stock
- In the dashboard, open a product and enter a number in the Stock (Зарах тоо) field.
- Leave it empty for unlimited sales (the default).
- The products list shows the current stock in the "Үлдэгдэл" column.
Stock lives on the product, so all of a product's prices share one counter. Ad-hoc items passed to a checkout via price_data (unregistered products) are never stock-tracked.
Manual adjustments
You can change the stock by hand at any time — restocking, correcting after a physical count, and so on. Every change is recorded in the activity log with who changed it and the old and new values.
What happens during a purchase?
- When a customer confirms their checkout and reaches the payment step, their items are reserved for 10 minutes, and a countdown is shown on the payment page.
- Until the hold expires, those units are subtracted from the stock other customers can buy. Refreshing the page does not extend the hold — a new window starts only when the quantity changes or the old hold has expired.
- Once the hold expires, the payment can no longer proceed and a "Restart" button appears — the purchase starts over.
- When the available stock can't cover the order, the checkout won't confirm and returns an "insufficient stock" error.
When the payment succeeds, the sold quantity is subtracted from the stock. This is also recorded in the activity log.
Stock can go negative
Byl doesn't reject a payment that lands after its reservation expired — the sale is honored and the stock decremented, so the stock can go negative (oversold). You'll be notified when this happens; reconcile with your physical inventory and refund if necessary.
Notifications and webhooks
A product.stock_low event fires when the stock crosses a threshold, and is delivered to your webhook endpoints and notification channels:
- Stock drops to 5 or below — a "low stock" warning.
- Stock hits 0 — an "out of stock" notice; checkout link sales stop.
- Stock goes negative — an oversell alert.
Repeated sales inside the low zone stay quiet — the event fires once per boundary crossing.
{
"id": 112,
"project_id": 1,
"type": "product.stock_low",
"object": "product",
"data": {
"object": {
"id": 7,
"project_id": 1,
"name": "Handmade vase",
"client_reference_id": null,
"stock": 4
}
},
"created_at": "2026-08-14T09:30:00.000000Z",
"updated_at": "2026-08-14T09:30:00.000000Z"
}With checkout links
Checkout links fully respect stock:
- As soon as the stock can't cover the link's minimum demand, the link shows a "sold out" page.
- The maximum quantity a customer can pick is capped at the available stock.
- Top up the stock and the link starts selling again by itself.
Notes
- Setting the stock to
0stops sales; that's different from leaving it empty (unlimited). - Stock applies equally to checkouts created via the Checkout API and to checkout links — every channel draws from the same counter.
- Free (₮0) orders complete immediately, and decrement stock just the same.
Next steps
- Checkout links — sell through a link that enforces your stock
- Notifications — receive
product.stock_lowvia Telegram or email - Webhooks — receive stock events in your own system