commercetools icon

commercetools

Interact with the commercetools API. Operations are auto-generated from the official Postman collection.

Actions671

Inventory → Update InventoryEntry by ID

AI-generated

Summary

Update a specific InventoryEntry in commercetools by its unique Inventory ID and version, applying one or more specified update actions.

Inputs

  • Inventory ID (required) — The unique ID of the InventoryEntry to update.
  • Version (required) — The current version number of the InventoryEntry, required for concurrency control.
  • Actions (JSON) — Raw JSON array of update actions to apply; if provided and not empty, this overrides any UI-specified actions.
  • Actions (UI) — A collection of individual update actions to apply, such as changing quantity, setting custom fields, or modifying expected delivery, entered via the UI and used only if the Actions (JSON) field is empty.

Output shape

a single JSON object representing the updated InventoryEntry returned from the commercetools API

The operation returns the full updated InventoryEntry as JSON. The request requires specifying the current version of the entry for optimistic locking. Either Actions (JSON) or Actions (UI) must be provided; if both are given, Actions (JSON) takes precedence.

Examples

Example 1: Update the quantity by adding 10 units to the inventory entry with ID 'abc123' at version 5.

Set Resource to Inventory, Operation to Update InventoryEntry by ID. Specify Inventory ID as 'abc123', Version as 5, and use the Actions (UI) to addQuantity with Quantity 10.

Links

Discussion