commercetools icon

commercetools

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

Actions671

State → Update State by Key

AI-generated

Summary

Update a commercetools State resource identified by its unique key using specified version and actions.

Inputs

  • State Key (required) — The unique key of the State resource to update.
  • Version (required) — The current version number of the State to ensure update concurrency control.
  • Actions (JSON) — A raw JSON array of update actions to apply; if provided and not empty, this overrides the UI-based actions.
  • Actions (UI) — A collection of predefined update actions (e.g., addRoles, changeKey, setDescription) allowing to modify the State incrementally without raw JSON input.

Output shape

A single updated State resource object in JSON format.

The operation returns the updated State object reflecting the changes made by the provided actions. The 'Version' input acts as optimistic locking to prevent conflicting updates. Errors occur if the State key does not exist or version conflicts arise.

Examples

Example 1: Update the name and add roles of a State by key.

Supply the State Key and current Version, select 'SetName' and 'AddRoles' actions in the UI with desired data.

Links

Discussion