createCustomersStep - Medusa Core Workflows Reference

This documentation provides a reference to the createCustomersStep. It belongs to the @medusajs/medusa/core-flows package.

This step creates one or more customers.

Example#

Code
1const data = createCustomersStep([2  {3    first_name: "John",4    last_name: "Doe",5    email: "customer@example.com",6  }7])

Input#

CreateCustomersStepInputCreateCustomersStepInput
The data to create one or more customers.
company_namenull | stringOptional
The company name of the customer.
first_namenull | stringOptional
The first name of the customer.
last_namenull | stringOptional
The last name of the customer.
emailnull | stringOptional
The email of the customer.
phonenull | stringOptional
The phone of the customer.
created_bynull | stringOptional
Who created the customer.
has_accountbooleanOptional
Whether the customer has an account.
addressesOmit<CreateCustomerAddressDTO, "customer_id">[]Optional
The addresses of the customer.
metadataMetadataTypeOptional
Holds custom data in key-value pairs.

Output#

CustomerDTO[]CustomerDTO[]
CustomerDTOCustomerDTO
The customer details.
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