Edit in GitHubLog an issue

updateCustomer mutation

The updateCustomer mutation updates the customer's personal information.

To return or modify information about a customer, we recommend you use customer tokens in the header of your GraphQL calls. However, you also can use session authentication.

Syntax

mutation: {updateCustomer(input: CustomerInput!) {CustomerOutput}}

Reference

The updateCustomer reference provides detailed information about the types and fields defined in this mutation.

Example usage

The following call updates the first name and email address for a specific customer.

Request:

Copied to your clipboard
mutation {
updateCustomer(
input: {
firstname: "Rob"
email: "robloblaw@example.com"
}
) {
customer {
firstname
email
}
}
}

Response:

Copied to your clipboard
{
"data": {
"updateCustomer": {
"customer": {
"firstname": "Rob",
"email": "robloblaw@example.com"
}
}
}
}

Errors

ErrorDescription
"input" value should be specified
The input argument is empty.
"Email" is not a valid email address.
The value provided in the input.email argument has an invalid format.
Provide the current "password" to change "email".
To change an email address, specify the correct customer password in the password argument.
A customer with the same email address already exists in an associated website.
You cannot apply a new email address to a current customer because another user has the same email address.
Invalid login or password.
The value specified in the password argument is incorrect.
The current customer isn't authorized.
The current customer is not currently logged in, or the customer's token does not exist in the oauth_token table.
  • Privacy
  • Terms of Use
  • Do not sell or share my personal information
  • AdChoices
Copyright © 2024 Adobe. All rights reserved.