Menu
product
Fetch a single product by ID or key.
Use it in a workflow
- Add a step and choose the Commercetools connector.
- Pick the product action (under Product).
- Fill in the fields below, then reference the result from later steps as
{{product.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 Product($projectExpandedProducts: Boolean, $localeProjection: [Locale!], $sku: String, $variantKey: String, $id: String, $key: String) {
product(
projectExpandedProducts: $projectExpandedProducts
localeProjection: $localeProjection
sku: $sku
variantKey: $variantKey
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.
{
"projectExpandedProducts": false,
"localeProjection": [
"string"
],
"sku": "string",
"variantKey": "string",
"id": "string",
"key": "string"
}
Response
Read the result with {{product.response.data.data.product}}. If the API returns errors, the step fails and they are at {{product.response.data.errors}}.
Need more? See the Commercetools guide for connection setup and behaviour shared by every action.
Was this page helpful?