SalesChannelService
constructor
Parameters
__namedParameters
InjectedDependenciesRequiredProperties
manager_
EntityManagerRequiredtransactionManager_
undefined | EntityManagerRequired__container__
anyRequiredEvents
objectRequiredEvents.UPDATED
stringRequiredDefault: "sales_channel.updated"
Events.CREATED
stringRequiredDefault: "sales_channel.created"
Events.DELETED
stringRequiredDefault: "sales_channel.deleted"
featureFlagRouter_
FlagRouterRequired__configModule__
Record<string, unknown>__moduleDeclaration__
Record<string, unknown>Accessors
activeManager_
Returns
EntityManager
EntityManagerRequiredMethods
withTransaction
Parameters
transactionManager
EntityManagerReturns
this
thisRequiredshouldRetryTransaction_
Parameters
err
Record<string, unknown> | objectRequiredReturns
boolean
booleanRequiredatomicPhase_
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
TResult
objectRequiredTError
objectRequiredParameters
work
(transactionManager: EntityManager) => Promise<TResult>RequiredisolationOrErrorHandler
IsolationLevel | (error: TError) => Promise<void | TResult>maybeErrorHandlerOrDontFail
(error: TError) => Promise<void | TResult>Returns
Promise
Promise<TResult>Requiredretrieve_
A generic retrieve used to find a sales channel by different attributes.
Parameters
Default: {}
Returns
retrieve
Retrieve a SalesChannel by id
Parameters
salesChannelId
stringRequiredDefault: {}
Returns
retrieveByName
Find a sales channel by name.
Parameters
name
stringRequiredDefault: {}
Returns
Promise
Promise<unknown>RequiredlistAndCount
Lists sales channels based on the provided parameters and include the count of sales channels that match the query.
Parameters
Returns
list
Lists sales channels based on the provided parameters.
Parameters
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
data
CreateSalesChannelInputRequiredReturns
update
Parameters
salesChannelId
stringRequireddata
Partial<CreateSalesChannelInput>RequiredReturns
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
salesChannelId
stringRequiredReturns
Promise
Promise<void>RequiredcreateDefault
Creates a default sales channel, if this does not already exist.
Returns
retrieveDefault
Retrieves the default sales channel.
Returns
listProductIdsBySalesChannelIds
List all product ids that belongs to the sales channels ids
Parameters
salesChannelIds
string | string[]RequiredReturns
Promise
Promise<object>RequiredremoveProducts
Remove a batch of product from a sales channel
Parameters
salesChannelId
stringRequiredproductIds
string[]RequiredReturns
addProducts
Add a batch of product to a sales channel
Parameters
salesChannelId
stringRequiredproductIds
string[]Required