1. Packages
  2. Packages
  3. Commercetools Provider
  4. API Docs
  5. Type
Viewing docs for commercetools 1.22.0
published on Thursday, May 7, 2026 by labd
Viewing docs for commercetools 1.22.0
published on Thursday, May 7, 2026 by labd

    Types define custom fields that are used to enhance resources as you need. Use Types to model your own CustomFields on resources, like Category and Customer.

    In case you want to customize products, please use product types instead that serve a similar purpose, but tailored to products.

    See also the Types Api Documentation

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as commercetools from "@pulumi/commercetools";
    
    const my_custom_type = new commercetools.Type("my-custom-type", {
        key: "my-custom-type",
        name: {
            en: "Contact info",
            nl: "Contact informatie",
        },
        description: {
            en: "All things related communication",
            nl: "Alle communicatie-gerelateerde zaken",
        },
        resourceTypeIds: ["customer"],
        fields: [
            {
                name: "skype_name",
                label: {
                    en: "Skype name",
                    nl: "Skype naam",
                },
                type: {
                    name: "String",
                },
            },
            {
                name: "contact_time",
                label: {
                    en: "Contact time",
                    nl: "Contact tijd",
                },
                type: {
                    name: "Enum",
                    values: [
                        {
                            key: "day",
                            label: "Daytime",
                        },
                        {
                            key: "evening",
                            label: "Evening",
                        },
                    ],
                },
            },
            {
                name: "emails",
                label: {
                    en: "Emails",
                    nl: "Emails",
                },
                type: {
                    name: "Set",
                    elementType: {
                        name: "String",
                    },
                },
            },
            {
                name: "contact_preference",
                label: {
                    en: "Contact preference",
                    nl: "Contact voorkeur",
                },
                type: {
                    name: "LocalizedEnum",
                    localizedValues: [
                        {
                            key: "phone",
                            label: {
                                en: "Phone",
                                nl: "Telefoon",
                            },
                        },
                        {
                            key: "skype",
                            label: {
                                en: "Skype",
                                nl: "Skype",
                            },
                        },
                    ],
                },
            },
        ],
    });
    
    import pulumi
    import pulumi_commercetools as commercetools
    
    my_custom_type = commercetools.Type("my-custom-type",
        key="my-custom-type",
        name={
            "en": "Contact info",
            "nl": "Contact informatie",
        },
        description={
            "en": "All things related communication",
            "nl": "Alle communicatie-gerelateerde zaken",
        },
        resource_type_ids=["customer"],
        fields=[
            {
                "name": "skype_name",
                "label": {
                    "en": "Skype name",
                    "nl": "Skype naam",
                },
                "type": {
                    "name": "String",
                },
            },
            {
                "name": "contact_time",
                "label": {
                    "en": "Contact time",
                    "nl": "Contact tijd",
                },
                "type": {
                    "name": "Enum",
                    "values": [
                        {
                            "key": "day",
                            "label": "Daytime",
                        },
                        {
                            "key": "evening",
                            "label": "Evening",
                        },
                    ],
                },
            },
            {
                "name": "emails",
                "label": {
                    "en": "Emails",
                    "nl": "Emails",
                },
                "type": {
                    "name": "Set",
                    "element_type": {
                        "name": "String",
                    },
                },
            },
            {
                "name": "contact_preference",
                "label": {
                    "en": "Contact preference",
                    "nl": "Contact voorkeur",
                },
                "type": {
                    "name": "LocalizedEnum",
                    "localized_values": [
                        {
                            "key": "phone",
                            "label": {
                                "en": "Phone",
                                "nl": "Telefoon",
                            },
                        },
                        {
                            "key": "skype",
                            "label": {
                                "en": "Skype",
                                "nl": "Skype",
                            },
                        },
                    ],
                },
            },
        ])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/commercetools/commercetools"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := commercetools.NewType(ctx, "my-custom-type", &commercetools.TypeArgs{
    			Key: pulumi.String("my-custom-type"),
    			Name: pulumi.StringMap{
    				"en": pulumi.String("Contact info"),
    				"nl": pulumi.String("Contact informatie"),
    			},
    			Description: pulumi.StringMap{
    				"en": pulumi.String("All things related communication"),
    				"nl": pulumi.String("Alle communicatie-gerelateerde zaken"),
    			},
    			ResourceTypeIds: pulumi.StringArray{
    				pulumi.String("customer"),
    			},
    			Fields: commercetools.TypeFieldArray{
    				&commercetools.TypeFieldArgs{
    					Name: pulumi.String("skype_name"),
    					Label: pulumi.StringMap{
    						"en": pulumi.String("Skype name"),
    						"nl": pulumi.String("Skype naam"),
    					},
    					Type: &commercetools.TypeFieldTypeArgs{
    						Name: pulumi.String("String"),
    					},
    				},
    				&commercetools.TypeFieldArgs{
    					Name: pulumi.String("contact_time"),
    					Label: pulumi.StringMap{
    						"en": pulumi.String("Contact time"),
    						"nl": pulumi.String("Contact tijd"),
    					},
    					Type: &commercetools.TypeFieldTypeArgs{
    						Name: pulumi.String("Enum"),
    						Values: commercetools.TypeFieldTypeValueArray{
    							&commercetools.TypeFieldTypeValueArgs{
    								Key:   pulumi.String("day"),
    								Label: pulumi.String("Daytime"),
    							},
    							&commercetools.TypeFieldTypeValueArgs{
    								Key:   pulumi.String("evening"),
    								Label: pulumi.String("Evening"),
    							},
    						},
    					},
    				},
    				&commercetools.TypeFieldArgs{
    					Name: pulumi.String("emails"),
    					Label: pulumi.StringMap{
    						"en": pulumi.String("Emails"),
    						"nl": pulumi.String("Emails"),
    					},
    					Type: &commercetools.TypeFieldTypeArgs{
    						Name: pulumi.String("Set"),
    						ElementType: &commercetools.TypeFieldTypeElementTypeArgs{
    							Name: pulumi.String("String"),
    						},
    					},
    				},
    				&commercetools.TypeFieldArgs{
    					Name: pulumi.String("contact_preference"),
    					Label: pulumi.StringMap{
    						"en": pulumi.String("Contact preference"),
    						"nl": pulumi.String("Contact voorkeur"),
    					},
    					Type: &commercetools.TypeFieldTypeArgs{
    						Name: pulumi.String("LocalizedEnum"),
    						LocalizedValues: commercetools.TypeFieldTypeLocalizedValueArray{
    							&commercetools.TypeFieldTypeLocalizedValueArgs{
    								Key: pulumi.String("phone"),
    								Label: pulumi.StringMap{
    									"en": pulumi.String("Phone"),
    									"nl": pulumi.String("Telefoon"),
    								},
    							},
    							&commercetools.TypeFieldTypeLocalizedValueArgs{
    								Key: pulumi.String("skype"),
    								Label: pulumi.StringMap{
    									"en": pulumi.String("Skype"),
    									"nl": pulumi.String("Skype"),
    								},
    							},
    						},
    					},
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Commercetools = Pulumi.Commercetools;
    
    return await Deployment.RunAsync(() => 
    {
        var my_custom_type = new Commercetools.Type("my-custom-type", new()
        {
            Key = "my-custom-type",
            Name = 
            {
                { "en", "Contact info" },
                { "nl", "Contact informatie" },
            },
            Description = 
            {
                { "en", "All things related communication" },
                { "nl", "Alle communicatie-gerelateerde zaken" },
            },
            ResourceTypeIds = new[]
            {
                "customer",
            },
            Fields = new[]
            {
                new Commercetools.Inputs.TypeFieldArgs
                {
                    Name = "skype_name",
                    Label = 
                    {
                        { "en", "Skype name" },
                        { "nl", "Skype naam" },
                    },
                    Type = new Commercetools.Inputs.TypeFieldTypeArgs
                    {
                        Name = "String",
                    },
                },
                new Commercetools.Inputs.TypeFieldArgs
                {
                    Name = "contact_time",
                    Label = 
                    {
                        { "en", "Contact time" },
                        { "nl", "Contact tijd" },
                    },
                    Type = new Commercetools.Inputs.TypeFieldTypeArgs
                    {
                        Name = "Enum",
                        Values = new[]
                        {
                            new Commercetools.Inputs.TypeFieldTypeValueArgs
                            {
                                Key = "day",
                                Label = "Daytime",
                            },
                            new Commercetools.Inputs.TypeFieldTypeValueArgs
                            {
                                Key = "evening",
                                Label = "Evening",
                            },
                        },
                    },
                },
                new Commercetools.Inputs.TypeFieldArgs
                {
                    Name = "emails",
                    Label = 
                    {
                        { "en", "Emails" },
                        { "nl", "Emails" },
                    },
                    Type = new Commercetools.Inputs.TypeFieldTypeArgs
                    {
                        Name = "Set",
                        ElementType = new Commercetools.Inputs.TypeFieldTypeElementTypeArgs
                        {
                            Name = "String",
                        },
                    },
                },
                new Commercetools.Inputs.TypeFieldArgs
                {
                    Name = "contact_preference",
                    Label = 
                    {
                        { "en", "Contact preference" },
                        { "nl", "Contact voorkeur" },
                    },
                    Type = new Commercetools.Inputs.TypeFieldTypeArgs
                    {
                        Name = "LocalizedEnum",
                        LocalizedValues = new[]
                        {
                            new Commercetools.Inputs.TypeFieldTypeLocalizedValueArgs
                            {
                                Key = "phone",
                                Label = 
                                {
                                    { "en", "Phone" },
                                    { "nl", "Telefoon" },
                                },
                            },
                            new Commercetools.Inputs.TypeFieldTypeLocalizedValueArgs
                            {
                                Key = "skype",
                                Label = 
                                {
                                    { "en", "Skype" },
                                    { "nl", "Skype" },
                                },
                            },
                        },
                    },
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.commercetools.Type;
    import com.pulumi.commercetools.TypeArgs;
    import com.pulumi.commercetools.inputs.TypeFieldArgs;
    import com.pulumi.commercetools.inputs.TypeFieldTypeArgs;
    import com.pulumi.commercetools.inputs.TypeFieldTypeElementTypeArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var my_custom_type = new Type("my-custom-type", TypeArgs.builder()
                .key("my-custom-type")
                .name(Map.ofEntries(
                    Map.entry("en", "Contact info"),
                    Map.entry("nl", "Contact informatie")
                ))
                .description(Map.ofEntries(
                    Map.entry("en", "All things related communication"),
                    Map.entry("nl", "Alle communicatie-gerelateerde zaken")
                ))
                .resourceTypeIds("customer")
                .fields(            
                    TypeFieldArgs.builder()
                        .name("skype_name")
                        .label(Map.ofEntries(
                            Map.entry("en", "Skype name"),
                            Map.entry("nl", "Skype naam")
                        ))
                        .type(TypeFieldTypeArgs.builder()
                            .name("String")
                            .build())
                        .build(),
                    TypeFieldArgs.builder()
                        .name("contact_time")
                        .label(Map.ofEntries(
                            Map.entry("en", "Contact time"),
                            Map.entry("nl", "Contact tijd")
                        ))
                        .type(TypeFieldTypeArgs.builder()
                            .name("Enum")
                            .values(                        
                                TypeFieldTypeValueArgs.builder()
                                    .key("day")
                                    .label("Daytime")
                                    .build(),
                                TypeFieldTypeValueArgs.builder()
                                    .key("evening")
                                    .label("Evening")
                                    .build())
                            .build())
                        .build(),
                    TypeFieldArgs.builder()
                        .name("emails")
                        .label(Map.ofEntries(
                            Map.entry("en", "Emails"),
                            Map.entry("nl", "Emails")
                        ))
                        .type(TypeFieldTypeArgs.builder()
                            .name("Set")
                            .elementType(TypeFieldTypeElementTypeArgs.builder()
                                .name("String")
                                .build())
                            .build())
                        .build(),
                    TypeFieldArgs.builder()
                        .name("contact_preference")
                        .label(Map.ofEntries(
                            Map.entry("en", "Contact preference"),
                            Map.entry("nl", "Contact voorkeur")
                        ))
                        .type(TypeFieldTypeArgs.builder()
                            .name("LocalizedEnum")
                            .localizedValues(                        
                                TypeFieldTypeLocalizedValueArgs.builder()
                                    .key("phone")
                                    .label(Map.ofEntries(
                                        Map.entry("en", "Phone"),
                                        Map.entry("nl", "Telefoon")
                                    ))
                                    .build(),
                                TypeFieldTypeLocalizedValueArgs.builder()
                                    .key("skype")
                                    .label(Map.ofEntries(
                                        Map.entry("en", "Skype"),
                                        Map.entry("nl", "Skype")
                                    ))
                                    .build())
                            .build())
                        .build())
                .build());
    
        }
    }
    
    resources:
      my-custom-type:
        type: commercetools:Type
        properties:
          key: my-custom-type
          name:
            en: Contact info
            nl: Contact informatie
          description:
            en: All things related communication
            nl: Alle communicatie-gerelateerde zaken
          resourceTypeIds:
            - customer
          fields:
            - name: skype_name
              label:
                en: Skype name
                nl: Skype naam
              type:
                name: String
            - name: contact_time
              label:
                en: Contact time
                nl: Contact tijd
              type:
                name: Enum
                values:
                  - key: day
                    label: Daytime
                  - key: evening
                    label: Evening
            - name: emails
              label:
                en: Emails
                nl: Emails
              type:
                name: Set
                elementType:
                  name: String
            - name: contact_preference
              label:
                en: Contact preference
                nl: Contact voorkeur
              type:
                name: LocalizedEnum
                localizedValues:
                  - key: phone
                    label:
                      en: Phone
                      nl: Telefoon
                  - key: skype
                    label:
                      en: Skype
                      nl: Skype
    
    Example coming soon!
    

    Create Type Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new Type(name: string, args: TypeArgs, opts?: CustomResourceOptions);
    @overload
    def Type(resource_name: str,
             args: TypeArgs,
             opts: Optional[ResourceOptions] = None)
    
    @overload
    def Type(resource_name: str,
             opts: Optional[ResourceOptions] = None,
             key: Optional[str] = None,
             name: Optional[Mapping[str, str]] = None,
             resource_type_ids: Optional[Sequence[str]] = None,
             description: Optional[Mapping[str, str]] = None,
             fields: Optional[Sequence[TypeFieldArgs]] = None,
             type_id: Optional[str] = None)
    func NewType(ctx *Context, name string, args TypeArgs, opts ...ResourceOption) (*Type, error)
    public Type(string name, TypeArgs args, CustomResourceOptions? opts = null)
    public Type(String name, TypeArgs args)
    public Type(String name, TypeArgs args, CustomResourceOptions options)
    
    type: commercetools:Type
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "commercetools_type" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args TypeArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args TypeArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args TypeArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args TypeArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args TypeArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var typeResource = new Commercetools.Type("typeResource", new()
    {
        Key = "string",
        Name = 
        {
            { "string", "string" },
        },
        ResourceTypeIds = new[]
        {
            "string",
        },
        Description = 
        {
            { "string", "string" },
        },
        Fields = new[]
        {
            new Commercetools.Inputs.TypeFieldArgs
            {
                Label = 
                {
                    { "string", "string" },
                },
                Name = "string",
                Type = new Commercetools.Inputs.TypeFieldTypeArgs
                {
                    Name = "string",
                    ElementType = new Commercetools.Inputs.TypeFieldTypeElementTypeArgs
                    {
                        Name = "string",
                        LocalizedValues = new[]
                        {
                            new Commercetools.Inputs.TypeFieldTypeElementTypeLocalizedValueArgs
                            {
                                Key = "string",
                                Label = 
                                {
                                    { "string", "string" },
                                },
                            },
                        },
                        ReferenceTypeId = "string",
                        Values = new[]
                        {
                            new Commercetools.Inputs.TypeFieldTypeElementTypeValueArgs
                            {
                                Key = "string",
                                Label = "string",
                            },
                        },
                    },
                    LocalizedValues = new[]
                    {
                        new Commercetools.Inputs.TypeFieldTypeLocalizedValueArgs
                        {
                            Key = "string",
                            Label = 
                            {
                                { "string", "string" },
                            },
                        },
                    },
                    ReferenceTypeId = "string",
                    Values = new[]
                    {
                        new Commercetools.Inputs.TypeFieldTypeValueArgs
                        {
                            Key = "string",
                            Label = "string",
                        },
                    },
                },
                InputHint = "string",
                Required = false,
            },
        },
        TypeId = "string",
    });
    
    example, err := commercetools.NewType(ctx, "typeResource", &commercetools.TypeArgs{
    	Key: pulumi.String("string"),
    	Name: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    	ResourceTypeIds: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	Description: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    	Fields: commercetools.TypeFieldArray{
    		&commercetools.TypeFieldArgs{
    			Label: pulumi.StringMap{
    				"string": pulumi.String("string"),
    			},
    			Name: pulumi.String("string"),
    			Type: &commercetools.TypeFieldTypeArgs{
    				Name: pulumi.String("string"),
    				ElementType: &commercetools.TypeFieldTypeElementTypeArgs{
    					Name: pulumi.String("string"),
    					LocalizedValues: commercetools.TypeFieldTypeElementTypeLocalizedValueArray{
    						&commercetools.TypeFieldTypeElementTypeLocalizedValueArgs{
    							Key: pulumi.String("string"),
    							Label: pulumi.StringMap{
    								"string": pulumi.String("string"),
    							},
    						},
    					},
    					ReferenceTypeId: pulumi.String("string"),
    					Values: commercetools.TypeFieldTypeElementTypeValueArray{
    						&commercetools.TypeFieldTypeElementTypeValueArgs{
    							Key:   pulumi.String("string"),
    							Label: pulumi.String("string"),
    						},
    					},
    				},
    				LocalizedValues: commercetools.TypeFieldTypeLocalizedValueArray{
    					&commercetools.TypeFieldTypeLocalizedValueArgs{
    						Key: pulumi.String("string"),
    						Label: pulumi.StringMap{
    							"string": pulumi.String("string"),
    						},
    					},
    				},
    				ReferenceTypeId: pulumi.String("string"),
    				Values: commercetools.TypeFieldTypeValueArray{
    					&commercetools.TypeFieldTypeValueArgs{
    						Key:   pulumi.String("string"),
    						Label: pulumi.String("string"),
    					},
    				},
    			},
    			InputHint: pulumi.String("string"),
    			Required:  pulumi.Bool(false),
    		},
    	},
    	TypeId: pulumi.String("string"),
    })
    
    resource "commercetools_type" "typeResource" {
      key = "string"
      name = {
        "string" = "string"
      }
      resource_type_ids = ["string"]
      description = {
        "string" = "string"
      }
      fields {
        label = {
          "string" = "string"
        }
        name = "string"
        type = {
          name = "string"
          element_type = {
            name = "string"
            localized_values = [{
              "key" = "string"
              "label" = {
                "string" = "string"
              }
            }]
            reference_type_id = "string"
            values = [{
              "key"   = "string"
              "label" = "string"
            }]
          }
          localized_values = [{
            "key" = "string"
            "label" = {
              "string" = "string"
            }
          }]
          reference_type_id = "string"
          values = [{
            "key"   = "string"
            "label" = "string"
          }]
        }
        input_hint = "string"
        required   = false
      }
      type_id = "string"
    }
    
    var typeResource = new Type("typeResource", TypeArgs.builder()
        .key("string")
        .name(Map.of("string", "string"))
        .resourceTypeIds("string")
        .description(Map.of("string", "string"))
        .fields(TypeFieldArgs.builder()
            .label(Map.of("string", "string"))
            .name("string")
            .type(TypeFieldTypeArgs.builder()
                .name("string")
                .elementType(TypeFieldTypeElementTypeArgs.builder()
                    .name("string")
                    .localizedValues(TypeFieldTypeElementTypeLocalizedValueArgs.builder()
                        .key("string")
                        .label(Map.of("string", "string"))
                        .build())
                    .referenceTypeId("string")
                    .values(TypeFieldTypeElementTypeValueArgs.builder()
                        .key("string")
                        .label("string")
                        .build())
                    .build())
                .localizedValues(TypeFieldTypeLocalizedValueArgs.builder()
                    .key("string")
                    .label(Map.of("string", "string"))
                    .build())
                .referenceTypeId("string")
                .values(TypeFieldTypeValueArgs.builder()
                    .key("string")
                    .label("string")
                    .build())
                .build())
            .inputHint("string")
            .required(false)
            .build())
        .typeId("string")
        .build());
    
    type_resource = commercetools.Type("typeResource",
        key="string",
        name={
            "string": "string",
        },
        resource_type_ids=["string"],
        description={
            "string": "string",
        },
        fields=[{
            "label": {
                "string": "string",
            },
            "name": "string",
            "type": {
                "name": "string",
                "element_type": {
                    "name": "string",
                    "localized_values": [{
                        "key": "string",
                        "label": {
                            "string": "string",
                        },
                    }],
                    "reference_type_id": "string",
                    "values": [{
                        "key": "string",
                        "label": "string",
                    }],
                },
                "localized_values": [{
                    "key": "string",
                    "label": {
                        "string": "string",
                    },
                }],
                "reference_type_id": "string",
                "values": [{
                    "key": "string",
                    "label": "string",
                }],
            },
            "input_hint": "string",
            "required": False,
        }],
        type_id="string")
    
    const typeResource = new commercetools.Type("typeResource", {
        key: "string",
        name: {
            string: "string",
        },
        resourceTypeIds: ["string"],
        description: {
            string: "string",
        },
        fields: [{
            label: {
                string: "string",
            },
            name: "string",
            type: {
                name: "string",
                elementType: {
                    name: "string",
                    localizedValues: [{
                        key: "string",
                        label: {
                            string: "string",
                        },
                    }],
                    referenceTypeId: "string",
                    values: [{
                        key: "string",
                        label: "string",
                    }],
                },
                localizedValues: [{
                    key: "string",
                    label: {
                        string: "string",
                    },
                }],
                referenceTypeId: "string",
                values: [{
                    key: "string",
                    label: "string",
                }],
            },
            inputHint: "string",
            required: false,
        }],
        typeId: "string",
    });
    
    type: commercetools:Type
    properties:
        description:
            string: string
        fields:
            - inputHint: string
              label:
                string: string
              name: string
              required: false
              type:
                elementType:
                    localizedValues:
                        - key: string
                          label:
                            string: string
                    name: string
                    referenceTypeId: string
                    values:
                        - key: string
                          label: string
                localizedValues:
                    - key: string
                      label:
                        string: string
                name: string
                referenceTypeId: string
                values:
                    - key: string
                      label: string
        key: string
        name:
            string: string
        resourceTypeIds:
            - string
        typeId: string
    

    Type Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The Type resource accepts the following input properties:

    Key string
    Identifier for the type (max. 256 characters)
    Name Dictionary<string, string>
    LocalizedString
    ResourceTypeIds List<string>
    Defines for which resources the type is valid
    Description Dictionary<string, string>
    LocalizedString
    Fields List<TypeField>
    Field definition
    TypeId string
    The ID of this resource.
    Key string
    Identifier for the type (max. 256 characters)
    Name map[string]string
    LocalizedString
    ResourceTypeIds []string
    Defines for which resources the type is valid
    Description map[string]string
    LocalizedString
    Fields []TypeFieldArgs
    Field definition
    TypeId string
    The ID of this resource.
    key string
    Identifier for the type (max. 256 characters)
    name map(string)
    LocalizedString
    resource_type_ids list(string)
    Defines for which resources the type is valid
    description map(string)
    LocalizedString
    fields list(object)
    Field definition
    type_id string
    The ID of this resource.
    key String
    Identifier for the type (max. 256 characters)
    name Map<String,String>
    LocalizedString
    resourceTypeIds List<String>
    Defines for which resources the type is valid
    description Map<String,String>
    LocalizedString
    fields List<TypeField>
    Field definition
    typeId String
    The ID of this resource.
    key string
    Identifier for the type (max. 256 characters)
    name {[key: string]: string}
    LocalizedString
    resourceTypeIds string[]
    Defines for which resources the type is valid
    description {[key: string]: string}
    LocalizedString
    fields TypeField[]
    Field definition
    typeId string
    The ID of this resource.
    key str
    Identifier for the type (max. 256 characters)
    name Mapping[str, str]
    LocalizedString
    resource_type_ids Sequence[str]
    Defines for which resources the type is valid
    description Mapping[str, str]
    LocalizedString
    fields Sequence[TypeFieldArgs]
    Field definition
    type_id str
    The ID of this resource.
    key String
    Identifier for the type (max. 256 characters)
    name Map<String>
    LocalizedString
    resourceTypeIds List<String>
    Defines for which resources the type is valid
    description Map<String>
    LocalizedString
    fields List<Property Map>
    Field definition
    typeId String
    The ID of this resource.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Type resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Version double
    Id string
    The provider-assigned unique ID for this managed resource.
    Version float64
    id string
    The provider-assigned unique ID for this managed resource.
    version number
    id String
    The provider-assigned unique ID for this managed resource.
    version Double
    id string
    The provider-assigned unique ID for this managed resource.
    version number
    id str
    The provider-assigned unique ID for this managed resource.
    version float
    id String
    The provider-assigned unique ID for this managed resource.
    version Number

    Look up Existing Type Resource

    Get an existing Type resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: TypeState, opts?: CustomResourceOptions): Type
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            description: Optional[Mapping[str, str]] = None,
            fields: Optional[Sequence[TypeFieldArgs]] = None,
            key: Optional[str] = None,
            name: Optional[Mapping[str, str]] = None,
            resource_type_ids: Optional[Sequence[str]] = None,
            type_id: Optional[str] = None,
            version: Optional[float] = None) -> Type
    func GetType(ctx *Context, name string, id IDInput, state *TypeState, opts ...ResourceOption) (*Type, error)
    public static Type Get(string name, Input<string> id, TypeState? state, CustomResourceOptions? opts = null)
    public static Type get(String name, Output<String> id, TypeState state, CustomResourceOptions options)
    resources:  _:    type: commercetools:Type    get:      id: ${id}
    import {
      to = commercetools_type.example
      id = "${id}"
    }
    
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    Description Dictionary<string, string>
    LocalizedString
    Fields List<TypeField>
    Field definition
    Key string
    Identifier for the type (max. 256 characters)
    Name Dictionary<string, string>
    LocalizedString
    ResourceTypeIds List<string>
    Defines for which resources the type is valid
    TypeId string
    The ID of this resource.
    Version double
    Description map[string]string
    LocalizedString
    Fields []TypeFieldArgs
    Field definition
    Key string
    Identifier for the type (max. 256 characters)
    Name map[string]string
    LocalizedString
    ResourceTypeIds []string
    Defines for which resources the type is valid
    TypeId string
    The ID of this resource.
    Version float64
    description map(string)
    LocalizedString
    fields list(object)
    Field definition
    key string
    Identifier for the type (max. 256 characters)
    name map(string)
    LocalizedString
    resource_type_ids list(string)
    Defines for which resources the type is valid
    type_id string
    The ID of this resource.
    version number
    description Map<String,String>
    LocalizedString
    fields List<TypeField>
    Field definition
    key String
    Identifier for the type (max. 256 characters)
    name Map<String,String>
    LocalizedString
    resourceTypeIds List<String>
    Defines for which resources the type is valid
    typeId String
    The ID of this resource.
    version Double
    description {[key: string]: string}
    LocalizedString
    fields TypeField[]
    Field definition
    key string
    Identifier for the type (max. 256 characters)
    name {[key: string]: string}
    LocalizedString
    resourceTypeIds string[]
    Defines for which resources the type is valid
    typeId string
    The ID of this resource.
    version number
    description Mapping[str, str]
    LocalizedString
    fields Sequence[TypeFieldArgs]
    Field definition
    key str
    Identifier for the type (max. 256 characters)
    name Mapping[str, str]
    LocalizedString
    resource_type_ids Sequence[str]
    Defines for which resources the type is valid
    type_id str
    The ID of this resource.
    version float
    description Map<String>
    LocalizedString
    fields List<Property Map>
    Field definition
    key String
    Identifier for the type (max. 256 characters)
    name Map<String>
    LocalizedString
    resourceTypeIds List<String>
    Defines for which resources the type is valid
    typeId String
    The ID of this resource.
    version Number

    Supporting Types

    TypeField, TypeFieldArgs

    Label Dictionary<string, string>
    A human-readable label for the field
    Name string
    The name of the field. The name must be between two and 36 characters long and can contain the ASCII letters A to Z in lowercase or uppercase, digits, underscores (_) and the hyphen-minus (-). The name must be unique for a given resource type ID. In case there is a field with the same name in another type it has to have the same FieldType also
    Type TypeFieldType
    Describes the type of the field
    InputHint string
    TextInputHint Provides a visual representation type for this field. It is only relevant for string-based field types like StringType and LocalizedStringType
    Required bool
    Whether the field is required to have a value
    Label map[string]string
    A human-readable label for the field
    Name string
    The name of the field. The name must be between two and 36 characters long and can contain the ASCII letters A to Z in lowercase or uppercase, digits, underscores (_) and the hyphen-minus (-). The name must be unique for a given resource type ID. In case there is a field with the same name in another type it has to have the same FieldType also
    Type TypeFieldType
    Describes the type of the field
    InputHint string
    TextInputHint Provides a visual representation type for this field. It is only relevant for string-based field types like StringType and LocalizedStringType
    Required bool
    Whether the field is required to have a value
    label map(string)
    A human-readable label for the field
    name string
    The name of the field. The name must be between two and 36 characters long and can contain the ASCII letters A to Z in lowercase or uppercase, digits, underscores (_) and the hyphen-minus (-). The name must be unique for a given resource type ID. In case there is a field with the same name in another type it has to have the same FieldType also
    type object
    Describes the type of the field
    input_hint string
    TextInputHint Provides a visual representation type for this field. It is only relevant for string-based field types like StringType and LocalizedStringType
    required bool
    Whether the field is required to have a value
    label Map<String,String>
    A human-readable label for the field
    name String
    The name of the field. The name must be between two and 36 characters long and can contain the ASCII letters A to Z in lowercase or uppercase, digits, underscores (_) and the hyphen-minus (-). The name must be unique for a given resource type ID. In case there is a field with the same name in another type it has to have the same FieldType also
    type TypeFieldType
    Describes the type of the field
    inputHint String
    TextInputHint Provides a visual representation type for this field. It is only relevant for string-based field types like StringType and LocalizedStringType
    required Boolean
    Whether the field is required to have a value
    label {[key: string]: string}
    A human-readable label for the field
    name string
    The name of the field. The name must be between two and 36 characters long and can contain the ASCII letters A to Z in lowercase or uppercase, digits, underscores (_) and the hyphen-minus (-). The name must be unique for a given resource type ID. In case there is a field with the same name in another type it has to have the same FieldType also
    type TypeFieldType
    Describes the type of the field
    inputHint string
    TextInputHint Provides a visual representation type for this field. It is only relevant for string-based field types like StringType and LocalizedStringType
    required boolean
    Whether the field is required to have a value
    label Mapping[str, str]
    A human-readable label for the field
    name str
    The name of the field. The name must be between two and 36 characters long and can contain the ASCII letters A to Z in lowercase or uppercase, digits, underscores (_) and the hyphen-minus (-). The name must be unique for a given resource type ID. In case there is a field with the same name in another type it has to have the same FieldType also
    type TypeFieldType
    Describes the type of the field
    input_hint str
    TextInputHint Provides a visual representation type for this field. It is only relevant for string-based field types like StringType and LocalizedStringType
    required bool
    Whether the field is required to have a value
    label Map<String>
    A human-readable label for the field
    name String
    The name of the field. The name must be between two and 36 characters long and can contain the ASCII letters A to Z in lowercase or uppercase, digits, underscores (_) and the hyphen-minus (-). The name must be unique for a given resource type ID. In case there is a field with the same name in another type it has to have the same FieldType also
    type Property Map
    Describes the type of the field
    inputHint String
    TextInputHint Provides a visual representation type for this field. It is only relevant for string-based field types like StringType and LocalizedStringType
    required Boolean
    Whether the field is required to have a value

    TypeFieldType, TypeFieldTypeArgs

    Name string
    Name of the field type. Some types require extra fields to be set. Note that changing the type after creating is not supported. You need to delete the attribute and re-add it.
    ElementType TypeFieldTypeElementType
    LocalizedValues List<TypeFieldTypeLocalizedValue>
    Localized values for the lenum type.
    ReferenceTypeId string
    Resource type the Custom Field can reference. Required when type is Reference
    Values List<TypeFieldTypeValue>
    Values for the enum type.
    Name string
    Name of the field type. Some types require extra fields to be set. Note that changing the type after creating is not supported. You need to delete the attribute and re-add it.
    ElementType TypeFieldTypeElementType
    LocalizedValues []TypeFieldTypeLocalizedValue
    Localized values for the lenum type.
    ReferenceTypeId string
    Resource type the Custom Field can reference. Required when type is Reference
    Values []TypeFieldTypeValue
    Values for the enum type.
    name string
    Name of the field type. Some types require extra fields to be set. Note that changing the type after creating is not supported. You need to delete the attribute and re-add it.
    element_type object
    localized_values list(object)
    Localized values for the lenum type.
    reference_type_id string
    Resource type the Custom Field can reference. Required when type is Reference
    values list(object)
    Values for the enum type.
    name String
    Name of the field type. Some types require extra fields to be set. Note that changing the type after creating is not supported. You need to delete the attribute and re-add it.
    elementType TypeFieldTypeElementType
    localizedValues List<TypeFieldTypeLocalizedValue>
    Localized values for the lenum type.
    referenceTypeId String
    Resource type the Custom Field can reference. Required when type is Reference
    values List<TypeFieldTypeValue>
    Values for the enum type.
    name string
    Name of the field type. Some types require extra fields to be set. Note that changing the type after creating is not supported. You need to delete the attribute and re-add it.
    elementType TypeFieldTypeElementType
    localizedValues TypeFieldTypeLocalizedValue[]
    Localized values for the lenum type.
    referenceTypeId string
    Resource type the Custom Field can reference. Required when type is Reference
    values TypeFieldTypeValue[]
    Values for the enum type.
    name str
    Name of the field type. Some types require extra fields to be set. Note that changing the type after creating is not supported. You need to delete the attribute and re-add it.
    element_type TypeFieldTypeElementType
    localized_values Sequence[TypeFieldTypeLocalizedValue]
    Localized values for the lenum type.
    reference_type_id str
    Resource type the Custom Field can reference. Required when type is Reference
    values Sequence[TypeFieldTypeValue]
    Values for the enum type.
    name String
    Name of the field type. Some types require extra fields to be set. Note that changing the type after creating is not supported. You need to delete the attribute and re-add it.
    elementType Property Map
    localizedValues List<Property Map>
    Localized values for the lenum type.
    referenceTypeId String
    Resource type the Custom Field can reference. Required when type is Reference
    values List<Property Map>
    Values for the enum type.

    TypeFieldTypeElementType, TypeFieldTypeElementTypeArgs

    Name string
    Name of the field type. Some types require extra fields to be set. Note that changing the type after creating is not supported. You need to delete the attribute and re-add it.
    LocalizedValues List<TypeFieldTypeElementTypeLocalizedValue>
    Localized values for the lenum type.
    ReferenceTypeId string
    Resource type the Custom Field can reference. Required when type is Reference
    Values List<TypeFieldTypeElementTypeValue>
    Values for the enum type.
    Name string
    Name of the field type. Some types require extra fields to be set. Note that changing the type after creating is not supported. You need to delete the attribute and re-add it.
    LocalizedValues []TypeFieldTypeElementTypeLocalizedValue
    Localized values for the lenum type.
    ReferenceTypeId string
    Resource type the Custom Field can reference. Required when type is Reference
    Values []TypeFieldTypeElementTypeValue
    Values for the enum type.
    name string
    Name of the field type. Some types require extra fields to be set. Note that changing the type after creating is not supported. You need to delete the attribute and re-add it.
    localized_values list(object)
    Localized values for the lenum type.
    reference_type_id string
    Resource type the Custom Field can reference. Required when type is Reference
    values list(object)
    Values for the enum type.
    name String
    Name of the field type. Some types require extra fields to be set. Note that changing the type after creating is not supported. You need to delete the attribute and re-add it.
    localizedValues List<TypeFieldTypeElementTypeLocalizedValue>
    Localized values for the lenum type.
    referenceTypeId String
    Resource type the Custom Field can reference. Required when type is Reference
    values List<TypeFieldTypeElementTypeValue>
    Values for the enum type.
    name string
    Name of the field type. Some types require extra fields to be set. Note that changing the type after creating is not supported. You need to delete the attribute and re-add it.
    localizedValues TypeFieldTypeElementTypeLocalizedValue[]
    Localized values for the lenum type.
    referenceTypeId string
    Resource type the Custom Field can reference. Required when type is Reference
    values TypeFieldTypeElementTypeValue[]
    Values for the enum type.
    name str
    Name of the field type. Some types require extra fields to be set. Note that changing the type after creating is not supported. You need to delete the attribute and re-add it.
    localized_values Sequence[TypeFieldTypeElementTypeLocalizedValue]
    Localized values for the lenum type.
    reference_type_id str
    Resource type the Custom Field can reference. Required when type is Reference
    values Sequence[TypeFieldTypeElementTypeValue]
    Values for the enum type.
    name String
    Name of the field type. Some types require extra fields to be set. Note that changing the type after creating is not supported. You need to delete the attribute and re-add it.
    localizedValues List<Property Map>
    Localized values for the lenum type.
    referenceTypeId String
    Resource type the Custom Field can reference. Required when type is Reference
    values List<Property Map>
    Values for the enum type.

    TypeFieldTypeElementTypeLocalizedValue, TypeFieldTypeElementTypeLocalizedValueArgs

    Key string
    Label Dictionary<string, string>
    Key string
    Label map[string]string
    key string
    label map(string)
    key String
    label Map<String,String>
    key string
    label {[key: string]: string}
    key str
    label Mapping[str, str]
    key String
    label Map<String>

    TypeFieldTypeElementTypeValue, TypeFieldTypeElementTypeValueArgs

    Key string
    Label string
    Key string
    Label string
    key string
    label string
    key String
    label String
    key string
    label string
    key str
    label str
    key String
    label String

    TypeFieldTypeLocalizedValue, TypeFieldTypeLocalizedValueArgs

    Key string
    Label Dictionary<string, string>
    Key string
    Label map[string]string
    key string
    label map(string)
    key String
    label Map<String,String>
    key string
    label {[key: string]: string}
    key str
    label Mapping[str, str]
    key String
    label Map<String>

    TypeFieldTypeValue, TypeFieldTypeValueArgs

    Key string
    Label string
    Key string
    Label string
    key string
    label string
    key String
    label String
    key string
    label string
    key str
    label str
    key String
    label String

    Package Details

    Repository
    commercetools labd/terraform-provider-commercetools
    License
    Notes
    This Pulumi package is based on the commercetools Terraform Provider.
    Viewing docs for commercetools 1.22.0
    published on Thursday, May 7, 2026 by labd
      Try Pulumi Cloud free. Your team will thank you.