Product Tailoring lets you manage market-specific Product information.
Product Tailoring allows you to customize your product information for different brands or regions based on your business needs. By tailoring product information to different markets, you can increase visibility, customer loyalty, and number of orders.
100 000 000
Product Tailoring over all Products and Stores can be created per Project. Learn more about this limit here.Tailor product information
name
and description
fields of a Product, but not for its slug.
For the slug
field, the ProductProjection takes the original value from the ProductData.Field name | Field value on ProductData | Field value on ProductTailoringData | Field value on ProductProjection in Store |
---|---|---|---|
name | "en: original name" | "en: tailored name" | "en: tailored name" |
description | "en: original desc" | "en: tailored desc" | "en: tailored desc" |
slug | "en: original_slug" | "en: original_slug" |
Fallback to the original piece of product information gives you the flexibility to customize only the information that needs to be tailored for your Store, while not repeating the information that is identical to the original product information.
Tailor Product Variant information
Stage and publish tailored product information
staged
version of ProductData, you can prepare the tailored product information in a staged
version of the ProductTailoringData, before you publish the ProductTailoring to current
.published
flag on the ProductTailoring indicates the publication status of the tailoring as a whole. When true
, you'll find only the fields in the current
ProductTailoringData object in the related current ProductProjection in Store. With the unpublish action you can set published
to false
which leads to all fields falling back to their original values from ProductData regardless of what is stored in the current
version of the ProductTailoringData.hasStagedChanges
field is true
whenever someone modified tailored information in the staged
tailoring information, that are not yet reflected in the current
tailoring information. This can give your team some indication to review the staged changes before publishing them, but your reviewer needs to find out which fields have changed. If you are interested in changes on particular fields of the ProductTailoring, we recommend subscribing to Product Tailoring Messages.Product information retrievable in Store
published
field on ProductCatalogData determines whether the current Product Projection in Store is retrievable or not. The following table summarizes the effect the different published statuses have on the availability of Product Projections and their tailored information:Product | Product Tailoring | Staged Product Projection in Store | Current Product Projection in Store |
---|---|---|---|
unpublished | unpublished | original Product information | not retrievable |
unpublished | published | tailored Product information | not retrievable |
published | unpublished | tailored Product information | original Product information |
published | published | tailored Product information | tailored Product information |
Retrieve Product Projection with tailored information
storeProjection
query parameter does scope the query to the specified Store, but only for projecting original product information on locales, prices, and inventory entries.With a Product Tailoring for a Product and a Store, you control whether the original Product information or the tailored information is contained in the Product Projection retrieved through those endpoints.
staged
query parameter and the published
flag on ProductTailoring as well as on ProductCatalogData in the following way when retrieving Product Projections for the Store:Response | staged query parameter | published on ProductCatalogData | published on ProductTailoring |
---|---|---|---|
current original Product information | false or absent | true | false |
current tailored Product information | false or absent | true | true |
staged original Product information | true | false | false |
staged tailored Product information | true | true | true or false |
staged tailored Product information | true | true or false | true |
Attribute Constraints are validated on Tailoring creation, update, and publishing, but their consistency is not guaranteed with respect to changes on the corresponding Product side.
Representations
ProductTailoring
id ​String​ | Unique identifier of the ProductTailoring. |
version ​Int​ | Current version of the ProductTailoring. |
key ​String​ | User-defined unique identifier of the ProductTailoring. |
store ​ | The Store to which the ProductTailoring belongs. |
product ​ | Reference to the Product the ProductTailoring belongs to. |
published ​Boolean​ | If true , 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. |
current ​ | Current (published) data of the ProductTailoring. |
staged ​ | Staged (unpublished) data of the ProductTailoring. |
hasStagedChanges ​Boolean​ | true if the staged data is different from the current data. |
createdAt ​DateTime​ | Date and time (UTC) the ProductTailoring was initially created. |
createdBy ​BETACreatedBy​ | IDs and references that created the ProductTailoring. |
lastModifiedAt ​DateTime​ | Date and time (UTC) the ProductTailoring was last updated. |
lastModifiedBy ​BETA | IDs and references that last modified the ProductTailoring. |
warnings ​Array of WarningObject​ | Warnings about processing of a request.
Appears in response to requests with response status code 202 Accepted . |
{
"id": "207ee692-6002-4570-a78c-d15e7adbebbb",
"version": 2,
"createdAt": "2023-09-01T13:26:10.475Z",
"lastModifiedAt": "2023-09-01T13:26:10.475Z",
"lastModifiedBy": {
"clientId": "ywjliB_u26xzmcJNKznjbJp4",
"isPlatformClient": false
},
"createdBy": {
"clientId": "ywjliB_u26xzmcJNKznjbJp4",
"isPlatformClient": false
},
"product": {
"typeId": "product",
"id": "daf720e5-9e8e-4300-98db-3a3219327db9"
},
"store": {
"typeId": "store",
"key": "store-key"
},
"current": {
"variants": []
},
"staged": {
"name": {
"en": "tailored name"
},
"description": {
"en": "tailored description"
},
"metaTitle": {
"en": "tailored meta title"
},
"metaDescription": {
"en": "tailored meta description"
},
"metaKeywords": {
"en": "tailored meta keywords"
},
"slug": {
"en": "tailored-slug"
},
"variants": [
{
"id": 1,
"images": [
{
"url": "//myimage.jpg",
"dimensions": {
"w": 400,
"h": 300
}
}
],
"assets": [],
"attributes": []
},
{
"id": 2,
"images": [
{
"url": "//myimage-2.png",
"dimensions": {
"w": 400,
"h": 300
}
}
],
"assets": [],
"attributes": []
}
]
},
"published": false,
"hasStagedChanges": true
}
ProductTailoringData
Contains all the tailored information of a Product.
name ​ | Tailored name of the Product. |
description ​ | Tailored description of the Product. |
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. |
slug ​ | User-defined identifier used in a deep-link URL for the ProductTailoring.
Matches the pattern [a-zA-Z0-9_-]{2,256} . |
variants ​Array of ProductVariantTailoring​ | Tailored Variants of the Product. |
ProductVariantTailoring
id ​Int​ | The id of the tailored ProductVariant. |
images ​Array of Image​ | Images of the tailored Product Variant.
If present, these images will override the images of the corresponding ProductVariant 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 in total. |
attributes ​Array of ProductTailoringAttribute​ | Attributes of the tailored Product Variant.
If present, these Attributes are selectively merged into the
attributes of the corresponding ProductVariant:
|
ProductTailoringDraft
Contains the information to be tailored for a Product.
key ​String​ | User-defined unique identifier of the ProductTailoring. |
store ​ | The Store to which the ProductTailoring belongs. |
product ​ | ResourceIdentifier of the Product the ProductTailoring belongs to. |
name ​ | Tailored name of the Product. |
description ​ | Tailored description of the Product. |
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. |
slug ​ | User-defined identifier used in a deep-link URL for the ProductTailoring.
Matches the pattern [a-zA-Z0-9_-]{2,256} . |
publish ​Boolean​ | Set to true to publish the ProductTailoring immediately.
Otherwise, the tailored product information is just staged. |
variants ​Array of ProductVariantTailoringDraft​ | Tailored Variants of the Product. |
ProductVariantTailoringDraft
id ​Int​ | The id of the ProductVariant to be tailored. |
sku ​String​ | The sku of the ProductVariant to be tailored. |
images ​Array of Image​ | Images of the tailored Product Variant. |
assets ​Array of Asset​ | Media assets of the tailored Product Variant. |
attributes ​Array of ProductTailoringAttribute​ | Attributes of the tailored Product Variant according to the respective AttributeDefinition.
If provided, these Attributes are selectively merged into the
attributes of the corresponding ProductVariant:
|
ProductTailoringInStoreDraft
Contains all the tailored information of a Product for a specific Store.
key ​String​ | User-defined unique identifier of the ProductTailoring. |
product ​ | ResourceIdentifier of the Product the ProductTailoring belongs to. |
name ​ | Tailored name of the Product. |
description ​ | Tailored description of the Product. |
metaTitle ​ | Tailored title of the Product that is used by search engines. |
metaDescription ​ | Tailored description of the Product that is used in search engine. |
metaKeywords ​ | Tailored keywords related to the Product that are used by search engines. |
slug ​ | User-defined identifier used in a deep-link URL for the ProductTailoring.
Matches the pattern [a-zA-Z0-9_-]{2,256} . |
publish ​Boolean​ | If true , the ProductTailoring is published immediately. |
variants ​Array of ProductVariantTailoringDraft​ | Tailored Variants of the Product. |
ProductTailoringPagedQueryResponse
limit ​Int​ | Number of results requested. Default: 20 ​Minimum: 0 ​Maximum: 500 ​ |
offset ​Int​ | Number of elements skipped. Default: 0 ​Maximum: 10000 ​ |
count ​Int​ | Actual number of results returned. |
total ​Int​ | Total number of results matching the query.
Present only when the withTotal query parameter is set to true .
This number is an estimation that is not strongly consistent.
When the results are filtered with a Query Predicate, total is subject to a limit. |
results ​Array of ProductTailoring​ | ProductTailoring list matching the query. |
{
"limit": 20,
"offset": 0,
"count": 2,
"results": [
{
"id": "207ee692-6002-4570-a78c-d15e7adbebbb",
"version": 2,
"createdAt": "2023-09-01T13:26:10.475Z",
"lastModifiedAt": "2023-09-01T13:26:10.475Z",
"lastModifiedBy": {
"clientId": "ywjliB_u26xzmcJNKznjbJp4",
"isPlatformClient": false
},
"createdBy": {
"clientId": "ywjliB_u26xzmcJNKznjbJp4",
"isPlatformClient": false
},
"product": {
"typeId": "product",
"id": "daf720e5-9e8e-4300-98db-3a3219327db9"
},
"store": {
"typeId": "store",
"key": "store-key"
},
"current": {
"variants": []
},
"staged": {
"name": {
"en": "tailored name"
},
"description": {
"en": "tailored description"
},
"metaTitle": {
"en": "tailored meta title"
},
"metaDescription": {
"en": "tailored meta description"
},
"metaKeywords": {
"en": "tailored meta keywords"
},
"slug": {
"en": "tailored-slug"
},
"variants": [
{
"id": 1,
"images": [
{
"url": "//myimage.jpg",
"dimensions": {
"w": 400,
"h": 300
}
}
],
"assets": [],
"attributes": []
},
{
"id": 2,
"images": [
{
"url": "//myimage-2.png",
"dimensions": {
"w": 400,
"h": 300
}
}
],
"assets": [],
"attributes": []
}
]
},
"published": false,
"hasStagedChanges": true
},
{
"id": "207ee692-6002-4570-a78c-d15e7adbecc",
"version": 2,
"createdAt": "2023-09-01T13:27:10.475Z",
"lastModifiedAt": "2023-09-01T14:26:10.475Z",
"lastModifiedBy": {
"clientId": "ywjliB_u26xzmcJNKznjbJp4",
"isPlatformClient": false
},
"createdBy": {
"clientId": "ywjliB_u26xzmcJNKznjbJp4",
"isPlatformClient": false
},
"product": {
"typeId": "product",
"id": "daf720e5-9e8e-4300-98db-3a3219327db9"
},
"store": {
"typeId": "store",
"key": "store-two"
},
"current": {
"variants": []
},
"staged": {
"name": {
"en": "Second store tailored name"
},
"description": {
"en": "This is a tailored description"
},
"metaTitle": {
"en": "tailored meta title"
},
"metaDescription": {
"en": "tailored meta description"
},
"metaKeywords": {
"en": "tailored meta keywords"
},
"slug": {
"en": "tailored-slug-two"
},
"variants": []
},
"published": false,
"hasStagedChanges": true
}
]
}
ProductTailoringReference
id ​String​ | Unique identifier of the referenced ProductTailoring. |
typeId ​ | product-tailoring Type of referenced resource. |
obj ​ | Contains the representation of the expanded ProductTailoring. Only present in responses to requests with Reference Expansion for ProductTailoring. |
ProductTailoringResourceIdentifier
id ​String​ | |
key ​String​ | |
typeId ​ | product-tailoring Type of referenced resource. If given, it must match the expected ReferenceTypeId of the referenced resource. |
ProductTailoringAttribute
value
field: "value" : "\"A value\""
.name ​String​ | Name of the Attribute. (elementIdentifier):Âtrue ​ |
value ​Any​ | The AttributeType determines the format of the Attribute
value to be provided:
Tailoring of Nested Type Attributes is not supported. (expandable): true ​ |
Get ProductTailoring
Get ProductTailoring by ID
view_products:{projectKey}
region String ​ | Region in which the Project is hosted. |
projectKey String ​ | key of the Project. |
id String ​ | id of the ProductTailoring. |
expand | The parameter can be passed multiple times. |
application/json
curl --get https://api.{region}.commercetools.com/{projectKey}/product-tailoring/{id} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}"
{
"id": "207ee692-6002-4570-a78c-d15e7adbebbb",
"version": 2,
"createdAt": "2023-09-01T13:26:10.475Z",
"lastModifiedAt": "2023-09-01T13:26:10.475Z",
"lastModifiedBy": {
"clientId": "ywjliB_u26xzmcJNKznjbJp4",
"isPlatformClient": false
},
"createdBy": {
"clientId": "ywjliB_u26xzmcJNKznjbJp4",
"isPlatformClient": false
},
"product": {
"typeId": "product",
"id": "daf720e5-9e8e-4300-98db-3a3219327db9"
},
"store": {
"typeId": "store",
"key": "store-key"
},
"current": {
"variants": []
},
"staged": {
"name": {
"en": "tailored name"
},
"description": {
"en": "tailored description"
},
"metaTitle": {
"en": "tailored meta title"
},
"metaDescription": {
"en": "tailored meta description"
},
"metaKeywords": {
"en": "tailored meta keywords"
},
"slug": {
"en": "tailored-slug"
},
"variants": [
{
"id": 1,
"images": [
{
"url": "//myimage.jpg",
"dimensions": {
"w": 400,
"h": 300
}
}
],
"assets": [],
"attributes": []
},
{
"id": 2,
"images": [
{
"url": "//myimage-2.png",
"dimensions": {
"w": 400,
"h": 300
}
}
],
"assets": [],
"attributes": []
}
]
},
"published": false,
"hasStagedChanges": true
}
Get ProductTailoring by Key
view_products:{projectKey}
region String ​ | Region in which the Project is hosted. |
projectKey String ​ | key of the Project. |
key String ​ | key of the ProductTailoring. |
expand | The parameter can be passed multiple times. |
application/json
curl --get https://api.{region}.commercetools.com/{projectKey}/product-tailoring/key={key} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}"
{
"id": "207ee692-6002-4570-a78c-d15e7adbebbb",
"version": 2,
"createdAt": "2023-09-01T13:26:10.475Z",
"lastModifiedAt": "2023-09-01T13:26:10.475Z",
"lastModifiedBy": {
"clientId": "ywjliB_u26xzmcJNKznjbJp4",
"isPlatformClient": false
},
"createdBy": {
"clientId": "ywjliB_u26xzmcJNKznjbJp4",
"isPlatformClient": false
},
"product": {
"typeId": "product",
"id": "daf720e5-9e8e-4300-98db-3a3219327db9"
},
"store": {
"typeId": "store",
"key": "store-key"
},
"current": {
"variants": []
},
"staged": {
"name": {
"en": "tailored name"
},
"description": {
"en": "tailored description"
},
"metaTitle": {
"en": "tailored meta title"
},
"metaDescription": {
"en": "tailored meta description"
},
"metaKeywords": {
"en": "tailored meta keywords"
},
"slug": {
"en": "tailored-slug"
},
"variants": [
{
"id": 1,
"images": [
{
"url": "//myimage.jpg",
"dimensions": {
"w": 400,
"h": 300
}
}
],
"assets": [],
"attributes": []
},
{
"id": 2,
"images": [
{
"url": "//myimage-2.png",
"dimensions": {
"w": 400,
"h": 300
}
}
],
"assets": [],
"attributes": []
}
]
},
"published": false,
"hasStagedChanges": true
}
Get ProductTailoring assigned to Product in Store
Get ProductTailoring assigned to Product in Store by Product ID
view_products:{projectKey}
view_products:{projectKey}:{storeKey}
region String ​ | Region in which the Project is hosted. |
projectKey String ​ | key of the Project. |
storeKey String ​ | key of the Store. |
productID String ​ | id of the Product. |
expand | The parameter can be passed multiple times. |
application/json
curl --get https://api.{region}.commercetools.com/{projectKey}/in-store/key={storeKey}/products/{productID}/product-tailoring -i \
--header "Authorization: Bearer ${BEARER_TOKEN}"
{
"id": "207ee692-6002-4570-a78c-d15e7adbebbb",
"version": 2,
"createdAt": "2023-09-01T13:26:10.475Z",
"lastModifiedAt": "2023-09-01T13:26:10.475Z",
"lastModifiedBy": {
"clientId": "ywjliB_u26xzmcJNKznjbJp4",
"isPlatformClient": false
},
"createdBy": {
"clientId": "ywjliB_u26xzmcJNKznjbJp4",
"isPlatformClient": false
},
"product": {
"typeId": "product",
"id": "daf720e5-9e8e-4300-98db-3a3219327db9"
},
"store": {
"typeId": "store",
"key": "store-key"
},
"current": {
"variants": []
},
"staged": {
"name": {
"en": "tailored name"
},
"description": {
"en": "tailored description"
},
"metaTitle": {
"en": "tailored meta title"
},
"metaDescription": {
"en": "tailored meta description"
},
"metaKeywords": {
"en": "tailored meta keywords"
},
"slug": {
"en": "tailored-slug"
},
"variants": [
{
"id": 1,
"images": [
{
"url": "//myimage.jpg",
"dimensions": {
"w": 400,
"h": 300
}
}
],
"assets": [],
"attributes": []
},
{
"id": 2,
"images": [
{
"url": "//myimage-2.png",
"dimensions": {
"w": 400,
"h": 300
}
}
],
"assets": [],
"attributes": []
}
]
},
"published": false,
"hasStagedChanges": true
}
Get ProductTailoring assigned to Product in Store by Product Key
view_products:{projectKey}
view_products:{projectKey}:{storeKey}
region String ​ | Region in which the Project is hosted. |
projectKey String ​ | key of the Project. |
storeKey String ​ | key of the Store. |
productKey String ​ | key of the Product. |
expand | The parameter can be passed multiple times. |
application/json
curl --get https://api.{region}.commercetools.com/{projectKey}/in-store/key={storeKey}/products/key={productKey}/product-tailoring -i \
--header "Authorization: Bearer ${BEARER_TOKEN}"
{
"id": "207ee692-6002-4570-a78c-d15e7adbebbb",
"version": 2,
"createdAt": "2023-09-01T13:26:10.475Z",
"lastModifiedAt": "2023-09-01T13:26:10.475Z",
"lastModifiedBy": {
"clientId": "ywjliB_u26xzmcJNKznjbJp4",
"isPlatformClient": false
},
"createdBy": {
"clientId": "ywjliB_u26xzmcJNKznjbJp4",
"isPlatformClient": false
},
"product": {
"typeId": "product",
"id": "daf720e5-9e8e-4300-98db-3a3219327db9"
},
"store": {
"typeId": "store",
"key": "store-key"
},
"current": {
"variants": []
},
"staged": {
"name": {
"en": "tailored name"
},
"description": {
"en": "tailored description"
},
"metaTitle": {
"en": "tailored meta title"
},
"metaDescription": {
"en": "tailored meta description"
},
"metaKeywords": {
"en": "tailored meta keywords"
},
"slug": {
"en": "tailored-slug"
},
"variants": [
{
"id": 1,
"images": [
{
"url": "//myimage.jpg",
"dimensions": {
"w": 400,
"h": 300
}
}
],
"assets": [],
"attributes": []
},
{
"id": 2,
"images": [
{
"url": "//myimage-2.png",
"dimensions": {
"w": 400,
"h": 300
}
}
],
"assets": [],
"attributes": []
}
]
},
"published": false,
"hasStagedChanges": true
}
Query ProductTailoring
view_products:{projectKey}
region String ​ | Region in which the Project is hosted. |
projectKey String ​ | key of the Project. |
where | The parameter can be passed multiple times. |
sort | The parameter can be passed multiple times. |
expand | The parameter can be passed multiple times. |
limit Int ​ | Number of results requested. Default: 20 ​Minimum: 0 ​Maximum: 500 ​ |
offset Int ​ | Number of elements skipped. Default: 0 ​Maximum: 10000 ​ |
withTotal Boolean ​ | |
var.<varName> String ​ | Predicate parameter values. The parameter can be passed multiple times. |
ProductTailoringPagedQueryResponse
asapplication/json
curl --get https://api.{region}.commercetools.com/{projectKey}/product-tailoring -i \
--header "Authorization: Bearer ${BEARER_TOKEN}"
{
"limit": 20,
"offset": 0,
"count": 2,
"results": [
{
"id": "207ee692-6002-4570-a78c-d15e7adbebbb",
"version": 2,
"createdAt": "2023-09-01T13:26:10.475Z",
"lastModifiedAt": "2023-09-01T13:26:10.475Z",
"lastModifiedBy": {
"clientId": "ywjliB_u26xzmcJNKznjbJp4",
"isPlatformClient": false
},
"createdBy": {
"clientId": "ywjliB_u26xzmcJNKznjbJp4",
"isPlatformClient": false
},
"product": {
"typeId": "product",
"id": "daf720e5-9e8e-4300-98db-3a3219327db9"
},
"store": {
"typeId": "store",
"key": "store-key"
},
"current": {
"variants": []
},
"staged": {
"name": {
"en": "tailored name"
},
"description": {
"en": "tailored description"
},
"metaTitle": {
"en": "tailored meta title"
},
"metaDescription": {
"en": "tailored meta description"
},
"metaKeywords": {
"en": "tailored meta keywords"
},
"slug": {
"en": "tailored-slug"
},
"variants": [
{
"id": 1,
"images": [
{
"url": "//myimage.jpg",
"dimensions": {
"w": 400,
"h": 300
}
}
],
"assets": [],
"attributes": []
},
{
"id": 2,
"images": [
{
"url": "//myimage-2.png",
"dimensions": {
"w": 400,
"h": 300
}
}
],
"assets": [],
"attributes": []
}
]
},
"published": false,
"hasStagedChanges": true
},
{
"id": "207ee692-6002-4570-a78c-d15e7adbecc",
"version": 2,
"createdAt": "2023-09-01T13:27:10.475Z",
"lastModifiedAt": "2023-09-01T14:26:10.475Z",
"lastModifiedBy": {
"clientId": "ywjliB_u26xzmcJNKznjbJp4",
"isPlatformClient": false
},
"createdBy": {
"clientId": "ywjliB_u26xzmcJNKznjbJp4",
"isPlatformClient": false
},
"product": {
"typeId": "product",
"id": "daf720e5-9e8e-4300-98db-3a3219327db9"
},
"store": {
"typeId": "store",
"key": "store-two"
},
"current": {
"variants": []
},
"staged": {
"name": {
"en": "Second store tailored name"
},
"description": {
"en": "This is a tailored description"
},
"metaTitle": {
"en": "tailored meta title"
},
"metaDescription": {
"en": "tailored meta description"
},
"metaKeywords": {
"en": "tailored meta keywords"
},
"slug": {
"en": "tailored-slug-two"
},
"variants": []
},
"published": false,
"hasStagedChanges": true
}
]
}
Query ProductTailoring in Store
view_products:{projectKey}
region String ​ | Region in which the Project is hosted. |
projectKey String ​ | key of the Project. |
storeKey String ​ | key of the Store. |
where | The parameter can be passed multiple times. |
sort | The parameter can be passed multiple times. |
expand | The parameter can be passed multiple times. |
limit Int ​ | Number of results requested. Default: 20 ​Minimum: 0 ​Maximum: 500 ​ |
offset Int ​ | Number of elements skipped. Default: 0 ​Maximum: 10000 ​ |
withTotal Boolean ​ | |
var.<varName> String ​ | Predicate parameter values. The parameter can be passed multiple times. |
ProductTailoringPagedQueryResponse
asapplication/json
curl --get https://api.{region}.commercetools.com/{projectKey}/in-store/key={storeKey}/product-tailoring -i \
--header "Authorization: Bearer ${BEARER_TOKEN}"
{
"limit": 20,
"offset": 0,
"count": 2,
"results": [
{
"id": "207ee692-6002-4570-a78c-d15e7adbebbb",
"version": 2,
"createdAt": "2023-09-01T13:26:10.475Z",
"lastModifiedAt": "2023-09-01T13:26:10.475Z",
"lastModifiedBy": {
"clientId": "ywjliB_u26xzmcJNKznjbJp4",
"isPlatformClient": false
},
"createdBy": {
"clientId": "ywjliB_u26xzmcJNKznjbJp4",
"isPlatformClient": false
},
"product": {
"typeId": "product",
"id": "daf720e5-9e8e-4300-98db-3a3219327db9"
},
"store": {
"typeId": "store",
"key": "store-key"
},
"current": {
"variants": []
},
"staged": {
"name": {
"en": "tailored name"
},
"description": {
"en": "tailored description"
},
"metaTitle": {
"en": "tailored meta title"
},
"metaDescription": {
"en": "tailored meta description"
},
"metaKeywords": {
"en": "tailored meta keywords"
},
"slug": {
"en": "tailored-slug"
},
"variants": [
{
"id": 1,
"images": [
{
"url": "//myimage.jpg",
"dimensions": {
"w": 400,
"h": 300
}
}
],
"assets": [],
"attributes": []
},
{
"id": 2,
"images": [
{
"url": "//myimage-2.png",
"dimensions": {
"w": 400,
"h": 300
}
}
],
"assets": [],
"attributes": []
}
]
},
"published": false,
"hasStagedChanges": true
},
{
"id": "207ee692-6002-4570-a78c-d15e7adbecc",
"version": 2,
"createdAt": "2023-09-01T13:27:10.475Z",
"lastModifiedAt": "2023-09-01T14:26:10.475Z",
"lastModifiedBy": {
"clientId": "ywjliB_u26xzmcJNKznjbJp4",
"isPlatformClient": false
},
"createdBy": {
"clientId": "ywjliB_u26xzmcJNKznjbJp4",
"isPlatformClient": false
},
"product": {
"typeId": "product",
"id": "daf720e5-9e8e-4300-98db-3a3219327db9"
},
"store": {
"typeId": "store",
"key": "store-two"
},
"current": {
"variants": []
},
"staged": {
"name": {
"en": "Second store tailored name"
},
"description": {
"en": "This is a tailored description"
},
"metaTitle": {
"en": "tailored meta title"
},
"metaDescription": {
"en": "tailored meta description"
},
"metaKeywords": {
"en": "tailored meta keywords"
},
"slug": {
"en": "tailored-slug-two"
},
"variants": []
},
"published": false,
"hasStagedChanges": true
}
]
}
Check if ProductTailoring exists by Query Predicate
200 OK
status if any ProductTailoring match the query predicate, or a 404 Not Found
otherwise.view_products:{projectKey}
region String ​ | Region in which the Project is hosted. |
projectKey String ​ | key of the Project. |
where | The parameter can be passed multiple times. |
curl --head https://api.{region}.commercetools.com/{projectKey}/product-tailoring -i \
--header "Authorization: Bearer ${BEARER_TOKEN}"
Create ProductTailoring
manage_products:{projectKey}
region String ​ | Region in which the Project is hosted. |
projectKey String ​ | key of the Project. |
expand | The parameter can be passed multiple times. |
application/json
application/json
curl https://api.{region}.commercetools.com/{projectKey}/product-tailoring -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" \
--header 'Content-Type: application/json' \
--data-binary @- << DATA
{
"product" : {
"typeId" : "product",
"id" : "daf720e5-9e8e-4300-98db-3a3219327db9"
},
"store" : {
"key" : "store-key"
},
"name" : {
"en" : "tailored name"
},
"metaTitle" : {
"en" : "tailored meta title"
},
"metaDescription" : {
"en" : "tailored meta description"
},
"metaKeywords" : {
"en" : "tailored meta keywords"
},
"slug" : {
"en" : "tailored-slug"
},
"description" : {
"en" : "tailored description"
},
"variants" : [ {
"id" : 1,
"images" : [ {
"url" : "//myimage.jpg",
"dimensions" : {
"w" : 400,
"h" : 300
}
} ],
"attributes" : [ {
"name" : "my-attribute",
"value" : "attribute-1"
} ]
}, {
"sku" : "sku-1",
"images" : [ {
"url" : "//myimage-2.png",
"dimensions" : {
"w" : 400,
"h" : 300
}
} ],
"attributes" : [ {
"name" : "my-attribute",
"value" : "attribute-2"
} ]
} ],
"publish" : false
}
DATA
{
"id": "207ee692-6002-4570-a78c-d15e7adbebbb",
"version": 2,
"createdAt": "2023-09-01T13:26:10.475Z",
"lastModifiedAt": "2023-09-01T13:26:10.475Z",
"lastModifiedBy": {
"clientId": "ywjliB_u26xzmcJNKznjbJp4",
"isPlatformClient": false
},
"createdBy": {
"clientId": "ywjliB_u26xzmcJNKznjbJp4",
"isPlatformClient": false
},
"product": {
"typeId": "product",
"id": "daf720e5-9e8e-4300-98db-3a3219327db9"
},
"store": {
"typeId": "store",
"key": "store-key"
},
"current": {
"variants": []
},
"staged": {
"name": {
"en": "tailored name"
},
"description": {
"en": "tailored description"
},
"metaTitle": {
"en": "tailored meta title"
},
"metaDescription": {
"en": "tailored meta description"
},
"metaKeywords": {
"en": "tailored meta keywords"
},
"slug": {
"en": "tailored-slug"
},
"variants": [
{
"id": 1,
"images": [
{
"url": "//myimage.jpg",
"dimensions": {
"w": 400,
"h": 300
}
}
],
"assets": [],
"attributes": []
},
{
"id": 2,
"images": [
{
"url": "//myimage-2.png",
"dimensions": {
"w": 400,
"h": 300
}
}
],
"assets": [],
"attributes": []
}
]
},
"published": false,
"hasStagedChanges": true
}
Create ProductTailoring in Store
storeKey
.
When using this endpoint the ProductTailoring's store
field is always set to the Store specified in the path parameter.manage_products:{projectKey}
manage_products:{projectKey}:{storeKey}
region String ​ | Region in which the Project is hosted. |
projectKey String ​ | key of the Project. |
storeKey String ​ | key of the Store. |
expand | The parameter can be passed multiple times. |
application/json
application/json
curl https://api.{region}.commercetools.com/{projectKey}/in-store/key={storeKey}/product-tailoring -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" \
--header 'Content-Type: application/json' \
--data-binary @- << DATA
{
"product" : {
"typeId" : "product",
"id" : "daf720e5-9e8e-4300-98db-3a3219327db9"
},
"name" : {
"en" : "tailored name"
},
"metaTitle" : {
"en" : "tailored meta title"
},
"metaDescription" : {
"en" : "tailored meta description"
},
"metaKeywords" : {
"en" : "tailored meta keywords"
},
"slug" : {
"en" : "tailored-slug"
},
"description" : {
"en" : "tailored description"
},
"variants" : [ {
"id" : 1,
"images" : [ {
"url" : "//myimage.jpg",
"dimensions" : {
"w" : 400,
"h" : 300
}
} ],
"attributes" : [ {
"name" : "my-attribute",
"value" : "attribute-1"
} ]
}, {
"sku" : "sku-1",
"images" : [ {
"url" : "//myimage-2.png",
"dimensions" : {
"w" : 400,
"h" : 300
}
} ],
"attributes" : [ {
"name" : "my-attribute",
"value" : "attribute-2"
} ]
} ],
"publish" : false
}
DATA
{
"id": "207ee692-6002-4570-a78c-d15e7adbebbb",
"version": 2,
"createdAt": "2023-09-01T13:26:10.475Z",
"lastModifiedAt": "2023-09-01T13:26:10.475Z",
"lastModifiedBy": {
"clientId": "ywjliB_u26xzmcJNKznjbJp4",
"isPlatformClient": false
},
"createdBy": {
"clientId": "ywjliB_u26xzmcJNKznjbJp4",
"isPlatformClient": false
},
"product": {
"typeId": "product",
"id": "daf720e5-9e8e-4300-98db-3a3219327db9"
},
"store": {
"typeId": "store",
"key": "store-key"
},
"current": {
"variants": []
},
"staged": {
"name": {
"en": "tailored name"
},
"description": {
"en": "tailored description"
},
"metaTitle": {
"en": "tailored meta title"
},
"metaDescription": {
"en": "tailored meta description"
},
"metaKeywords": {
"en": "tailored meta keywords"
},
"slug": {
"en": "tailored-slug"
},
"variants": [
{
"id": 1,
"images": [
{
"url": "//myimage.jpg",
"dimensions": {
"w": 400,
"h": 300
}
}
],
"assets": [],
"attributes": []
},
{
"id": 2,
"images": [
{
"url": "//myimage-2.png",
"dimensions": {
"w": 400,
"h": 300
}
}
],
"assets": [],
"attributes": []
}
]
},
"published": false,
"hasStagedChanges": true
}
Update ProductTailoring
Update ProductTailoring by ID
manage_products:{projectKey}
region String ​ | Region in which the Project is hosted. |
projectKey String ​ | key of the Project. |
id String ​ | id of the ProductTailoring. |
expand | The parameter can be passed multiple times. |
application/json
version ​Int​ | Expected version of the ProductTailoring on which the changes apply.
If the expected version does not match the actual version, a 409 Conflict is returned. |
actions ​Array of ProductTailoringUpdateAction​ | Update actions to be performed on the ProductTailoring. |
application/json
curl https://api.{region}.commercetools.com/{projectKey}/product-tailoring/{id} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" \
--header 'Content-Type: application/json' \
--data-binary @- << DATA
{
"version" : 1,
"actions" : [ {
"action" : "setDescription",
"description" : {
"en" : "A description"
},
"staged" : true
} ]
}
DATA
{
"id": "207ee692-6002-4570-a78c-d15e7adbebbb",
"version": 2,
"createdAt": "2023-09-01T13:26:10.475Z",
"lastModifiedAt": "2023-09-01T13:26:10.475Z",
"lastModifiedBy": {
"clientId": "ywjliB_u26xzmcJNKznjbJp4",
"isPlatformClient": false
},
"createdBy": {
"clientId": "ywjliB_u26xzmcJNKznjbJp4",
"isPlatformClient": false
},
"product": {
"typeId": "product",
"id": "daf720e5-9e8e-4300-98db-3a3219327db9"
},
"store": {
"typeId": "store",
"key": "store-key"
},
"current": {
"variants": []
},
"staged": {
"name": {
"en": "tailored name"
},
"description": {
"en": "A description"
},
"slug": {
"en": "tailored-slug"
},
"variants": []
},
"published": false,
"hasStagedChanges": true
}
Update ProductTailoring by Key
manage_products:{projectKey}
region String ​ | Region in which the Project is hosted. |
projectKey String ​ | key of the Project. |
key String ​ | key of the ProductTailoring. |
expand | The parameter can be passed multiple times. |
application/json
version ​Int​ | Expected version of the ProductTailoring on which the changes apply.
If the expected version does not match the actual version, a 409 Conflict is returned. |
actions ​Array of ProductTailoringUpdateAction​ | Update actions to be performed on the ProductTailoring. |
application/json
curl https://api.{region}.commercetools.com/{projectKey}/product-tailoring/key={key} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" \
--header 'Content-Type: application/json' \
--data-binary @- << DATA
{
"version" : 1,
"actions" : [ {
"action" : "setDescription",
"description" : {
"en" : "A description"
},
"staged" : true
} ]
}
DATA
{
"id": "207ee692-6002-4570-a78c-d15e7adbebbb",
"version": 2,
"createdAt": "2023-09-01T13:26:10.475Z",
"lastModifiedAt": "2023-09-01T13:26:10.475Z",
"lastModifiedBy": {
"clientId": "ywjliB_u26xzmcJNKznjbJp4",
"isPlatformClient": false
},
"createdBy": {
"clientId": "ywjliB_u26xzmcJNKznjbJp4",
"isPlatformClient": false
},
"product": {
"typeId": "product",
"id": "daf720e5-9e8e-4300-98db-3a3219327db9"
},
"store": {
"typeId": "store",
"key": "store-key"
},
"current": {
"variants": []
},
"staged": {
"name": {
"en": "tailored name"
},
"description": {
"en": "A description"
},
"slug": {
"en": "tailored-slug"
},
"variants": []
},
"published": false,
"hasStagedChanges": true
}
Update ProductTailoring assigned to Product in Store
Use these update methods in case you know the Product ID or key rather than the ID or key of the ProductTailoring.
Update ProductTailoring assigned to Product in Store by Product ID
manage_products:{projectKey}
manage_products:{projectKey}:{storeKey}
region String ​ | Region in which the Project is hosted. |
projectKey String ​ | key of the Project. |
storeKey String ​ | key of the Store. |
productID String ​ | id of the Product. |
expand | The parameter can be passed multiple times. |
application/json
version ​Int​ | Expected version of the ProductTailoring on which the changes apply.
If the expected version does not match the actual version, a 409 Conflict is returned. |
actions ​Array of ProductTailoringUpdateAction​ | Update actions to be performed on the ProductTailoring. |
application/json
curl https://api.{region}.commercetools.com/{projectKey}/in-store/key={storeKey}/products/{productID}/product-tailoring -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" \
--header 'Content-Type: application/json' \
--data-binary @- << DATA
{
"version" : 1,
"actions" : [ {
"action" : "setDescription",
"description" : {
"en" : "A description"
},
"staged" : true
} ]
}
DATA
{
"id": "207ee692-6002-4570-a78c-d15e7adbebbb",
"version": 2,
"createdAt": "2023-09-01T13:26:10.475Z",
"lastModifiedAt": "2023-09-01T13:26:10.475Z",
"lastModifiedBy": {
"clientId": "ywjliB_u26xzmcJNKznjbJp4",
"isPlatformClient": false
},
"createdBy": {
"clientId": "ywjliB_u26xzmcJNKznjbJp4",
"isPlatformClient": false
},
"product": {
"typeId": "product",
"id": "daf720e5-9e8e-4300-98db-3a3219327db9"
},
"store": {
"typeId": "store",
"key": "store-key"
},
"current": {
"variants": []
},
"staged": {
"name": {
"en": "tailored name"
},
"description": {
"en": "A description"
},
"slug": {
"en": "tailored-slug"
},
"variants": []
},
"published": false,
"hasStagedChanges": true
}
Update ProductTailoring assigned to Product in Store by Product Key
manage_products:{projectKey}
manage_products:{projectKey}:{storeKey}
region String ​ | Region in which the Project is hosted. |
projectKey String ​ | key of the Project. |
storeKey String ​ | key of the Store. |
productKey String ​ | key of the Product. |
expand | The parameter can be passed multiple times. |
application/json
version ​Int​ | Expected version of the ProductTailoring on which the changes apply.
If the expected version does not match the actual version, a 409 Conflict is returned. |
actions ​Array of ProductTailoringUpdateAction​ | Update actions to be performed on the ProductTailoring. |
application/json
curl https://api.{region}.commercetools.com/{projectKey}/in-store/key={storeKey}/products/key={productKey}/product-tailoring -i \
--header "Authorization: Bearer ${BEARER_TOKEN}" \
--header 'Content-Type: application/json' \
--data-binary @- << DATA
{
"version" : 1,
"actions" : [ {
"action" : "setDescription",
"description" : {
"en" : "A description"
},
"staged" : true
} ]
}
DATA
{
"id": "207ee692-6002-4570-a78c-d15e7adbebbb",
"version": 2,
"createdAt": "2023-09-01T13:26:10.475Z",
"lastModifiedAt": "2023-09-01T13:26:10.475Z",
"lastModifiedBy": {
"clientId": "ywjliB_u26xzmcJNKznjbJp4",
"isPlatformClient": false
},
"createdBy": {
"clientId": "ywjliB_u26xzmcJNKznjbJp4",
"isPlatformClient": false
},
"product": {
"typeId": "product",
"id": "daf720e5-9e8e-4300-98db-3a3219327db9"
},
"store": {
"typeId": "store",
"key": "store-key"
},
"current": {
"variants": []
},
"staged": {
"name": {
"en": "tailored name"
},
"description": {
"en": "A description"
},
"slug": {
"en": "tailored-slug"
},
"variants": []
},
"published": false,
"hasStagedChanges": true
}
Update actions
on ProductTailoring
Set Name
action ​String​ | "setName" |
name ​ | Value to set. If empty, any existing value will be removed. |
staged ​Boolean​ | If Default: true , only the staged name is updated. If false , both the current and staged name are updated.true ​ |
{
"action": "setName",
"name": {
"en": "A name"
},
"staged": true
}
Set Description
action ​String​ | "setDescription" |
description ​ | Value to set. If empty, any existing value will be removed. |
staged ​Boolean​ | If Default: true , only the staged description is updated. If false , both the current and staged description are updated.true ​ |
{
"action": "setDescription",
"description": {
"en": "A description"
},
"staged": true
}
Set Slug
action ​String​ | "setSlug" |
slug ​ | Value to set. If empty, any existing value will be removed. |
staged ​Boolean​ | If Default: true , only the staged slug is updated. If false , both the current and staged slug are updated.true ​ |
{
"action": "setSlug",
"slug": {
"en": "a-slug"
},
"staged": true
}
Set Meta Attributes
Updates all meta attributes at the same time.
action ​String​ | "setMetaAttributes" |
metaTitle ​ | Value to set. If empty, any existing value will be removed. |
metaDescription ​ | Value to set. If empty, any existing value will be removed. |
metaKeywords ​ | Value to set. If empty, any existing value will be removed. |
staged ​Boolean​ | If Default: true , only the staged attributes are updated. If false , both the current and staged attributes are updated.true ​ |
{
"action": "setMetaAttributes",
"metaTitle": {
"en": "A Meta Title"
},
"metaDescription": {
"en": "A Meta Description"
},
"metaKeywords": {
"en": "Meta Keywords"
},
"staged": true
}
Set Meta Title
action ​String​ | "setMetaTitle" |
metaTitle ​ | Value to set. If empty, any existing value will be removed. |
staged ​Boolean​ | If Default: true , only the staged metaTitle is updated. If false , both the current and staged metaTitle are updated.true ​ |
{
"action": "setMetaTitle",
"metaTitle": {
"en": "A Meta Title"
},
"staged": true
}
Set Meta Keywords
action ​String​ | "setMetaKeywords" |
metaKeywords ​ | Value to set. If empty, any existing value will be removed. |
staged ​Boolean​ | If Default: true , only the staged metaKeywords is updated. If false , both the current and staged metaKeywords are updated.true ​ |
{
"action": "setMetaKeywords",
"metaKeywords": {
"en": "Meta Keywords"
},
"staged": true
}
Set Meta Description
action ​String​ | "setMetaDescription" |
metaDescription ​ | Value to set. If empty, any existing value will be removed. |
staged ​Boolean​ | If Default: true , only the staged metaDescription is updated. If false , both the current and staged metaDescription are updated.true ​ |
{
"action": "setMetaDescription",
"metaDescription": {
"en": "A Meta Description"
},
"staged": true
}
Publish
staged
data of the ProductTailoring to current
. Sets hasStagedChanges
to false
.
Generates the ProductTailoringPublished Message.action ​String​ | "publish" |
{
"action": "publish"
}
Unpublish
current
data of the ProductTailoring. Sets the published
field to false
.
Generates the ProductTailoringUnpublished Message.action ​String​ | "unpublish" |
{
"action": "unpublish"
}
on ProductVariantTailoring
Add Variant
id
or sku
is required to reference a ProductVariant that exists.
Produces the ProductVariantTailoringAdded Message.id ​Int​ | The id of the tailored ProductVariant to update. |
action ​String​ | "addVariant" |
sku ​String​ | The sku of the tailored ProductVariant to update. |
images ​Array of Image​ | Images for the Product Variant Tailoring. |
assets ​Array of AssetDraft​ | Media assets for the Product Variant Tailoring. |
attributes ​Array of ProductTailoringAttribute​ | Attributes for the Product Variant Tailoring. |
staged ​Boolean​ | If Default: true the new Product Variant Tailoring is only staged. If false the new Product Variant Tailoring is both current and staged.true ​ |
{
"action": "addVariant",
"id": 2,
"sku": "VariantSKU"
}
Remove Variant
images
that have been uploaded to our CDN and that are also used on other Product Variant Tailorings, then removing the Product Variant will make the images unavailable wherever they are shared.id ​Int​ | The id of the ProductVariant to remove from the Tailoring. |
action ​String​ | "removeVariant" |
sku ​String​ | The sku of the ProductVariant to remove from the Tailoring. |
staged ​Boolean​ | If Default: true , only the staged Product Variant Tailoring is removed. If false , both the current and staged Product Variant Tailoring is removed.true ​ |
{
"action": "removeVariant",
"id": 2
}
Add External Image
variantId
or sku
is required to reference a ProductVariant that exists. Produces the ProductTailoringImageAdded Message.action ​String​ | "addExternalImage" |
variantId ​Int​ | The id of the tailored ProductVariant to update. |
sku ​String​ | The sku of the tailored ProductVariant to update. |
image ​Image​ | Value to add to images . |
staged ​Boolean​ | If Default: true , only the staged images is updated. If false , both the current and staged images is updated.true ​ |
{
"action": "addExternalImage",
"variantId": 1,
"image": {
"url": "//myimage.jpg",
"dimensions": {
"w": 1400,
"h": 1400
},
"label": "myImage"
}
}
Move Image To Position
action ​String​ | "moveImageToPosition" |
variantId ​Int​ | The id of the tailored ProductVariant to update. |
sku ​String​ | The sku of the tailored ProductVariant 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​ | If Default: true , only the staged images is updated. If false , both the current and staged images is updated.true ​ |
{
"action": "moveImageToPosition",
"variantId": 1,
"imageUrl": "//myimage2.jpg",
"position": 1
}
Remove Image
imageUrl
is also used on other Product Variant Tailorings, then removing the image will make it unavailable wherever it is shared.action ​String​ | "removeImage" |
variantId ​Int​ | The id of the tailored ProductVariant to update. |
sku ​String​ | The sku of the tailored ProductVariant to update. |
imageUrl ​String​ | The URL of the image to remove. |
staged ​Boolean​ | If Default: true , only the staged image is removed. If false , both the current and staged image is removed.true ​ |
{
"action": "removeImage",
"variantId": 1,
"imageUrl": "//myimage2.jpg"
}
Set Images
variantId
or sku
is required to reference a ProductVariant that exists. Produces the ProductTailoringImagesSet Message.action ​String​ | "setImages" |
variantId ​Int​ | The id of the tailored ProductVariant to update. |
sku ​String​ | The sku of the tailored ProductVariant to update. |
images ​Array of Image​ | Images of the tailored ProductVariant. Don't provide this field if you want to remove all images from the tailored Product Variant.
Set to [] (empty) if you want to hide all images of the original ProductVariant on the tailored ProductVariant. |
staged ​Boolean​ | If Default: true , only the staged images is updated. If false , both the current and staged images is updated.true ​ |
{
"action": "setImages",
"variantId": 1,
"images": [
{
"url": "//myimage.jpg",
"dimensions": {
"w": 100,
"h": 100
}
},
{
"url": "//myimage2.jpg",
"dimensions": {
"w": 100,
"h": 100
}
}
]
}
Set Image Label
action ​String​ | "setImageLabel" |
sku ​String​ | The sku of the tailored ProductVariant to update. |
variantId ​Int​ | The id of the tailored ProductVariant to update. |
imageUrl ​String​ | The URL of the image to set the label. |
label ​String​ | Value to set. If empty, any existing value will be removed. |
staged ​Boolean​ | If Default: true , only the staged image is updated. If false , both the current and staged image is updated.true ​ |
{
"action": "setImageLabel",
"variantId": 2,
"imageUrl": "//image.png",
"label": "labelString",
"staged": true
}
Add Asset
action ​String​ | "addAsset" |
variantId ​Int​ | The id of the tailored ProductVariant to update. |
sku ​String​ | The sku of the tailored ProductVariant to update. |
staged ​Boolean​ | If Default: true , only the staged assets are updated. If false , both the current and staged assets are updated.true ​ |
asset ​AssetDraft​ | Value to append. |
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 . |
{
"action": "addAsset",
"variantId": 1,
"asset": {
"sources": [
{
"uri": "//asset.mp4"
}
],
"name": {
"de": "FirstAssetDE",
"en": "FirstassetEN"
}
}
}
Remove Asset
variantId
or sku
is required to reference a ProductVariant that exists.
The Asset to remove must be specified using either assetId
or assetKey
.action ​String​ | "removeAsset" |
variantId ​Int​ | The id of the tailored ProductVariant to update. |
sku ​String​ | The sku of the tailored ProductVariant to update. |
staged ​Boolean​ | If Default: true , only the staged Asset is removed. If false , both the current and staged Asset is removed.true ​ |
assetId ​String​ | The id of the Asset to remove. |
assetKey ​String​ | The key of the Asset to remove. |
{
"action": "removeAsset",
"variantId": 1,
"assetId": "{{assetId}}"
}
on Assets
Set Asset Key
action ​String​ | "setAssetKey" |
variantId ​Int​ | The id of the tailored ProductVariant to update. |
sku ​String​ | The sku of the tailored ProductVariant to update. |
staged ​Boolean​ | If Default: true , only the staged Asset is updated. If false , both the current and staged Asset is updated.true ​ |
assetId ​String​ | The id of the Asset to update. |
assetKey ​String​ | Value to set. If empty, any existing value will be removed. MinLength:Â2 ​MaxLength: 256 ​Pattern: ^[A-Za-z0-9_-]+$ ​ |
{
"action": "setAssetKey",
"variantId": 1,
"assetId": "{{assetId}}",
"assetKey": "assetKeyString"
}
Change Asset Order
action ​String​ | "changeAssetOrder" |
variantId ​Int​ | The id of the tailored ProductVariant to update. |
sku ​String​ | The sku of the tailored ProductVariant to update. |
staged ​Boolean​ | If Default: true , only the staged assets is updated. If false , both the current and staged assets are updated.true ​ |
assetOrder ​Array of String​ | All existing Asset id s of the ProductVariantTailoring in the desired new order. |
{
"action": "changeAssetOrder",
"variantId": 1,
"assetOrder": [
"{{assetId1}}",
"{{assetId2}}"
]
}
Change Asset Name
variantId
or sku
is required to reference a ProductVariant that exists.
The Asset to update must be specified using either assetId
or assetKey
.action ​String​ | "changeAssetName" |
variantId ​Int​ | The id of the tailored ProductVariant to update. |
sku ​String​ | The sku of the tailored ProductVariant to update. |
staged ​Boolean​ | If Default: true , only the staged Asset is updated. If false , both the current and staged Asset is updated.true ​ |
assetId ​String​ | The id of the Asset to update. |
assetKey ​String​ | The key of the Asset to update. |
name ​ | New value to set. Must not be empty. |
{
"action": "changeAssetName",
"variantId": 1,
"assetId": "{{assetId}}",
"name": {
"de": "Mein Asset",
"en": "My asset"
}
}
Set Asset Description
variantId
or sku
is required to reference a ProductVariant that exists.
The Asset to update must be specified using either assetId
or assetKey
.action ​String​ | "setAssetDescription" |
variantId ​Int​ | The id of the tailored ProductVariant to update. |
sku ​String​ | The sku of the tailored ProductVariant to update. |
staged ​Boolean​ | If Default: true , only the staged Asset is updated. If false , both the current and staged Asset is updated.true ​ |
assetId ​String​ | The id of the Asset to update. |
assetKey ​String​ | The key of the Asset to update. |
description ​ | Value to set. If empty, any existing value will be removed. |
{
"action": "setAssetDescription",
"assetId": "{{assetId}}",
"variantId": 1,
"description": {
"de": "Dies ist eine Asset-Beschreibung",
"en": "This is an asset description"
}
}
Set Asset Sources
variantId
or sku
is required to reference a ProductVariant that exists.
The Asset to update must be specified using either assetId
or assetKey
.action ​String​ | "setAssetSources" |
variantId ​Int​ | The id of the tailored ProductVariant to update. |
sku ​String​ | The sku of the tailored ProductVariant to update. |
staged ​Boolean​ | If Default: true , only the staged Asset is updated. If false both the current and staged Asset is updated.true ​ |
assetId ​String​ | The id of the Asset to update. |
assetKey ​String​ | The key of the Asset to update. |
sources ​Array of AssetSource​ | Value to set. MinItems:Â1 ​ |
{
"action": "setAssetSources",
"variantId": 1,
"assetId": "{{assetId}}",
"sources": [
{
"uri": "https://www.commercetools.de/ct-logo.svg",
"key": "vector"
}
]
}
Set Asset Custom Type
variantId
or sku
is required to reference a ProductVariant that exists.
The Asset to update must be specified using either assetId
or assetKey
.action ​String​ | "setAssetCustomType" |
variantId ​Int​ | The id of the tailored ProductVariant to update. |
sku ​String​ | The sku of the tailored ProductVariant to update. |
staged ​Boolean​ | If Default: true , only the staged Asset is updated. If false , both the current and staged Asset is updated.true ​ |
assetId ​String​ | The id of the Asset to update. |
assetKey ​String​ | The key of the Asset to update. |
type ​ | Defines the Type that extends the Asset with Custom Fields.
If absent, any existing Type and Custom Fields are removed from the Asset. |
fields ​ | Sets the Custom Fields fields for the Asset. |
{
"action": "setAssetCustomType",
"variantId": 1,
"assetId": "{{assetId}}",
"type": {
"id": "{{type-id}}",
"typeId": "type"
},
"fields": {
"exampleStringField": "TextString"
}
}
Set Asset CustomField
variantId
or sku
is required to reference a ProductVariant that exists.
The Asset to update must be specified using either assetId
or assetKey
.action ​String​ | "setAssetCustomField" |
variantId ​Int​ | The id of the tailored ProductVariant to update. |
sku ​String​ | The sku of the tailored ProductVariant to update. |
staged ​Boolean​ | If Default: true , only the staged Asset is updated. If false , both the current and staged Asset is updated.true ​ |
assetId ​String​ | The id of the Asset to update. |
assetKey ​String​ | The key of the Asset to update. |
name ​String​ | Name of the Custom Field. |
value ​ | 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 . |
{
"action": "setAssetCustomField",
"assetId": "{{assetId}}",
"variantId": 1,
"name": "exampleStringField",
"value": "TextString"
}
on Attributes
Set Attribute
variantId
or sku
is required.action ​String​ | "setAttribute" |
variantId ​Int​ | The id of the ProductVariant to update.
Required if sku is absent. |
sku ​String​ | The sku of the ProductVariant to update.
Required if variantId is absent. |
name ​String​ | The name of the Attribute to set. |
value ​Any​ | Value to set for the Attribute. If empty, any existing value will be removed. The AttributeType determines the format of the Attribute
value to be provided:
Tailoring of Nested Type Attributes is not supported. |
staged ​Boolean​ | If Default: true , only the staged Attribute is set. If false , both current and staged Attribute is set.true ​ |
{
"action": "setAttribute",
"variantId": 1,
"name": "ExampleStringTypeAttribute",
"value": "TextString"
}
Set Attribute In All Variants
SameForAll
.action ​String​ | "setAttributeInAllVariants" |
name ​String​ | The name of the Attribute to set. |
value ​Any​ | Value to set for the Attributes. If empty, any existing value will be removed. The AttributeType determines the format of the Attribute
value to be provided:
Tailoring of Nested Type Attributes is not supported. |
staged ​Boolean​ | If Default: true , only the staged Attributes are set. If false , both the current and staged Attributes are set.true ​ |
{
"action": "setAttributeInAllVariants",
"name": "ExampleStringTypeAttribute",
"value": "TextString"
}
Upload Product Tailoring image
InvalidInput
and the message Unsupported image data. Not able to identify the color model of your image.
url
may be shared across different Products in the same Project or in other Projects. However, the Image itself is tied to the Product Variant Tailoring where it was originally uploaded.If the Image is removed from any Product Variant Tailoring, then the Image will be deleted from the CDN and it will no longer be available wherever it is shared.
200 OK
, and if the image is larger, it responds with 202 Accepted
.- A
200 OK
response is returned when all sizes of the image have been successfully uploaded to the CDN. - A
202 Accepted
response is returned when thesmall
size of the image has been successfully uploaded to the CDN, but the upload of the other sizes is still ongoing. These other sizes will be available soon thereafter.
by Product ID
variant
or sku
is required to update a specific ProductVariant.
If neither is provided, the image is uploaded to the Master Variant of the Product.200 OK
, and if the image is larger, it responds with 202 Accepted
.
The Product returned with a 202 Accepted
status code contains a warnings
field with an ImageProcessingOngoing Warning.manage_products:{projectKey}
region String ​ | Region in which the Project is hosted. |
projectKey String ​ | key of the Project. |
storeKey String ​ | key of the Store. |
productID String ​ | id of the Product. |
filename String ​ | URL-encoded filename of the image when stored in the Content Delivery Network (CDN). The filename is modified when uploaded to prevent filename conflicts. If not provided, a random filename is generated. Default: img ​ |
variant Int ​ | The id of the ProductVariantTailoring the image should be uploaded to.
It must correspond to an existing ProductVariant in the Product. |
sku String ​ | The sku of the ProductVariantTailoring the image should be uploaded to.
It must correspond to an existing ProductVariant in the Product. |
staged Boolean ​ | If true , only the staged ProductVariantTailoring is updated.
If false , both the current and staged ProductVariantTailoring are updated.Default: true ​ |
Request headers:
Content-Type String ​ | One of image/jpeg , image/png , or image/gif . |
image/jpeg
image/png
image/gif
.
application/json
202asapplication/json
Request headers:
Content-Type String ​ | One of image/jpeg , image/png , or image/gif . |
by Product Key
variant
or sku
is required to update a specific ProductVariant.
If neither is provided, the image is uploaded to the Master Variant of the Product.200 OK
, and if the image is larger, it responds with 202 Accepted
.
The Product returned with a 202 Accepted
status code contains a warnings
field with an ImageProcessingOngoing Warning.manage_products:{projectKey}
region String ​ | Region in which the Project is hosted. |
projectKey String ​ | key of the Project. |
storeKey String ​ | key of the Store. |
productKey String ​ | key of the Product. |
filename String ​ | URL-encoded filename of the image when stored in the Content Delivery Network (CDN). The filename is modified when uploaded to prevent filename conflicts. If not provided, a random filename is generated. Default: img ​ |
variant Int ​ | The id of the ProductVariantTailoring the image should be uploaded to.
It must correspond to an existing ProductVariant in the Product. |
sku String ​ | The sku of the ProductVariantTailoring the image should be uploaded to.
It must correspond to an existing ProductVariant in the Product. |
staged Boolean ​ | If true , only the staged ProductVariantTailoring is updated.
If false , both the current and staged ProductVariantTailoring are updated.Default: true ​ |
Request headers:
Content-Type String ​ | One of image/jpeg , image/png , or image/gif . |
image/jpeg
image/png
image/gif
.
application/json
202asapplication/json
Request headers:
Content-Type String ​ | One of image/jpeg , image/png , or image/gif . |
id
= 2
, in the Product with specified {productID}
and the Store specified in {storeKey}
: curl -X POST \
-H "Content-Type: image/jpeg" \
-H "Authorization: Bearer {token}" \
--upload-file "detail.jpg" \
"https://api.{region}.commercetools.com/{projectKey}/in-store/{storeKey}/products/{productID}/product-tailoring/images?variant=2&filename=detail.jpg"
filename
parameter was included (filename=detail.jpg
), an example URL of the uploaded image is https://{commercetools-cdn}/detail-6xAq4Efp.jpg
.Delete ProductTailoring
Delete ProductTailoring by ID
manage_products:{projectKey}
region String ​ | Region in which the Project is hosted. |
projectKey String ​ | key of the Project. |
id String ​ | id of the ProductTailoring. |
version Int ​ | Last seen version of the resource. |
expand | The parameter can be passed multiple times. |
application/json
curl -X DELETE https://api.{region}.commercetools.com/{projectKey}/product-tailoring/{id}?version={version} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}"
{
"id": "207ee692-6002-4570-a78c-d15e7adbebbb",
"version": 2,
"createdAt": "2023-09-01T13:26:10.475Z",
"lastModifiedAt": "2023-09-01T13:26:10.475Z",
"lastModifiedBy": {
"clientId": "ywjliB_u26xzmcJNKznjbJp4",
"isPlatformClient": false
},
"createdBy": {
"clientId": "ywjliB_u26xzmcJNKznjbJp4",
"isPlatformClient": false
},
"product": {
"typeId": "product",
"id": "daf720e5-9e8e-4300-98db-3a3219327db9"
},
"store": {
"typeId": "store",
"key": "store-key"
},
"current": {
"variants": []
},
"staged": {
"name": {
"en": "tailored name"
},
"description": {
"en": "tailored description"
},
"metaTitle": {
"en": "tailored meta title"
},
"metaDescription": {
"en": "tailored meta description"
},
"metaKeywords": {
"en": "tailored meta keywords"
},
"slug": {
"en": "tailored-slug"
},
"variants": [
{
"id": 1,
"images": [
{
"url": "//myimage.jpg",
"dimensions": {
"w": 400,
"h": 300
}
}
],
"assets": [],
"attributes": []
},
{
"id": 2,
"images": [
{
"url": "//myimage-2.png",
"dimensions": {
"w": 400,
"h": 300
}
}
],
"assets": [],
"attributes": []
}
]
},
"published": false,
"hasStagedChanges": true
}
Delete ProductTailoring by Key
manage_products:{projectKey}
region String ​ | Region in which the Project is hosted. |
projectKey String ​ | key of the Project. |
key String ​ | key of the ProductTailoring. |
version Int ​ | Last seen version of the resource. |
expand | The parameter can be passed multiple times. |
application/json
curl -X DELETE https://api.{region}.commercetools.com/{projectKey}/product-tailoring/key={key}?version={version} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}"
{
"id": "207ee692-6002-4570-a78c-d15e7adbebbb",
"version": 2,
"createdAt": "2023-09-01T13:26:10.475Z",
"lastModifiedAt": "2023-09-01T13:26:10.475Z",
"lastModifiedBy": {
"clientId": "ywjliB_u26xzmcJNKznjbJp4",
"isPlatformClient": false
},
"createdBy": {
"clientId": "ywjliB_u26xzmcJNKznjbJp4",
"isPlatformClient": false
},
"product": {
"typeId": "product",
"id": "daf720e5-9e8e-4300-98db-3a3219327db9"
},
"store": {
"typeId": "store",
"key": "store-key"
},
"current": {
"variants": []
},
"staged": {
"name": {
"en": "tailored name"
},
"description": {
"en": "tailored description"
},
"metaTitle": {
"en": "tailored meta title"
},
"metaDescription": {
"en": "tailored meta description"
},
"metaKeywords": {
"en": "tailored meta keywords"
},
"slug": {
"en": "tailored-slug"
},
"variants": [
{
"id": 1,
"images": [
{
"url": "//myimage.jpg",
"dimensions": {
"w": 400,
"h": 300
}
}
],
"assets": [],
"attributes": []
},
{
"id": 2,
"images": [
{
"url": "//myimage-2.png",
"dimensions": {
"w": 400,
"h": 300
}
}
],
"assets": [],
"attributes": []
}
]
},
"published": false,
"hasStagedChanges": true
}
Delete ProductTailoring assigned to Product in Store
Delete ProductTailoring assigned to Product in Store by Product ID
manage_products:{projectKey}
manage_products:{projectKey}:{storeKey}
region String ​ | Region in which the Project is hosted. |
projectKey String ​ | key of the Project. |
storeKey String ​ | key of the Store. |
productID String ​ | id of the Product. |
version Int ​ | Last seen version of the resource. |
expand | The parameter can be passed multiple times. |
application/json
curl -X DELETE https://api.{region}.commercetools.com/{projectKey}/in-store/key={storeKey}/products/{productID}/product-tailoring?version={version} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}"
{
"id": "207ee692-6002-4570-a78c-d15e7adbebbb",
"version": 2,
"createdAt": "2023-09-01T13:26:10.475Z",
"lastModifiedAt": "2023-09-01T13:26:10.475Z",
"lastModifiedBy": {
"clientId": "ywjliB_u26xzmcJNKznjbJp4",
"isPlatformClient": false
},
"createdBy": {
"clientId": "ywjliB_u26xzmcJNKznjbJp4",
"isPlatformClient": false
},
"product": {
"typeId": "product",
"id": "daf720e5-9e8e-4300-98db-3a3219327db9"
},
"store": {
"typeId": "store",
"key": "store-key"
},
"current": {
"variants": []
},
"staged": {
"name": {
"en": "tailored name"
},
"description": {
"en": "tailored description"
},
"metaTitle": {
"en": "tailored meta title"
},
"metaDescription": {
"en": "tailored meta description"
},
"metaKeywords": {
"en": "tailored meta keywords"
},
"slug": {
"en": "tailored-slug"
},
"variants": [
{
"id": 1,
"images": [
{
"url": "//myimage.jpg",
"dimensions": {
"w": 400,
"h": 300
}
}
],
"assets": [],
"attributes": []
},
{
"id": 2,
"images": [
{
"url": "//myimage-2.png",
"dimensions": {
"w": 400,
"h": 300
}
}
],
"assets": [],
"attributes": []
}
]
},
"published": false,
"hasStagedChanges": true
}
Delete ProductTailoring assigned to Product in Store by Product Key
manage_products:{projectKey}
manage_products:{projectKey}:{storeKey}
region String ​ | Region in which the Project is hosted. |
projectKey String ​ | key of the Project. |
storeKey String ​ | key of the Store. |
productKey String ​ | key of the Product. |
version Int ​ | Last seen version of the resource. |
expand | The parameter can be passed multiple times. |
application/json
curl -X DELETE https://api.{region}.commercetools.com/{projectKey}/in-store/key={storeKey}/products/key={productKey}/product-tailoring?version={version} -i \
--header "Authorization: Bearer ${BEARER_TOKEN}"
{
"id": "207ee692-6002-4570-a78c-d15e7adbebbb",
"version": 2,
"createdAt": "2023-09-01T13:26:10.475Z",
"lastModifiedAt": "2023-09-01T13:26:10.475Z",
"lastModifiedBy": {
"clientId": "ywjliB_u26xzmcJNKznjbJp4",
"isPlatformClient": false
},
"createdBy": {
"clientId": "ywjliB_u26xzmcJNKznjbJp4",
"isPlatformClient": false
},
"product": {
"typeId": "product",
"id": "daf720e5-9e8e-4300-98db-3a3219327db9"
},
"store": {
"typeId": "store",
"key": "store-key"
},
"current": {
"variants": []
},
"staged": {
"name": {
"en": "tailored name"
},
"description": {
"en": "tailored description"
},
"metaTitle": {
"en": "tailored meta title"
},
"metaDescription": {
"en": "tailored meta description"
},
"metaKeywords": {
"en": "tailored meta keywords"
},
"slug": {
"en": "tailored-slug"
},
"variants": [
{
"id": 1,
"images": [
{
"url": "//myimage.jpg",
"dimensions": {
"w": 400,
"h": 300
}
}
],
"assets": [],
"attributes": []
},
{
"id": 2,
"images": [
{
"url": "//myimage-2.png",
"dimensions": {
"w": 400,
"h": 300
}
}
],
"assets": [],
"attributes": []
}
]
},
"published": false,
"hasStagedChanges": true
}