TypeError: Cannot read properties of undefined (reading 'rest')

Topic summary

A user encounters a TypeError when attempting to create a customer via the Shopify REST API. The error message indicates an issue with reading properties of undefined.

Root Cause Identified:
The problem stems from including the password property when creating a customer through the REST API, which is not supported.

Recommended Solution:

  • Create the customer without password properties
  • After successful customer creation, send an account invite email
  • The customer will receive an email to set their own password and can then log in

Reference documentation for the customer REST API is provided for additional guidance on proper implementation.

Summarized with AI on November 24. AI used: claude-sonnet-4-5-20250929.

I’m trying to create a customer using REST API, but I can’t seem to do so because of this error.

I don’t know much about the Shopify API, and I only followed the steps in the Shopify API to create an app.

Hi,

You can not create a customer with the password property when using the rest api. Just the create the customer with the password properties and if the customer was created successfully. Send him an account invite, he will then an email to create his password and can then login.

More info about the customer rest api here.