Queries and mutations for managing Product Tailoring in the platform.

Queries

Query Product Tailoring

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

Get Product Tailoring

QUERYproductTailoring
Arguments
id​
String​

Queries with specified ID

key​
String​

Queries with specified key

productId​
String​

Queries with specified Product ID

productKey​
String​

Queries with specified Product key

storeKey​

The mutation is only performed if the resource is part of the store. Can be used with store-specific OAuth permissions.

Mutations

Create Product Tailoring

MUTATIONcreateProductTailoring
Arguments
storeKey​

The mutation is only performed if the resource is part of the store. Can be used with store-specific OAuth permissions.

draft​

Update Product Tailoring

MUTATIONupdateProductTailoring
Arguments
storeKey​

The mutation is only performed if the resource is part of the store. Can be used with store-specific OAuth permissions.

productId​
String​

Queries with specified Product ID

productKey​
String​

Queries with specified Product key

id​
String​

Queries with specified ID

key​
String​

Queries with specified key

actions​
version​
Long​

Delete Product Tailoring

MUTATIONdeleteProductTailoring
Arguments
storeKey​

The mutation is only performed if the resource is part of the store. Can be used with store-specific OAuth permissions.

productId​
String​

Queries with specified Product ID

productKey​
String​

Queries with specified Product key

id​
String​

Queries with specified ID

key​
String​

Queries with specified key

version​
Long​

Output types

ProductTailoring

A single ProductTailoring representation contains the current and the staged representation of its product information tailored per Store.
key​
String​

User-defined unique identifier of the ProductTailoring.

productRef​

Reference to the Product the ProductTailoring belongs to.

product​

Reference to the Product the ProductTailoring belongs to.

storeRef​

The Store to which the ProductTailoring belongs.

store​

The Store to which the ProductTailoring belongs.

current​
Current data of the ProductTailoring returned in the Product Projection response when the ProductTailoring is published.
staged​

Staged data of the ProductTailoring. This data is not returned in the Product Projection response by default.

published​
Boolean​
Whether the tailored information contained in the current ProductTailoringData is provided when retrieving the ProductProjection in Store. For information not part of the ProductTailoringData, the original information contained in the ProductData is provided. If false, only the original information contained in the ProductData is provided.
hasStagedChanges​
Boolean​
Whether the staged data is different from the current data.
id​
String​

Unique identifier of the ProductTailoring.

version​
Long​

Current version of the ProductTailoring.

createdAt​

Date and time (UTC) the ProductTailoring was initially created.

lastModifiedAt​

Date and time (UTC) the ProductTailoring was last updated.

createdBy​

IDs and references that created the ProductTailoring.

lastModifiedBy​

IDs and references that last modified the ProductTailoring.

ProductTailoringData

Contains all the tailored information of a Product.

name​
String​

Tailored name of the Product.

nameAllLocales​
Array of LocalizedString​

Tailored name of the Product.

description​
String​

Tailored description of the Product.

descriptionAllLocales​
Array of LocalizedString​

Tailored description of the Product.

slug​
String​
User-defined identifier used in a deep-link URL for the ProductTailoring. Matches the pattern [a-zA-Z0-9_-]{2,256}.
slugAllLocales​
Array of LocalizedString​
User-defined identifier used in a deep-link URL for the ProductTailoring. Matches the pattern [a-zA-Z0-9_-]{2,256}.
metaTitle​
String​

Tailored title of the Product that is used by search engines.

metaTitleAllLocales​
Array of LocalizedString​

Tailored title of the Product that is used by search engines.

metaDescription​
String​

Tailored description of the Product that is used by search engines.

metaDescriptionAllLocales​
Array of LocalizedString​

Tailored description of the Product that is used by search engines.

metaKeywords​
String​

Tailored keywords related to the Product that are used by search engines.

metaKeywordsAllLocales​
Array of LocalizedString​

Tailored keywords related to the Product that are used by search engines.

variants​

Tailored Variants of the Product.

attributesRaw​
Attributes of the tailored Product. If available, these Attributes are selectively merged into the attributes of the corresponding Product. If the Product contains an Attribute with the same name, then its value is overwritten. Otherwise, the Attribute and its value are added to the Product.

