Menu
variant
A single product variant by SKU or key.
Use it in a workflow
- Add a step and choose the Commercetools connector.
- Pick the variant action (under Variant).
- Fill in the fields below, then reference the result from later steps as
{{variant.response.data}}.
Query
This is the query the action sends by default. Edit it in the step's Query field to change which fields come back.
query Variant($sku: String, $stagedSku: String, $id: String, $key: String) {
variant(sku: $sku, stagedSku: $stagedSku, id: $id, key: $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
}
}
variantId
key
current {
sku
images {
url
dimensions
label
}
assets {
id
key
sources
nameAllLocales
descriptionAllLocales
tags
custom
}
}
staged {
sku
images {
url
dimensions
label
}
assets {
id
key
sources
nameAllLocales
descriptionAllLocales
tags
custom
}
}
published
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.
{
"sku": "string",
"stagedSku": "string",
"id": "string",
"key": "string"
}
Response
Read the result with {{variant.response.data.data.variant}}. If the API returns errors, the step fails and they are at {{variant.response.data.errors}}.
Need more? See the Commercetools guide for connection setup and behaviour shared by every action.
Was this page helpful?