commercetools icon

commercetools

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

Actions671

State → Update State by ID

AI-generated

Summary

Update a State resource in commercetools by specifying its State ID and current version, applying one or more update actions.

Inputs

  • State ID (required) — The unique identifier of the State to update.
  • Version (required) — The current version number of the State resource, used for concurrency control.
  • Actions (JSON) — A raw JSON array of update actions to apply to the State. If provided and non-empty, this overrides the Actions (UI).
  • Actions (UI) — A UI-friendly collection of individual update actions, such as adding/removing roles, changing key, type, name, description, initial flag, or transitions. Ignored if Actions (JSON) is provided and non-empty.

Output shape

a single JSON object representing the updated State resource returned by the commercetools API

The operation returns the full updated State object on success. It requires the current version for optimistic concurrency control to ensure the update applies correctly. If the version is outdated or the resource does not exist, an error is thrown.

Links

Discussion