Edit in GitHubLog an issue

generateCustomerToken mutation

Use the generateCustomerToken mutation to create a new customer token.

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

Copied to your clipboard
mutation {
generateCustomerToken(
email: String!
password: String!
) {
token
}
}

Reference

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

Example usage

The following call creates a new customer token.

Request:

Copied to your clipboard
mutation {
generateCustomerToken(
email: "bobloblaw@example.com"
password: "b0bl0bl@w"
) {
token
}
}

Response:

Copied to your clipboard
{
"data": {
"generateCustomerToken": {
"token": "ar4116zozoagxty1xjn4lj13kim36r6x"
}
}
}

Errors

ErrorDescription
Specify the "email" value.
The value specified in the email argument is empty.
Specify the "password" value.
The value specified value in the password argument is empty.
The account sign-in was incorrect or your account is disabled temporarily. Please wait and try again later.
Authentication error. The email or password is incorrect, or the customer account is locked.
This account isn't confirmed. Verify and try again.
Authentication error. The email account is not confirmed.
  • Privacy
  • Terms of Use
  • Do not sell or share my personal information
  • AdChoices
Copyright © 2024 Adobe. All rights reserved.