1. Packages
  2. Commercetools Provider
  3. API Docs
  4. Channel
commercetools 1.19.3 published on Friday, Apr 4, 2025 by labd

commercetools.Channel

Explore with Pulumi AI

Channels represent a source or destination of different entities. They can be used to model warehouses or stores.

See also the Channels API Documentation

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as commercetools from "@pulumi/commercetools";

const my_channel = new commercetools.Channel("my-channel", {
    description: {
        "nl-NL": "Channel",
    },
    key: "my-channel-key",
    name: {
        "nl-NL": "Channel",
    },
    roles: ["ProductDistribution"],
});
Copy
import pulumi
import pulumi_commercetools as commercetools

my_channel = commercetools.Channel("my-channel",
    description={
        "nl-NL": "Channel",
    },
    key="my-channel-key",
    name={
        "nl-NL": "Channel",
    },
    roles=["ProductDistribution"])
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/commercetools/commercetools"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := commercetools.NewChannel(ctx, "my-channel", &commercetools.ChannelArgs{
			Description: pulumi.StringMap{
				"nl-NL": pulumi.String("Channel"),
			},
			Key: pulumi.String("my-channel-key"),
			Name: pulumi.StringMap{
				"nl-NL": pulumi.String("Channel"),
			},
			Roles: pulumi.StringArray{
				pulumi.String("ProductDistribution"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Commercetools = Pulumi.Commercetools;

return await Deployment.RunAsync(() => 
{
    var my_channel = new Commercetools.Channel("my-channel", new()
    {
        Description = 
        {
            { "nl-NL", "Channel" },
        },
        Key = "my-channel-key",
        Name = 
        {
            { "nl-NL", "Channel" },
        },
        Roles = new[]
        {
            "ProductDistribution",
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.commercetools.Channel;
import com.pulumi.commercetools.ChannelArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var my_channel = new Channel("my-channel", ChannelArgs.builder()
            .description(Map.of("nl-NL", "Channel"))
            .key("my-channel-key")
            .name(Map.of("nl-NL", "Channel"))
            .roles("ProductDistribution")
            .build());

    }
}
Copy
resources:
  my-channel:
    type: commercetools:Channel
    properties:
      description:
        nl-NL: Channel
      key: my-channel-key
      name:
        nl-NL: Channel
      roles:
        - ProductDistribution
Copy

Create Channel Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new Channel(name: string, args: ChannelArgs, opts?: CustomResourceOptions);
@overload
def Channel(resource_name: str,
            args: ChannelArgs,
            opts: Optional[ResourceOptions] = None)

@overload
def Channel(resource_name: str,
            opts: Optional[ResourceOptions] = None,
            key: Optional[str] = None,
            roles: Optional[Sequence[str]] = None,
            address: Optional[ChannelAddressArgs] = None,
            channel_id: Optional[str] = None,
            custom: Optional[ChannelCustomArgs] = None,
            description: Optional[Mapping[str, str]] = None,
            geolocation: Optional[ChannelGeolocationArgs] = None,
            name: Optional[Mapping[str, str]] = None)
func NewChannel(ctx *Context, name string, args ChannelArgs, opts ...ResourceOption) (*Channel, error)
public Channel(string name, ChannelArgs args, CustomResourceOptions? opts = null)
public Channel(String name, ChannelArgs args)
public Channel(String name, ChannelArgs args, CustomResourceOptions options)
type: commercetools:Channel
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. ChannelArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. ChannelArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. ChannelArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. ChannelArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. ChannelArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var channelResource = new Commercetools.Channel("channelResource", new()
{
    Key = "string",
    Roles = new[]
    {
        "string",
    },
    Address = new Commercetools.Inputs.ChannelAddressArgs
    {
        Country = "string",
        Id = "string",
        Department = "string",
        Building = "string",
        City = "string",
        Company = "string",
        AdditionalStreetInfo = "string",
        AdditionalAddressInfo = "string",
        Email = "string",
        ExternalId = "string",
        Fax = "string",
        Apartment = "string",
        FirstName = "string",
        PoBox = "string",
        LastName = "string",
        Mobile = "string",
        Phone = "string",
        Key = "string",
        PostalCode = "string",
        Region = "string",
        Salutation = "string",
        State = "string",
        StreetName = "string",
        StreetNumber = "string",
        Title = "string",
    },
    ChannelId = "string",
    Custom = new Commercetools.Inputs.ChannelCustomArgs
    {
        TypeId = "string",
        Fields = 
        {
            { "string", "string" },
        },
    },
    Description = 
    {
        { "string", "string" },
    },
    Geolocation = new Commercetools.Inputs.ChannelGeolocationArgs
    {
        Coordinates = new[]
        {
            0,
        },
    },
    Name = 
    {
        { "string", "string" },
    },
});
Copy
example, err := commercetools.NewChannel(ctx, "channelResource", &commercetools.ChannelArgs{
Key: pulumi.String("string"),
Roles: pulumi.StringArray{
pulumi.String("string"),
},
Address: &.ChannelAddressArgs{
Country: pulumi.String("string"),
Id: pulumi.String("string"),
Department: pulumi.String("string"),
Building: pulumi.String("string"),
City: pulumi.String("string"),
Company: pulumi.String("string"),
AdditionalStreetInfo: pulumi.String("string"),
AdditionalAddressInfo: pulumi.String("string"),
Email: pulumi.String("string"),
ExternalId: pulumi.String("string"),
Fax: pulumi.String("string"),
Apartment: pulumi.String("string"),
FirstName: pulumi.String("string"),
PoBox: pulumi.String("string"),
LastName: pulumi.String("string"),
Mobile: pulumi.String("string"),
Phone: pulumi.String("string"),
Key: pulumi.String("string"),
PostalCode: pulumi.String("string"),
Region: pulumi.String("string"),
Salutation: pulumi.String("string"),
State: pulumi.String("string"),
StreetName: pulumi.String("string"),
StreetNumber: pulumi.String("string"),
Title: pulumi.String("string"),
},
ChannelId: pulumi.String("string"),
Custom: &.ChannelCustomArgs{
TypeId: pulumi.String("string"),
Fields: pulumi.StringMap{
"string": pulumi.String("string"),
},
},
Description: pulumi.StringMap{
"string": pulumi.String("string"),
},
Geolocation: &.ChannelGeolocationArgs{
Coordinates: pulumi.Float64Array{
pulumi.Float64(0),
},
},
Name: pulumi.StringMap{
"string": pulumi.String("string"),
},
})
Copy
var channelResource = new Channel("channelResource", ChannelArgs.builder()
    .key("string")
    .roles("string")
    .address(ChannelAddressArgs.builder()
        .country("string")
        .id("string")
        .department("string")
        .building("string")
        .city("string")
        .company("string")
        .additionalStreetInfo("string")
        .additionalAddressInfo("string")
        .email("string")
        .externalId("string")
        .fax("string")
        .apartment("string")
        .firstName("string")
        .poBox("string")
        .lastName("string")
        .mobile("string")
        .phone("string")
        .key("string")
        .postalCode("string")
        .region("string")
        .salutation("string")
        .state("string")
        .streetName("string")
        .streetNumber("string")
        .title("string")
        .build())
    .channelId("string")
    .custom(ChannelCustomArgs.builder()
        .typeId("string")
        .fields(Map.of("string", "string"))
        .build())
    .description(Map.of("string", "string"))
    .geolocation(ChannelGeolocationArgs.builder()
        .coordinates(0)
        .build())
    .name(Map.of("string", "string"))
    .build());
Copy
channel_resource = commercetools.Channel("channelResource",
    key="string",
    roles=["string"],
    address={
        "country": "string",
        "id": "string",
        "department": "string",
        "building": "string",
        "city": "string",
        "company": "string",
        "additional_street_info": "string",
        "additional_address_info": "string",
        "email": "string",
        "external_id": "string",
        "fax": "string",
        "apartment": "string",
        "first_name": "string",
        "po_box": "string",
        "last_name": "string",
        "mobile": "string",
        "phone": "string",
        "key": "string",
        "postal_code": "string",
        "region": "string",
        "salutation": "string",
        "state": "string",
        "street_name": "string",
        "street_number": "string",
        "title": "string",
    },
    channel_id="string",
    custom={
        "type_id": "string",
        "fields": {
            "string": "string",
        },
    },
    description={
        "string": "string",
    },
    geolocation={
        "coordinates": [0],
    },
    name={
        "string": "string",
    })
Copy
const channelResource = new commercetools.Channel("channelResource", {
    key: "string",
    roles: ["string"],
    address: {
        country: "string",
        id: "string",
        department: "string",
        building: "string",
        city: "string",
        company: "string",
        additionalStreetInfo: "string",
        additionalAddressInfo: "string",
        email: "string",
        externalId: "string",
        fax: "string",
        apartment: "string",
        firstName: "string",
        poBox: "string",
        lastName: "string",
        mobile: "string",
        phone: "string",
        key: "string",
        postalCode: "string",
        region: "string",
        salutation: "string",
        state: "string",
        streetName: "string",
        streetNumber: "string",
        title: "string",
    },
    channelId: "string",
    custom: {
        typeId: "string",
        fields: {
            string: "string",
        },
    },
    description: {
        string: "string",
    },
    geolocation: {
        coordinates: [0],
    },
    name: {
        string: "string",
    },
});
Copy
type: commercetools:Channel
properties:
    address:
        additionalAddressInfo: string
        additionalStreetInfo: string
        apartment: string
        building: string
        city: string
        company: string
        country: string
        department: string
        email: string
        externalId: string
        fax: string
        firstName: string
        id: string
        key: string
        lastName: string
        mobile: string
        phone: string
        poBox: string
        postalCode: string
        region: string
        salutation: string
        state: string
        streetName: string
        streetNumber: string
        title: string
    channelId: string
    custom:
        fields:
            string: string
        typeId: string
    description:
        string: string
    geolocation:
        coordinates:
            - 0
    key: string
    name:
        string: string
    roles:
        - string
Copy

Channel Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The Channel resource accepts the following input properties:

Key This property is required. string
Any arbitrary string key that uniquely identifies this channel within the project
Roles This property is required. List<string>
The roles of this channel. Each channel must have at least one role
Address ChannelAddress
ChannelId string
The ID of this resource.
Custom ChannelCustom
Description Dictionary<string, string>
LocalizedString
Geolocation ChannelGeolocation
Name Dictionary<string, string>
LocalizedString
Key This property is required. string
Any arbitrary string key that uniquely identifies this channel within the project
Roles This property is required. []string
The roles of this channel. Each channel must have at least one role
Address ChannelAddressArgs
ChannelId string
The ID of this resource.
Custom ChannelCustomArgs
Description map[string]string
LocalizedString
Geolocation ChannelGeolocationArgs
Name map[string]string
LocalizedString
key This property is required. String
Any arbitrary string key that uniquely identifies this channel within the project
roles This property is required. List<String>
The roles of this channel. Each channel must have at least one role
address ChannelAddress
channelId String
The ID of this resource.
custom ChannelCustom
description Map<String,String>
LocalizedString
geolocation ChannelGeolocation
name Map<String,String>
LocalizedString
key This property is required. string
Any arbitrary string key that uniquely identifies this channel within the project
roles This property is required. string[]
The roles of this channel. Each channel must have at least one role
address ChannelAddress
channelId string
The ID of this resource.
custom ChannelCustom
description {[key: string]: string}
LocalizedString
geolocation ChannelGeolocation
name {[key: string]: string}
LocalizedString
key This property is required. str
Any arbitrary string key that uniquely identifies this channel within the project
roles This property is required. Sequence[str]
The roles of this channel. Each channel must have at least one role
address ChannelAddressArgs
channel_id str
The ID of this resource.
custom ChannelCustomArgs
description Mapping[str, str]
LocalizedString
geolocation ChannelGeolocationArgs
name Mapping[str, str]
LocalizedString
key This property is required. String
Any arbitrary string key that uniquely identifies this channel within the project
roles This property is required. List<String>
The roles of this channel. Each channel must have at least one role
address Property Map
channelId String
The ID of this resource.
custom Property Map
description Map<String>
LocalizedString
geolocation Property Map
name Map<String>
LocalizedString

Outputs

All input properties are implicitly available as output properties. Additionally, the Channel resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Version double
Id string
The provider-assigned unique ID for this managed resource.
Version float64
id String
The provider-assigned unique ID for this managed resource.
version Double
id string
The provider-assigned unique ID for this managed resource.
version number
id str
The provider-assigned unique ID for this managed resource.
version float
id String
The provider-assigned unique ID for this managed resource.
version Number

Look up Existing Channel Resource

Get an existing Channel resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: ChannelState, opts?: CustomResourceOptions): Channel
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        address: Optional[ChannelAddressArgs] = None,
        channel_id: Optional[str] = None,
        custom: Optional[ChannelCustomArgs] = None,
        description: Optional[Mapping[str, str]] = None,
        geolocation: Optional[ChannelGeolocationArgs] = None,
        key: Optional[str] = None,
        name: Optional[Mapping[str, str]] = None,
        roles: Optional[Sequence[str]] = None,
        version: Optional[float] = None) -> Channel
func GetChannel(ctx *Context, name string, id IDInput, state *ChannelState, opts ...ResourceOption) (*Channel, error)
public static Channel Get(string name, Input<string> id, ChannelState? state, CustomResourceOptions? opts = null)
public static Channel get(String name, Output<String> id, ChannelState state, CustomResourceOptions options)
resources:  _:    type: commercetools:Channel    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
Address ChannelAddress
ChannelId string
The ID of this resource.
Custom ChannelCustom
Description Dictionary<string, string>
LocalizedString
Geolocation ChannelGeolocation
Key string
Any arbitrary string key that uniquely identifies this channel within the project
Name Dictionary<string, string>
LocalizedString
Roles List<string>
The roles of this channel. Each channel must have at least one role
Version double
Address ChannelAddressArgs
ChannelId string
The ID of this resource.
Custom ChannelCustomArgs
Description map[string]string
LocalizedString
Geolocation ChannelGeolocationArgs
Key string
Any arbitrary string key that uniquely identifies this channel within the project
Name map[string]string
LocalizedString
Roles []string
The roles of this channel. Each channel must have at least one role
Version float64
address ChannelAddress
channelId String
The ID of this resource.
custom ChannelCustom
description Map<String,String>
LocalizedString
geolocation ChannelGeolocation
key String
Any arbitrary string key that uniquely identifies this channel within the project
name Map<String,String>
LocalizedString
roles List<String>
The roles of this channel. Each channel must have at least one role
version Double
address ChannelAddress
channelId string
The ID of this resource.
custom ChannelCustom
description {[key: string]: string}
LocalizedString
geolocation ChannelGeolocation
key string
Any arbitrary string key that uniquely identifies this channel within the project
name {[key: string]: string}
LocalizedString
roles string[]
The roles of this channel. Each channel must have at least one role
version number
address ChannelAddressArgs
channel_id str
The ID of this resource.
custom ChannelCustomArgs
description Mapping[str, str]
LocalizedString
geolocation ChannelGeolocationArgs
key str
Any arbitrary string key that uniquely identifies this channel within the project
name Mapping[str, str]
LocalizedString
roles Sequence[str]
The roles of this channel. Each channel must have at least one role
version float
address Property Map
channelId String
The ID of this resource.
custom Property Map
description Map<String>
LocalizedString
geolocation Property Map
key String
Any arbitrary string key that uniquely identifies this channel within the project
name Map<String>
LocalizedString
roles List<String>
The roles of this channel. Each channel must have at least one role
version Number

Supporting Types

ChannelAddress
, ChannelAddressArgs

Country This property is required. string
AdditionalAddressInfo string
AdditionalStreetInfo string
Apartment string
Building string
City string
Company string
Department string
Email string
ExternalId string
Fax string
FirstName string
Id string
Key string
LastName string
Mobile string
Phone string
PoBox string
PostalCode string
Region string
Salutation string
State string
StreetName string
StreetNumber string
Title string
Country This property is required. string
AdditionalAddressInfo string
AdditionalStreetInfo string
Apartment string
Building string
City string
Company string
Department string
Email string
ExternalId string
Fax string
FirstName string
Id string
Key string
LastName string
Mobile string
Phone string
PoBox string
PostalCode string
Region string
Salutation string
State string
StreetName string
StreetNumber string
Title string
country This property is required. String
additionalAddressInfo String
additionalStreetInfo String
apartment String
building String
city String
company String
department String
email String
externalId String
fax String
firstName String
id String
key String
lastName String
mobile String
phone String
poBox String
postalCode String
region String
salutation String
state String
streetName String
streetNumber String
title String
country This property is required. string
additionalAddressInfo string
additionalStreetInfo string
apartment string
building string
city string
company string
department string
email string
externalId string
fax string
firstName string
id string
key string
lastName string
mobile string
phone string
poBox string
postalCode string
region string
salutation string
state string
streetName string
streetNumber string
title string
country This property is required. String
additionalAddressInfo String
additionalStreetInfo String
apartment String
building String
city String
company String
department String
email String
externalId String
fax String
firstName String
id String
key String
lastName String
mobile String
phone String
poBox String
postalCode String
region String
salutation String
state String
streetName String
streetNumber String
title String

ChannelCustom
, ChannelCustomArgs

TypeId This property is required. string
Fields Dictionary<string, string>
Custom fields for this resource. Note that the values need to be provided as JSON encoded strings: my-value = jsonencode({"key": "value"})
TypeId This property is required. string
Fields map[string]string
Custom fields for this resource. Note that the values need to be provided as JSON encoded strings: my-value = jsonencode({"key": "value"})
typeId This property is required. String
fields Map<String,String>
Custom fields for this resource. Note that the values need to be provided as JSON encoded strings: my-value = jsonencode({"key": "value"})
typeId This property is required. string
fields {[key: string]: string}
Custom fields for this resource. Note that the values need to be provided as JSON encoded strings: my-value = jsonencode({"key": "value"})
type_id This property is required. str
fields Mapping[str, str]
Custom fields for this resource. Note that the values need to be provided as JSON encoded strings: my-value = jsonencode({"key": "value"})
typeId This property is required. String
fields Map<String>
Custom fields for this resource. Note that the values need to be provided as JSON encoded strings: my-value = jsonencode({"key": "value"})

ChannelGeolocation
, ChannelGeolocationArgs

Coordinates This property is required. List<double>
Coordinates This property is required. []float64
coordinates This property is required. List<Double>
coordinates This property is required. number[]
coordinates This property is required. Sequence[float]
coordinates This property is required. List<Number>

Package Details

Repository
commercetools labd/terraform-provider-commercetools
License
Notes
This Pulumi package is based on the commercetools Terraform Provider.