Inventory out of stock event

Understand the inventory out of stock event.

In inventory management, staying updated on stock levels is crucial for smooth operations and customer satisfaction. The inventory.out_of_stock event plays a pivotal role in this context. It serves as an alert mechanism, triggered when a product's inventory level falls to zero signaling that the item is no longer available for purchase or back ordered upon order submission. This real-time notification lets your business respond quickly to stock shortages by updating its online product availability, informing interested customers, and initiating restocking procedures. With detailed information like product ID, the exact time of occurrence, and inventory settings, you can make informed decisions to mitigate the adverse effects of running out of stock.

See Getting started with webhooks in Commerce API for instructions on configuring the webhook events.

Key attributes

The inventory.out_of_stock event contains crucial information that facilitates immediate and informed responses to stock shortages. Below are the key attributes:

  • id: A unique identifier for the event instance allows easy tracking and reference.

  • type: Specifies the event type, in this case, inventory.out_of_stock, to differentiate from other inventory or system events.

  • data: Encapsulates the event-specific data, including:

    • object: Contains details about the out-of-stock item, such as:

      • quantity: The product's inventory level will be 0 for an out-of-stock event.

      • timestamp: The exact time when the product inventory reached zero.

      • products: AContains an array of products affected by the inventory update. Each product has:

        • externalReferenceId: A unique external reference identifier for the product (null if not provided).

        • productId: The unique identifier of the product.

      • eventType: Identifies the specific action that triggered the inventory update event. This attribute is crucial for understanding the nature of the event, such as inventory.out_of_stock, indicating the product is out of stock. This helps in filtering and responding to various types of inventory-related events effectively.

      • partNumber: The part number related to the inventory item.

      • fulfiller: The name of the third-party fulfiller managing the inventory (DR globalTech).

      • allowBackOrder: Indicates whether backorders are allowed for the out-of-stock product (false).

      • inventoryManagement: Specifies the inventory management type, which is Self Managed.

  • previousAttributes: Contains critical product information regarding the state of inventory before the out_of_stock event was triggered, allowing for a comparison of the inventory status before and after the event. This can include:

    • quantity: Shows the product's inventory level just before it reached zero, providing insight into the rate of stock depletion.

  • liveMode: Indicates if the event was triggered in a live operational environment or a test mode (false).

  • createdTime: Records the timestamp of when the webhook event was generated, providing a chronology.

Understanding these key attributes is essential for leveraging the inventory.out_of_stock event to maintain optimal inventory levels and respond effectively to stock shortages.

The inventory.out_of_stock event is a critical notification in inventory management systems, indicating that a product has reached a quantity of zero and is no longer available for sale. This event is triggered in real-time, allowing businesses to respond swiftly to potential stock shortages. It contains essential data, including:

    "id": "cda6bf91-96e6-463b-959b-8e82dd81addd",
    "type": "inventory.out_of_stock",
    "data": {
        "object": {
            "quantity": 0,
            "timestamp": "2024-01-30T08:49:44.331Z",
            "products": [
                    "externalReferenceId": null,
                    "productId": "15116720197"
            "eventType": "inventory.out_of_stock",
            "partNumber": "CCC",
            "fulfiller": "DR globalTech",
            "allowBackOrder": false,
            "inventoryManagement": "Self Managed"
        "previousAttributes": {
            "quantity": 1
    "liveMode": false,
    "createdTime": "2024-01-30T14:49:45.55875Z"

See the Creating a webhook section for instructions on creating the webhook.

Responding to an inventory.out_of_stock event

When the inventory.out_of_stock event is triggered, here are steps a business should consider taking to manage the situation effectively:

  1. Review the notification: Examine the event details, particularly the products array to identify which specific products are affected.

  2. Update product listings: Temporarily disable or update the listings of the out-of-stock products to reflect their availability status, especially if allowBackOrder is false.

  3. Notify relevant departments: Alert purchasing, sales, and customer service teams about the stockout situation to prepare for potential customer inquiries and expedite restocking.

  4. Communicate with customers: If necessary, inform customers about the stockout, particularly those who have already placed orders. Offer alternatives or estimated restock dates to maintain customer satisfaction.

  5. Analyze inventory patterns: Use the timestamp information to analyze inventory patterns and identify any trends or recurring stockout issues.

  6. Adjust inventory management: Depending on the inventoryManagement setting, consider adjusting ordering strategies or inventory levels to prevent future stockouts.

  7. Monitor restocking efforts: Work closely with the fulfiller or suppliers to ensure a timely restocking of the affected products.

By following these steps, businesses can minimize the negative impact of stockouts and maintain a positive customer experience.

inventory.out_of_stock use case

If a product's inventory drops from 1 to 0 due to a customer's purchase, the system sends the webhook payload for the inventory.out_of_stock event. The following image displays the payload for this webhook event.

Last updated