ProductVariantTailoring

The tailoring of a ProductVariant or Variant.
id​
Int​
The id of the tailored ProductVariant or Variant.
images​
Array of Image​
Images of the tailored Product Variant. If present, these images will override the images of the corresponding ProductVariant or Variant in total.
assets​
Array of Asset​
Media assets of the tailored Product Variant. If present, these assets will override the assets of the corresponding ProductVariant or Variant in total.
attributesRaw​
Attributes of the tailored Product Variant. If present, these Attributes are selectively merged into the attributes of the corresponding ProductVariant or Variant:
  • If the ProductVariant or Variant contains an Attribute with the same name, its value is overwritten. Otherwise, the Attribute and its value are added to the ProductVariant or Variant.

RawProductAttribute

attributeDefinition​
name​
String​
value​
Json​
attributesRaw​
BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta
referencedResource​
referencedResourceSet​

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

ProductTailoringQueryResult

offset​
Int​
count​
Int​
total​
Long​
exists​
Boolean​
results​
Array of ProductTailoring​

Input types

ProductTailoringDraft

Contains the information to be tailored for a Product.

ResourceIdentifier of the Product the ProductTailoring belongs to.

name​

Tailored name of the Product.

key​
String​

User-defined unique identifier of the ProductTailoring.

description​

Tailored description of the Product.

slug​
User-defined identifier used in a deep-link URL for the ProductTailoring. Matches the pattern [a-zA-Z0-9_-]{2,256}.
metaTitle​

Tailored title of the Product that is used by search engines.

metaDescription​

Tailored description of the Product that is used by search engines.

metaKeywords​

Tailored keywords related to the Product that are used by search engines.

publish​
Boolean​
Whether to publish the ProductTailoring immediately. Otherwise, the tailored product information is just staged.
variants​

Tailored Variants of the Product.

Default: []​
attributes​
Attributes of the tailored Product. If provided, these Attributes are selectively merged into the attributes of the corresponding Product. If the Product contains an Attribute with the same name, then its value is overwritten. Otherwise, the Attribute and its value are added to the Product.
Default: []​

ProductVariantTailoringInput

id​
Int​
sku​
String​
attributes​
Default: []​
images​
Array of ImageInput​
assets​
Array of AssetDraftInput​

ProductAttributeInput

An input object used to define a ProductAttribute.

The value should be passed in a form of escaped JSON.

Examples for value:
  • FieldType String: "\"This is a string\""
  • FieldType DateTimeType: "\"2018-10-12T14:00:00.000Z\""
  • FieldType Number: "4"
  • FieldType Set with an elementType of String: "[\"This is a string\", \"This is another string\"]"
  • FieldType Reference: "{\"id\": \"b911b62d-353a-4388-93ee-8d488d9af962\", \"typeId\": \"product\"}"
name​
String​
value​
String​

The value should be passed in a form of escaped JSON.

Examples for value:
  • FieldType String: "\"This is a string\""
  • FieldType DateTimeType: "\"2018-10-12T14:00:00.000Z\""
  • FieldType Number: "4"
  • FieldType Set with an elementType of String: "[\"This is a string\", \"This is another string\"]"
  • FieldType Reference: "{\"id\": \"b911b62d-353a-4388-93ee-8d488d9af962\", \"typeId\": \"product\"}"

ImageInput

url​
String​
label​
String​
dimensions​

DimensionsInput

width​
Int​
height​
Int​

AssetDraftInput

key​
String​
name​
description​
custom​
sources​
Array of AssetSourceInput​
tags​
Array of String​

AssetSourceInput

uri​
String​
key​
String​
dimensions​
contentType​
String​

AssetDimensionsInput

width​
Int​
height​
Int​

ProductTailoringUpdateAction

moveImageToPosition​
addVariant​
removeVariant​
publish​
unpublish​
setProductAttribute​
addAsset​
addExternalImage​
changeAssetName​
changeAssetOrder​
removeAsset​
removeImage​
setAssetCustomField​
setAssetCustomType​
setAssetDescription​
setAssetKey​
setAssetSources​
setAssetTags​
setImages​
setAttribute​
setAttributeInAllVariants​
setDescription​
setImageLabel​
setKey​
setMetaAttributes​
setMetaDescription​
setMetaKeywords​
setMetaTitle​
setName​
setSlug​

