--- title: customerCreate - Storefront API description: Creates a new customer. api_version: 2025-10 api_name: storefront type: mutation api_type: graphql source_url: html: https://shopify.dev/docs/api/storefront/latest/mutations/customerCreate md: https://shopify.dev/docs/api/storefront/latest/mutations/customerCreate.md --- # customer​Create mutation Requires `unauthenticated_write_customers` access scope. Creates a new customer. ## Arguments * input [Customer​Create​Input!](https://shopify.dev/docs/api/storefront/latest/input-objects/CustomerCreateInput) required The fields used to create a new customer. *** ## Customer​Create​Payload returns * customer [Customer](https://shopify.dev/docs/api/storefront/latest/objects/Customer) The created customer object. * customer​User​Errors [\[Customer​User​Error!\]!](https://shopify.dev/docs/api/storefront/latest/objects/CustomerUserError) non-null The list of errors that occurred from executing the mutation. * user​Errors [\[User​Error!\]!](https://shopify.dev/docs/api/storefront/latest/objects/UserError) non-nullDeprecated The list of errors that occurred from executing the mutation. *** ## Examples * ### Create a customer #### Description Create a new customer #### Query ```graphql mutation customerCreate($input: CustomerCreateInput!) { customerCreate(input: $input) { customer { firstName lastName email phone acceptsMarketing } customerUserErrors { field message code } } } ``` #### Variables ```json { "input": { "firstName": "John", "lastName": "Smith", "email": "johnsmith@shopify.com", "phone": "+15146669999", "password": "5hopify", "acceptsMarketing": true } } ``` #### cURL ```bash curl -X POST \ https://your-development-store.myshopify.com/api/2025-10/graphql.json \ -H 'Content-Type: application/json' \ -H 'X-Shopify-Storefront-Access-Token: {storefront_access_token}' \ -d '{ "query": "mutation customerCreate($input: CustomerCreateInput!) { customerCreate(input: $input) { customer { firstName lastName email phone acceptsMarketing } customerUserErrors { field message code } } }", "variables": { "input": { "firstName": "John", "lastName": "Smith", "email": "johnsmith@shopify.com", "phone": "+15146669999", "password": "5hopify", "acceptsMarketing": true } } }' ``` #### React Router ```javascript import { unauthenticated } from "../shopify.server"; export const loader = async () => { const { storefront } = await unauthenticated.storefront( 'your-development-store.myshopify.com' ); const response = await storefront.graphql( `#graphql mutation customerCreate($input: CustomerCreateInput!) { customerCreate(input: $input) { customer { firstName lastName email phone acceptsMarketing } customerUserErrors { field message code } } }`, { variables: { "input": { "firstName": "John", "lastName": "Smith", "email": "johnsmith@shopify.com", "phone": "+15146669999", "password": "5hopify", "acceptsMarketing": true } }, }, ); const json = await response.json(); return json.data; } ``` #### Node.js ```javascript const client = new shopify.clients.Storefront({ domain: 'your-development-store.myshopify.com', storefrontAccessToken, }); const data = await client.query({ data: { "query": `mutation customerCreate($input: CustomerCreateInput!) { customerCreate(input: $input) { customer { firstName lastName email phone acceptsMarketing } customerUserErrors { field message code } } }`, "variables": { "input": { "firstName": "John", "lastName": "Smith", "email": "johnsmith@shopify.com", "phone": "+15146669999", "password": "5hopify", "acceptsMarketing": true } }, }, }); ``` #### Response ```json { "customerCreate": { "customer": { "firstName": "John", "lastName": "Smith", "email": "johnsmith@shopify.com", "phone": "+15146669999", "acceptsMarketing": true }, "customerUserErrors": [] } } ``` * ### customerCreate reference [Open in GraphiQL](http://localhost:3457/graphiql?query=mutation%20customerCreate\(%24input%3A%20CustomerCreateInput!\)%20%7B%0A%20%20customerCreate\(input%3A%20%24input\)%20%7B%0A%20%20%20%20customer%20%7B%0A%20%20%20%20%20%20firstName%0A%20%20%20%20%20%20lastName%0A%20%20%20%20%20%20email%0A%20%20%20%20%20%20phone%0A%20%20%20%20%20%20acceptsMarketing%0A%20%20%20%20%7D%0A%20%20%20%20customerUserErrors%20%7B%0A%20%20%20%20%20%20field%0A%20%20%20%20%20%20message%0A%20%20%20%20%20%20code%0A%20%20%20%20%7D%0A%20%20%7D%0A%7D\&variables=%7B%0A%20%20%22input%22%3A%20%7B%0A%20%20%20%20%22firstName%22%3A%20%22John%22%2C%0A%20%20%20%20%22lastName%22%3A%20%22Smith%22%2C%0A%20%20%20%20%22email%22%3A%20%22johnsmith%40shopify.com%22%2C%0A%20%20%20%20%22phone%22%3A%20%22%2B15146669999%22%2C%0A%20%20%20%20%22password%22%3A%20%225hopify%22%2C%0A%20%20%20%20%22acceptsMarketing%22%3A%20true%0A%20%20%7D%0A%7D) ```javascript import { unauthenticated } from "../shopify.server"; export const loader = async () => { const { storefront } = await unauthenticated.storefront( 'your-development-store.myshopify.com' ); const response = await storefront.graphql( `#graphql mutation customerCreate($input: CustomerCreateInput!) { customerCreate(input: $input) { customer { firstName lastName email phone acceptsMarketing } customerUserErrors { field message code } } }`, { variables: { "input": { "firstName": "John", "lastName": "Smith", "email": "johnsmith@shopify.com", "phone": "+15146669999", "password": "5hopify", "acceptsMarketing": true } }, }, ); const json = await response.json(); return json.data; } ``` ## Input variables JSON ```json { "input": { "firstName": "John", "lastName": "Smith", "email": "johnsmith@shopify.com", "phone": "+15146669999", "password": "5hopify", "acceptsMarketing": true } } ``` ## Response JSON ```json { "customerCreate": { "customer": { "firstName": "John", "lastName": "Smith", "email": "johnsmith@shopify.com", "phone": "+15146669999", "acceptsMarketing": true }, "customerUserErrors": [] } } ```