# Types Define Project-specific [Custom Fields](/api/projects/custom-fields.md) on resources and data types. commercetools commerce APIs provide flexible data models that cover a wide range of use cases with the standard fields on the resources and their data objects. However, you might want to add additional fields to resources and data types to better support your usage scenario. With Types, you can model your own Custom Fields on [these data types](/api/projects/types.md#resourcetypeid). A [Type](/api/projects/types.md#type) can contain multiple [FieldDefinitions](/api/projects/types.md#fielddefinition), each of which defines a Custom Field. [FieldDefinition](/api/projects/types.md#fielddefinition) is similar to [AttributeDefinition](/urn?urn=ctp%3Aapi%3Atype%3AAttributeDefinition) of [Product Types](/api/projects/productTypes.md). Multiple Types can be created for a single resource or data type, but a particular resource or data type can be customized with only one Type at the same time. The values of Custom Fields are represented by [CustomFieldValue](/urn?urn=ctp%3Aapi%3Atype%3ACustomFieldValue) on Custom Fields. Find a step-by-step example on how to use [Types](/api/projects/types.md) and [Custom Fields](/api/projects/custom-fields.md) in our respective [tutorial](/tutorials/custom-types.md). ## Representations #### Type [type definition](/api/projects/types.md?urn=ctp:api:type:Type). #### TypeDraft [type definition](/api/projects/types.md?urn=ctp:api:type:TypeDraft). #### TypePagedQueryResponse [type definition](/api/projects/types.md?urn=ctp:api:type:TypePagedQueryResponse). #### TypeReference [type definition](/api/projects/types.md?urn=ctp:api:type:TypeReference). #### TypeKeyReference [type definition](/api/projects/types.md?urn=ctp:import:type:TypeKeyReference). #### TypeResourceIdentifier [type definition](/api/projects/types.md?urn=ctp:api:type:TypeResourceIdentifier). #### ResourceTypeId [type definition](/api/projects/types.md?urn=ctp:api:type:ResourceTypeId). To extend a Product, use [Product Types](/api/projects/productTypes.md) to define custom [Attributes](/api/projects/productTypes.md#attributedefinition). For best practices, see the [Model your Product catalog](/learning-model-your-product-catalog/) learning path. #### FieldDefinition [type definition](/api/projects/types.md?urn=ctp:api:type:FieldDefinition). #### TextInputHint [type definition](/api/projects/types.md?urn=ctp:api:type:TypeTextInputHint). #### FieldType Abstract parent type for the specific field types with the common `name` field. Some FieldTypes have additional fields for metadata. For example, allowed `values` for enum types or `elementType` for set type fields. ##### CustomFieldBooleanType [type definition](/api/projects/types.md?urn=ctp:api:type:CustomFieldBooleanType). ##### CustomFieldNumberType [type definition](/api/projects/types.md?urn=ctp:api:type:CustomFieldNumberType). ##### CustomFieldStringType [type definition](/api/projects/types.md?urn=ctp:api:type:CustomFieldStringType). ##### CustomFieldLocalizedStringType [type definition](/api/projects/types.md?urn=ctp:api:type:CustomFieldLocalizedStringType). ##### CustomFieldEnumType [type definition](/api/projects/types.md?urn=ctp:api:type:CustomFieldEnumType). ##### CustomFieldLocalizedEnumType [type definition](/api/projects/types.md?urn=ctp:api:type:CustomFieldLocalizedEnumType). ##### CustomFieldMoneyType [type definition](/api/projects/types.md?urn=ctp:api:type:CustomFieldMoneyType). ##### CustomFieldDateType [type definition](/api/projects/types.md?urn=ctp:api:type:CustomFieldDateType). ##### CustomFieldTimeType [type definition](/api/projects/types.md?urn=ctp:api:type:CustomFieldTimeType). ##### CustomFieldDateTimeType [type definition](/api/projects/types.md?urn=ctp:api:type:CustomFieldDateTimeType). ##### CustomFieldReferenceType [type definition](/api/projects/types.md?urn=ctp:api:type:CustomFieldReferenceType). The value of a Custom Field with the `CustomFieldReferenceType` field type must be a [Reference](/urn?urn=ctp%3Aapi%3Atype%3AReference) identified by `id`. [KeyReference](/urn?urn=ctp%3Aapi%3Atype%3AKeyReference) is not supported. ##### CustomFieldSetType [type definition](/api/projects/types.md?urn=ctp:api:type:CustomFieldSetType). #### CustomFieldEnumValue [type definition](/api/projects/types.md?urn=ctp:api:type:CustomFieldEnumValue). #### CustomFieldLocalizedEnumValue [type definition](/api/projects/types.md?urn=ctp:api:type:CustomFieldLocalizedEnumValue). #### CustomFieldReferenceValue [type definition](/api/projects/types.md?urn=ctp:api:type:CustomFieldReferenceValue). ## Get Type ### Get Type by ID [endpoint definition](/api/projects/types.md?urn=ctp:api:endpoint:/\{projectKey}/types/\{id}:GET). ### Get Type by Key [endpoint definition](/api/projects/types.md?urn=ctp:api:endpoint:/\{projectKey}/types/key=\{key}:GET). ## Query Types [endpoint definition](/api/projects/types.md?urn=ctp:api:endpoint:/\{projectKey}/types:GET). ## Check if Type exists ### Check if Type exists by ID [endpoint definition](/api/projects/types.md?urn=ctp:api:endpoint:/\{projectKey}/types/\{id}:HEAD). ### Check if Type exists by Key [endpoint definition](/api/projects/types.md?urn=ctp:api:endpoint:/\{projectKey}/types/key=\{key}:HEAD). ### Check if Type exists by Query Predicate [endpoint definition](/api/projects/types.md?urn=ctp:api:endpoint:/\{projectKey}/types:HEAD). ## Create Type [endpoint definition](/api/projects/types.md?urn=ctp:api:endpoint:/\{projectKey}/types:POST). ## Update Type ### Update Type by ID [endpoint definition](/api/projects/types.md?urn=ctp:api:endpoint:/\{projectKey}/types/\{id}:POST). ### Update Type by Key [endpoint definition](/api/projects/types.md?urn=ctp:api:endpoint:/\{projectKey}/types/key=\{key}:POST). ## Update actions #### Change Key [type definition](/api/projects/types.md?urn=ctp:api:type:TypeChangeKeyAction). #### Change Name [type definition](/api/projects/types.md?urn=ctp:api:type:TypeChangeNameAction). #### Set Description [type definition](/api/projects/types.md?urn=ctp:api:type:TypeSetDescriptionAction). #### Add FieldDefinition [type definition](/api/projects/types.md?urn=ctp:api:type:TypeAddFieldDefinitionAction). #### Remove FieldDefinition [type definition](/api/projects/types.md?urn=ctp:api:type:TypeRemoveFieldDefinitionAction). #### Change FieldDefinition Label [type definition](/api/projects/types.md?urn=ctp:api:type:TypeChangeLabelAction). #### Add EnumValue to FieldDefinition [type definition](/api/projects/types.md?urn=ctp:api:type:TypeAddEnumValueAction). #### Add LocalizedEnumValue to FieldDefinition [type definition](/api/projects/types.md?urn=ctp:api:type:TypeAddLocalizedEnumValueAction). #### Change the order of FieldDefinitions [type definition](/api/projects/types.md?urn=ctp:api:type:TypeChangeFieldDefinitionOrderAction). #### Change the order of EnumValues [type definition](/api/projects/types.md?urn=ctp:api:type:TypeChangeEnumValueOrderAction). #### Change the order of LocalizedEnumValues [type definition](/api/projects/types.md?urn=ctp:api:type:TypeChangeLocalizedEnumValueOrderAction). #### Change InputHint [type definition](/api/projects/types.md?urn=ctp:api:type:TypeChangeInputHintAction). #### Change EnumValue Label [type definition](/api/projects/types.md?urn=ctp:api:type:TypeChangeEnumValueLabelAction). #### Change LocalizedEnumValue Label [type definition](/api/projects/types.md?urn=ctp:api:type:TypeChangeLocalizedEnumValueLabelAction). ## Delete Type These requests delete Types only if they are not referenced by other entities. ### Delete Type by ID [endpoint definition](/api/projects/types.md?urn=ctp:api:endpoint:/\{projectKey}/types/\{id}:DELETE). ### Delete Type by Key [endpoint definition](/api/projects/types.md?urn=ctp:api:endpoint:/\{projectKey}/types/key=\{key}:DELETE). ## Related pages - [Area overview page with navigation](/api.md) - [Previous page: Overview](/api/api-extensibility-overview.md) - [Next page: Custom Fields](/api/projects/custom-fields.md)