createStores - Store Module Reference

This documentation provides a reference to the createStores method. This belongs to the Store Module.

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

createStores(data, sharedContext?): Promise<StoreDTO[]>#

This method creates stores.

Example#

Code
1const stores = await storeModuleService.createStores([2  {3    name: "Acme",4    supported_currencies: [{ currency_code: "usd", is_default: true }, { currency_code: "eur" }],5  },6  {7    name: "Acme 2",8    supported_currencies: [{currency_code: "usd", is_default: true}],9  },10])

Parameters#

The stores to be created.
sharedContextContextOptional
A context used to share resources, such as transaction manager, between the application and the module.

Returns#

PromisePromise<StoreDTO[]>
The created stores.

createStores(data, sharedContext?): Promise<StoreDTO>#

This method creates a store.

Example#

Code
1const store = await storeModuleService.createStores({2  name: "Acme",3  supported_currencies: [{ currency_code: "usd", is_default: true }, { currency_code: "eur" }],4})

Parameters#

The store to be created.
sharedContextContextOptional
A context used to share resources, such as transaction manager, between the application and the module.

Returns#

PromisePromise<StoreDTO>
The created store.
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