# Product Types Product Types are used to describe common characteristics, most importantly common custom Attributes, of many concrete Products. Deciding which aspects of your product catalog to model as Product Type attributes is an important part of working with the API. For more information, see the [Product Modeling Module](/learning-model-your-product-catalog/product-modeling/overview.md). A maximum number of **1000** [ProductTypes](/api/projects/productTypes.md#producttype) can be created per Project. This is a soft limit that can be increased per Project after a performance impact review. See [Limit increase guidance](/api/limit-increase-guidance.md#resource-count-limits). To customize resources other than Products, refer to [Types](/api/projects/types.md). Learn more about Product Types in our self-paced Product data modeling and Advanced Product data modeling modules. ## Representations #### ProductType [type definition](/api/projects/productTypes.md?urn=ctp:api:type:ProductType). #### ProductTypeDraft [type definition](/api/projects/productTypes.md?urn=ctp:api:type:ProductTypeDraft). #### ProductTypePagedQueryResponse [type definition](/api/projects/productTypes.md?urn=ctp:api:type:ProductTypePagedQueryResponse). #### ProductTypeReference [type definition](/api/projects/productTypes.md?urn=ctp:api:type:ProductTypeReference). #### ProductTypeKeyReference [type definition](/api/projects/productTypes.md?urn=ctp:import:type:ProductTypeKeyReference). #### ProductTypeResourceIdentifier [type definition](/api/projects/productTypes.md?urn=ctp:api:type:ProductTypeResourceIdentifier). #### AttributeDefinition Attributes defined at the Product level are supported by [Product Search](/api/projects/product-search.md), but not by [Product Projection Search](/api/projects/product-projection-search.md). [type definition](/api/projects/productTypes.md?urn=ctp:api:type:AttributeDefinition). #### AttributeDefinitionDraft You can configure Attributes either at the variant level or at the Product level . Attributes defined at the Product level are common to all variants available within a Product. Attributes defined at the variant level can be unique for individual variants or same for all the variants within a Product. Attributes defined at the Product level are supported by [Product Search](/api/projects/product-search.md), but not by [Product Projection Search](/api/projects/product-projection-search.md). However, if your application requires Product Projection Search, then you can use Attributes at the variant level with the Attribute constraint as `SameForAll`. [type definition](/api/projects/productTypes.md?urn=ctp:api:type:AttributeDefinitionDraft). #### AttributeLevelEnum [type definition](/api/projects/productTypes.md?urn=ctp:api:type:AttributeLevelEnum). #### AttributeType Attributes are classified based on the data type the Attribute values hold. All Attribute types have a `name`. Some have additional fields such as `values` in enums or `elementType` in sets. ##### AttributeBooleanType [type definition](/api/projects/productTypes.md?urn=ctp:api:type:AttributeBooleanType). ##### AttributeTextType [type definition](/api/projects/productTypes.md?urn=ctp:api:type:AttributeTextType). ##### AttributeLocalizableTextType [type definition](/api/projects/productTypes.md?urn=ctp:api:type:AttributeLocalizableTextType). ##### AttributeEnumType [type definition](/api/projects/productTypes.md?urn=ctp:api:type:AttributeEnumType). ##### AttributeLocalizedEnumType [type definition](/api/projects/productTypes.md?urn=ctp:api:type:AttributeLocalizedEnumType). ##### AttributeNumberType [type definition](/api/projects/productTypes.md?urn=ctp:api:type:AttributeNumberType). ##### AttributeMoneyType [type definition](/api/projects/productTypes.md?urn=ctp:api:type:AttributeMoneyType). ##### AttributeDateType [type definition](/api/projects/productTypes.md?urn=ctp:api:type:AttributeDateType). ##### AttributeTimeType [type definition](/api/projects/productTypes.md?urn=ctp:api:type:AttributeTimeType). ##### AttributeDateTimeType [type definition](/api/projects/productTypes.md?urn=ctp:api:type:AttributeDateTimeType). ##### AttributeReferenceType [type definition](/api/projects/productTypes.md?urn=ctp:api:type:AttributeReferenceType). ##### AttributeSetType [type definition](/api/projects/productTypes.md?urn=ctp:api:type:AttributeSetType). ##### AttributeNestedType [type definition](/api/projects/productTypes.md?urn=ctp:api:type:AttributeNestedType). The value of the nested Attribute is an array of values. It reflects the structure of the `attributes` property of Product Variant, where every element of the array is a JSON object with properties `name` and `value`. Here is an example of nested Attribute values in a Product Variant: ```json { ... "attributes": [ {"name": "nutrients", "value": [ {"name": "servingSize", "value": 100}, {"name": "servingSizeUnits", "value": "GR" } ]} ] ... } ``` As with any other AttributeType, it is possible to declare a `set` of `nested` Attribute Type. However, an iteration of AttributeSetType that terminates with an AttributeNestedType is limited to 5 steps. ```json { "name": "productTypeWithNestedSet", "type": { "name": "set", "elementType": { "name": "nested", "typeReference": { "id": "", "typeId": "product-type" } } } } ``` Consult the [Nested Attribute type](/learning-model-your-product-catalog/attribute-types-and-attribute-groups/nested-attribute-type.md) learning module for more information. #### AttributePlainEnumValue [type definition](/api/projects/productTypes.md?urn=ctp:api:type:AttributePlainEnumValue). #### AttributeLocalizedEnumValue [type definition](/api/projects/productTypes.md?urn=ctp:api:type:AttributeLocalizedEnumValue). #### AttributeConstraintEnum [type definition](/api/projects/productTypes.md?urn=ctp:api:type:AttributeConstraintEnum). #### AttributeReferenceTypeId [type definition](/api/projects/productTypes.md?urn=ctp:api:type:AttributeReferenceTypeId). #### TextInputHint [type definition](/api/projects/productTypes.md?urn=ctp:api:type:TextInputHint). ## Get ProductType ### Get ProductType by ID [endpoint definition](/api/projects/productTypes.md?urn=ctp:api:endpoint:/\{projectKey}/product-types/\{id}:GET). ### Get ProductType by Key [endpoint definition](/api/projects/productTypes.md?urn=ctp:api:endpoint:/\{projectKey}/product-types/key=\{key}:GET). ## Query ProductTypes [endpoint definition](/api/projects/productTypes.md?urn=ctp:api:endpoint:/\{projectKey}/product-types:GET). ## Check if ProductType exists ### Check if ProductType exists by ID [endpoint definition](/api/projects/productTypes.md?urn=ctp:api:endpoint:/\{projectKey}/product-types/\{id}:HEAD). ### Check if ProductType exists by Key [endpoint definition](/api/projects/productTypes.md?urn=ctp:api:endpoint:/\{projectKey}/product-types/key=\{key}:HEAD). ### Check if ProductType exists by Query Predicate [endpoint definition](/api/projects/productTypes.md?urn=ctp:api:endpoint:/\{projectKey}/product-types:HEAD). ## Create ProductType [endpoint definition](/api/projects/productTypes.md?urn=ctp:api:endpoint:/\{projectKey}/product-types:POST). ## Update ProductType ### Update ProductType by ID [endpoint definition](/api/projects/productTypes.md?urn=ctp:api:endpoint:/\{projectKey}/product-types/\{id}:POST). ### Update ProductType by Key [endpoint definition](/api/projects/productTypes.md?urn=ctp:api:endpoint:/\{projectKey}/product-types/key=\{key}:POST). ## Update actions #### Set Key [type definition](/api/projects/productTypes.md?urn=ctp:api:type:ProductTypeSetKeyAction). #### Change Name [type definition](/api/projects/productTypes.md?urn=ctp:api:type:ProductTypeChangeNameAction). #### Change Description [type definition](/api/projects/productTypes.md?urn=ctp:api:type:ProductTypeChangeDescriptionAction). #### Add AttributeDefinition Adding a required AttributeDefinition to an existing ProductType can make existing Products and ProductVariants inconsistent until the required Attribute value is provided. ProductType changes cannot be staged. Before adding a required AttributeDefinition to an existing ProductType, plan how to backfill the Attribute value on affected Products. Product updates for affected Products require setting the missing required Attribute value. [type definition](/api/projects/productTypes.md?urn=ctp:api:type:ProductTypeAddAttributeDefinitionAction). #### Remove AttributeDefinition [type definition](/api/projects/productTypes.md?urn=ctp:api:type:ProductTypeRemoveAttributeDefinitionAction). #### Change AttributeDefinition Name [type definition](/api/projects/productTypes.md?urn=ctp:api:type:ProductTypeChangeAttributeNameAction). When renaming multiple Attributes, you must consider the impact of these updates on Products. For example: If there is a ProductType with the Attribute definitions `aa` and `bb`: 1. We send a command to update `bb` to `cc`. 2. We send another command to update `aa` to `bb`. When updating Products, the order is not guaranteed because these are two separate commands. It is possible (though unlikely) that the Products are updated in the wrong order: the Attribute `aa` is renamed to `bb`, and then to `cc`. To avoid this outcome, add both `"changeAttributeName"` update actions to `actions`. This ensures that Products are updated in the correct order: ```json { "version": "", "actions": [ { "action": "changeAttributeName", "attributeName": "bb", "newAttributeName": "cc" }, { "action": "changeAttributeName", "attributeName": "aa", "newAttributeName": "bb" } ] } ``` #### Change AttributeDefinition Label [type definition](/api/projects/productTypes.md?urn=ctp:api:type:ProductTypeChangeLabelAction). #### Set AttributeDefinition InputTip [type definition](/api/projects/productTypes.md?urn=ctp:api:type:ProductTypeSetInputTipAction). #### Add PlainEnumValue to AttributeDefinition [type definition](/api/projects/productTypes.md?urn=ctp:api:type:ProductTypeAddPlainEnumValueAction). #### Add LocalizableEnumValue to AttributeDefinition [type definition](/api/projects/productTypes.md?urn=ctp:api:type:ProductTypeAddLocalizedEnumValueAction). #### Remove EnumValues from AttributeDefinition [type definition](/api/projects/productTypes.md?urn=ctp:api:type:ProductTypeRemoveEnumValuesAction). #### Change the order of AttributeDefinitions [type definition](/api/projects/productTypes.md?urn=ctp:api:type:ProductTypeChangeAttributeOrderByNameAction). #### Change the order of EnumValues [type definition](/api/projects/productTypes.md?urn=ctp:api:type:ProductTypeChangePlainEnumValueOrderAction). #### Change the order of LocalizedEnumValues [type definition](/api/projects/productTypes.md?urn=ctp:api:type:ProductTypeChangeLocalizedEnumValueOrderAction). #### Change the key of an EnumValue [type definition](/api/projects/productTypes.md?urn=ctp:api:type:ProductTypeChangeEnumKeyAction). #### Change the label of an EnumValue [type definition](/api/projects/productTypes.md?urn=ctp:api:type:ProductTypeChangePlainEnumValueLabelAction). #### Change the label of a LocalizedEnumValue [type definition](/api/projects/productTypes.md?urn=ctp:api:type:ProductTypeChangeLocalizedEnumValueLabelAction). #### Change AttributeDefinition IsSearchable [type definition](/api/projects/productTypes.md?urn=ctp:api:type:ProductTypeChangeIsSearchableAction). #### Change AttributeDefinition InputHint [type definition](/api/projects/productTypes.md?urn=ctp:api:type:ProductTypeChangeInputHintAction). #### Change AttributeDefinition AttributeConstraint [type definition](/api/projects/productTypes.md?urn=ctp:api:type:ProductTypeChangeAttributeConstraintAction). ## Delete ProductType ProductTypes can only be deleted if they are not referenced by a [Product](/urn?urn=ctp%3Aapi%3Atype%3AProduct). ### Delete ProductType by ID [endpoint definition](/api/projects/productTypes.md?urn=ctp:api:endpoint:/\{projectKey}/product-types/\{id}:DELETE). ### Delete ProductType by Key [endpoint definition](/api/projects/productTypes.md?urn=ctp:api:endpoint:/\{projectKey}/product-types/key=\{key}:DELETE). ## Related pages - [Area overview page with navigation](/api.md) - [Previous page: Overview](/api/product-catalog-overview.md) - [Next page: Attribute Groups](/api/projects/attribute-groups.md)