Skip to content

Product Inventories — Bulk Update (GraphQL)

Sets the on-hand quantity per inventory source for a product. This is a parent-scoped mutation — pass the product as productId inside the input. A source id with a positive quantity is set to that value, a source id with 0 is zeroed out, and any source you leave out of the map is untouched.

The inventories field is a map of inventory_source_id (as a string key) to integer quantity. The id field must be a placeholder IRI (/api/admin/catalog/products/{productId}/inventories) — it is ignored; the product is resolved from productId. Select _id on the returned node (not id, since this is a parent-scoped resource with no standalone route).

The mutation returns the updated source as a single node. To read the full per-source list together with the aggregate totalQty, query adminCatalogProductInventories(productId:) (a connection — edges { node { _id sourceId sourceCode sourceName qty } }); totalQty is not available on the mutation result.

TIP

See the Products overview for how the catalog product menu fits together.

All admin operations require an admin Bearer token — see Authentication.

Input

FieldTypeRequiredNotes
productIdInt!yesParent product.
inventoriesObject!yesMap of inventory_source_id (string key) to integer quantity (greater than or equal to 0).
idID!yesPlaceholder IRI; ignored by the server.

Released under the MIT License.