Update actions

Move Image To Position

Either variantId or sku is required to reference a ProductVariant or Variant that exists.
variantId​
Int​
The id of the tailored ProductVariant or Variant to update.
sku​
String​
The sku of the tailored ProductVariant or Variant to update.
imageUrl​
String​

The URL of the image to update.

position​
Int​
Position in images where the image should be moved. Must be between 0 and the total number of images minus 1.
staged​
Boolean​
Whether only the staged images is updated. If false, both the current and staged images are updated.
Default: true​

Add Variant

id​
Int​
sku​
String​
attributes​
Default: []​
images​
Array of ImageInput​
assets​
Array of AssetDraftInput​
staged​
Boolean​
Default: true​

ProductAttributeInput

An input object used to define a ProductAttribute.

The value should be passed in a form of escaped JSON.

Examples for value:
  • FieldType String: "\"This is a string\""
  • FieldType DateTimeType: "\"2018-10-12T14:00:00.000Z\""
  • FieldType Number: "4"
  • FieldType Set with an elementType of String: "[\"This is a string\", \"This is another string\"]"
  • FieldType Reference: "{\"id\": \"b911b62d-353a-4388-93ee-8d488d9af962\", \"typeId\": \"product\"}"
name​
String​
value​
String​

The value should be passed in a form of escaped JSON.

Examples for value:
  • FieldType String: "\"This is a string\""
  • FieldType DateTimeType: "\"2018-10-12T14:00:00.000Z\""
  • FieldType Number: "4"
  • FieldType Set with an elementType of String: "[\"This is a string\", \"This is another string\"]"
  • FieldType Reference: "{\"id\": \"b911b62d-353a-4388-93ee-8d488d9af962\", \"typeId\": \"product\"}"

ImageInput

url​
String​
label​
String​
dimensions​

DimensionsInput

width​
Int​
height​
Int​

AssetDraftInput

key​
String​
name​
description​
custom​
sources​
Array of AssetSourceInput​
tags​
Array of String​

AssetSourceInput

uri​
String​
key​
String​
dimensions​
contentType​
String​

AssetDimensionsInput

width​
Int​
height​
Int​

Remove Variant

id​
Int​
sku​
String​
staged​
Boolean​
Default: true​

Publish

dummy​
String​

Unpublish

dummy​
String​

Set Product Attribute

name​
String​
value​
String​
staged​
Boolean​
Default: true​

Add Asset

Either variantId or sku is required to reference a ProductVariant or Variant that exists.
variantId​
Int​
The id of the tailored ProductVariant or Variant to update.
sku​
String​
The sku of the tailored ProductVariant or Variant to update.
staged​
Boolean​
Whether only the staged assets are updated. If false, both the current and staged assets are updated.
Default: true​
position​
Int​
Position in assets where the Asset should be put. When specified, the value must be between 0 and the total number of Assets minus 1.
asset​

Value to append.

AssetDraftInput

key​
String​
name​
description​
custom​
sources​
Array of AssetSourceInput​
tags​
Array of String​

AssetSourceInput

uri​
String​
key​
String​
dimensions​
contentType​
String​

AssetDimensionsInput

width​
Int​
height​
Int​

Add External Image

Either variantId or sku is required to reference a ProductVariant or Variant that exists. Produces the ProductTailoringImageAdded Message.
variantId​
Int​
The id of the tailored ProductVariant or Variant to update.
sku​
String​
The sku of the tailored ProductVariant or Variant to update.
image​
Value to add to images.
staged​
Boolean​
Whether only the staged images is updated. If false, both the current and staged images are updated.
Default: true​

ImageInput

url​
String​
label​
String​
dimensions​

DimensionsInput

width​
Int​
height​
Int​

Change Asset Name

Either variantId or sku is required to reference a ProductVariant that exists. The Asset to update must be specified using either assetId or assetKey.
variantId​
Int​
The id of the tailored ProductVariant to update.
sku​
String​
The sku of the tailored ProductVariant to update.
staged​
Boolean​
Whether only the staged Asset is updated. If false, both the current and staged Asset is updated.
Default: true​
name​

