Skip to content

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 ​

EndpointMethod
/api/admin/catalog/products/{productId}/inventoriesPUT

Request body ​

FieldTypeRequiredNotes
inventoriesobjectyesMap of inventory_source_id → quantity (integer ≥ 0).

Upsert semantics ​

  • A source passed with qty > 0 is upserted.
  • A source passed with qty = 0 is 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 ​

HTTPCause
401 UnauthorizedMissing or invalid admin Bearer token.
403 ForbiddenAdmin role lacks catalog.products.edit.
404 Not FoundProduct not found.
422 Unprocessable EntityMissing inventories, unknown source id, or negative qty.

Released under the MIT License.