SalesChannelService
Properties
__configModule__Record<string, unknown>__container__anyRequired__moduleDeclaration__Record<string, unknown>manager_EntityManagerRequiredsalesChannelRepository_Repository<SalesChannel> & { addProducts: Method addProducts ; getFreeTextSearchResultsAndCount: Method getFreeTextSearchResultsAndCount ; listProductIdsBySalesChannelIds: Method listProductIdsBySalesChannelIds ; removeProducts: Method removeProducts }RequiredtransactionManager_undefined | EntityManagerRequiredEventsobjectRequiredEvents.CREATEDstringRequiredEvents.DELETEDstringRequiredEvents.UPDATEDstringRequiredAccessors
activeManager_
Inherited from
TransactionBaseService.activeManager_
Methods
addProducts
Add a batch of product to a sales channel
Parameters
salesChannelIdstringRequiredproductIdsstring[]RequiredReturns
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.
Parameters
work(transactionManager: EntityManager) => Promise<TResult>RequiredisolationOrErrorHandlerIsolationLevel | (error: TError) => Promise<void | TResult>maybeErrorHandlerOrDontFail(error: TError) => Promise<void | TResult>Returns
PromisePromise<TResult>Requiredcreate
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
salesChannelIdstringRequiredReturns
PromisePromise<void>RequiredlistAndCount
Lists sales channels based on the provided parameters and includes the count of sales channels that match the query.
Parameters
configFindConfig<SalesChannel>Returns
listProductIdsBySalesChannelIds
List all product ids that belongs to the sales channels ids
Parameters
salesChannelIdsstring | string[]RequiredReturns
PromisePromise<{ [salesChannelId: string]: string[]; }>RequiredremoveProducts
Remove a batch of product from a sales channel
Parameters
salesChannelIdstringRequiredproductIdsstring[]RequiredReturns
retrieve
Retrieve a SalesChannel by id
Parameters
salesChannelIdstringRequiredconfigFindConfig<SalesChannel>Returns
retrieveByName
Find a sales channel by name.
Parameters
namestringRequiredconfigFindConfig<SalesChannel>Returns
PromisePromise<unknown>RequiredretrieveDefault
Retrieves the default sales channel.
Returns
retrieve_
A generic retrieve used to find a sales channel by different attributes.
Parameters
configFindConfig<SalesChannel>Returns
shouldRetryTransaction_
Parameters
errRecord<string, unknown> | { code: string }RequiredReturns
booleanbooleanupdate
Parameters
salesChannelIdstringRequiredReturns
withTransaction
Parameters
transactionManagerEntityManager