New value to set. Must not be empty.

assetKey​
String​
The key of the Asset to update.
assetId​
String​
The id of the Asset to update.

Change Asset Order

Either variantId or sku is required to reference a ProductVariant that exists.
variantId​
Int​
The id of the tailored ProductVariant to update.
sku​
String​
The sku of the tailored ProductVariant to update.
staged​
Boolean​
Whether only the staged assets is updated. If false, both the current and staged assets are updated.
Default: true​
assetOrder​
Array of String​
All existing Asset ids of the ProductVariantTailoring in the desired new order.

Remove Asset

Either variantId or sku is required to reference a ProductVariant or Variant that exists. The Asset to remove must be specified using either assetId or assetKey.
variantId​
Int​
The id of the tailored ProductVariant or Variant to update.
sku​
String​
The sku of the tailored ProductVariant or Variant to update.
staged​
Boolean​
Whether only the staged Asset is removed. If false, both the current and staged Asset is removed.
Default: true​
assetKey​
String​
The key of the Asset to remove.
assetId​
String​
The id of the Asset to remove.

Remove Image

Either variantId or sku is required to reference a ProductVariant or Variant that exists.
variantId​
Int​
The id of the tailored ProductVariant or Variant to update.
sku​
String​
The sku of the tailored ProductVariant or Variant to update.
imageUrl​
String​

The URL of the image to remove.

staged​
Boolean​
Whether only the staged image is removed. If false, both the current and staged image is removed.
Default: true​

Set Asset Custom Field

Either variantId or sku is required to reference a ProductVariant that exists. The Asset to update must be specified using either assetId or assetKey.
variantId​
Int​
The id of the tailored ProductVariant to update.
sku​
String​
The sku of the tailored ProductVariant to update.
staged​
Boolean​
Whether only the staged Asset is updated. If false, both the current and staged Asset is updated.
Default: true​
value​
String​
If value is absent or null, this field will be removed if it exists. Removing a field that does not exist returns an InvalidOperation error. If value is provided, it is set for the field defined by name.
name​
String​
Name of the Custom Field.
assetKey​
String​
The key of the Asset to update.
assetId​
String​
The id of the Asset to update.

Set Asset Custom Type

variantId​
Int​
sku​
String​
staged​
Boolean​
Default: true​
typeId​
String​
typeKey​
String​
fields​
Array of CustomFieldInput​
assetKey​
String​
assetId​
String​

Set Asset Description

Either variantId or sku is required to reference a ProductVariant that exists. The Asset to update must be specified using either assetId or assetKey.
variantId​
Int​
The id of the tailored ProductVariant to update.
sku​
String​
The sku of the tailored ProductVariant to update.
staged​
Boolean​
Whether only the staged Asset is updated. If false, both the current and staged Asset is updated.
Default: true​
description​

Value to set. If omitted, any existing value is removed.

assetKey​
String​
The key of the Asset to update.
assetId​
String​
The id of the Asset to update.

Set Asset Key

Either variantId or sku is required to reference a ProductVariant that exists.
variantId​
Int​
The id of the tailored ProductVariant to update.
sku​
String​
The sku of the tailored ProductVariant to update.
staged​
Boolean​
Whether only the staged Asset is updated. If false, both the current and staged Asset is updated.
Default: true​
assetKey​
String​

Value to set. If omitted, any existing value is removed.

assetId​
String​
The id of the Asset to update.

Set Asset Sources

Either variantId or sku is required to reference a ProductVariant that exists. The Asset to update must be specified using either assetId or assetKey.
variantId​
Int​
The id of the tailored ProductVariant to update.
sku​
String​
The sku of the tailored ProductVariant to update.
staged​
Boolean​
Whether only the staged Asset is updated. If false, both the current and staged Asset is updated.
Default: true​
sources​
Array of AssetSourceInput​

Value to set.

Default: []​
assetKey​
String​
The key of the Asset to update.
assetId​
String​
The id of the Asset to update.

AssetSourceInput

uri​
String​
key​
String​
dimensions​
contentType​
String​

AssetDimensionsInput

width​
Int​
height​
Int​

Set Asset Tags

