--- displayed_sidebar: servicesSidebar --- import ParameterTypes from "@site/src/components/ParameterTypes" # SalesChannelService ## constructor ### Parameters ___ ## Properties `", "description": "", "optional": true, "defaultValue": "", "expandable": false, "children": [] }, { "name": "__container__", "type": "`any`", "description": "", "optional": false, "defaultValue": "", "expandable": false, "children": [] }, { "name": "__moduleDeclaration__", "type": "`Record`", "description": "", "optional": true, "defaultValue": "", "expandable": false, "children": [] }, { "name": "eventBusService_", "type": "[EventBusService](services.EventBusService.mdx)", "description": "", "optional": false, "defaultValue": "", "expandable": false, "children": [] }, { "name": "manager_", "type": "`EntityManager`", "description": "", "optional": false, "defaultValue": "", "expandable": false, "children": [] }, { "name": "salesChannelRepository_", "type": "Repository<[SalesChannel](../../entities/classes/entities.SalesChannel.mdx)> & `object`", "description": "", "optional": false, "defaultValue": "", "expandable": false, "children": [] }, { "name": "storeService_", "type": "[StoreService](services.StoreService.mdx)", "description": "", "optional": false, "defaultValue": "", "expandable": false, "children": [] }, { "name": "transactionManager_", "type": "`undefined` \\| `EntityManager`", "description": "", "optional": false, "defaultValue": "", "expandable": false, "children": [] }, { "name": "Events", "type": "`object`", "description": "", "optional": false, "defaultValue": "", "expandable": false, "children": [] }, { "name": "Events.CREATED", "type": "`string`", "description": "", "optional": false, "defaultValue": "\"sales_channel.created\"", "expandable": false, "children": [] }, { "name": "Events.DELETED", "type": "`string`", "description": "", "optional": false, "defaultValue": "\"sales_channel.deleted\"", "expandable": false, "children": [] }, { "name": "Events.UPDATED", "type": "`string`", "description": "", "optional": false, "defaultValue": "\"sales_channel.updated\"", "expandable": false, "children": [] } ]} /> ___ ## Accessors ### activeManager\_ #### Returns ___ ## Methods ### addProducts Add a batch of product to a sales channel #### Parameters #### Returns ___ ### atomicPhase\_ Wraps some work within a transactional block. If the service already has a transaction manager attached this will be reused, otherwise a new transaction manager is created. #### Type Parameters #### Parameters Promise<TResult>", "description": "the transactional work to be done", "optional": false, "defaultValue": "", "expandable": false, "children": [] }, { "name": "isolationOrErrorHandler", "type": "`IsolationLevel` \\| (`error`: `TError`) => Promise<void \\| TResult>", "description": "the isolation level to be used for the work.", "optional": true, "defaultValue": "", "expandable": false, "children": [] }, { "name": "maybeErrorHandlerOrDontFail", "type": "(`error`: `TError`) => Promise<void \\| TResult>", "description": "Potential error handler", "optional": true, "defaultValue": "", "expandable": false, "children": [] } ]} /> #### Returns ___ ### create Creates a SalesChannel This feature is under development and may change in the future. To use this feature please enable the corresponding feature flag in your medusa backend project. #### Parameters #### Returns ___ ### createDefault Creates a default sales channel, if this does not already exist. #### Returns ___ ### delete Deletes a sales channel from This feature is under development and may change in the future. To use this feature please enable the corresponding feature flag in your medusa backend project. #### Parameters #### Returns ___ ### listAndCount Lists sales channels based on the provided parameters and includes the count of sales channels that match the query. #### Parameters #### Returns ___ ### listProductIdsBySalesChannelIds List all product ids that belongs to the sales channels ids #### Parameters #### Returns ___ ### removeProducts Remove a batch of product from a sales channel #### Parameters #### Returns ___ ### retrieve Retrieve a SalesChannel by id #### Parameters #### Returns ___ ### retrieveByName Find a sales channel by name. #### Parameters #### Returns ___ ### retrieveDefault Retrieves the default sales channel. #### Returns ___ ### retrieve\_ A generic retrieve used to find a sales channel by different attributes. #### Parameters #### Returns ___ ### shouldRetryTransaction\_ #### Parameters ` \\| `object`", "description": "", "optional": false, "defaultValue": "", "expandable": false, "children": [] } ]} /> #### Returns ___ ### update #### Parameters #### Returns ___ ### withTransaction #### Parameters #### Returns