younifyd
Menu

updateProductTailoring

Update an existing product tailoring — pass its current version and an array of update actions.

Use it in a workflow

  1. Add a step and choose the Commercetools connector.
  2. Pick the updateProductTailoring action (under Update).
  3. Fill in the fields below, then reference the result from later steps as {{updateproducttailoring.response.data}}.

Query

This is the mutation the action sends by default. Edit it in the step's Query field to change which fields come back.

graphql
mutation UpdateProductTailoring($storeKey: KeyReferenceInput, $productId: String, $productKey: String, $id: String, $key: String, $actions: [ProductTailoringUpdateAction!]!, $version: Long!) {
  updateProductTailoring(
    storeKey: $storeKey
    productId: $productId
    productKey: $productKey
    id: $id
    key: $key
    actions: $actions
    version: $version
  ) {
    key
    productRef {
      typeId
      id
    }
    product {
      id
      key
      version
      productTypeRef {
        typeId
        id
      }
      productType {
        key
        name
        description
        id
        version
        createdAt
        lastModifiedAt
        createdBy
        lastModifiedBy
      }
      masterData {
        current
        staged
        published
        hasStagedChanges
      }
      skus
      createdAt
      lastModifiedAt
      stateRef {
        typeId
        id
      }
      state {
        id
        version
        key
        type
        roles
        nameAllLocales
        descriptionAllLocales
        builtIn
        transitionsRef
        transitions
        initial
        createdAt
        lastModifiedAt
        createdBy
        lastModifiedBy
      }
      priceMode
      taxCategoryRef {
        typeId
        id
      }
      taxCategory {
        name
        description
        rates
        key
        id
        version
        createdAt
        lastModifiedAt
        createdBy
        lastModifiedBy
      }
      reviewRatingStatistics {
        averageRating
        highestRating
        lowestRating
        count
        ratingsDistribution
      }
      createdBy {
        isPlatformClient
        clientId
        externalUserId
        anonymousId
        customerRef
        userRef
        associateRef
        attributedTo
      }
      lastModifiedBy {
        isPlatformClient
        clientId
        externalUserId
        anonymousId
        customerRef
        userRef
        associateRef
        attributedTo
      }
    }
    storeRef {
      typeId
      key
    }
    store {
      id
      version
      key
      nameAllLocales {
        locale
        value
      }
      languages
      countries {
        code
      }
      productSelections {
        productSelectionRef
        productSelection
        active
      }
      distributionChannelsRef {
        typeId
        id
      }
      distributionChannels {
        id
        version
        key
        roles
        nameAllLocales
        descriptionAllLocales
        address
        geoLocation
        createdAt
        lastModifiedAt
        reviewRatingStatistics
        custom
        createdBy
        lastModifiedBy
      }
      supplyChannelsRef {
        typeId
        id
      }
      supplyChannels {
        id
        version
        key
        roles
        nameAllLocales
        descriptionAllLocales
        address
        geoLocation
        createdAt
        lastModifiedAt
        reviewRatingStatistics
        custom
        createdBy
        lastModifiedBy
      }
      storefront {
        checkoutUrlTemplate
        orderUrlTemplate
        termsOfServiceUrl
        privacyPolicyUrl
        refundPolicyUrl
        shippingPolicyUrl
        cookiePolicyUrl
        imprintUrl
        faqUrl
        contactUrl
      }
      createdAt
      lastModifiedAt
      custom {
        typeRef
        type
      }
      createdBy {
        isPlatformClient
        clientId
        externalUserId
        anonymousId
        customerRef
        userRef
        associateRef
        attributedTo
      }
      lastModifiedBy {
        isPlatformClient
        clientId
        externalUserId
        anonymousId
        customerRef
        userRef
        associateRef
        attributedTo
      }
    }
    current {
      nameAllLocales {
        locale
        value
      }
      descriptionAllLocales {
        locale
        value
      }
      slugAllLocales {
        locale
        value
      }
      metaTitleAllLocales {
        locale
        value
      }
      metaDescriptionAllLocales {
        locale
        value
      }
      metaKeywordsAllLocales {
        locale
        value
      }
      variants {
        id
        images
        assets
        attributesRaw
      }
      attributesRaw {
        attributeDefinition
        name
        value
        attributesRaw
        referencedResource
        referencedResourceSet
      }
    }
    staged {
      nameAllLocales {
        locale
        value
      }
      descriptionAllLocales {
        locale
        value
      }
      slugAllLocales {
        locale
        value
      }
      metaTitleAllLocales {
        locale
        value
      }
      metaDescriptionAllLocales {
        locale
        value
      }
      metaKeywordsAllLocales {
        locale
        value
      }
      variants {
        id
        images
        assets
        attributesRaw
      }
      attributesRaw {
        attributeDefinition
        name
        value
        attributesRaw
        referencedResource
        referencedResourceSet
      }
    }
    published
    hasStagedChanges
    id
    version
    createdAt
    lastModifiedAt
    createdBy {
      isPlatformClient
      clientId
      externalUserId
      anonymousId
      customerRef {
        typeId
        id
      }
      userRef {
        typeId
        id
      }
      associateRef {
        typeId
        id
      }
      attributedTo {
        clientId
        source
        userRef
      }
    }
    lastModifiedBy {
      isPlatformClient
      clientId
      externalUserId
      anonymousId
      customerRef {
        typeId
        id
      }
      userRef {
        typeId
        id
      }
      associateRef {
        typeId
        id
      }
      attributedTo {
        clientId
        source
        userRef
      }
    }
  }
}

