commercetools icon

commercetools

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

Actions671

Type → Update Type by ID

AI-generated

Summary

Update an existing commercetools Type by its unique Type ID and version number, applying specified update actions to modify the Type's fields or metadata.

Inputs

  • Type ID (required) — The unique identifier of the Type to update.
  • Version (required) — The current version of the Type, required for concurrency control to perform the update.
  • Actions (JSON) — Raw JSON array of update actions to apply to the Type. When provided, this overrides any UI-specified actions.
  • Actions (UI) — A collection of user-friendly update actions (such as adding enum values, changing labels, reordering fields, setting descriptions) to apply to the Type. Ignored if Actions (JSON) is non-empty.

Output shape

a single JSON object representing the updated Type resource as returned from the commercetools API

The operation expects the specified Version to match the current resource version for concurrency safety; update actions are sent as per commercetools API requirements. Errors may be thrown on version conflicts or invalid actions.

Examples

Example 1: Update an existing Type to add a new enum value to a field

Provide the Type ID, current version number, and configure the Actions (UI) to 'AddEnumValue' specifying the target field name and the new enum value details.

Links

Discussion