ShippingEligibilityChecker[]ShippingCalculator[](ctx: RequestContext, productVariantId: ID, options?: StockMovementListOptions) => Promise<PaginatedList<StockMovement>>Returns a PaginatedList of all StockMovements associated with the specified ProductVariant.
(ctx: RequestContext, productVariantId: ID, stockOnHandNumberOrInput: number | StockLevelInput[]) => Promise<StockAdjustment[]>Adjusts the stock level of the ProductVariant, creating a new StockAdjustment entity in the process.
The stockOnHand of the input is absolute, but the write which applies it is a relative
stockOnHand + delta, so the current value is read under a write lock held until the
surrounding transaction commits. Two concurrent adjustments of the same ProductVariant
therefore serialize, and the stored value is the one the later of the two asked for.
When adjusting more than one ProductVariant in a transaction, call
StockLevelService.lockStockLevelsForVariants for the whole set first, with
{ includeUntrackedVariants: true }, so the locks are taken in the shared order.
(ctx: RequestContext, order: Order) => Promise<Allocation[]>Creates a new Allocation for each OrderLine in the Order. For ProductVariants
which are configured to track stock levels, the ProductVariant.stockAllocated value is
increased, indicating that this quantity of stock is allocated and cannot be sold.
(ctx: RequestContext, lines: OrderLineInput[]) => Promise<Allocation[]>Creates a new Allocation for each of the given OrderLines. For ProductVariants
which are configured to track stock levels, the ProductVariant.stockAllocated value is
increased, indicating that this quantity of stock is allocated and cannot be sold.
(ctx: RequestContext, lines: OrderLineInput[]) => Promise<Sale[]>Creates Sales for each OrderLine in the Order. For ProductVariants
which are configured to track stock levels, the ProductVariant.stockAllocated value is
reduced and the stockOnHand value is also reduced by the OrderLine quantity, indicating
that the stock is no longer allocated, but is actually sold and no longer available.
(ctx: RequestContext, lineInputs: OrderLineInput[]) => Promise<Cancellation[]>Creates a Cancellation for each of the specified OrderItems. For ProductVariants
which are configured to track stock levels, the ProductVariant.stockOnHand value is
increased for each Cancellation, allowing that stock to be sold again.
(ctx: RequestContext, lineInputs: OrderLineInput[]) => Promise<Release[]>Creates a Release for each of the specified OrderItems. For ProductVariants
which are configured to track stock levels, the ProductVariant.stockAllocated value is
reduced, indicating that this stock is once again available to buy.
Architecture reviews, custom plugin work, migrations, ongoing support. Get a hand from the team that builds Vendure.
Talk to the team