Queries and mutations for managing Product Types in the platform.

Queries

Query Product Types

QUERYproductTypes
Arguments
where​
String​
sort​
Array of String​
limit​
Int​
offset​
Int​

Get Product Type

QUERYproductType
Arguments
id​
String​

Queries with specified ID

key​
String​

Queries with specified key

Mutations

Create Product Type

MUTATIONcreateProductType
Arguments
draft​

Update Product Type

MUTATIONupdateProductType
Arguments
version​
Long​
actions​
id​
String​

Queries with specified ID

key​
String​

Queries with specified key

Delete Product Type

MUTATIONdeleteProductType
Arguments
version​
Long​
id​
String​

Queries with specified ID

key​
String​

Queries with specified key

Output types

ProductTypeDefinition

key​
String​
name​
String​
description​
String​
attributeDefinitions​
id​
String​
version​
Long​
createdAt​
lastModifiedAt​
createdBy​
lastModifiedBy​

AttributeDefinitionResult

limit​
Int​
offset​
Int​
total​
Int​
results​

AttributeDefinition

type​

Describes the Type of the Attribute.

name​
String​
User-defined name of the Attribute that is unique within the Project.
label​
String​

Human-readable label for the Attribute.

isRequired​
Boolean​
Whether the Attribute must have a value on a ProductVariant.
attributeConstraint​

Specifies how Attributes are validated across all variants of a Product.

Can be None, Unique, CombinationUnique, or SameForAll​
level​

Specifies whether the Attribute is defined at the Product or Variant level.

Can be Variant, or Product​
inputTip​
String​

Provides additional Attribute information to aid content managers configure Product details.

inputHint​
Provides a visual representation directive for values of this Attribute (only relevant for AttributeTextType and AttributeLocalizableTextType).
Can be SingleLine, or MultiLine​
isSearchable​
Boolean​
Whether the Attribute's values are available in the Product Search or the Product Projection Search API for use in full-text search queries, filters, and facets. However, if an Attribute's level is set as Product, then Product Projection Search does not support the Attribute. To use the Attribute in search, filters, or facets, set isSearchable to true for all AttributeDefinitions with the same name across different ProductTypes. If the isSearchable values are different, the Attribute isn't available for search, filters, or facets.
The exact features that are available with this flag depend on the specific AttributeType. The maximum size of a searchable field is restricted by the Field content size limit. This constraint is enforced at both Product creation and Product update. If the length of the input exceeds the maximum size, an InvalidField error is returned.
savedToLineItem​
Boolean​
Whether the Attribute value is copied onto the LineItem when the Product is added to a Cart. When false, the Attribute value is excluded from the Line Item variant. Line Items already in a Cart are not immediately affected by a change to this value. Existing Line Items are updated the next time their Product data is refreshed, such as when a Recalculate update action is performed with updateProductData set to true, or on a Cart update that triggers an API Extension. Replicating a Cart creates a new Cart that contains the current Product data; it does not update the original Cart.
When savedToLineItem is false, LineItem predicates that reference this Attribute, such as those in Cart Discounts and Shipping Methods, evaluate as if the Attribute is not set.
labelAllLocales​
Array of LocalizedString​

Human-readable label for the Attribute.

inputTipAllLocales​
Array of LocalizedString​

Provides additional Attribute information to aid content managers configure Product details.

AttributeDefinitionType

AttributeConstraint

None
No constraints are applied to the attribute
Unique
Attribute value should be different in each variant
CombinationUnique
A set of attributes, that have this constraint, should have different combinations in each variant
SameForAll
Attribute value should be the same in all variants

Level

Variant
The attribute can be used on the variant level
Product
The attribute can be used on the product level

ProductTypeDefinitionQueryResult

offset​
Int​
count​
Int​
total​
Long​
exists​
Boolean​
results​

Input types

ProductTypeDraft

name​
String​
description​
String​
key​
String​
attributeDefinitions​

AttributeDefinitionDraft

Specify the Attribute to be created with the ProductTypeDraft.
type​

Describes the Type of the Attribute.

When the type is different for an AttributeDefinition using the same name in multiple ProductTypes, an AttributeDefinitionTypeConflict error is returned.
name​
String​

User-defined name of the Attribute that must be unique within the ProductType.

To use the same name in multiple ProductTypes, each AttributeDefinition must have the same type; otherwise, an AttributeDefinitionTypeConflict error is returned. For enum or lenum Types and sets of these AttributeTypes, the enum values can be different for each ProductType.
label​

Human-readable label for the Attribute.

isRequired​
Boolean​
Whether the Attribute is required to have a value on a ProductVariant.
attributeConstraint​
Specifies how an Attribute or a combination of Attributes should be validated across all variants of a Product. If the Attribute is defined at Product level, then attributeConstraint must be None. Otherwise, an InvalidOperation error is returned.
Can be None, Unique, CombinationUnique, or SameForAll​
level​

