Menu
createChannel
Create a new channel.
Use it in a workflow
- Add a step and choose the Commercetools connector.
- Pick the createChannel action (under Create).
- Fill in the fields below, then reference the result from later steps as
{{createchannel.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 CreateChannel($draft: ChannelDraft!) {
createChannel(draft: $draft) {
id
version
key
roles
nameAllLocales {
locale
value
}
descriptionAllLocales {
locale
value
}
address {
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 {
typeRef
type
}
}
geoLocation {
type
}
createdAt
lastModifiedAt
reviewRatingStatistics {
averageRating
highestRating
lowestRating
count
ratingsDistribution
}
custom {
typeRef {
typeId
id
}
type {
key
nameAllLocales
descriptionAllLocales
resourceTypeIds
id
version
createdAt
lastModifiedAt
createdBy
lastModifiedBy
}
}
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.
{
"draft": {
"key": "string",
"roles": [
"InventorySupply"
],
"name": [
{
"locale": "string",
"value": "string"
}
],
"description": [
{
"locale": "string",
"value": "string"
}
],
"custom": {
"typeId": "string",
"typeKey": "string",
"type": {
"typeId": "string",
"id": "string",
"key": "string"
},
"fields": [
"string"
]
},
"address": {
"country": "string",
"id": "string",
"title": "string",
"salutation": "string",
"firstName": "string",
"lastName": "string",
"streetName": "string",
"streetNumber": "string",
"additionalStreetInfo": "string",
"postalCode": "string",
"city": "string",
"region": "string"
},
"geoLocation": {
"type": "string",
"coordinates": [
"string"
]
}
}
}
Response
Read the result with {{createchannel.response.data.data.createChannel}}. If the API returns errors, the step fails and they are at {{createchannel.response.data.errors}}.
Need more? See the Commercetools guide for connection setup and behaviour shared by every action.
Was this page helpful?