commercetools icon

commercetools

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

Actions671

Type → Create Type

AI-generated

Summary

Create a new custom Type in the commercetools project with specified key, name, description, associated resource types, and field definitions.

Inputs

  • Key (required) — A unique string key for the new Type.
  • Name (required) — Localized JSON object specifying the display name of the Type (e.g., { "en": "Example Name" }).
  • Description (required) — Localized JSON object providing the description of the Type.
  • Resource Type Ids (required) — JSON array of resource type identifiers that this Type applies to.
  • Field Definitions (required) — JSON array defining the custom fields and their types to add to the Type.

Output shape

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

The operation returns the full JSON representation of the newly created Type, including its assigned ID and version. Errors during creation throw NodeApiError exceptions unless 'continueOnFail' is enabled.

Examples

Example 1: Creating a new custom Type for products with custom fields defining a 'color' and 'releaseDate'

Fill in the required parameters: provide a unique 'Key', localized 'Name' and 'Description', specify 'resourceTypeIds' as ['product'], and define 'fieldDefinitions' for the 'color' (string) and 'releaseDate' (date) fields.

Links

Discussion