Specifies whether the Attribute is defined at the Product or Variant level.

Can be Variant, or Product​
inputTip​

Provides additional information about the Attribute that aids content managers when setting Product details.

inputHint​
Provides a visual representation directive for values of this Attribute (only relevant for AttributeTextType and AttributeLocalizableTextType).
Can be SingleLine, or MultiLine​
isSearchable​
Boolean​
Set as true if you want the Attribute's values to be available in the Product Search or the Product Projection Search API and can be used in full-text search queries, filters, and facets. If an Attribute's level is set as Product, then Product Projection Search does not support the Attribute. To use the Attribute in search, filters, or facets, set isSearchable to true for all AttributeDefinitions with the same name across different ProductTypes. If the isSearchable values are different, the Attribute isn't available for search, filters, or facets.
Which exact features are available with this flag depends on the specific AttributeType. The maximum size of a searchable field is restricted by the Field content size limit. This constraint is enforced at both Product creation and Product update. If the length of the input exceeds the maximum size, an InvalidField error is returned.
savedToLineItem​
Boolean​
Whether the Attribute value is copied onto the LineItem when the Product is added to a Cart. When false, the Attribute value is excluded from the Line Item variant. Line Items already in a Cart are not immediately affected by a change to this value. Existing Line Items are updated the next time their Product data is refreshed, such as when a Recalculate update action is performed with updateProductData set to true, or on a Cart update that triggers an API Extension. Replicating a Cart creates a new Cart that contains the current Product data; it does not update the original Cart.
When savedToLineItem is false, LineItem predicates that reference this Attribute, such as those in Cart Discounts and Shipping Methods, evaluate as if the Attribute is not set.
Default: true​

AttributeTypeDraft

set​
text​
number​
money​
date​
time​
datetime​
boolean​
reference​
enum​
lenum​
ltext​

AttributeSetTypeDraft

elementType​

AttributeSetElementTypeDraft

text​
number​
money​
date​
time​
datetime​
boolean​
reference​
enum​
lenum​
ltext​

SimpleAttributeTypeDraft

dummy​
String​

ReferenceTypeDefinitionDraft

referenceTypeId​
String​

EnumTypeDraft

values​

PlainEnumValueDraft

key​
String​
label​
String​

LocalizableEnumTypeDraft

values​

AttributeConstraint

None
No constraints are applied to the attribute
Unique
Attribute value should be different in each variant
CombinationUnique
A set of attributes, that have this constraint, should have different combinations in each variant
SameForAll
Attribute value should be the same in all variants

Level

Variant
The attribute can be used on the variant level
Product
The attribute can be used on the product level

ProductTypeUpdateAction

setKey​
changeName​
changeDescription​
removeAttributeDefinition​
changeLabel​
setInputTip​
changeIsSearchable​
setSavedToLineItem​
changeInputHint​
addAttributeDefinition​
changeAttributeOrder​
changeAttributeOrderByName​
removeEnumValues​
addPlainEnumValue​
changePlainEnumValueLabel​
changePlainEnumValueOrder​
addLocalizedEnumValue​
changeLocalizedEnumValueLabel​
changeLocalizedEnumValueOrder​
changeAttributeName​
changeEnumKey​

Update actions

Set Key

key​
String​

Change Name

name​
String​

Change Description

description​
String​

Remove Attribute Definition

name​
String​

Change Label

attributeName​
String​
label​

Set Input Tip

attributeName​
String​
inputTip​

Change Is Searchable

attributeName​
String​
isSearchable​
Boolean​

Set Saved To Line Item

attributeName​
String​
savedToLineItem​
Boolean​

Change Input Hint

attributeName​
String​
newValue​
Can be SingleLine, or MultiLine​

Add Attribute Definition

attributeDefinition​

Change Attribute Order

attributeDefinitions​

Change Attribute Order By Name

attributeNames​
Array of String​

Remove Enum Values

attributeName​
String​
keys​
Array of String​

Add Plain Enum Value

attributeName​
String​
value​

PlainEnumValueDraft

key​
String​
label​
String​

Change Plain Enum Value Label

attributeName​
String​
newValue​

PlainEnumValueDraft

key​
String​
label​
String​

Change Plain Enum Value Order

attributeName​
String​
values​

PlainEnumValueDraft

key​
String​
label​
String​

Add Localized Enum Value

attributeName​
String​

Change Localized Enum Value Label

attributeName​
String​

Change Localized Enum Value Order

attributeName​
String​
values​

Change Attribute Name

attributeName​
String​
newAttributeName​
String​

Change Enum Key

attributeName​
String​
key​
String​
newKey​
String​