> For the complete documentation index, see [llms.txt](https://docs.fulfillmenttools.com/documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fulfillmenttools.com/documentation/by-pillar/global-inventory-hub/stock/stock-availability.md). Agents can also search and read this documentation through its [MCP server](https://docs.fulfillmenttools.com/documentation/~gitbook/mcp).

# Stock availability

fulfillmenttools serves as the central repository for stock data. It integrates updates from multiple sources and consolidates these inputs to deliver diverse availability metrics for various use cases. You can query these metrics through the REST API and access them in Backoffice.

## Getting stock availability information

|                                                      | Backoffice                                                                                                                             | REST API                                                                                                                                                                                             |
| ---------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Stock availability per article on network level**  | [Inventory network overview in the Backoffice](https://docs.fulfillmenttools.com/documentation/backoffice/network-view/inventory.md)   | [api/stocks/summaries](https://docs.fulfillmenttools.com/documentation/apis/api-reference/stocks-inventory#get-api-stocks-summaries)                                                                 |
| **Stock availability per article on facility level** | [Inventory facility overview in the Backoffice](https://docs.fulfillmenttools.com/documentation/backoffice/facility-view/inventory.md) | <p><a href="#request-stocks-by-facility-for-a-specific-product">api/stockdistribution</a><br><br><a href="#inventory-facility-stock-changed-event">InventoryFacilityStockChangedWebHookEvent</a></p> |

## Stock availability values

<table><thead><tr><th width="241.16015625">Availability value</th><th>Meaning</th></tr></thead><tbody><tr><td><strong>Stock on hand</strong> (On hand)</td><td>Describes stock that is physically located in a facility. Stock that is, for example, still booked to the facility but is already in transit to another facility is not included.</td></tr><tr><td><strong>Available on stock</strong> (AOS)</td><td><p>Available on stock describes stock that's available for sale (not earmarked for other purposes). In fulfillmenttools, it refers to stock that's <a href="https://docs.fulfillmenttools.com/documentation/by-pillar/global-inventory-hub/inventory-traits.md#available-traits">accessible</a>, reduced by:</p><ul><li>Stock that is <a href="https://docs.fulfillmenttools.com/documentation/by-pillar/global-inventory-hub/reservations.md">reserved</a> for orders</li><li><a href="#safety-stock">Safety stock</a> (stock that's held back for offline sales)</li><li><a href="https://docs.fulfillmenttools.com/documentation/by-pillar/global-inventory-hub/stock.md#stock-properties">Expired stock</a> (if defined)</li><li>Stock that has reached its <a href="https://docs.fulfillmenttools.com/documentation/by-pillar/global-inventory-hub/listing.md#stock-available-until">availableUntil</a> value (if defined)</li></ul></td></tr><tr><td><strong>Available for picking</strong> (AFP)<br><br></td><td><p>Available for picking describes stock that's available (not earmarked for other purposes) and ready to be picked. In fulfillmenttools, it refers to all stock that is <a href="https://docs.fulfillmenttools.com/documentation/by-pillar/global-inventory-hub/inventory-traits.md">accessible</a> and <a href="https://docs.fulfillmenttools.com/documentation/by-pillar/global-inventory-hub/inventory-traits.md">pickable</a>, reduced by:</p><ul><li>Stock that's <a href="https://docs.fulfillmenttools.com/documentation/by-pillar/global-inventory-hub/reservations.md">reserved</a> for orders</li><li><a href="#safety-stock">Safety stock</a> (stock that's held back for offline sales)</li><li><a href="https://docs.fulfillmenttools.com/documentation/by-pillar/global-inventory-hub/inventory-traits.md">Expired stock</a> (if defined)</li><li>stock that has reached its <a href="https://docs.fulfillmenttools.com/documentation/by-pillar/global-inventory-hub/listing.md#stock-available-until">availableUntil</a> value (if defined)</li></ul><div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>This value is used for incoming orders. It's sometimes referred to as available for shipping.</p></div></td></tr><tr><td><strong>Expected stock</strong></td><td><p>Expected stock is stock expected to arrive or be produced. Expected stock can be communicated via the <a href="https://docs.fulfillmenttools.com/documentation/by-pillar/global-inventory-hub/inbound-process.md">inbound process</a>. After an <code>inboundProcess</code> with a <code>purchaseOrder</code> was created, our systems automatically create expected stock for the requested items. Expected stock is visible in the <a href="https://docs.fulfillmenttools.com/documentation/backoffice/network-view/inventory.md#stock-availability">stock overview</a> in Backoffice. Once a purchase order is created, its expected stock can be considered in the shop's <a href="https://docs.fulfillmenttools.com/documentation/by-pillar/global-inventory-hub/stock/expected-stock-in-availability.md">availability</a>.</p><div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>This value can be considered for incoming orders. More information can be found under <a href="https://docs.fulfillmenttools.com/documentation/by-pillar/global-inventory-hub/stock/expected-stock-in-availability.md">Expected stock in availability.</a></p></div></td></tr><tr><td><strong>Safety stock</strong></td><td><p>Safety stock allows guarding offline sales against online-induced stock-outs. It can be defined on the facility level, and decreases the available stock levels ("<a href="#available-for-picking-afp">available for picking</a>" and "<a href="#available-on-stock-aos">available on stock</a>"). This means that if the stock level in a given facility is equal or less than the configured safety stock, the available stock is 0.</p><p>Users can configure the desired safety stock quantity for each listing. Configurations can be made in the <a href="https://docs.fulfillmenttools.com/documentation/backoffice/network-view/inventory.md#stock-availability">stock overview</a> in the Backoffice or via <a href="https://fulfillmenttools.github.io/fulfillmenttools-api-reference-ui/#put-/api/safetystocks">safety stocks REST API</a>.</p><div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>More information can be found under <a href="https://docs.fulfillmenttools.com/documentation/by-pillar/global-inventory-hub/stock/safety-stock.md">Safety stock</a>.</p></div><div data-gb-custom-block data-tag="hint" data-style="warning" class="hint hint-warning"><p>Safety stock is considered in order routing meaning that orders can become <a href="https://docs.fulfillmenttools.com/documentation/by-pillar/advanced-order-routing/unroutable-orders.md">unroutable</a> if the available stock is equal to or less than the configured safety stock.</p></div></td></tr></tbody></table>

## Inventory facility stock changed event

When stock levels change in a facility, the `INVENTORY_FACILITY_STOCK_CHANGED` event is emitted. It uses the `InventoryFacilityStockChangedWebHookEvent` payload. You can find the [schema in the models page](https://docs.fulfillmenttools.com/documentation/apis/api-reference/models.md).

Each event reports one `tenantArticleId` in one `facilityRef`. Every quantity in the payload is the aggregated value for that facility only. It does not contain a network-wide aggregate.

You can create an event scope for this event to include more than one facility, see the [Event scope section of the Eventing article](https://docs.fulfillmenttools.com/documentation/getting-started/eventing.md#event-scopes).

## Future availability

### Creation and management of expected stock

Expected stock is automatically created after a new [inbound process](https://docs.fulfillmenttools.com/documentation/by-pillar/global-inventory-hub/inbound-process.md) with a corresponding purchase order is added. Expected stock can only be managed via the purchase order and cannot directly be edited via API. Quantities, attributes, and so on of expected stock can be edited via the requested items of the [purchase order](https://docs.fulfillmenttools.com/documentation/by-pillar/global-inventory-hub/inbound-process/purchase-order.md).

### Stock properties and available until

**Available until**

**`availableUntil`** defines until when stock is considered available.

* Calculated automatically for stock and expected stock based on expiry or creation date, with optional modifiers (for example, `-P30D` to shift earlier) if configured in the [listing](https://docs.fulfillmenttools.com/documentation/by-pillar/global-inventory-hub/listing.md).
* For expected stock, the creation date of the purchase order is used if `calculationBase` is set to `CREATION`. When a receipt is created, `availableUntil` of the stock is updated based on the creation date of the stock.

{% hint style="warning" %}
When updating a listing with `stockAvailableUntil`, the value will be only added to newly created stock.
{% endhint %}

**Stock properties**

* Stock properties (especially `expiry`) provide the values required for calculating `availableUntil` with `calculationBase` = `EXPIRY`.
* [Listings](https://docs.fulfillmenttools.com/documentation/by-pillar/global-inventory-hub/listing.md) define which properties are required.
* For expected stock, `properties` can be specified in the `requestedItems` of the [purchase order](https://docs.fulfillmenttools.com/documentation/by-pillar/global-inventory-hub/inbound-process/purchase-order.md). When a `receipt` is created, the `properties` are transferred to the stock.
* If a `defaultValue` is defined for a stock property in the listing, the stock is created with that value. Empty strings provided as default values are ignored.

**Interaction**

* `availableUntil` is the decisive value for availability.
* If both `expiry` and `availableUntil` (with `calculationBase` = `CREATION`) are set, only `availableUntil` applies.
* `availableUntil` defaults to the expiry date if `expiry` `properties` are configured in the stock.

## Stock availability thresholds

Stock availability thresholds let you define your own low stock or critical stock levels for articles, categories, facilities, or facility groups. Whenever a stock level crosses one of these thresholds, you'll get notified automatically.

Instead of periodically checking stock reports yourself, you can set a threshold once, and fulfillmenttools monitors stock levels in the background for as long as the threshold is active.

Typical uses:

* **Replenishment triggers:** Get alerted when an article's available stock in a facility drops below a safety level, so you can reorder before it sells out.
* **Automation:** React programmatically when stock drops into a critical range (for example, pause promotions or notify a supplier).

### How availability thresholds work

A threshold configuration has two parts:

1. A `target`, which is what to monitor. For example, one or more articles, categories, facilities, or facility groups. You can combine these (for example, these 3 articles and these 2 facilities), or leave the target empty to monitor everything.
2. A `threshold` is the level you care about. Each has a name that you choose (for example, `CRITICAL_STOCK` or `LOW_STOCK`) and a numeric limit. You decide whether the limit is measured against [available for picking stock](https://docs.fulfillmenttools.com/documentation/by-pillar/global-inventory-hub/stock/stock-availability.md) or [stock on hand](https://docs.fulfillmenttools.com/documentation/by-pillar/global-inventory-hub/stock/stock-availability.md).

Once a configuration is created, every time a targeted article's stock changes, fulfillmenttools checks whether it has moved across one of your levels:

* If a stock level drops to or below a threshold's limit for the first time, that's a `TO_ON` transition, and the alert activates.
* If the stock level later recovers above the limit, that's a `TO_OFF` transition. The alert is "deactivated" because the situation has resolved itself.

If you set several levels (for example, `LOW_STOCK` at 20 units and `CRITICAL_STOCK` at 5 units), fulfillmenttools always reports the most specific one that applies. So stock falling straight from 100 to 3 units reports directly as `CRITICAL_STOCK`, not as `LOW_STOCK` followed by `CRITICAL_STOCK`.

Thresholds compare against a single number per stock measure. They don't currently account for trends (for example, rapid drops). Only the current value relative to your configured limit.

Everything is tracked per listing, per facility. If your target matches several facilities, each facility listing is monitored and alerted independently. One facility running low doesn't affect another facility's alert status.

{% hint style="info" %}
Today, one threshold configuration effectively monitors a single stock measure (either available for picking or stock on hand). If you need to watch both for the same target, create two separate threshold configurations.
{% endhint %}

A configuration with no target (empty target) applies to everything. Use this deliberately, as it will start monitoring your entire network.

### Example

Say you configure a threshold named `LOW_STOCK` with a limit of `10`, targeting article `SNEAKER-001` across all facilities in your Germany facility group, measured against available for picking stock.

* The Berlin facility has 45 available for `SNEAKER-001`, so nothing happens.
* A wave of orders brings Berlin's stock down to 8 available, so a `LOW_STOCK` alert fires `TO_ON` for Berlin.
* The Munich facility still has 60 available, so no alert for Munich as each facility is evaluated independently.
* Restocking brings Berlin back up to 30 available, so a `TO_OFF` alert fires for Berlin, closing out the earlier alert.
* Prague drops to 9 available, but no alert fires for the Prague facility because it's not in the target.

### Create a threshold

You manage threshold configurations via the [availability threshold configuration API](broken://pages/1f496cc9ee9e942e304f90b9a68880f27e643e26). You can create, update, or delete a configuration by specifying its target and its threshold levels. You don't need to poll or schedule anything.

To create a threshold, use the endpoint below:

```http
POST https://{YOUR-TENANT-NAME}.api.fulfillmenttools.com/api/configurations/availability/thresholds
```

If we created a threshold as described in the [example](#example), it would look like the following:

```json
{
  "target": {
    "context": [
      {
        "type": "FACILITY_GROUP",
        "values": [
          "{YOUR_FACILITY_GROUP_ID}"
        ]
      },
      {
        "type": "ARTICLE",
        "values": [
          "SNEAKER-001"
        ]
      }     
    ]
  },
  "tenantThresholdId": "LOW_STOCK_SNEAKER-001",
  "thresholds": [
    {
      "levels": [
        {
          "key": "LOW_STOCK",
          "limit": 10
        }
      ],
      "thresholdOnValue": "AVAILABLE_FOR_PICKING"
    }
  ]
}
```

### Edit a threshold

Changing a configuration resets all active alerts for that configuration, so the next stock change is evaluated against the new settings. If a given stock level was already in a `TO_ON` state before the change, it will be treated as a new transition if it is still below the threshold after the change.

To update a threshold, use the endpoint below:

{% tabs %}
{% tab title="Endpoint" %}

```http
PUT https://{YOUR-TENANT-NAME}.api.fulfillmenttools.com/api/configurations/availability/thresholds/{YOUR_THRESHOLD_ID}
```

{% endtab %}

{% tab title="Request" %}

```json
{
  "version": 1,
  "thresholds": [
    {
      "thresholdOnValue": "STOCK_ON_HAND",
      "levels": [
        {
          "key": "LOW_STOCK",
          "limit": 5
        }
      ]
    }
  ]
}
```

The `version` field is required and must match the stored version of the threshold configuration.
{% endtab %}
{% endtabs %}

You can also trigger a full reevaluation of the affected stock availabilities when the `context` or `threshold` changes.

To do this, use the `enforceFullReevaluation=true` parameter:

```http
PUT https://{YOUR-TENANT-NAME}.api.fulfillmenttools.com/api/configurations/availability/thresholds/{{thresholdId}}?enforceFullReevaluation=true
```

The reevaluation runs asynchronously and sends `INVENTORY_FACILITY_STOCK_THRESHOLD_TRANSITIONED` events for each resulting threshold transition, plus an `INVENTORY_FACILITY_STOCK_THRESHOLD_TRANSITIONED_BULK` event.

{% hint style="warning" %}
A reevaluation after a change can send many events in a short time. The `INVENTORY_FACILITY_STOCK_THRESHOLD_TRANSITIONED_BULK` event reduces webhook calls. Event consumers must be able to process these large volumes.
{% endhint %}

For each processed stock availability, the reevaluation sends up to two transitions per entry in the thresholds array of the configuration:

* `TO_OFF` for the previous configuration version, if a threshold level was reached.
* `TO_ON` for the updated configuration version, if a threshold level is reached.

{% tabs %}
{% tab title="Event payload" %}
A single webhook call contains the transitions for one `tenantArticleId` in one facility. The following payload shows a configuration that changed from version 1 to version 2 while the stock stayed below both limits.

{% code title="INVENTORY\_FACILITY\_STOCK\_THRESHOLD\_TRANSITIONED" %}

```json
{
  "event": "INVENTORY_FACILITY_STOCK_THRESHOLD_TRANSITIONED",
  "eventId": "{YOUR_EVENT_ID}",
  "payload": {
    "tenantArticleId": "{YOUR_TENANT_ARTICLE_ID}",
    "facilityRef": "{YOUR_FACILITY_ID}",
    "facility": {
      "facilityRef": "{YOUR_FACILITY_ID}",
      "tenantFacilityId": null
    },
    "thresholds": [
      {
        "config": {
          "id": "{YOUR_CONFIG_ID}",
          "version": 1,
          "tenantThresholdId": "{YOUR_TENANT_THRESHOLD_ID}"
        },
        "transition": "TO_OFF",
        "triggerTimestamp": "2026-01-01T10:00:00.000Z",
        "thresholdOnValue": "STOCK_ON_HAND",
        "thresholdLevel": {
          "key": "LOW_STOCK",
          "limit": 3,
          "actual": 1
        }
      },
      {
        "config": {
          "id": "{YOUR_CONFIG_ID}",
          "version": 2,
          "tenantThresholdId": "{YOUR_TENANT_THRESHOLD_ID}"
        },
        "transition": "TO_ON",
        "triggerTimestamp": "2026-01-01T10:00:00.000Z",
        "thresholdOnValue": "STOCK_ON_HAND",
        "thresholdLevel": {
          "key": "LOW_STOCK",
          "limit": 4,
          "actual": 1
        }
      }
    ]
  }
}
```

{% endcode %}
{% endtab %}

{% tab title="Bulk event payload" %}
The `INVENTORY_FACILITY_STOCK_THRESHOLD_TRANSITIONED_BULK` event bundles the transitions of multiple stock availabilities in one webhook call. Each entry of the array has the same structure as the payload of the `INVENTORY_FACILITY_STOCK_THRESHOLD_TRANSITIONED` event, for different `tenantArticleId` and `facilityRef` combinations.

{% code title="INVENTORY\_FACILITY\_STOCK\_THRESHOLD\_TRANSITIONED\_BULK" %}

```json
{
  "event": "INVENTORY_FACILITY_STOCK_THRESHOLD_TRANSITIONED_BULK",
  "eventId": "{YOUR_EVENT_ID}",
  "payload": [
	{
  	"tenantArticleId": "{YOUR_TENANT_ARTICLE_ID_1}",
  	"facilityRef": "{YOUR_FACILITY_ID}",
  	"facility": {
    	"facilityRef": "{YOUR_FACILITY_ID}",
    	"tenantFacilityId": null
  	},
  	"thresholds": [
    	{
      	"config": {
        	"id": "{YOUR_CONFIG_ID}",
        	"version": 2,
        	"tenantThresholdId": "{YOUR_TENANT_THRESHOLD_ID}"
      	},
      	"transition": "TO_ON",
      	"triggerTimestamp": "2026-01-01T10:00:00.000Z",
      	"thresholdOnValue": "STOCK_ON_HAND",
      	"thresholdLevel": {
        	"key": "LOW_STOCK",
        	"limit": 4,
        	"actual": 1
      	}
    	}
  	]
	},
	{
  	"tenantArticleId": "{YOUR_TENANT_ARTICLE_ID_2}",
  	"facilityRef": "{YOUR_FACILITY_ID}",
  	"facility": {
    	"facilityRef": "{YOUR_FACILITY_ID}",
    	"tenantFacilityId": null
  	},
  	"thresholds": [
    	{
      	"config": {
        	"id": "{YOUR_CONFIG_ID}",
        	"version": 2,
        	"tenantThresholdId": "{YOUR_TENANT_THRESHOLD_ID}"
      	},
      	"transition": "TO_ON",
      	"triggerTimestamp": "2026-01-01T10:00:00.000Z",
      	"thresholdOnValue": "STOCK_ON_HAND",
      	"thresholdLevel": {
        	"key": "LOW_STOCK",
        	"limit": 4,
        	"actual": 2
      	}
    	}
  	]
	}
  ]
}
```

{% endcode %}
{% endtab %}
{% endtabs %}

As the reevaluation is asynchronous, regular stock changes can occur while it's running. Correct results can only be guaranteed if the following rules are adhered to:

* If `config.version` is higher than the stored version, the event is accepted.
* If `config.version` equals the stored version, the event with the higher `triggerTimestamp` for the given threshold is kept.

{% hint style="info" %}
Transitions that originate from a reevaluation don't create alerts in the Notification center.
{% endhint %}

#### Concurrent updates

An update with `enforceFullReevaluation=true` while a reevaluation of the same threshold configuration is running stops the running reevaluation and starts a new one. The new reevaluation sends only the events for the change from the previous configuration version to the updated one.

An update without `enforceFullReevaluation` while a reevaluation is running stops the reevaluation.

Updating a configuration with `enforceFullReevaluation=true` in quick succession isn't recommended. If a threshold configuration is updated multiple times, it's recommended that you remove data stored from previous configuration versions.

A stock availability matches a threshold configuration when a stock availability change is processed while the configuration exists. Stock availabilities that haven't changed since the configuration was created aren't matched. A reevaluation after a threshold change doesn't process these stock availabilities.

A reevaluation after a context change takes longer. The duration depends on the number of unique stocks across facilities and `tenantArticleId` values.

### View an alert

You can view an alert in two ways, via [Backoffice](#backoffice-users) or [API](#api-consumers).

{% hint style="warning" %}
This isn't automatically viewable. You must opt in first by configuring the [Notification center](https://docs.fulfillmenttools.com/documentation/getting-started/eventing/notification-center.md) settings.
{% endhint %}

Alerts are informational only. Reaching a threshold doesn't itself block orders, pause listings, or take any other automated action. You (or your configured notification channel) decide how to respond.

#### Backoffice users

When a threshold activates (`TO_ON`), it can be surfaced as:

* An in-app notification in Backoffice
* An email sent to the addresses configured for your tenant or facility

Both channels are opt-in and configured through the [Notification center](https://docs.fulfillmenttools.com/documentation/getting-started/eventing/notification-center.md) settings.

{% hint style="info" %}
Only the `TO_ON` (stock became critical) transition is treated as notification-worthy. The recovery (`TO_OFF`) is intentionally silent, since the problem resolved itself rarely needs an alert of its own.
{% endhint %}

#### API consumers

Every transition (`TO_ON` and `TO_OFF`) is emitted as a domain event containing the article, the facility, and the threshold level(s) that changed, so you have the full picture even though only `TO_ON` triggers a human-facing notification by default.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.fulfillmenttools.com/documentation/by-pillar/global-inventory-hub/stock/stock-availability.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
