createAddresses - Cart Module Reference

This documentation provides a reference to the createAddresses method. This belongs to the Cart Module.

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

createAddresses(data, sharedContext?): Promise<CartAddressDTO[]>#

This method creates addresses.

Example#

Code
1const addresses = await cartModuleService.createAddresses([2  {3    address_1: "412 E Cheyenne Rd",4    country_code: "us",5  },6  {7    first_name: "Genevieve",8    last_name: "Fox",9    address_1: "17350 Northwest Fwy",10    country_code: "us",11  },12])

Parameters#

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

Returns#

PromisePromise<CartAddressDTO[]>
The created addresses.

createAddresses(data, sharedContext?): Promise<CartAddressDTO>#

This method creates a address.

Example#

Code
1const address = await cartModuleService.createAddresses({2  first_name: "Genevieve",3  last_name: "Fox",4  address_1: "17350 Northwest Fwy",5  country_code: "us",6})

Parameters#

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

Returns#

PromisePromise<CartAddressDTO>
The created address.
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