updateSalesChannels - Sales Channel Module Reference

This documentation provides a reference to the updateSalesChannels method. This belongs to the Sales Channel Module.

NoteYou should only use this methods when implementing complex customizations. For common cases, check out available workflows instead.

updateSalesChannels(channelId, data, sharedContext?): Promise<SalesChannelDTO>#

This method updates an existing sales channel.

Example#

Code
1const salesChannel = await salesChannelModuleService.updateSalesChannels(2  "sc_123",3  {4    description: "Sales channel for B2B customers",5  }6)

Parameters#

channelIdstring
The sales channel's ID.
The attributes to update in the sales channel.
sharedContextContextOptional
A context used to share resources, such as transaction manager, between the application and the module.

Returns#

PromisePromise<SalesChannelDTO>
The updated sales channel.

updateSalesChannels(selector, data, sharedContext?): Promise<SalesChannelDTO[]>#

This method updates existing sales channels matching the specified filters

Example#

Code
1const salesChannels = await salesChannelModuleService.updateSalesChannels(2  {3    name: "B2B",4  },5  {6    description: "Sales channel for B2B customers",7  }8)

Parameters#

The filters specifying which sales channels to update.
The attributes to update in the sales channel.
sharedContextContextOptional
A context used to share resources, such as transaction manager, between the application and the module.

Returns#

PromisePromise<SalesChannelDTO[]>
The updated sales channels.
Was this page helpful?
Ask Anything
FAQ
What is Medusa?
How can I create a module?
How can I create a data model?
How do I create a workflow?
How can I extend a data model in the Product Module?
Recipes
How do I build a marketplace with Medusa?
How do I build digital products with Medusa?
How do I build subscription-based purchases with Medusa?
What other recipes are available in the Medusa documentation?
Chat is cleared on refresh
Line break