createStockLocations - Stock Location Next Module Reference

This documentation provides a reference to the createStockLocations method. This belongs to the Stock Location Next Module.

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

createStockLocations(input, context?): Promise<StockLocationDTO>#

This method creates a stock location.

Example#

Code
1const stockLocation = await stockLocationModuleService.createStockLocations(2  {3    name: "Warehouse",4    address: {5      address_1: "1855 Powder Mill Rd",6      country_code: "us",7    },8  }9)

Parameters#

The stock location to create.
contextContextOptional
A context used to share resources, such as transaction manager, between the application and the module.

Returns#

PromisePromise<StockLocationDTO>
The created stock location.

createStockLocations(input, context?): Promise<StockLocationDTO[]>#

This method creates stock locations.

Example#

Code
1const stockLocations =2  await stockLocationModuleService.createStockLocations([3    {4      name: "Warehouse",5      address: {6        address_1: "1855 Powder Mill Rd",7        country_code: "us",8      },9    },10    {11      name: "Warehouse 2",12      address_id: "laddr_123",13    },14  ])

Parameters#

The stock locations to create.
contextContextOptional
A context used to share resources, such as transaction manager, between the application and the module.

Returns#

PromisePromise<StockLocationDTO[]>
The created stock locations.
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