# Inventory models

An inventory model defines a list of [stock locations](/core-api-reference/stock_locations.md) ordered by priority. The priority and cutoff determine how the availability of SKUs gets calculated within a market.

{% hint style="info" %}
The stock location cutoff defines the maximum number of stock locations used for inventory computation at the inventory model level. The default value is **2**, it can be increased up to **10** by patching the inventory model resource and setting the desired value for the related attribute.
{% endhint %}

The list of [inventory stock locations](/core-api-reference/inventory_stock_locations.md) determines the availability of SKUs that are being purchased. The list of [inventory return locations](/core-api-reference/inventory_return_locations.md) determines the available options for returns.

### Inventory strategies

Multiple [inventory model strategies](/how-tos/inventory/strategies.md) are available. You can select a specific one by setting the `strategy` attribute accordingly, depending on how you want your order items to be fulfilled. An inventory model strategy is responsible to decide how many [shipments](/core-api-reference/shipments.md) are generated and from which stock location each shipment will be shipped. Based on the selected strategy, if an order contains line items from two or more stock locations, the order can be split into two or more shipments, one for each location. [Stock transfers](/core-api-reference/stock_transfers.md) from a stock location (e.g. secondary) to another (e.g. primary) can be created as well.

{% hint style="info" %}
In case the inventory model strategy is left as default – **no split** – just a single shipment from a single stock location is always created.
{% endhint %}

### Stock reservation settings

Draft [stock reservations](/core-api-reference/stock_reservations.md) (i.e. created before the order placement) have a default expiration date of **1 hour**. You can override the default duration by setting the inventory model `stock_reservation_cutoff` attribute to the desired value (expressed in seconds).

{% hint style="info" %}
Any change to the stock reservations expiration date won't affect existing stock reservations. It will be applied to the ones created after the update only.
{% endhint %}

### Manual stock decrementation

By default as soon as an [order](/core-api-reference/orders.md) is approved the related [stock item](/core-api-reference/stock_items.md) quantities are decremented and all the involved [stock reservations](/core-api-reference/stock_reservations.md) cancelled. If you need to manually manage the stock decrementation and the concomitant stock reservation cancellation at any time after the order approval, you can override this behavior by setting the `manual_stock_decrement` flag to `true`.

{% hint style="info" %}
Please note that the manual stock decrementation does not happen at the order level, but you need to perform it at the [shipment](/core-api-reference/shipments.md#manual-stock-management) or (if you need more granular control on the action) at the [stock line item level](/core-api-reference/stock_line_items.md#manual-stock-line-items-management).
{% endhint %}

<details>

<summary>Data model</summary>

Check the related [ER diagram](https://commercelayer.io/docs/data-model/inventory-models) and explore the flowchart that illustrates how the inventory model resource relates to the other API entities.

</details>

<details>

<summary>How-to</summary>

Check the related [guide](/how-tos/inventory/strategies.md) to learn more about the available inventory model strategies and how they work.

</details>


---

# 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/core-api-reference/inventory_models.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.
