- Get Started
- Product
- Resources
- Tools & SDKs
- Framework
- Reference
Menu
- Get Started
- Product
- Resources
- Tools & SDKs
- Framework
- Reference
createCustomerAccountWorkflow - Medusa Core Workflows Reference
This documentation provides a reference to the createCustomerAccountWorkflow
. It belongs to the @medusajs/medusa/core-flows
package.
This workflow creates a customer and attaches it to an auth identity. It's used by the Register Customer Store API Route.
You can create an auth identity first using the Retrieve Registration JWT Token API Route. Learn more about basic authentication flows in this documentation.
You can use this workflow within your customizations or your own custom workflows, allowing you to register or create customer accounts within your custom flows.
Source CodeExamples#
Steps#
Workflow Hook
Step conditioned by when
Input#
CreateCustomerAccountWorkflowInput
CreateCustomerAccountWorkflowInputThe details of the customer account to create.
CreateCustomerAccountWorkflowInput
CreateCustomerAccountWorkflowInputauthIdentityId
stringThe ID of the auth identity to attach the customer to.
authIdentityId
stringcustomerData
CreateCustomerDTOThe details of the customer to create.
customerData
CreateCustomerDTOOutput#
CustomerDTO
CustomerDTOThe customer details.
CustomerDTO
CustomerDTOid
stringThe ID of the customer.
id
stringemail
stringThe email of the customer.
email
stringhas_account
booleanA flag indicating if customer has an account or not.
has_account
booleandefault_billing_address_id
null | stringThe associated default billing address's ID.
default_billing_address_id
null | stringdefault_shipping_address_id
null | stringThe associated default shipping address's ID.
default_shipping_address_id
null | stringcompany_name
null | stringThe company name of the customer.
company_name
null | stringfirst_name
null | stringThe first name of the customer.
first_name
null | stringlast_name
null | stringThe last name of the customer.
last_name
null | stringaddresses
CustomerAddressDTO[]The addresses of the customer.
addresses
CustomerAddressDTO[]phone
null | stringThe phone of the customer.
phone
null | stringgroups
object[]The groups of the customer.
groups
object[]metadata
Record<string, unknown>Holds custom data in key-value pairs.
metadata
Record<string, unknown>created_by
null | stringWho created the customer.
created_by
null | stringdeleted_at
null | string | DateThe deletion date of the customer.
deleted_at
null | string | Datecreated_at
string | DateThe creation date of the customer.
created_at
string | Dateupdated_at
string | DateThe update date of the customer.
updated_at
string | DateWas this page helpful?