Skip to main content
object

Requires unauthenticated_read_customers access scope.

A customer account with the shop. Includes data such as contact information, addresses and marketing preferences for logged-in customers, so they don't have to provide these details at every checkout.

Access the customer through the customer query using a customer access token obtained from the customerAccessTokenCreate mutation.

The object implements the HasMetafields interface, enabling retrieval of custom data associated with the customer.

•Boolean!
non-null

Indicates whether the customer has consented to be sent marketing material via email.

•MailingAddressConnection!
non-null

A list of addresses for the customer.

Arguments

•Int

Returns up to the first n elements from the list.

•String

Returns the elements that come after the specified cursor.

•Int

Returns up to the last n elements from the list.

•String

Returns the elements that come before the specified cursor.

•Boolean
Default:false

Reverse the order of the underlying list.


•String

The URL of the customer's avatar image.

•DateTime!
non-null

The date and time when the customer was created.

•MailingAddress

The customer’s default address.

•String!
non-null

The customer’s name, email or phone number.

•String

The customer’s email address.

•String

The customer’s first name.

•ID!
non-null

A unique ID for the customer.

•String

The customer’s last name.

•Metafield

A custom field, including its namespace and key, that's associated with a Shopify resource for the purposes of adding and storing additional information.

Arguments

•String

The container the metafield belongs to. If omitted, the app-reserved namespace will be used.

•String!
required

The identifier for the metafield.


•[Metafield]!
non-null

A list of custom fields that a merchant associates with a Shopify resource.

Arguments

•[HasMetafieldsIdentifier!]!
required

The list of metafields to retrieve by namespace and key.

The input must not contain more than 250 values.


•UnsignedInt64!
non-null

The number of orders that the customer has made at the store in their lifetime.

•OrderConnection!
non-null

The orders associated with the customer.

Arguments

•Int

Returns up to the first n elements from the list.

•String

Returns the elements that come after the specified cursor.

•Int

Returns up to the last n elements from the list.

•String

Returns the elements that come before the specified cursor.

•Boolean
Default:false

Reverse the order of the underlying list.

•OrderSortKeys
Default:ID

Sort the underlying list by the given key.

•String

Apply one or multiple filters to the query. Refer to the detailed search syntax for more information about using filters.

Anchor to processed_at
•

•String

The customer’s phone number.

•SocialLoginProvider

The social login provider associated with the customer.

•[String!]!
non-null

A comma separated list of tags that have been added to the customer. Additional access scope required: unauthenticated_read_customer_tags.

•DateTime!
non-null

The date and time when the customer information was updated.


Was this section helpful?

•query

Retrieves the Customer associated with the provided access token. Use the customerAccessTokenCreate mutation to obtain an access token using legacy customer account authentication (email and password).

The returned customer includes data such as contact information, addresses, orders, and custom data associated with the customer.

Arguments

•String!
required

The customer access token.



Was this section helpful?

•mutation

Activates a customer account using an activation token received from the customerCreate mutation. The customer sets their password during activation and receives a CustomerAccessToken for authenticated access.

For a simpler approach that doesn't require parsing the activation URL, use customerActivateByUrl instead.


Caution

This mutation handles customer credentials. Always use HTTPS and never log or expose the password or access token.


Arguments

•ID!
required

Specifies the customer to activate.

•CustomerActivateInput!
required

The fields used to activate a customer.


•mutation

Activates a customer account using the full activation URL from the customerCreate mutation. This approach simplifies activation by accepting the complete URL directly, eliminating the need to parse it for the customer ID and activation token. Returns a CustomerAccessToken for authenticating subsequent requests.


Caution

Store the returned access token securely. It grants access to the customer's account data.


Arguments

•URL!
required

The customer activation URL.

•String!
required

A new password set during activation.


•mutation

Creates a new Customer account with the provided contact information and login credentials. The customer can then sign in for things such as accessing their account, viewing order history, and managing saved addresses.


Caution

This mutation creates customer credentials. Ensure passwords are collected securely and never logged or exposed in client-side code.


Arguments

•CustomerCreateInput!
required

The fields used to create a new customer.


•mutation

Updates the default address of an existing Customer. Requires a customer access token to identify the customer and an address ID to specify which address to set as the new default.

Arguments

•String!
required

The access token used to identify the customer.

•ID!
required

ID of the address to set as the new default for the customer.


•mutation

Resets a customer's password using the reset token from a password recovery email. On success, returns the updated Customer and a new CustomerAccessToken for immediate authentication.

Use the customerRecover mutation to send the password recovery email that provides the reset token. Alternatively, use customerResetByUrl if you have the full reset URL instead of the customer ID and token.


Caution

This mutation handles sensitive customer credentials. Validate password requirements on the client before submission.


Arguments

•ID!
required

Specifies the customer to reset.

•CustomerResetInput!
required

The fields used to reset a customer’s password.


•mutation

Resets a customer's password using the reset URL from a password recovery email. The reset URL is generated by the customerRecover mutation.

On success, returns the updated Customer and a new CustomerAccessToken for immediate authentication.


Caution

This mutation handles customer credentials. Ensure the new password is transmitted securely and never logged or exposed in client-side code.


Arguments

•URL!
required

The customer's reset password url.

•String!
required

New password that will be set as part of the reset password process.


•mutation

Updates a customer's personal information such as name, password, and marketing preferences. Requires a valid CustomerAccessToken to authenticate the customer making the update.

If the customer's password is updated, then all previous access tokens become invalid. The mutation returns a new access token in the payload to maintain the customer's session.


Caution

Password changes invalidate all existing access tokens. Ensure your app handles the new token returned in the response to avoid logging the customer out.


Arguments

•String!
required

The access token used to identify the customer.

•CustomerUpdateInput!
required

The customer object input.



Was this section helpful?


Was this section helpful?