validateCustomerAccountCreation - Medusa Core Workflows Reference

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

This step validates the input data for creating a customer account. The step throws an error if:

  • The email is missing
  • A customer with the email already exists and has an account
  • A guest customer with the email already exists

Example#

Code
1const data = validateCustomerAccountCreation({2  authIdentityId: "au_1234",3  customerData: {4    first_name: "John",5    last_name: "Doe",6    email: "john.doe@example.com",7  }8})

Input#

CreateCustomerAccountWorkflowInputCreateCustomerAccountWorkflowInput
The details of the customer account to create.
authIdentityIdstring
The ID of the auth identity to attach the customer to.
customerDataCreateCustomerDTO
The details of the customer to create.
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