Either variantId or sku is required to reference a ProductVariant that exists. The Asset to update must be specified using either assetId or assetKey.
variantId​
Int​
The id of the tailored ProductVariant to update.
sku​
String​
The sku of the tailored ProductVariant to update.
staged​
Boolean​
Whether only the staged Asset is updated. If false, both the current and staged Asset is updated.
Default: true​
tags​
Array of String​

Keywords for categorizing and organizing Assets.

Default: []​
assetKey​
String​
The key of the Asset to update.
assetId​
String​
The id of the Asset to update.

Set Images

variantId​
Int​
sku​
String​
images​
Array of ImageInput​
staged​
Boolean​
Default: true​

ImageInput

url​
String​
label​
String​
dimensions​

DimensionsInput

width​
Int​
height​
Int​

Set Attribute

Either variantId or sku is required.
variantId​
Int​
The id of the ProductVariant or Variant to update. Required if sku is absent.
sku​
String​
The sku of the ProductVariant or Variant to update. Required if variantId is absent.
name​
String​

The name of the Attribute to set.

value​
String​

Value to set for the Attribute. If omitted, any existing value is removed.

The AttributeType determines the format of the Attribute value to be provided:
Tailoring of Nested Type Attributes is not supported.
staged​
Boolean​
Whether only the staged Attribute is set. If false, both current and staged Attribute is set.
Default: true​

Set Attribute In All Variants

Adds, removes, or changes a tailored Attribute in all Product Variants of a Product at the same time. This action is useful for setting tailored values for Attributes with the Constraint SameForAll.
name​
String​

The name of the Attribute to set.

value​
String​

Value to set for the Attributes. If omitted, any existing value is removed.

The AttributeType determines the format of the Attribute value to be provided:
Tailoring of Nested Type Attributes is not supported.
staged​
Boolean​
Whether only the staged Attributes are set. If false, both the current and staged Attributes are set.
Default: true​

Set Description

Generates the ProductTailoringDescriptionSet Message.
description​

Value to set. If omitted, any existing value is removed.

staged​
Boolean​
Whether only the staged description is updated. If false, both the current and staged description are updated.
Default: true​

Set Image Label

Either variantId or sku is required to reference a ProductVariant or Variant that exists.
variantId​
Int​
The id of the tailored ProductVariant or Variant to update.
sku​
String​
The sku of the tailored ProductVariant or Variant to update.
imageUrl​
String​

The URL of the image to set the label.

label​
String​

Value to set. If omitted, any existing value is removed.

staged​
Boolean​
Whether only the staged image is updated. If false, both the current and staged image is updated.
Default: true​

Set Key

Generates the ProductTailoringKeySet Message.
key​
String​

Value to set. Must be unique. If omitted, any existing value is removed.

Set Meta Attributes

Updates all meta attributes at the same time.

metaDescription​

Value to set. If omitted, any existing value is removed.

metaKeywords​

Value to set. If omitted, any existing value is removed.

metaTitle​

Value to set. If omitted, any existing value is removed.

staged​
Boolean​
Whether only the staged attributes are updated. If false, both the current and staged attributes are updated.
Default: true​

Set Meta Description

metaDescription​

Value to set. If omitted, any existing value is removed.

staged​
Boolean​
Whether only the staged metaDescription is updated. If false, both the current and staged metaDescription are updated.
Default: true​

Set Meta Keywords

metaKeywords​

Value to set. If omitted, any existing value is removed.

staged​
Boolean​
Whether only the staged metaKeywords is updated. If false, both the current and staged metaKeywords are updated.
Default: true​

Set Meta Title

metaTitle​

Value to set. If omitted, any existing value is removed.

staged​
Boolean​
Whether only the staged metaTitle is updated. If false, both the current and staged metaTitle are updated.
Default: true​

Set Name

Generates the ProductTailoringNameSet Message.
name​

Value to set. If omitted, any existing value is removed.

staged​
Boolean​
Whether only the staged name is updated. If false, both the current and staged name are updated.
Default: true​

Set Slug

Generates the ProductTailoringSlugSet Message.
slug​

Value to set. If omitted, any existing value is removed.

staged​
Boolean​
Whether only the staged slug is updated. If false, both the current and staged slug are updated.
Default: true​