Enable the feature
- Go to Merchant Tools > Algolia > Algolia.
- Enable Enable Real-Time Inventory and click Apply.
- The cartridge starts sending inventory data to Algolia in real time.
How real-time inventory updates work
- After each order, the cartridgeβs
CheckoutServices-PlaceOrder
controller fires theinventoryUpdate
hook. - Shipments are checked to classify orders as in-store pickup or regular (store inventory) orders.
- If some products become out of stock, the hook script computes the affected products (master and variants) and prepares partialUpdateObject operations.
- The updates are sent to Algolia so the
in_stock
andstoreAvailability
fields reflect the latest order status.
If IndexOutOfStock is
false
(default) and the product is out of stock, the product is removed from the Algolia index.Troubleshooting
No update after an order
- Ensure Enable Real-Time Inventory is enabled and the productβs new inventory level is below the InStock Threshold.
- In the Algolia dashboard, go to API Monitoring > Search API Logs and verify that the request was sent.
- Check the Salesforce B2C Commerce logs for
AlgoliaOperation
errors.