younifyd
Menu

deleteProduct

Delete a product (requires its current version).

Use it in a workflow

  1. Add a step and choose the Commercetools connector.
  2. Pick the deleteProduct action (under Delete).
  3. Fill in the fields below, then reference the result from later steps as {{deleteproduct.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 DeleteProduct($version: Long!, $id: String, $key: String) {
  deleteProduct(version: $version, id: $id, key: $key) {
    id
    key
    version
    productTypeRef {
      typeId
      id
    }
    productType {
      key
      name
      description
      id
      version
      createdAt
      lastModifiedAt
      createdBy {
        isPlatformClient
        clientId
        externalUserId
        anonymousId
        customerRef
        userRef
        associateRef
        attributedTo
      }
      lastModifiedBy {
        isPlatformClient
        clientId
        externalUserId
        anonymousId
        customerRef
        userRef
        associateRef
        attributedTo
      }
    }
    masterData {
      current {
        nameAllLocales
        descriptionAllLocales
        slugAllLocales
        categoryOrderHints
        categoriesRef
        categories
        searchKeywords
        metaTitleAllLocales
        metaKeywordsAllLocales
        metaDescriptionAllLocales
        masterVariant
        skus
        attributesRaw
        defaultVariantRef
        defaultVariant
      }
      staged {
        nameAllLocales
        descriptionAllLocales
        slugAllLocales
        categoryOrderHints
        categoriesRef
        categories
        searchKeywords
        metaTitleAllLocales
        metaKeywordsAllLocales
        metaDescriptionAllLocales
        masterVariant
        skus
        attributesRaw
        defaultVariantRef
        defaultVariant
      }
      published
      hasStagedChanges
    }
    skus
    createdAt
    lastModifiedAt
    stateRef {
      typeId
      id
    }
    state {
      id
      version
      key
      type
      roles
      nameAllLocales {
        locale
        value
      }
      descriptionAllLocales {
        locale
        value
      }
      builtIn
      transitionsRef {
        typeId
        id
      }
      transitions
      initial
      createdAt
      lastModifiedAt
      createdBy {
        isPlatformClient
        clientId
        externalUserId
        anonymousId
        customerRef
        userRef
        associateRef
        attributedTo
      }
      lastModifiedBy {
        isPlatformClient
        clientId
        externalUserId
        anonymousId
        customerRef
        userRef
        associateRef
        attributedTo
      }
    }
    priceMode
    taxCategoryRef {
      typeId
      id
    }
    taxCategory {
      name
      description
      rates {
        name
        amount
        includedInPrice
        country
        state
        id
        key
        subRates
      }
      key
      id
      version
      createdAt
      lastModifiedAt
      createdBy {
        isPlatformClient
        clientId
        externalUserId
        anonymousId
        customerRef
        userRef
        associateRef
        attributedTo
      }
      lastModifiedBy {
        isPlatformClient
        clientId
        externalUserId
        anonymousId
        customerRef
        userRef
        associateRef
        attributedTo
      }
    }
    reviewRatingStatistics {
      averageRating
      highestRating
      lowestRating
      count
      ratingsDistribution
    }
    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
idstring

Queries with specified ID

keystring

Queries with specified key

json
{
  "version": "string",
  "id": "string",
  "key": "string"
}

Response

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

idstring
keystring
versionstring
productTypeRefobject
typeIdstring
idstring
productTypeobject
keystring
namestring
descriptionstring
idstring
versionstring
createdAtstring
lastModifiedAtstring
createdByobject8 fields
lastModifiedByobject8 fields
masterDataobject
currentobject15 fields
stagedobject15 fields
publishedboolean
hasStagedChangesboolean
skusarray<string>
createdAtstring
lastModifiedAtstring
stateRefobject
typeIdstring
idstring
stateobject
idstring
versionstring
keystring
typestring

One ofLineItemStateOrderStatePaymentStateProductStateQuoteRequestStateQuoteStateRecurringOrderStateReviewStateStagedQuoteState

rolesarray<object>
nameAllLocalesarray<object>
descriptionAllLocalesarray<object>
builtInboolean
transitionsRefarray<object>
transitionsarray<object>
initialboolean
createdAtstring
lastModifiedAtstring
createdByobject8 fields
lastModifiedByobject8 fields
priceModestring

One ofEmbeddedStandalone

taxCategoryRefobject
typeIdstring
idstring
taxCategoryobject
namestring
descriptionstring
ratesarray<object>
keystring
idstring
versionstring
createdAtstring
lastModifiedAtstring
createdByobject8 fields
lastModifiedByobject8 fields
reviewRatingStatisticsobject
averageRatingnumber
highestRatingnumber
lowestRatingnumber
countstring
ratingsDistributionstring
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.