# Stock items

<figure><img src="/files/kiqzb4dtgMHkp20zcSoN" alt=""><figcaption></figcaption></figure>

{% hint style="info" icon="lightbulb" %}
A stock item represents the inventory of an SKU in a given stock location. Stock is automatically reserved when an order is placed and decremented on approval. Manual early reservation is also supported.
{% endhint %}

## What is a stock item?

A [stock item](/core-api-reference/stock_items.md) is the inventory of an SKU in a given stock location.

{% hint style="warning" %}
The actual *available* quantity may differ from the total stock, as it accounts for any active [stock reservations](#how-stock-reservation-works).
{% endhint %}

When an order is approved, stock item quantities are decremented. When a return is approved and items are restocked, they are incremented.

When creating a stock item, the associated SKU must be available in one of the market's stock locations. The quantity you set represents the initial stock level for that SKU in that location.

## How stock reservation works

Unless triggered manually, stock is automatically reserved when an order is placed. This creates stock reservations in *pending* status for each line item. At this stage, quantities are not yet decremented — the actual availability equals the stock item quantity minus the reserved quantity.

Once the order is approved, quantities are decremented and the stock reservations are deleted. If the order is cancelled, the reserved stock is released and the reservations are also deleted.

Stock associated with an SKU or bundle line item can also be reserved before the order is placed, using a trigger attribute via an integration application (limited to integrations for security reasons). In this case, stock reservations are created in *draft* status and moved to *pending* when the order is placed. Manually triggered reservations expire after **1 hour** by default — this can be changed at the inventory model level. If the order is not placed before expiration, or the line item is removed, the reserved stock is released.

{% hint style="info" %}
Stock reservations act on the whole line item quantity. If the available stock is split across multiple stock locations, multiple stock reservations are created.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.commercelayer.io/data-model/inventory-management/stock-items.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
