The Single Product Update API allows you to update inventory, pricing, and availability settings for a specific product at a specific location.
This endpoint is ideal for real-time stock updates, manual adjustments, or syncing individual product changes from external systems.
Endpoint
POST
/mulopimfwc/v1/inventory/update
Headers
| Key | Value |
|---|---|
| Content-Type | application/json |
| X-API-Key | your-api-key-here |
🔐 The
X-API-Keyis required for authentication. Requests without a valid API key will be rejected. Please set up the API first by following the documentation.
Request Body
The request body contains product identification, location identification, and inventory-related fields.
You must specify both:
- A product identifier (
product_idorsku) - A location identifier (
location_idorlocation_slug)
Request Body Example
{
"product_id": 456,
"location_id": 3,
"stock": 25,
"regular_price": "39.99",
"sale_price": "34.99",
"backorders": "no",
"disabled": false
}
Field Description
| Field | Type | Required | Description |
|---|---|---|---|
| product_id | integer | Optional | WooCommerce Product ID (required if SKU is not provided) |
| sku | string | Optional | Product SKU (required if product_id is not provided) |
| location_id | integer | Optional | Location ID (required if location_slug is not provided) |
| location_slug | string | Optional | Location slug |
| stock | integer | Yes | Stock quantity for the product at the specified location |
| regular_price | string | Optional | Regular price of the product |
| sale_price | string | Optional | Sale price (must be lower than regular price) |
| backorders | string | Optional | Backorder status (no, notify, yes) |
| disabled | boolean | Optional | Disable product availability for this location (true or false) |
Backorder Values
| Value | Meaning |
|---|---|
| no | Backorders not allowed |
| notify | Allow backorders and notify customer |
| yes | Allow backorders without notification |
Response Example
{
"success": true,
"message": "Inventory updated successfully.",
"data": {
"product_id": 456,
"location_id": 3,
"sku": "PROD-456"
}
}
Response Fields
| Field | Description |
|---|---|
| success | Indicates whether the update was successful |
| message | Human-readable status message |
| data.product_id | Updated product ID |
| data.location_id | Updated location ID |
| data.sku | Product SKU |
Behavior Notes
- If
stockis set to0, the product will be treated as out of stock for that location. - Setting
disabled: truewill make the product unavailable at the specified location without deleting inventory data. - Pricing updates apply only to the selected location, not globally.
Error Handling
- Missing required identifiers will return a validation error.
- Invalid price values (e.g., sale price higher than regular price) will cause the request to fail.
- Errors are returned with descriptive messages to help debugging.