commercetools icon

commercetools

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

Actions671

State → Create State

AI-generated

Summary

Create a new State resource in commercetools with specified key, type, roles, name, description, and initial flag.

Inputs

  • Key (required) — Unique identifier for the State.
  • Type (required) — Type of the State (string).
  • Roles (required) — Array of roles assigned to the State, provided as JSON.
  • Name (required) — Localized name of the State, provided as JSON with language keys.
  • Description (required) — Localized description of the State, provided as JSON with language keys.
  • Initial (required) — Boolean flag indicating if this State is the initial state.

Output shape

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

The output contains the full State resource data after creation. Errors during creation throw a node error unless 'continueOnFail' is enabled.

Examples

Example 1: Create a new State with localization and roles

Set 'Key' to a unique string, 'Type' to the desired state type, fill in 'Roles' as a JSON array of roles, provide 'Name' and 'Description' as localized JSON objects, and set 'Initial' as true or false depending on your workflow needs.

Links

Discussion