Skip to content

Update Product Stock

Modify product inventory levels and stock status.

Overview

The Update Product Stock action modifies a WooCommerce product’s inventory quantity and stock status. Essential for inventory management and external system synchronization.

Configuration

Required Fields

FieldTypeDescription
ProductintegerProduct ID

Optional Fields

FieldTypeDescription
Stock QuantityintegerNew stock level
Stock Statusselectinstock, outofstock, onbackorder
Manage StockbooleanEnable stock management
Backordersselectno, notify, yes

Example Configurations

Set Stock Level

Product: {{Trigger.product_id}}
Stock Quantity: {{Trigger.new_quantity}}

Sync from Warehouse

Product: {{Trigger.wp_product_id}}
Stock Quantity: {{Trigger.warehouse_quantity}}
Manage Stock: true

Mark Out of Stock

Product: {{Trigger.product_id}}
Stock Status: outofstock
Stock Quantity: 0

Enable Backorders

Product: {{Trigger.product_id}}
Backorders: notify

Stock Status Options

StatusDescription
instockAvailable for purchase
outofstockNot available
onbackorderCan be ordered, delayed

Backorder Options

OptionDescription
noNo backorders
notifyAllow with notification
yesAllow silently

Output Data

VariableTypeDescription
{{Action.product_id}}integerProduct ID
{{Action.old_quantity}}integerPrevious quantity
{{Action.new_quantity}}integerNew quantity
{{Action.stock_status}}stringStock status

Common Workflows

Inventory Sync

  1. Trigger: External inventory update
  2. Action: Update Product Stock
    • Stock Quantity: External value
    • Manage Stock: true

Auto-Restock

  1. Trigger: Shipment received
  2. Action: Update Product Stock
    • Stock Quantity: Current + received

Out of Stock Alert

  1. Trigger: Stock Changed
  2. Condition: Quantity = 0
  3. Action: Update Product Stock
    • Stock Status: outofstock

Best Practices

  • Always sync with source of truth
  • Enable stock management for tracking
  • Set appropriate backorder policies
  • Log all stock changes