Menu
updateReview
Update an existing review — pass its current version and an array of update actions.
Use it in a workflow
- Add a step and choose the Commercetools connector.
- Pick the updateReview action (under Update).
- Fill in the fields below, then reference the result from later steps as
{{updatereview.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.
mutation UpdateReview($version: Long!, $actions: [ReviewUpdateAction!]!, $id: String, $key: String) {
updateReview(version: $version, actions: $actions, id: $id, key: $key) {
key
uniquenessValue
locale
authorName
title
text
targetRef {
typeId
id
}
target {
id
}
rating
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
}
}
includedInStatistics
customerRef {
typeId
id
}
customer {
id
customerNumber
email
addresses {
id
streetName
streetNumber
additionalStreetInfo
postalCode
city
region
state
country
company
department
building
apartment
pOBox
additionalAddressInfo
externalId
key
phone
mobile
email
fax
title
salutation
firstName
lastName
custom
}
defaultShippingAddressId
defaultBillingAddressId
shippingAddressIds
billingAddressIds
isEmailVerified
customerGroupRef {
typeId
id
}
externalId
key
authenticationMode
firstName
lastName
middleName
title
locale
salutation
dateOfBirth
companyName
vatId
password
customerGroup {
id
version
name
key
createdAt
lastModifiedAt
custom
createdBy
lastModifiedBy
}
defaultShippingAddress {
id
streetName
streetNumber
additionalStreetInfo
postalCode
city
region
state
country
company
department
building
apartment
pOBox
additionalAddressInfo
externalId
key
phone
mobile
email
fax
title
salutation
firstName
lastName
custom
}
defaultBillingAddress {
id
streetName
streetNumber
additionalStreetInfo
postalCode
city
region
state
country
company
department
building
apartment
pOBox
additionalAddressInfo
externalId
key
phone
mobile
email
fax
title
salutation
firstName
lastName
custom
}
shippingAddresses {
id
streetName
streetNumber
additionalStreetInfo
postalCode
city
region
state
country
company
department
building
apartment
pOBox
additionalAddressInfo
externalId
key
phone
mobile
email
fax
title
salutation
firstName
lastName
custom
}
billingAddresses {
id
streetName
streetNumber
additionalStreetInfo
postalCode
city
region
state
country
company
department
building
apartment
pOBox
additionalAddressInfo
externalId
key
phone
mobile
email
fax
title
salutation
firstName
lastName
custom
}
storesRef {
typeId
key
}
stores {
id
version
key
nameAllLocales
languages
countries
productSelections
distributionChannelsRef
distributionChannels
supplyChannelsRef
supplyChannels
storefront
createdAt
lastModifiedAt
custom
createdBy
lastModifiedBy
}
customerGroupAssignments {
customerGroupRef
customerGroup
}
custom {
typeRef
type
}
version
createdAt
lastModifiedAt
createdBy {
isPlatformClient
clientId
externalUserId
anonymousId
customerRef
userRef
associateRef
attributedTo
}
lastModifiedBy {
isPlatformClient
clientId
externalUserId
anonymousId
customerRef
userRef
associateRef
attributedTo
}
}
custom {
typeRef {
typeId
id
}
type {
key
nameAllLocales
descriptionAllLocales
resourceTypeIds
id
version
createdAt
lastModifiedAt
createdBy
lastModifiedBy
}
}
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.
{
"version": "string",
"actions": [
{
"setAuthorName": {
"authorName": "string"
},
"setCustomField": {
"name": "string",
"value": "string"
},
"setCustomType": {
"fields": "string",
"type": "string",
"typeKey": "string",
"typeId": "string"
},
"setCustomer": {
"customer": "string"
},
"setKey": {
"key": "string"
},
"setLocale": {
"locale": "string"
},
"setRating": {
"rating": "string"
},
"setTarget": {
"target": "string"
},
"setText": {
"text": "string"
},
"setTitle": {
"title": "string"
},
"transitionState": {
"state": "string",
"force": "string"
}
}
],
"id": "string",
"key": "string"
}
Response
Read the result with {{updatereview.response.data.data.updateReview}}. If the API returns errors, the step fails and they are at {{updatereview.response.data.errors}}.
Need more? See the Commercetools guide for connection setup and behaviour shared by every action.
Was this page helpful?