younifyd
Menu

createAttributeGroup

Create a new attribute group.

Use it in a workflow

  1. Add a step and choose the Commercetools connector.
  2. Pick the createAttributeGroup action (under Create).
  3. Fill in the fields below, then reference the result from later steps as {{createattributegroup.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 CreateAttributeGroup($draft: AttributeGroupDraft!) {
  createAttributeGroup(draft: $draft) {
    id
    version
    createdAt
    lastModifiedAt
    nameAllLocales {
      locale
      value
    }
    descriptionAllLocales {
      locale
      value
    }
    key
    attributes {
      key
    }
    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.

draftobjectrequired
namearray<object>required2 fields
descriptionarray<object>2 fields
keystring
attributesarray<object>required1 fields
json
{
  "draft": {
    "name": [
      {
        "locale": "string",
        "value": "string"
      }
    ],
    "attributes": [
      {
        "key": "string"
      }
    ],
    "description": [
      {
        "locale": "string",
        "value": "string"
      }
    ],
    "key": "string"
  }
}

Response

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

idstring
versionstring
createdAtstring
lastModifiedAtstring
nameAllLocalesarray<object>
localeobject
valueobject
descriptionAllLocalesarray<object>
localeobject
valueobject
keystring
attributesarray<object>
keyobject
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.

createAttributeGroup — Commercetools — Documentation