restoreReservationItemsByLineItem - Inventory Next Module Reference

This documentation provides a reference to the restoreReservationItemsByLineItem method. This belongs to the Inventory Next Module.

Note: You should only use this methods when implementing complex customizations. For common cases, check out available workflows instead.

This method is used to restore the reservation items associated with a line item or multiple line items that were deleted.

Example#

Code
1import {2  initialize as initializeInventoryModule,3} from "@medusajs/inventory"4
5async function restoreReservationItemsByLineItem (6  lineItemIds: string[]7) {8  const inventoryModule = await initializeInventoryModule({})9
10  await inventoryModule.restoreReservationItemsByLineItem(11    lineItemIds12  )13}

Parameters#

lineItemIdstring | string[]
The ID(s) of the line item(s).
contextContextOptional
A context used to share re9sources, such as transaction manager, between the application and the module.

Returns#

PromisePromise<void>
Resolves when the reservation items are successfully deleted.
Was this page helpful?
Ask Anything
FAQ
What is Medusa?
How can I create a module?
How can I create a data model?
How do I create a workflow?
How can I extend a data model in the Product Module?
Recipes
How do I build a marketplace with Medusa?
How do I build digital products with Medusa?
How do I build subscription-based purchases with Medusa?
What other recipes are available in the Medusa documentation?
Chat is cleared on refresh
Line break