Webhook Inventory Update

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

KeyValue
Content-Typeapplication/json
X-Webhook-Secretyour-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

FieldTypeRequiredDescription
skustringYes*Product SKU
product_idintegerYes*Product ID (alternative to SKU)
location_slugstringYes*Location slug
location_idintegerYes*Location ID (alternative to slug)
stockintegerYesUpdated 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

FieldDescription
successIndicates whether the webhook request succeeded
messageStatus message
dataUpdated product and location details

Error Responses

HTTP CodeReason
401Invalid or missing webhook secret
404Product or location not found
422Invalid request data
500Internal 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.