younifyd
Menu

updateDiscountGroup

Update an existing discount group — 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 updateDiscountGroup action (under Update).
  3. Fill in the fields below, then reference the result from later steps as {{updatediscountgroup.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 UpdateDiscountGroup($version: Long!, $actions: [DiscountGroupUpdateAction!]!, $id: String, $key: String) {
  updateDiscountGroup(version: $version, actions: $actions, id: $id, key: $key) {
    id
    version
    key
    sortOrder
    isActive
    nameAllLocales {
      locale
      value
    }
    descriptionAllLocales {
      locale
      value
    }
    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
setSortOrderobject1 fields
setNameobject1 fields
setIsActiveobject1 fields
setDescriptionobject1 fields
idstring

Queries with specified ID

keystring

Queries with specified key

json
{
  "version": "string",
  "actions": [
    {
      "setKey": {
        "key": "string"
      },
      "setSortOrder": {
        "sortOrder": "string"
      },
      "setName": {
        "name": "string"
      },
      "setIsActive": {
        "isActive": "string"
      },
      "setDescription": {
        "description": "string"
      }
    }
  ],
  "id": "string",
  "key": "string"
}

Response

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

idstring
versionstring
keystring
sortOrderstring
isActiveboolean
nameAllLocalesarray<object>
localeobject
valueobject
descriptionAllLocalesarray<object>
localeobject
valueobject
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.

updateDiscountGroup — Commercetools — Documentation