FAQWhat 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?
RecipesHow 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 createCustomerAddressesStep - Medusa Core Workflows Reference
This documentation provides a reference to the createCustomerAddressesStep
. It belongs to the @medusajs/medusa/core-flows
package.
This step creates one or more customer addresses.
Example#
1const data = createCustomerAddressesStep([2 {3 customer_id: "cus_123",4 first_name: "John",5 last_name: "Doe",6 address_1: "123 Main St",7 city: "Anytown",8 province: "NY",9 postal_code: "12345",10 country_code: "us",11 }12])
The data to create one or more customer addresses.
The associated customer's ID.
address_name
null | stringOptional
The address's name.
is_default_shipping
booleanOptional
Whether the address is default shipping.
is_default_billing
booleanOptional
Whether the address is the default for billing.
company
null | stringOptional
The company.
first_name
null | stringOptional
The first name.
last_name
null | stringOptional
The last name.
address_1
null | stringOptional
The address 1.
address_2
null | stringOptional
The address 2.
city
null | stringOptional
The city.
country_code
null | stringOptional
The country code.
province
null | stringOptional
The lower-case
ISO 3166-2 province of the address.
postal_code
null | stringOptional
The postal code.
phone
null | stringOptional
The phone.
Holds custom data in key-value pairs.
Output#
The ID of the customer address.
is_default_shipping
boolean
Whether the customer address is default shipping.
is_default_billing
boolean
Whether the customer address is default billing.
The associated customer's ID.
The created at of the customer address.
The updated at of the customer address.
address_name
stringOptional
The address name of the customer address.
The company of the customer address.
The first name of the customer address.
The last name of the customer address.
The address 1 of the customer address.
The address 2 of the customer address.
The city of the customer address.
country_code
stringOptional
The country code of the customer address.
The lower-case
ISO 3166-2 province of the customer address.
postal_code
stringOptional
The postal code of the customer address.
The phone of the customer address.
metadata
Record<string, unknown>Optional
Holds custom data in key-value pairs.