27 June 2024
Composable Commerce
HTTP API
Enhancement
Product catalogGraphQLMessages/Subscriptions

We introduced Product Tailoring of images and assets in public beta. You can now customize product images and assets for specific brands or countries, modeled with Stores, to enhance your product offering in different markets.

Changes:

  • [GraphQL API] Added input fields addVariant, addAsset, addExternalImage, changeAssetName, changeAssetOrder, moveImageToPosition, removeAsset, removeImage, removeVariant, setAssetCustomField, setAssetCustomType, setAssetDescription, setAssetKey, setAssetSources, setAssetTags, setImages, and setImageLabelto the ProductTailoringUpdateAction type.
  • [GraphQL API] Added the following types to the GraphQL schema: AddProductTailoringAsset, AddProductTailoringExternalImage, AddProductVariantTailoring, ChangeProductTailoringAssetName, ChangeProductTailoringAssetOrder, MoveProductTailoringImageToPosition, ProductTailoringImageAdded, ProductTailoringImagesSet, ProductVariantTailoring, ProductVariantTailoringAdded, ProductVariantTailoringInput, ProductVariantTailoringRemoved, RemoveProductTailoringAsset, RemoveProductTailoringImage, RemoveProductVariantTailoring, SetProductTailoringAssetCustomField, SetProductTailoringAssetCustomType, SetProductTailoringAssetDescription, SetProductTailoringAssetKey, SetProductTailoringAssetSources, SetProductTailoringAssetTags, SetProductTailoringImageLabel, SetProductTailoringImages, VariantTailoring.

The following changes were introduced in terms of GraphQL SDL:

extend type ProductTailoringCreated {
  "BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
  variants: [ProductVariantTailoring!]!
}

extend interface HasProductTailoringData {
  "BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
  variants: [ProductVariantTailoring!]!
}

extend type ProductTailoringData {
  "BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
  variants: [ProductVariantTailoring!]!
}

extend input ProductTailoringDraft {
  "BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
  variants: [ProductVariantTailoringInput!] = []
}

extend input ProductTailoringUpdateAction {
  addAsset: AddProductTailoringAsset
  addExternalImage: AddProductTailoringExternalImage

  "BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
  addVariant: AddProductVariantTailoring
  changeAssetName: ChangeProductTailoringAssetName
  changeAssetOrder: ChangeProductTailoringAssetOrder

  "BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
  moveImageToPosition: MoveProductTailoringImageToPosition
  removeAsset: RemoveProductTailoringAsset
  removeImage: RemoveProductTailoringImage

  "BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
  removeVariant: RemoveProductVariantTailoring
  setAssetCustomField: SetProductTailoringAssetCustomField
  setAssetCustomType: SetProductTailoringAssetCustomType
  setAssetDescription: SetProductTailoringAssetDescription
  setAssetKey: SetProductTailoringAssetKey
  setAssetSources: SetProductTailoringAssetSources
  setAssetTags: SetProductTailoringAssetTags
  setImageLabel: SetProductTailoringImageLabel
  setImages: SetProductTailoringImages
}

input AddProductTailoringAsset {
  variantId: Int
  sku: String
  staged: Boolean = true
  position: Int
  asset: AssetDraftInput!
}

input AddProductTailoringExternalImage {
  variantId: Int
  sku: String
  image: ImageInput!
  staged: Boolean = true
}

"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
input AddProductVariantTailoring {
  id: Int
  sku: String
  images: [ImageInput!] = []
  assets: [AssetDraftInput!] = []
  staged: Boolean = true
}

input ChangeProductTailoringAssetName {
  variantId: Int
  sku: String
  staged: Boolean = true
  name: [LocalizedStringItemInputType!]!
  assetKey: String
  assetId: String
}

input ChangeProductTailoringAssetOrder {
  variantId: Int
  sku: String
  staged: Boolean = true
  assetOrder: [String!]!
}

"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
input MoveProductTailoringImageToPosition {
  variantId: Int
  sku: String
  imageUrl: String!
  position: Int!
  staged: Boolean = true
}

"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
type ProductTailoringImageAdded implements MessagePayload {
  variantId: Int!
  storeRef: KeyReference!
  productRef: Reference!
  productKey: String
  image: Image!
  type: String!
}

"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
type ProductTailoringImagesSet implements MessagePayload {
  variantId: Int!
  storeRef: KeyReference!
  productRef: Reference!
  productKey: String
  oldImages: [Image!]!
  images: [Image!]!
  type: String!
}

"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
type ProductVariantTailoring {
  id: Int!
  images: [Image!]!
  assets: [Asset!]!
}

"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
type ProductVariantTailoringAdded implements MessagePayload {
  variantId: Int!
  storeRef: KeyReference!
  productRef: Reference!
  productKey: String
  variant: VariantTailoring!
  type: String!
}

"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
input ProductVariantTailoringInput {
  id: Int
  sku: String
  images: [ImageInput!] = []
  assets: [AssetDraftInput!] = []
}

"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
type ProductVariantTailoringRemoved implements MessagePayload {
  variantId: Int!
  storeRef: KeyReference!
  productRef: Reference!
  productKey: String
  variant: VariantTailoring!
  type: String!
}

input RemoveProductTailoringAsset {
  variantId: Int
  sku: String
  staged: Boolean = true
  assetKey: String
  assetId: String
}

input RemoveProductTailoringImage {
  variantId: Int
  sku: String
  imageUrl: String!
  staged: Boolean = true
}

"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
input RemoveProductVariantTailoring {
  id: Int
  sku: String
  staged: Boolean = true
}

input SetProductTailoringAssetCustomField {
  variantId: Int
  sku: String
  staged: Boolean = true
  value: String
  name: String!
  assetKey: String
  assetId: String
}

input SetProductTailoringAssetCustomType {
  variantId: Int
  sku: String
  staged: Boolean = true
  typeId: String
  typeKey: String
  type: ResourceIdentifierInput
  fields: [CustomFieldInput!]
  assetKey: String
  assetId: String
}

input SetProductTailoringAssetDescription {
  variantId: Int
  sku: String
  staged: Boolean = true
  description: [LocalizedStringItemInputType!]
  assetKey: String
  assetId: String
}

input SetProductTailoringAssetKey {
  variantId: Int
  sku: String
  staged: Boolean = true
  assetKey: String
  assetId: String!
}

input SetProductTailoringAssetSources {
  variantId: Int
  sku: String
  staged: Boolean = true
  sources: [AssetSourceInput!] = []
  assetKey: String
  assetId: String
}

input SetProductTailoringAssetTags {
  variantId: Int
  sku: String
  staged: Boolean = true
  tags: [String!] = []
  assetKey: String
  assetId: String
}

input SetProductTailoringImageLabel {
  variantId: Int
  sku: String
  imageUrl: String!
  label: String
  staged: Boolean = true
}

input SetProductTailoringImages {
  variantId: Int
  sku: String
  images: [ImageInput!]!
  staged: Boolean = true
}

"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
type VariantTailoring {
  images: [Image!]!
  assets: [Asset!]!
}