Variables

Pass these as a JSON object in the step's Variables field.

storeKeystring

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

productIdstring

Queries with specified Product ID

productKeystring

Queries with specified Product key

idstring

Queries with specified ID

keystring

Queries with specified key

actionsarray<object>required
moveImageToPositionobject5 fields
addVariantobject6 fields
removeVariantobject3 fields
publishobject1 fields
unpublishobject1 fields
setProductAttributeobject3 fields
addAssetobject5 fields
addExternalImageobject4 fields
changeAssetNameobject6 fields
changeAssetOrderobject4 fields
removeAssetobject5 fields
removeImageobject4 fields
setAssetCustomFieldobject7 fields
setAssetCustomTypeobject9 fields
setAssetDescriptionobject6 fields
setAssetKeyobject5 fields
setAssetSourcesobject6 fields
setAssetTagsobject6 fields
setImagesobject4 fields
setAttributeobject5 fields
setAttributeInAllVariantsobject3 fields
setDescriptionobject2 fields
setImageLabelobject5 fields
setKeyobject1 fields
setMetaAttributesobject4 fields
setMetaDescriptionobject2 fields
setMetaKeywordsobject2 fields
setMetaTitleobject2 fields
setNameobject2 fields
setSlugobject2 fields
versionstringrequired
json
{
  "actions": [
    {
      "moveImageToPosition": {
        "imageUrl": "string",
        "position": "string",
        "variantId": "string",
        "sku": "string",
        "staged": "string"
      },
      "addVariant": {
        "id": "string",
        "sku": "string",
        "attributes": "string",
        "images": "string",
        "assets": "string",
        "staged": "string"
      },
      "removeVariant": {
        "id": "string",
        "sku": "string",
        "staged": "string"
      },
      "publish": {
        "dummy": "string"
      },
      "unpublish": {
        "dummy": "string"
      },
      "setProductAttribute": {
        "name": "string",
        "value": "string",
        "staged": "string"
      },
      "addAsset": {
        "asset": "string",
        "variantId": "string",
        "sku": "string",
        "staged": "string",
        "position": "string"
      },
      "addExternalImage": {
        "image": "string",
        "variantId": "string",
        "sku": "string",
        "staged": "string"
      },
      "changeAssetName": {
        "name": "string",
        "variantId": "string",
        "sku": "string",
        "staged": "string",
        "assetKey": "string",
        "assetId": "string"
      },
      "changeAssetOrder": {
        "assetOrder": "string",
        "variantId": "string",
        "sku": "string",
        "staged": "string"
      },
      "removeAsset": {
        "variantId": "string",
        "sku": "string",
        "staged": "string",
        "assetKey": "string",
        "assetId": "string"
      },
      "removeImage": {
        "imageUrl": "string",
        "variantId": "string",
        "sku": "string",
        "staged": "string"
      }
    }
  ],
  "version": "string",
  "storeKey": "string",
  "productId": "string",
  "productKey": "string",
  "id": "string",
  "key": "string"
}

Response

Read the result with {{updateproducttailoring.response.data.data.updateProductTailoring}}. If the API returns errors, the step fails and they are at {{updateproducttailoring.response.data.errors}}.

keystring
productRefobject
typeIdstring
idstring
productobject
idstring
keystring
versionstring
productTypeRefobject2 fields
productTypeobject9 fields
masterDataobject4 fields
skusarray<object>
createdAtstring
lastModifiedAtstring
stateRefobject2 fields
stateobject15 fields
priceModestring

One ofEmbeddedStandalone

taxCategoryRefobject2 fields
taxCategoryobject10 fields
reviewRatingStatisticsobject5 fields
createdByobject8 fields
lastModifiedByobject8 fields
storeRefobject
typeIdstring
keystring
storeobject
idstring
versionstring
keystring
nameAllLocalesarray<object>
languagesarray<object>
countriesarray<object>
productSelectionsarray<object>
distributionChannelsRefarray<object>
distributionChannelsarray<object>
supplyChannelsRefarray<object>
supplyChannelsarray<object>
storefrontobject10 fields
createdAtstring
lastModifiedAtstring
customobject2 fields
createdByobject8 fields
lastModifiedByobject8 fields
currentobject
nameAllLocalesarray<object>
descriptionAllLocalesarray<object>
slugAllLocalesarray<object>
metaTitleAllLocalesarray<object>
metaDescriptionAllLocalesarray<object>
metaKeywordsAllLocalesarray<object>
variantsarray<object>
attributesRawarray<object>
stagedobject
nameAllLocalesarray<object>
descriptionAllLocalesarray<object>
slugAllLocalesarray<object>
metaTitleAllLocalesarray<object>
metaDescriptionAllLocalesarray<object>
metaKeywordsAllLocalesarray<object>
variantsarray<object>
attributesRawarray<object>
publishedboolean
hasStagedChangesboolean
idstring
versionstring
createdAtstring
lastModifiedAtstring
createdByobject
isPlatformClientboolean
clientIdstring
externalUserIdstring
anonymousIdstring
customerRefobject2 fields
userRefobject2 fields
associateRefobject2 fields
attributedToobject3 fields
lastModifiedByobject
isPlatformClientboolean
clientIdstring
externalUserIdstring
anonymousIdstring
customerRefobject2 fields
userRefobject2 fields
associateRefobject2 fields
attributedToobject3 fields

Need more? See the Commercetools guide for connection setup and behaviour shared by every action.