MageSmith
MutationCustomer · Magento 2.4.9

generateCustomerToken

generateCustomerToken is a Magento 2 GraphQL mutation in the Customer module. Generate a token for specified customer. It returns CustomerToken and requires an Authorization header (Bearer customer token).

Last verified: against Magento 2.4.9.

Returns

CustomerToken

Resolver class

\Magento\CustomerGraphQl\Model\Resolver\GenerateCustomerToken

Arguments

email String! Required

The customer's email address.

password String! Required

The customer's password.

Example request

Auto-generated from the SDL — paste-ready against your store's /graphql endpoint. Replace the host, store code, and any required values before running.

Headers

Content-Type
application/json
Store
default store view code; use 'default' for the single-store baseline
Authorization
Bearer <CUSTOMER_TOKEN>

Query

mutation ($email: String!, $password: String!) {
  generateCustomerToken(email: $email, password: $password) {
    token
  }
}

Variables

{
  "email": "",
  "password": ""
}

Every Magento dev tool, in one hosted workspace.

Free to sign up. Nothing to install. Drafts, audits, and projects saved across every tool.