# Product Types

## GraphQL partial SDLs

This is a graphql reference page. In the llms.txt variant, those components link to the shared partial SDL key list instead of trying to resolve inline GraphQL reference content.

Fetch all available partial SDL keys first:

```text
GET https://docs.commercetools.com/apis/rest/content/by-id?id=ctp:gql-sphere:returnTypesList
```

Then fetch the one or more relevant partial SDL with a key from that list by calling the same endpoint with a schema ID:

```text
GET https://docs.commercetools.com/apis/rest/content/by-id?id=ctp:gql-sphere:schema:<key>
```

The response body is a JSON object keyed by the requested content ID. For example, the key-list request returns a `ctp:gql-sphere:returnTypesList` field and a schema request returns a `ctp:gql-sphere:schema:<key>` field.

**Queries and mutations for managing Product Types in the platform.**

## Queries

### Query Product Types

[fetch SDL for query productTypes](#graphql-partial-sdls).

### Get Product Type

[fetch SDL for query productType](#graphql-partial-sdls).

## Mutations

### Create Product Type

[fetch SDL for mutation createProductType](#graphql-partial-sdls).

### Update Product Type

[fetch SDL for mutation updateProductType](#graphql-partial-sdls).

### Delete Product Type

[fetch SDL for mutation deleteProductType](#graphql-partial-sdls).

## Output types

### ProductTypeDefinition

[fetch SDL for type ProductTypeDefinition](#graphql-partial-sdls).

### ProductTypeDefinitionQueryResult

[fetch SDL for type ProductTypeDefinitionQueryResult](#graphql-partial-sdls).

## Input types

### ProductTypeDraft

[fetch SDL for type ProductTypeDraft](#graphql-partial-sdls).

### AttributeDefinitionDraft

[fetch SDL for type AttributeDefinitionDraft](#graphql-partial-sdls).

### ProductTypeUpdateAction

[fetch SDL for type ProductTypeUpdateAction](#graphql-partial-sdls).

### Update actions

#### Set Key

[fetch SDL for type setKey](#graphql-partial-sdls).

#### Change Name

[fetch SDL for type changeName](#graphql-partial-sdls).

#### Change Description

[fetch SDL for type changeDescription](#graphql-partial-sdls).

#### Remove Attribute Definition

[fetch SDL for type removeAttributeDefinition](#graphql-partial-sdls).

#### Change Label

[fetch SDL for type changeLabel](#graphql-partial-sdls).

#### Set Input Tip

[fetch SDL for type setInputTip](#graphql-partial-sdls).

#### Change Is Searchable

[fetch SDL for type changeIsSearchable](#graphql-partial-sdls).

#### Set Saved To Line Item

[fetch SDL for type setSavedToLineItem](#graphql-partial-sdls).

#### Change Input Hint

[fetch SDL for type changeInputHint](#graphql-partial-sdls).

#### Add Attribute Definition

[fetch SDL for type addAttributeDefinition](#graphql-partial-sdls).

#### Change Attribute Order

[fetch SDL for type changeAttributeOrder](#graphql-partial-sdls).

#### Change Attribute Order By Name

[fetch SDL for type changeAttributeOrderByName](#graphql-partial-sdls).

#### Remove Enum Values

[fetch SDL for type removeEnumValues](#graphql-partial-sdls).

#### Add Plain Enum Value

[fetch SDL for type addPlainEnumValue](#graphql-partial-sdls).

#### Change Plain Enum Value Label

[fetch SDL for type changePlainEnumValueLabel](#graphql-partial-sdls).

#### Change Plain Enum Value Order

[fetch SDL for type changePlainEnumValueOrder](#graphql-partial-sdls).

#### Add Localized Enum Value

[fetch SDL for type addLocalizedEnumValue](#graphql-partial-sdls).

#### Change Localized Enum Value Label

[fetch SDL for type changeLocalizedEnumValueLabel](#graphql-partial-sdls).

#### Change Localized Enum Value Order

[fetch SDL for type changeLocalizedEnumValueOrder](#graphql-partial-sdls).

#### Change Attribute Name

[fetch SDL for type changeAttributeName](#graphql-partial-sdls).

#### Change Enum Key

[fetch SDL for type changeEnumKey](#graphql-partial-sdls).

## Related pages

- [Search documentation and API specs](/search.md)