> ## Documentation Index
> Fetch the complete documentation index at: https://86d.store/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Inventory

> Reference for @86d-store/inventory: stock records, reservations, adjustment endpoints, events, and components.

<Warning>
  **Experimental.** This Module has no test or production evidence recorded yet. Read it, run it locally, and hold off on real Orders. See [maturity levels](/docs/resources/versioning).
</Warning>

The Inventory [Module](/docs/concepts/modules) tracks stock for products and variants: current levels, reservations during [Checkout](/docs/concepts/commerce-model), manual adjustments, and low-stock reporting. Browser input never changes Inventory. Stock moves through server-side commerce operations.

<Warning>
  The Products package still stores its own Inventory fields, and cross-Module events are not a durable outbox. Verify which record is authoritative, and how retries and oversell behave, before you connect Inventory to live Checkout or Orders.
</Warning>

**Source:** [`modules/inventory`](https://github.com/86d-store/86d/tree/main/modules/inventory) · **npm:** [`@86d-store/inventory`](https://www.npmjs.com/package/@86d-store/inventory)

## Installation

```sh theme={null}
86d module add inventory
```

## Configuration

```ts theme={null}
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               |

Stock also decrements when the Orders Module records `order.placed`.

## Components

* `<StockBadge inventory={n} />`: [Storefront](/docs/concepts/storefront) badge ("In stock", "Only X left", "Out of stock").
* `<InventoryWidget />`: inline [Store Admin](/docs/concepts/admin) widget for adjusting stock.

## Related pages

* [Products](/docs/modules/products)
* [Orders](/docs/modules/orders)
* [Backorders](/docs/modules/backorders)
* [Preorders](/docs/modules/preorders)
* [How commerce records relate](/docs/concepts/commerce-model)
* [How 86d separates product authority](/docs/concepts/architecture#how-modules-talk-to-each-other)
* [86d glossary](/docs/resources/glossary#inventory)
* [Versioning and maturity](/docs/resources/versioning)
