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
| Field | Type | Description |
|---|
| Product | integer | Product ID |
Optional Fields
| Field | Type | Description |
|---|
| Stock Quantity | integer | New stock level |
| Stock Status | select | instock, outofstock, onbackorder |
| Manage Stock | boolean | Enable stock management |
| Backorders | select | no, 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
| Status | Description |
|---|
instock | Available for purchase |
outofstock | Not available |
onbackorder | Can be ordered, delayed |
Backorder Options
| Option | Description |
|---|
no | No backorders |
notify | Allow with notification |
yes | Allow silently |
Output Data
| Variable | Type | Description |
|---|
{{Action.product_id}} | integer | Product ID |
{{Action.old_quantity}} | integer | Previous quantity |
{{Action.new_quantity}} | integer | New quantity |
{{Action.stock_status}} | string | Stock status |
Common Workflows
Inventory Sync
- Trigger: External inventory update
- Action: Update Product Stock
- Stock Quantity: External value
- Manage Stock: true
Auto-Restock
- Trigger: Shipment received
- Action: Update Product Stock
- Stock Quantity: Current + received
Out of Stock Alert
- Trigger: Stock Changed
- Condition: Quantity = 0
- Action: Update Product Stock
Best Practices
- Always sync with source of truth
- Enable stock management for tracking
- Set appropriate backorder policies
- Log all stock changes