Product Tailoring
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.
With Product Tailoring you control what product information is displayed in the storefront. To control the availability of your Products for specific Stores, we recommend using Product Selections instead.
Product Tailoring is not a replacement for Localization but an additional option when using Stores. It allows you to control the tailoring of your Product information for each locale individually.
To ensure a consistent user experience for your Customers, Composable Commerce passes the tailored information to all entities involved in the buying process, such as Shopping Lists, Carts, and Orders.
You can create only one Product Tailoring for each combination of a Product and a Store. It is not possible to share a Product Tailoring between Stores. To assign the same tailored values to a given Product in different Stores, you must create a separate Product Tailoring for each Store.
A maximum number of 100 000 000 Product Tailoring over all Products and Stores can be created per Project. Learn more about this limit here.
Do not change the Product key of your tailored Products. If you were to change the Product key, you would lose all tailoring associated with that Product.
Tailor product information
For each piece of product information you want to tailor for the Store, add the appropriate Product field with the tailored value to the ProductTailoringData object. For fields that you don't add to this object, Composable Commerce returns the corresponding original value from the Product's ProductData object when retrieving the ProductProjection in Store.
The following example shows a Product Tailoring for the 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
The API allows you to customize Images and Assets per Store by tailoring existing ProductVariants. To assign Store-specific Product Variant information, add the tailored Image or Asset to the corresponding ProductVariantTailoring object. For Images and Assets that you don't add to this object, Composable Commerce returns the corresponding original Images and Assets from the ProductVariant when retrieving the ProductProjection in Store.
The following example shows a ProductVariantTailoring for the UK Store, but no tailoring for the ES Store. Composable Commerce retrieves the Images for ProductVariant in UK Store from the Images given in the ProductVariantTailoring UK ignoring the Images in the ProductVariant:
The images for ProductVariant in ES Store are retrieved from the original Images in the ProductVariant because no ProductVariantTailoring is defined for the ES Store.
Stage and publish tailored product information
Similar to the Product's ProductCatalogData, where you can prepare your original product information in the 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.
The 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.
The 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
The published status of the Product Tailoring is independent of the published status of a Product itself. The Product's 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
Tailored information is not indexed for the Storefront Search APIs.
Tailored information cannot be used in Query Predicates for the Query ProductProjections endpoint.
The storeProjection query parameter does scope the query to the specified Store, but only for projecting original product information on locales, prices, and inventory entries.
The intended approach to populate your storefront is to retrieve the products through the Get ProductProjection in Store methods.
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.
Based on this logic, set the 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 |
When using Product Selections also, the tailored Product must be available in Store.
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
A single ProductTailoring representation contains the current and the staged representation of its product information tailored per Store.
idString | Unique identifier of the ProductTailoring. |
versionInt | Current version of the ProductTailoring. |
keyString | User-defined unique identifier of the ProductTailoring. |
store | The Store to which the ProductTailoring belongs. |
product | Reference to the Product the ProductTailoring belongs to. |
publishedBoolean | If |
current | Current (published) data of the ProductTailoring. |
staged | Staged (unpublished) data of the ProductTailoring. |
hasStagedChangesBoolean |
|
createdAt | Date and time (UTC) the ProductTailoring was initially created. |
createdByBETA | IDs and references that created the ProductTailoring. |
lastModifiedAt | Date and time (UTC) the ProductTailoring was last updated. |
lastModifiedByBETA | IDs and references that last modified the ProductTailoring. |
warningsArray of WarningObject | Warnings about processing of a request.
Appears in response to requests with response status code |
{"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 |
variantsArray of ProductVariantTailoring | Tailored Variants of the Product. |
ProductVariantTailoring
The tailoring of a ProductVariant.
idInt | The |
imagesArray of Image | Images of the tailored Product Variant. If present, these images will override the images of the corresponding ProductVariant in total. |
assetsArray of Asset | Media assets of the tailored Product Variant. If present, these assets will override the assets of the corresponding ProductVariant in total. |
attributesArray of ProductTailoringAttribute | Attributes of the tailored Product Variant.
If present, these Attributes are selectively merged into the
|
ProductTailoringDraft
Contains the information to be tailored for a Product.
keyString | 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 |
publishBoolean | Set to false |
variantsArray of ProductVariantTailoringDraft | Tailored Variants of the Product. |
ProductVariantTailoringDraft
Either id or sku is required to reference a ProductVariant that exists.
idInt | The |
skuString | The |
imagesArray of Image | Images of the tailored Product Variant. |
assetsArray of Asset | Media assets of the tailored Product Variant. |
attributesArray of ProductTailoringAttribute | Attributes of the tailored Product Variant according to the respective AttributeDefinition.
If provided, these Attributes are selectively merged into the
|
ProductTailoringInStoreDraft
Contains all the tailored information of a Product for a specific Store.
keyString | 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 |
publishBoolean | If false |
variantsArray of ProductVariantTailoringDraft | Tailored Variants of the Product. |
ProductTailoringPagedQueryResponse
PagedQueryResult with results containing an array of ProductTailoring.
limitInt | Number of results requested. Default:20Maximum: 500 |
offsetInt | Number of elements skipped. Default:0Maximum: 10 000 |
countInt | Actual number of results returned. |
totalInt | Total number of results matching the query.
This number is an estimation that is not strongly consistent.
This field is returned by default.
For improved performance, calculating this field can be deactivated by using the query parameter |
resultsArray 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
Reference to a ProductTailoring.
idString | Unique identifier of the referenced ProductTailoring. |
typeId | "product-tailoring"References a ProductTailoring. |
obj | Contains the representation of the expanded ProductTailoring. Only present in responses to requests with Reference Expansion for ProductTailoring. |
ProductTailoringResourceIdentifier
idString | Unique identifier of the referenced ProductTailoring. Either |
keyString | User-defined unique identifier of the referenced ProductTailoring. Either |
typeId | "product-tailoring"References a ProductTailoring. |
ProductTailoringAttribute
When using attributes with GraphQL API mutations, you must escape any strings in the value field: "value" : "\"A value\"".
The same rules for name and value apply as for Attribute in Product Variants.
nameString | Name of the Attribute. |
valueAny | The AttributeType determines the format of the Attribute
Tailoring of Nested Type Attributes is not supported. |
Get ProductTailoring
Get ProductTailoring by ID
view_products:{projectKey}regionString | Region in which the Project is hosted. |
projectKeyString |
|
idString |
|
expand | The parameter can be passed multiple times. |
application/jsoncurl --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}regionString | Region in which the Project is hosted. |
projectKeyString |
|
keyString |
|
expand | The parameter can be passed multiple times. |
application/jsoncurl --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
Gets the current or staged representation of a Product Tailoring by its Product ID in the specified Store.
view_products:{projectKey}view_products:{projectKey}:{storeKey}regionString | Region in which the Project is hosted. |
projectKeyString |
|
storeKeyString |
|
productIDString |
|
expand | The parameter can be passed multiple times. |
application/jsoncurl --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
Gets the current or staged representation of a Product Tailoring by its Product key in the specified Store.
view_products:{projectKey}view_products:{projectKey}:{storeKey}regionString | Region in which the Project is hosted. |
projectKeyString |
|
storeKeyString |
|
productKeyString |
|
expand | The parameter can be passed multiple times. |
application/jsoncurl --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}regionString | Region in which the Project is hosted. |
projectKeyString |
|
where | The parameter can be passed multiple times. |
sort | The parameter can be passed multiple times. |
expand | The parameter can be passed multiple times. |
limitInt | Number of results requested. Default: 20 |
offsetInt | Number of elements skipped. Default: 0 |
withTotalBoolean | Controls the calculation of the total number of query results. Set to Default: true |
var.<varName>String | Predicate parameter values. The parameter can be passed multiple times. |
application/jsoncurl --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
Queries Product Tailoring in a specific Store.
view_products:{projectKey}regionString | Region in which the Project is hosted. |
projectKeyString |
|
storeKeyString |
|
where | The parameter can be passed multiple times. |
sort | The parameter can be passed multiple times. |
expand | The parameter can be passed multiple times. |
limitInt | Number of results requested. Default: 20 |
offsetInt | Number of elements skipped. Default: 0 |
withTotalBoolean | By default, the response does not include the Default: true |
var.<varName>String | Predicate parameter values. The parameter can be passed multiple times. |
application/jsoncurl --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
Checks if a ProductTailoring exists for a given Query Predicate. Returns a 200 OK status if any ProductTailoring match the Query Predicate or a 404 Not Found otherwise.
view_products:{projectKey}regionString | Region in which the Project is hosted. |
projectKeyString |
|
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
Generates the ProductTailoringCreated Message.
manage_products:{projectKey}regionString | Region in which the Project is hosted. |
projectKeyString |
|
expand | The parameter can be passed multiple times. |
application/jsonapplication/jsoncurl 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
Creates a ProductTailoring in the Store specified by storeKey.
When using this endpoint the ProductTailoring's store field is always set to the Store specified in the path parameter.
Generates the ProductTailoringCreated Message.
manage_products:{projectKey}manage_products:{projectKey}:{storeKey}regionString | Region in which the Project is hosted. |
projectKeyString |
|
storeKeyString |
|
expand | The parameter can be passed multiple times. |
application/jsonapplication/jsoncurl 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}regionString | Region in which the Project is hosted. |
projectKeyString |
|
idString |
|
expand | The parameter can be passed multiple times. |
application/jsonversionInt | 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. |
actionsArray of ProductTailoringUpdateAction | Update actions to be performed on the ProductTailoring. |
application/jsoncurl 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}regionString | Region in which the Project is hosted. |
projectKeyString |
|
keyString |
|
expand | The parameter can be passed multiple times. |
application/jsonversionInt | 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. |
actionsArray of ProductTailoringUpdateAction | Update actions to be performed on the ProductTailoring. |
application/jsoncurl 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
Updates the current or staged representation of a Product Tailoring by its Product ID in the specified Store.
manage_products:{projectKey}manage_products:{projectKey}:{storeKey}regionString | Region in which the Project is hosted. |
projectKeyString |
|
storeKeyString |
|
productIDString |
|
expand | The parameter can be passed multiple times. |
application/jsonversionInt | 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. |
actionsArray of ProductTailoringUpdateAction | Update actions to be performed on the ProductTailoring. |
application/jsoncurl 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
Updates the current or staged representation of a Product Tailoring by its Product key in the specified Store.
manage_products:{projectKey}manage_products:{projectKey}:{storeKey}regionString | Region in which the Project is hosted. |
projectKeyString |
|
storeKeyString |
|
productKeyString |
|
expand | The parameter can be passed multiple times. |
application/jsonversionInt | 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. |
actionsArray of ProductTailoringUpdateAction | Update actions to be performed on the ProductTailoring. |
application/jsoncurl 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
Generates the ProductTailoringNameSet Message.
actionString | "setName" |
name | Value to set. If empty, any existing value will be removed. |
stagedBoolean | If true |
{"action": "setName","name": {"en": "A name"},"staged": true}
Set Description
Generates the ProductTailoringDescriptionSet Message.
actionString | "setDescription" |
description | Value to set. If empty, any existing value will be removed. |
stagedBoolean | If true |
{"action": "setDescription","description": {"en": "A description"},"staged": true}
Set Slug
Generates the ProductTailoringSlugSet Message.
actionString | "setSlug" |
slug | Value to set. If empty, any existing value will be removed. |
stagedBoolean | If true |
{"action": "setSlug","slug": {"en": "a-slug"},"staged": true}
Set Meta Attributes
Updates all meta attributes at the same time.
actionString | "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. |
stagedBoolean | If true |
{"action": "setMetaAttributes","metaTitle": {"en": "A Meta Title"},"metaDescription": {"en": "A Meta Description"},"metaKeywords": {"en": "Meta Keywords"},"staged": true}
Set Meta Title
actionString | "setMetaTitle" |
metaTitle | Value to set. If empty, any existing value will be removed. |
stagedBoolean | If true |
{"action": "setMetaTitle","metaTitle": {"en": "A Meta Title"},"staged": true}
Set Meta Keywords
actionString | "setMetaKeywords" |
metaKeywords | Value to set. If empty, any existing value will be removed. |
stagedBoolean | If true |
{"action": "setMetaKeywords","metaKeywords": {"en": "Meta Keywords"},"staged": true}
Set Meta Description
actionString | "setMetaDescription" |
metaDescription | Value to set. If empty, any existing value will be removed. |
stagedBoolean | If true |
{"action": "setMetaDescription","metaDescription": {"en": "A Meta Description"},"staged": true}
Publish
Publishes the staged data of the ProductTailoring to current. Sets hasStagedChanges to false.
Generates the ProductTailoringPublished Message.
actionString | "publish" |
{"action": "publish"}
Unpublish
Unpublishes the current data of the ProductTailoring. Sets the published field to false.
Generates the ProductTailoringUnpublished Message.
actionString | "unpublish" |
{"action": "unpublish"}
on ProductVariantTailoring
Add Variant
Either id or sku is required to reference a ProductVariant that exists.
Produces the ProductVariantTailoringAdded Message.
idInt | The |
actionString | "addVariant" |
skuString | The |
imagesArray of Image | Images for the Product Variant Tailoring. |
assetsArray of AssetDraft | Media assets for the Product Variant Tailoring. |
attributesArray of ProductTailoringAttribute | Attributes for the Product Variant Tailoring. |
stagedBoolean | If true |
{"action": "addVariant","id": 2,"sku": "VariantSKU"}
Remove Variant
If the Product Variant Tailoring contains 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.
Either id or sku is required.
Produces the ProductVariantTailoringDeleted Message.
idInt | The |
actionString | "removeVariant" |
skuString | The |
stagedBoolean | If true |
{"action": "removeVariant","id": 2}
Add External Image
Either variantId or sku is required to reference a ProductVariant that exists. Produces the ProductTailoringImageAdded Message.
actionString | "addExternalImage" |
variantIdInt | The |
skuString | The |
image | Value to add to |
stagedBoolean | If true |
{"action": "addExternalImage","variantId": 1,"image": {"url": "//myimage.jpg","dimensions": {"w": 1400,"h": 1400},"label": "myImage"}}
Move Image To Position
Either variantId or sku is required to reference a ProductVariant that exists.
actionString | "moveImageToPosition" |
variantIdInt | The |
skuString | The |
imageUrlString | The URL of the image to update. |
positionInt | Position in |
stagedBoolean | If true |
{"action": "moveImageToPosition","variantId": 1,"imageUrl": "//myimage2.jpg","position": 1}
Remove Image
If the image that you want to delete has been uploaded to our CDN and its imageUrl is also used on other Product Variant Tailorings, then removing the image will make it unavailable wherever it is shared.
Either variantId or sku is required to reference a ProductVariant that exists.
actionString | "removeImage" |
variantIdInt | The |
skuString | The |
imageUrlString | The URL of the image to remove. |
stagedBoolean | If true |
{"action": "removeImage","variantId": 1,"imageUrl": "//myimage2.jpg"}
Set Images
Either variantId or sku is required to reference a ProductVariant that exists. Produces the ProductTailoringImagesSet Message.
actionString | "setImages" |
variantIdInt | The |
skuString | The |
imagesArray 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 |
stagedBoolean | If 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
Either variantId or sku is required to reference a ProductVariant that exists.
actionString | "setImageLabel" |
skuString | The |
variantIdInt | The |
imageUrlString | The URL of the image to set the label. |
labelString | Value to set. If empty, any existing value will be removed. |
stagedBoolean | If true |
{"action": "setImageLabel","variantId": 2,"imageUrl": "//image.png","label": "labelString","staged": true}
Add Asset
Either variantId or sku is required to reference a ProductVariant that exists.
actionString | "addAsset" |
variantIdInt | The |
skuString | The |
stagedBoolean | If true |
asset | Value to append. |
positionInt | Position in |
{"action": "addAsset","variantId": 1,"asset": {"sources": [{"uri": "//asset.mp4"}],"name": {"de": "FirstAssetDE","en": "FirstassetEN"}}}
Remove Asset
Either variantId or sku is required to reference a ProductVariant that exists.
The Asset to remove must be specified using either assetId or assetKey.
actionString | "removeAsset" |
variantIdInt | The |
skuString | The |
stagedBoolean | If true |
assetIdString | The |
assetKeyString | The |
{"action": "removeAsset","variantId": 1,"assetId": "{{assetId}}"}
on Assets
Set Asset Key
Either variantId or sku is required to reference a ProductVariant that exists.
actionString | "setAssetKey" |
variantIdInt | The |
skuString | The |
stagedBoolean | If true |
assetIdString | The |
assetKeyString | Value to set. If empty, any existing value will be removed. MinLength:2MaxLength: 256Pattern: ^[A-Za-z0-9_-]+$ |
{"action": "setAssetKey","variantId": 1,"assetId": "{{assetId}}","assetKey": "assetKeyString"}
Change Asset Order
Either variantId or sku is required to reference a ProductVariant that exists.
actionString | "changeAssetOrder" |
variantIdInt | The |
skuString | The |
stagedBoolean | If true |
assetOrderArray of String | All existing Asset |
{"action": "changeAssetOrder","variantId": 1,"assetOrder": ["{{assetId1}}", "{{assetId2}}"]}
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.
actionString | "changeAssetName" |
variantIdInt | The |
skuString | The |
stagedBoolean | If true |
assetIdString | The |
assetKeyString | The |
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
Either variantId or sku is required to reference a ProductVariant that exists.
The Asset to update must be specified using either assetId or assetKey.
actionString | "setAssetDescription" |
variantIdInt | The |
skuString | The |
stagedBoolean | If true |
assetIdString | The |
assetKeyString | The |
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
Either variantId or sku is required to reference a ProductVariant that exists.
The Asset to update must be specified using either assetId or assetKey.
actionString | "setAssetSources" |
variantIdInt | The |
skuString | The |
stagedBoolean | If true |
assetIdString | The |
assetKeyString | The |
sourcesArray 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
Either variantId or sku is required to reference a ProductVariant that exists.
The Asset to update must be specified using either assetId or assetKey.
actionString | "setAssetCustomType" |
variantIdInt | The |
skuString | The |
stagedBoolean | If true |
assetIdString | The |
assetKeyString | The |
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
Either variantId or sku is required to reference a ProductVariant that exists.
The Asset to update must be specified using either assetId or assetKey.
actionString | "setAssetCustomField" |
variantIdInt | The |
skuString | The |
stagedBoolean | If true |
assetIdString | The |
assetKeyString | The |
nameString | Name of the Custom Field. |
value | If |
{"action": "setAssetCustomField","assetId": "{{assetId}}","variantId": 1,"name": "exampleStringField","value": "TextString"}
on Attributes
Set Attribute
Either variantId or sku is required.
actionString | "setAttribute" |
variantIdInt | The |
skuString | The |
nameString | The name of the Attribute to set. |
valueAny | Value to set for the Attribute. If empty, any existing value will be removed. The AttributeType determines the format of the Attribute
Tailoring of Nested Type Attributes is not supported. |
stagedBoolean | If true |
{"action": "setAttribute","variantId": 1,"name": "ExampleStringTypeAttribute","value": "TextString"}
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.
actionString | "setAttributeInAllVariants" |
nameString | The name of the Attribute to set. |
valueAny | Value to set for the Attributes. If empty, any existing value will be removed. The AttributeType determines the format of the Attribute
Tailoring of Nested Type Attributes is not supported. |
stagedBoolean | If true |
{"action": "setAttributeInAllVariants","name": "ExampleStringTypeAttribute","value": "TextString"}
Upload Product Tailoring image
Uploads a binary image file to a given ProductVariantTailoring. After upload, the system converts the original image to several sizes that are retrievable from the builtin Content Delivery Network (CDN). Supported image formats are JPEG, PNG, and GIF. The maximum file size of the image to upload is 10 MB.
Only images in sRGB color space are supported. When trying to upload images with other color spaces, like Adobe RGB, the API returns a 400 Bad Request Error with code InvalidInput and the message Unsupported image data. Not able to identify the color model of your image.
The Image uploaded to the CDN is publicly available and its 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.
Depending on the size of the original image, the API returns different status codes that indicate the status of the image upload at the time the API responds.
If the original image is small, the API responds with 200 OK, and if the image is larger, it responds with 202 Accepted.
- A
200 OKresponse is returned when all sizes of the image have been successfully uploaded to the CDN. - A
202 Acceptedresponse is returned when thesmallsize 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
Uploads a JPEG, PNG and GIF file to a ProductVariantTailoring.
The maximum file size of the image is 10MB.
Either 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.
The response status code depends on the size of the original image.
If the image is small, the API responds with 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.
Produces the ProductTailoringImageAdded Message.
manage_products:{projectKey}regionString | Region in which the Project is hosted. |
projectKeyString |
|
storeKeyString |
|
productIDString |
|
filenameString | 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 |
variantInt | The |
skuString | The |
stagedBoolean | If Default: true |
Content-TypeString | One of |
image/jpegimage/pngimage/gif.
application/json202ProductTailoringasapplication/json{"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-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": []},{"id": 2,"images": [{"url": "//myimage-2.png","dimensions": {"w": 400,"h": 300}}],"assets": []}]},"published": false,"hasStagedChanges": true,"warnings": [{"code": "ImageProcessingOngoing","message": "The image processing is still ongoing."}]}
by Product Key
Uploads a JPEG, PNG and GIF file to a ProductVariantTailoring.
The maximum file size of the image is 10MB.
Either 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.
The response status code depends on the size of the original image.
If the image is small, the API responds with 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.
Produces the ProductTailoringImageAdded Message.
manage_products:{projectKey}regionString | Region in which the Project is hosted. |
projectKeyString |
|
storeKeyString |
|
productKeyString |
|
filenameString | 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 |
variantInt | The |
skuString | The |
stagedBoolean | If Default: true |
Content-TypeString | One of |
image/jpegimage/pngimage/gif.
application/json202ProductTailoringasapplication/json{"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-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": []},{"id": 2,"images": [{"url": "//myimage-2.png","dimensions": {"w": 400,"h": 300}}],"assets": []}]},"published": false,"hasStagedChanges": true,"warnings": [{"code": "ImageProcessingOngoing","message": "The image processing is still ongoing."}]}
The cURL example below adds an Image to tailor the ProductVariant with 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"
As the filename parameter was included (filename=detail.jpg), an example URL of the uploaded image is https://{commercetools-cdn}/detail-6xAq4Efp.jpg.
File upload using Content-Type: multipart/form-data is currently not supported.
Delete ProductTailoring
Delete ProductTailoring by ID
Generates the ProductTailoringDeleted Message.
manage_products:{projectKey}regionString | Region in which the Project is hosted. |
projectKeyString |
|
idString |
|
versionInt | Last seen version of the resource. |
expand | The parameter can be passed multiple times. |
application/jsoncurl -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
Generates the ProductTailoringDeleted Message.
manage_products:{projectKey}regionString | Region in which the Project is hosted. |
projectKeyString |
|
keyString |
|
versionInt | Last seen version of the resource. |
expand | The parameter can be passed multiple times. |
application/jsoncurl -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
Generates the ProductTailoringDeleted Message.
manage_products:{projectKey}manage_products:{projectKey}:{storeKey}regionString | Region in which the Project is hosted. |
projectKeyString |
|
storeKeyString |
|
productIDString |
|
versionInt | Last seen version of the resource. |
expand | The parameter can be passed multiple times. |
application/jsoncurl -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
Generates the ProductTailoringDeleted Message.
manage_products:{projectKey}manage_products:{projectKey}:{storeKey}regionString | Region in which the Project is hosted. |
projectKeyString |
|
storeKeyString |
|
productKeyString |
|
versionInt | Last seen version of the resource. |
expand | The parameter can be passed multiple times. |
application/jsoncurl -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}