The Inventory Update Webhook allows external systems (WMS, POS, ERP) to push real-time stock updates to WooCommerce for specific locations.
This ensures inventory stays synchronized across multiple locations without manual intervention.
Endpoint
POST
/mulopimfwc/v1/webhook/inventory-update
Headers
| Key | Value |
|---|---|
| Content-Type | application/json |
| X-Webhook-Secret | your-webhook-secret-here |
🔐 The webhook secret is used to authenticate incoming webhook requests. To set webhook first, visit the documentation.
Request Body
{
"sku": "PROD-001",
"location_slug": "main-store",
"stock": 75
}
Request Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| sku | string | Yes* | Product SKU |
| product_id | integer | Yes* | Product ID (alternative to SKU) |
| location_slug | string | Yes* | Location slug |
| location_id | integer | Yes* | Location ID (alternative to slug) |
| stock | integer | Yes | Updated stock quantity |
ℹ️ Either SKU or product_id is required.
ℹ️ Either location_slug or location_id is required.
Success Response
HTTP 200 OK
{
"success": true,
"message": "Inventory updated via webhook.",
"data": {
"product_id": 123,
"location_id": 5,
"sku": "PROD-001"
}
}
Response Fields
| Field | Description |
|---|---|
| success | Indicates whether the webhook request succeeded |
| message | Status message |
| data | Updated product and location details |
Error Responses
| HTTP Code | Reason |
|---|---|
| 401 | Invalid or missing webhook secret |
| 404 | Product or location not found |
| 422 | Invalid request data |
| 500 | Internal server error |
Behavior Notes
- Stock updates apply only to the specified location.
- If the product is disabled for the location, the update is rejected.
- Supports high-frequency updates for real-time inventory syncing.
- All webhook requests can be logged if Log Webhooks is enabled.
Webhook Logging
When Log Webhooks is enabled:
- Requests are logged to:
wp-content/uploads/mulopimfwc-webhook-log-YYYY-MM-DD.log
- Useful for debugging and auditing webhook calls.
Best Practices
- Always validate response status before marking sync as complete.
- Use retries with exponential backoff for failed requests.
- Keep webhook secrets secure and rotate periodically.
- Avoid sending bulk updates via webhook—use the Bulk Sync API instead.