Documentation Index
Fetch the complete documentation index at: https://86d.app/docs/llms.txt
Use this file to discover all available pages before exploring further.
The inventory module tracks stock levels per product or variant, decrements on order placement, holds reservations during checkout, and surfaces low-stock and out-of-stock signals to the storefront and the admin. It works alongside @86d-app/products (which holds the per-product inventory field) and @86d-app/orders (which fires the inventory-decrement event).
Source: modules/inventory · npm: @86d-app/inventory
Installation
Configuration
inventory({
lowStockThreshold: "5", // default low-stock alert threshold
reservationTtl: "1800000", // 30 minutes, in ms
allowNegativeStock: "false", // when "false", reject orders that would oversell
});
Store endpoints
| Method | Path | Description |
|---|
GET | /inventory/:productId | Public inventory level for a product |
POST | /inventory/reserve | Reserve stock during checkout |
POST | /inventory/release | Release a reservation |
Admin endpoints
| Method | Path | Description |
|---|
GET | /admin/inventory | List inventory across all products |
POST | /admin/inventory/:productId/adjust | Manual adjustment (+/-) with reason |
GET | /admin/inventory/low-stock | Items below lowStockThreshold |
GET | /admin/inventory/audit-log | Inventory change history |
Events
| Event | When |
|---|
inventory.adjusted | Manual adjustment recorded |
inventory.low-stock | A SKU crosses below threshold |
inventory.out-of-stock | A SKU hits zero |
Components
<StockBadge inventory={n} />: storefront badge (“In stock”, “Only X left”, “Out of stock”).
<InventoryWidget />: admin inline widget for quick adjustments.