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

# Real-time inventory updates

> Keep Algolia stock information in sync with every order in Salesforce B2C Commerce.

The indexing jobs keep Algolia in sync on a schedule, but high-velocity stores need **instant** stock updates.
Version **25.3.0** introduces an **Enable Real-Time Inventory** preference and a lightweight hook that pushes changes to Algolia immediately after checkout.

Real-time updates don't replace existing inventory jobs:
they complement them.
The existing system still handles bulk changes.
Stores with high turnover require real-time updates to synchronize inventory because [delta jobs](/doc/integration/salesforce-commerce-cloud-b2c/indexing/product-indexing/overview#overview-of-the-indexing-jobs) don't support inventory or pricing updates.

## Enable the feature

1. Go to **Merchant Tools > Algolia > Algolia**.
2. Enable **Enable Real-Time Inventory** and click **Apply**.
3. The cartridge starts sending inventory data to Algolia in real time.

## How real-time inventory updates work

1. After each order, the cartridge's `CheckoutServices-PlaceOrder` controller fires the `inventoryUpdate` hook.
2. Shipments are checked to classify orders as in-store pickup or regular (store inventory) orders.
3. If some products become out of stock, the hook script computes the affected products (master and variants) and prepares **partialUpdateObject** operations.
4. The updates are sent to Algolia so the `in_stock` and `storeAvailability` fields reflect the latest order status.

<Info>
  If **IndexOutOfStock** is `false` (default) and the product is out of stock, the product is removed from the Algolia index.
</Info>

## Troubleshooting

### No update after an order

* Ensure **Enable Real-Time Inventory** is enabled and the product's new inventory level is below **In-Stock Threshold**.
* In the Algolia dashboard, go to [API Monitoring > Search API Logs](https://dashboard.algolia.com/monitoring/logs) and verify that the request was sent.
* Check the Salesforce B2C Commerce logs for `AlgoliaOperation` errors.

### Out-of-sync stock

If the issue persists, [fully reindex](/doc/integration/salesforce-commerce-cloud-b2c/indexing/product-indexing/full-indexing) your product catalog.
