Customer
Requires 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 mutation.
The object implements the interface, enabling retrieval of custom data associated with the customer.
Anchor to FieldsFields
- acceptsMarketing (Boolean!)
- addresses (MailingAddressConnection!)
- avatarUrl (String)
- createdAt (DateTime!)
- defaultAddress (MailingAddress)
- displayName (String!)
- email (String)
- firstName (String)
- id (ID!)
- lastName (String)
- metafield (Metafield)
- metafields ([Metafield]!)
- numberOfOrders (UnsignedInt64!)
- orders (OrderConnection!)
- phone (String)
- socialLoginProvider (SocialLoginProvider)
- tags ([String!]!)
- updatedAt (DateTime!)
- Anchor to acceptsMarketingaccepts•Boolean!
Marketing non-null Token access required Indicates whether the customer has consented to be sent marketing material via email.
- Anchor to addressesaddresses•Mailing
Address Connection! non-null Token access required A list of addresses for the customer.
- Anchor to firstfirst•Int
Returns up to the first
nelements from the list.- Anchor to afterafter•String
Returns the elements that come after the specified cursor.
- Anchor to lastlast•Int
Returns up to the last
nelements from the list.- Anchor to beforebefore•String
Returns the elements that come before the specified cursor.
- Anchor to reversereverse•BooleanDefault:false
Reverse the order of the underlying list.
Arguments
- Anchor to avatarUrlavatar•String
Url Token access required The URL of the customer's avatar image.
- Anchor to createdAtcreated•Date
At Time! non-null Token access required The date and time when the customer was created.
- Anchor to defaultAddressdefault•Mailing
Address Address Token access required The customer’s default address.
- Anchor to displayNamedisplay•String!
Name non-null Token access required The customer’s name, email or phone number.
- Anchor to emailemail•StringToken access required
The customer’s email address.
- Anchor to firstNamefirst•String
Name Token access required The customer’s first name.
- •ID!non-null Token access required
A unique ID for the customer.
- Anchor to lastNamelast•String
Name Token access required The customer’s last name.
- Anchor to metafieldmetafield•MetafieldToken access required
A custom field, including its
namespaceandkey, that's associated with a Shopify resource for the purposes of adding and storing additional information.- Anchor to namespacenamespace•String
The container the metafield belongs to. If omitted, the app-reserved namespace will be used.
- •String!required
The identifier for the metafield.
Arguments
- Anchor to metafieldsmetafields•[Metafield]!non-null Token access required
A list of custom fields that a merchant associates with a Shopify resource.
- Anchor to identifiersidentifiers•[Has
Metafields Identifier!]! required The list of metafields to retrieve by namespace and key.
The input must not contain more than
250values.
Arguments
- Anchor to numberOfOrdersnumber•Unsigned
Of Orders Int64! non-null Token access required The number of orders that the customer has made at the store in their lifetime.
- Anchor to ordersorders•Order
Connection! non-null Token access required The orders associated with the customer.
- Anchor to firstfirst•Int
Returns up to the first
nelements from the list.- Anchor to afterafter•String
Returns the elements that come after the specified cursor.
- Anchor to lastlast•Int
Returns up to the last
nelements from the list.- Anchor to beforebefore•String
Returns the elements that come before the specified cursor.
- Anchor to reversereverse•BooleanDefault:false
Reverse the order of the underlying list.
- Anchor to sortKeysort•Order
Key Sort Keys Default:ID Sort the underlying list by the given key.
- Anchor to queryquery•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•
Arguments
- Anchor to phonephone•StringToken access required
The customer’s phone number.
- •Social
Login Provider Token access required The social login provider associated with the customer.
- •[String!]!non-null Token access required
A comma separated list of tags that have been added to the customer. Additional access scope required: unauthenticated_read_customer_tags.
- Anchor to updatedAtupdated•Date
At Time! non-null Token access required The date and time when the customer information was updated.
Anchor to QueriesQueries
- customer (Customer)
- •query
Retrieves the
Customerassociated with the provided access token. Use themutation 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.
- Anchor to customerAccessTokencustomer•String!
Access Token required The customer access token.
Arguments
Anchor to MutationsMutations
- customerActivate (CustomerActivatePayload)
- customerActivateByUrl (CustomerActivateByUrlPayload)
- customerCreate (CustomerCreatePayload)
- customerDefaultAddressUpdate (CustomerDefaultAddressUpdatePayload)
- customerReset (CustomerResetPayload)
- customerResetByUrl (CustomerResetByUrlPayload)
- customerUpdate (CustomerUpdatePayload)
- •mutation
Activates a customer account using an activation token received from the
mutation. The customer sets their password during activation and receives afor authenticated access.For a simpler approach that doesn't require parsing the activation URL, use
instead.CautionThis mutation handles customer credentials. Always use HTTPS and never log or expose the password or access token.
Caution:This mutation handles customer credentials. Always use HTTPS and never log or expose the password or access token.
Caution: This mutation handles customer credentials. Always use HTTPS and never log or expose the password or access token.
- •ID!required
Specifies the customer to activate.
- Anchor to inputinput•Customer
Activate Input! required The fields used to activate a customer.
Arguments
- •ID!
- •mutation
Activates a customer account using the full activation URL from the
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 afor authenticating subsequent requests.CautionStore the returned access token securely. It grants access to the customer's account data.
Caution:Store the returned access token securely. It grants access to the customer's account data.
Caution: Store the returned access token securely. It grants access to the customer's account data.
- Anchor to activationUrlactivation•URL!
Url required The customer activation URL.
- Anchor to passwordpassword•String!required
A new password set during activation.
Arguments
- •mutation
Creates a new
Customeraccount 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.CautionThis mutation creates customer credentials. Ensure passwords are collected securely and never logged or exposed in client-side code.
Caution:This mutation creates customer credentials. Ensure passwords are collected securely and never logged or exposed in client-side code.
Caution: This mutation creates customer credentials. Ensure passwords are collected securely and never logged or exposed in client-side code.
- Anchor to inputinput•Customer
Create Input! required The fields used to create a new customer.
Arguments
- •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.- Anchor to customerAccessTokencustomer•String!
Access Token required The access token used to identify the customer.
- Anchor to addressIdaddress•ID!
Id required ID of the address to set as the new default for the customer.
Arguments
- •mutation
Resets a customer's password using the reset token from a password recovery email. On success, returns the updated
Customerand a newfor immediate authentication.Use the
mutation to send the password recovery email that provides the reset token. Alternatively, useif you have the full reset URL instead of the customer ID and token.CautionThis mutation handles sensitive customer credentials. Validate password requirements on the client before submission.
Caution:This mutation handles sensitive customer credentials. Validate password requirements on the client before submission.
Caution: This mutation handles sensitive customer credentials. Validate password requirements on the client before submission.
- •ID!required
Specifies the customer to reset.
- Anchor to inputinput•Customer
Reset Input! required The fields used to reset a customer’s password.
Arguments
- •ID!
- •mutation
Resets a customer's password using the reset URL from a password recovery email. The reset URL is generated by the
mutation.On success, returns the updated
Customerand a newfor immediate authentication.CautionThis mutation handles customer credentials. Ensure the new password is transmitted securely and never logged or exposed in client-side code.
Caution:This mutation handles customer credentials. Ensure the new password is transmitted securely and never logged or exposed in client-side code.
Caution: This mutation handles customer credentials. Ensure the new password is transmitted securely and never logged or exposed in client-side code.
- Anchor to resetUrlreset•URL!
Url required The customer's reset password url.
- Anchor to passwordpassword•String!required
New password that will be set as part of the reset password process.
Arguments
- •mutation
Updates a customer's personal information such as name, password, and marketing preferences. Requires a valid
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.
CautionPassword changes invalidate all existing access tokens. Ensure your app handles the new token returned in the response to avoid logging the customer out.
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.
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.
- Anchor to customerAccessTokencustomer•String!
Access Token required The access token used to identify the customer.
- Anchor to customercustomer•Customer
Update Input! required The customer object input.
Arguments