younifyd
Menu

updateProductType

Update an existing product type — 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 updateProductType action (under Update).
  3. Fill in the fields below, then reference the result from later steps as {{updateproducttype.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 UpdateProductType($version: Long!, $actions: [ProductTypeUpdateAction!]!, $id: String, $key: String) {
  updateProductType(version: $version, actions: $actions, id: $id, key: $key) {
    key
    name
    description
    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.

versionstringrequired
actionsarray<object>required
setKeyobject1 fields
changeNameobject1 fields
changeDescriptionobject1 fields
removeAttributeDefinitionobject1 fields
changeLabelobject2 fields
setInputTipobject2 fields
changeIsSearchableobject2 fields
changeInputHintobject2 fields
addAttributeDefinitionobject1 fields
changeAttributeOrderobject1 fields
changeAttributeOrderByNameobject1 fields
removeEnumValuesobject2 fields
addPlainEnumValueobject2 fields
changePlainEnumValueLabelobject2 fields
changePlainEnumValueOrderobject2 fields
addLocalizedEnumValueobject2 fields
changeLocalizedEnumValueLabelobject2 fields
changeLocalizedEnumValueOrderobject2 fields
changeAttributeNameobject2 fields
changeEnumKeyobject3 fields
idstring

Queries with specified ID

keystring

Queries with specified key

json
{
  "version": "string",
  "actions": [
    {
      "setKey": {
        "key": "string"
      },
      "changeName": {
        "name": "string"
      },
      "changeDescription": {
        "description": "string"
      },
      "removeAttributeDefinition": {
        "name": "string"
      },
      "changeLabel": {
        "attributeName": "string",
        "label": "string"
      },
      "setInputTip": {
        "attributeName": "string",
        "inputTip": "string"
      },
      "changeIsSearchable": {
        "attributeName": "string",
        "isSearchable": "string"
      },
      "changeInputHint": {
        "attributeName": "string",
        "newValue": "string"
      },
      "addAttributeDefinition": {
        "attributeDefinition": "string"
      },
      "changeAttributeOrder": {
        "attributeDefinitions": "string"
      },
      "changeAttributeOrderByName": {
        "attributeNames": "string"
      },
      "removeEnumValues": {
        "attributeName": "string",
        "keys": "string"
      }
    }
  ],
  "id": "string",
  "key": "string"
}

Response

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

keystring
namestring
descriptionstring
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.