ProductVariantInventoryService
Properties
__configModule__
Record<string, unknown>__container__
anyRequired__moduleDeclaration__
Record<string, unknown>getAvailabilityContext
anyRequiredmanager_
EntityManagerRequiredtransactionManager_
undefined | EntityManagerRequiredAccessors
activeManager_
Returns
EntityManager
EntityManagerRequiredinventoryService_
Returns
adjustInventory
(inventoryItemId: string, locationId: string, adjustment: number, context?: SharedContext) => Promise<InventoryLevelDTO>RequiredconfirmInventory
(inventoryItemId: string, locationIds: string[], quantity: number, context?: SharedContext) => Promise<boolean>RequiredcreateInventoryItem
(input: CreateInventoryItemInput, context?: SharedContext) => Promise<InventoryItemDTO>RequiredcreateInventoryItems
(input: CreateInventoryItemInput[], context?: SharedContext) => Promise<InventoryItemDTO[]>RequiredcreateInventoryLevel
(data: CreateInventoryLevelInput, context?: SharedContext) => Promise<InventoryLevelDTO>RequiredcreateInventoryLevels
(data: CreateInventoryLevelInput[], context?: SharedContext) => Promise<InventoryLevelDTO[]>RequiredcreateReservationItem
(input: CreateReservationItemInput, context?: SharedContext) => Promise<ReservationItemDTO>RequiredcreateReservationItems
(input: CreateReservationItemInput[], context?: SharedContext) => Promise<ReservationItemDTO[]>RequireddeleteInventoryItem
(inventoryItemId: string | string[], context?: SharedContext) => Promise<void>RequireddeleteInventoryItemLevelByLocationId
(locationId: string | string[], context?: SharedContext) => Promise<void>RequireddeleteInventoryLevel
(inventoryItemId: string, locationId: string, context?: SharedContext) => Promise<void>RequireddeleteReservationItem
(reservationItemId: string | string[], context?: SharedContext) => Promise<void>RequireddeleteReservationItemByLocationId
(locationId: string | string[], context?: SharedContext) => Promise<void>RequireddeleteReservationItemsByLineItem
(lineItemId: string | string[], context?: SharedContext) => Promise<void>RequiredlistInventoryItems
(selector: FilterableInventoryItemProps, config?: FindConfig<InventoryItemDTO>, context?: SharedContext) => Promise<[InventoryItemDTO[], number]>RequiredlistInventoryLevels
(selector: FilterableInventoryLevelProps, config?: FindConfig<InventoryLevelDTO>, context?: SharedContext) => Promise<[InventoryLevelDTO[], number]>RequiredlistReservationItems
(selector: FilterableReservationItemProps, config?: FindConfig<ReservationItemDTO>, context?: SharedContext) => Promise<[ReservationItemDTO[], number]>RequiredrestoreInventoryItem
(inventoryItemId: string | string[], context?: SharedContext) => Promise<void>RequiredretrieveAvailableQuantity
(inventoryItemId: string, locationIds: string[], context?: SharedContext) => Promise<number>RequiredretrieveInventoryItem
(inventoryItemId: string, config?: FindConfig<InventoryItemDTO>, context?: SharedContext) => Promise<InventoryItemDTO>RequiredretrieveInventoryLevel
(inventoryItemId: string, locationId: string, context?: SharedContext) => Promise<InventoryLevelDTO>RequiredretrieveReservationItem
(reservationId: string, context?: SharedContext) => Promise<ReservationItemDTO>RequiredretrieveReservedQuantity
(inventoryItemId: string, locationIds: string[], context?: SharedContext) => Promise<number>RequiredretrieveStockedQuantity
(inventoryItemId: string, locationIds: string[], context?: SharedContext) => Promise<number>RequiredupdateInventoryItem
(inventoryItemId: string, input: Partial<CreateInventoryItemInput>, context?: SharedContext) => Promise<InventoryItemDTO>RequiredupdateInventoryLevel
(inventoryItemId: string, locationId: string, update: UpdateInventoryLevelInput, context?: SharedContext) => Promise<InventoryLevelDTO>RequiredupdateInventoryLevels
(updates: BulkUpdateInventoryLevelInput[], context?: SharedContext) => Promise<InventoryLevelDTO[]>RequiredupdateReservationItem
(reservationItemId: string, input: UpdateReservationItemInput, context?: SharedContext) => Promise<ReservationItemDTO>RequiredstockLocationService_
Returns
create
(input: CreateStockLocationInput, context?: SharedContext) => Promise<StockLocationDTO>Requiredlist
(selector: FilterableStockLocationProps, config?: FindConfig<StockLocationDTO>, context?: SharedContext) => Promise<StockLocationDTO[]>RequiredlistAndCount
(selector: FilterableStockLocationProps, config?: FindConfig<StockLocationDTO>, context?: SharedContext) => Promise<[StockLocationDTO[], number]>Requiredretrieve
(id: string, config?: FindConfig<StockLocationDTO>, context?: SharedContext) => Promise<StockLocationDTO>Requiredupdate
(id: string, input: UpdateStockLocationInput, context?: SharedContext) => Promise<StockLocationDTO>RequiredMethods
adjustInventory
Adjusts inventory of a variant on a location
Parameters
variantId
stringRequiredlocationId
stringRequiredquantity
numberRequiredReturns
Promise
Promise<void>RequiredadjustReservationsQuantityByLineItem
Adjusts the quantity of reservations for a line item by a given amount.
Parameters
lineItemId
stringRequiredvariantId
stringRequiredlocationId
stringRequiredquantity
numberRequiredReturns
Promise
Promise<void>RequiredatomicPhase_
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>RequiredisolationOrErrorHandler
IsolationLevel | (error: TError) => Promise<void | TResult>maybeErrorHandlerOrDontFail
(error: TError) => Promise<void | TResult>Returns
Promise
Promise<TResult>RequiredattachInventoryItem
**attachInventoryItem**(attachments): Promise<[ProductVariantInventoryItem](/references/js-client/internal/classes/internal.internal.ProductVariantInventoryItem)[]>
Attach a variant to an inventory item
Parameters
attachments
{ inventoryItemId: string ; requiredQuantity?: number ; variantId: string }[]RequiredReturns
**attachInventoryItem**(variantId, inventoryItemId, requiredQuantity?): Promise<[ProductVariantInventoryItem](/references/js-client/internal/classes/internal.internal.ProductVariantInventoryItem)[]>
Parameters
variantId
stringRequiredinventoryItemId
stringRequiredrequiredQuantity
numberReturns
confirmInventory
confirms if requested inventory is available
Parameters
variantId
stringRequiredquantity
numberRequiredcontext
objectcontext.salesChannelId
null | stringReturns
deleteReservationsByLineItem
delete a reservation of variant quantity
Parameters
lineItemId
string | string[]RequiredvariantId
stringRequiredquantity
numberRequiredReturns
Promise
Promise<void>RequireddetachInventoryItem
Remove a variant from an inventory item
Parameters
inventoryItemId
stringRequiredvariantId
stringReturns
Promise
Promise<void>RequiredgetVariantQuantityFromVariantInventoryItems
Get the quantity of a variant from a list of variantInventoryItems The inventory quantity of the variant should be equal to the inventory item with the smallest stock, adjusted for quantity required to fulfill the given variant.
Parameters
channelId
stringRequiredReturns
Promise
Promise<number>RequiredlistByItem
list registered inventory items
Parameters
itemIds
string[]RequiredReturns
listByVariant
List inventory items for a specific variant
Parameters
variantId
string | string[]RequiredReturns
listInventoryItemsByVariant
lists inventory items for a given variant
Parameters
variantId
stringRequiredReturns
listVariantsByItem
lists variant by inventory item id
Parameters
itemId
stringRequiredReturns
reserveQuantity
Reserves a quantity of a variant
Parameters
variantId
stringRequiredquantity
numberRequiredcontext
ReserveQuantityContextReturns
retrieve
Retrieves a product variant inventory item by its inventory item ID and variant ID.
Parameters
inventoryItemId
stringRequiredvariantId
stringRequiredReturns
setProductAvailability
Parameters
salesChannelId
undefined | string | string[]RequiredReturns
setVariantAvailability
Parameters
Returns
shouldRetryTransaction_
Parameters
err
Record<string, unknown> | { code: string }RequiredReturns
boolean
booleanvalidateInventoryAtLocation
Validate stock at a location for fulfillment items
Parameters
Returns
Promise
Promise<void>RequiredwithTransaction
Parameters
transactionManager
EntityManager