Product Inventories — Bulk Update
Bulk-upsert inventory quantities for a product across one or more sources. Fires catalog.product.update.before / catalog.product.update.after.
Endpoint
| Endpoint | Method |
|---|---|
/api/admin/catalog/products/{productId}/inventories | PUT |
Request body
| Field | Type | Required | Notes |
|---|---|---|---|
inventories | object | yes | Map of inventory_source_id → quantity (integer ≥ 0). |
Upsert semantics
- A source passed with
qty > 0is upserted. - A source passed with
qty = 0is kept but zeroed-out (the row is NOT deleted unless the underlying repository decides to). - Sources NOT included in the request are left untouched.
Response
200 OK — same shape as the list endpoint, with totals refreshed.
Errors
| HTTP | Cause |
|---|---|
401 Unauthorized | Missing or invalid admin Bearer token. |
403 Forbidden | Admin role lacks catalog.products.edit. |
404 Not Found | Product not found. |
422 Unprocessable Entity | Missing inventories, unknown source id, or negative qty. |

