Menu
updateApprovalRule
Update a B2B approval rule using an array of update actions.
Use it in a workflow
- Add a step and choose the Commercetools connector.
- Pick the updateApprovalRule action (under Update).
- Fill in the fields below, then reference the result from later steps as
{{updateapprovalrule.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 UpdateApprovalRule($version: Long!, $actions: [ApprovalRuleUpdateAction!]!, $asAssociate: AsAssociateArgument!, $id: String, $key: String) {
updateApprovalRule(
version: $version
actions: $actions
asAssociate: $asAssociate
id: $id
key: $key
) {
key
name
description
status
predicate
approvers {
tiers {
and
}
}
requesters {
associateRole {
key
buyerAssignable
name
permissions
custom
id
version
createdAt
lastModifiedAt
createdBy
lastModifiedBy
}
associateRoleRef {
typeId
key
}
}
businessUnitRef {
typeId
key
}
businessUnit {
id
key
name
contactEmail
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
}
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
}
defaultShippingAddressId
defaultBillingAddressId
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
}
shippingAddressIds
billingAddressIds
status
storesRef {
typeId
key
}
stores {
id
version
key
nameAllLocales
languages
countries
productSelections
distributionChannelsRef
distributionChannels
supplyChannelsRef
supplyChannels
storefront
createdAt
lastModifiedAt
custom
createdBy
lastModifiedBy
}
storeMode
unitType
associates {
associateRoleAssignments
customerRef
customer
}
associateMode
inheritedAssociates {
associateRoleAssignments
customerRef
customer
}
custom {
typeRef
type
}
parentUnitRef {
typeId
key
}
parentUnit
ancestors
inheritedStores {
store
storeRef
}
topLevelUnitRef {
typeId
key
}
topLevelUnit
approvalRuleMode
customerGroupAssignments {
customerGroupRef
customerGroup
}
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": [
{
"setCustomField": {
"name": "string",
"value": "string"
},
"setCustomType": {
"fields": "string",
"type": "string",
"typeKey": "string",
"typeId": "string"
},
"setKey": {
"key": "string"
},
"setName": {
"name": "string"
},
"setDescription": {
"description": "string"
},
"setPredicate": {
"predicate": "string"
},
"setRequesters": {
"requesters": "string"
},
"setStatus": {
"status": "string"
},
"setApprovers": {
"approvers": "string"
}
}
],
"asAssociate": {
"businessUnitKey": "string",
"associateId": "string"
},
"id": "string",
"key": "string"
}
Response
Read the result with {{updateapprovalrule.response.data.data.updateApprovalRule}}. If the API returns errors, the step fails and they are at {{updateapprovalrule.response.data.errors}}.
Need more? See the Commercetools guide for connection setup and behaviour shared by every action.
Was this page helpful?