Channel

Channel

A Channel represents a distinct sales channel and configures defaults for that channel.

  • Set a channel-specific currency, language, tax and shipping defaults
  • Assign only specific Products to the Channel (with Channel-specific prices)
  • Create Administrator roles limited to the Channel
  • Assign only specific StockLocations, Assets, Facets, Collections, Promotions, ShippingMethods & PaymentMethods to the Channel
  • Have Orders and Customers associated with specific Channels.

In Vendure, Channels have a number of different uses, such as:

  • Multi-region stores, where there is a distinct website for each territory with its own available inventory, pricing, tax and shipping rules.
  • Creating distinct rules and inventory for different sales channels such as Amazon.
  • Specialized stores offering a subset of the main inventory.
  • Implementing multi-vendor marketplace applications.

Signature

class Channel extends VendureEntity {
  constructor(input?: DeepPartial<Channel>)
  @Column({ unique: true }) @Column({ unique: true })
    code: string;
  @Column({ unique: true }) @Column({ unique: true })
    token: string;
  @Column({ default: '', nullable: true }) @Column({ default: '', nullable: true })
    description: string;
  @Index() @ManyToOne(type => Seller) @Index()
    @ManyToOne(type => Seller)
    seller?: Seller;
  @EntityId({ nullable: true }) @EntityId({ nullable: true })
    sellerId?: ID;
  @Column('varchar') @Column('varchar') defaultLanguageCode: LanguageCode;
  @Column({ type: 'simple-array', nullable: true }) @Column({ type: 'simple-array', nullable: true })
    availableLanguageCodes: LanguageCode[];
  @Index() @ManyToOne(type => Zone) @Index()
    @ManyToOne(type => Zone)
    defaultTaxZone: Zone;
  @Index() @ManyToOne(type => Zone) @Index()
    @ManyToOne(type => Zone)
    defaultShippingZone: Zone;
  @Column('varchar') @Column('varchar')
    defaultCurrencyCode: CurrencyCode;
  @Column({ type: 'simple-array', nullable: true }) @Column({ type: 'simple-array', nullable: true })
    availableCurrencyCodes: CurrencyCode[];
  @Column({ default: true }) @Column({ default: true })
    trackInventory: boolean;
  @Column({ default: 0 }) @Column({ default: 0 })
    outOfStockThreshold: number;
  @Column(type => CustomChannelFields) @Column(type => CustomChannelFields)
    customFields: CustomChannelFields;
  @Column() @Column() pricesIncludeTax: boolean;
}

Extends

Members

constructor

method
type:
(input?: DeepPartial<Channel>) => Channel

code

property
type:
string

token

property
type:
string

description

property
type:
string

seller

property
type:
Seller

sellerId

property
type:
ID

defaultLanguageCode

property
type:
LanguageCode

availableLanguageCodes

property
type:
LanguageCode[]

defaultTaxZone

property
type:
Zone

defaultShippingZone

property
type:
Zone

defaultCurrencyCode

property
type:
CurrencyCode

availableCurrencyCodes

property
type:
CurrencyCode[]

trackInventory

property
type:
boolean
Specifies the default value for inventory tracking for ProductVariants. Can be overridden per ProductVariant, but this value determines the default if not otherwise specified.

outOfStockThreshold

property
type:
number
Specifies the value of stockOnHand at which a given ProductVariant is considered out of stock.

customFields

property
type:
CustomChannelFields

pricesIncludeTax

property
type:
boolean