MageSmith
MutationLoginAsCustomer · Magento 2.4.9

generateCustomerTokenAsAdmin

generateCustomerTokenAsAdmin is a Magento 2 GraphQL mutation in the LoginAsCustomer module. Request a customer token so that an administrator can perform remote shopping assistance. It returns GenerateCustomerTokenAsAdminOutput and requires an Authorization header (Bearer customer token).

Last verified: against Magento 2.4.9.

Returns

GenerateCustomerTokenAsAdminOutput

Resolver class

Magento\LoginAsCustomerGraphQl\Model\Resolver\RequestCustomerToken

Arguments

An input object that defines the customer email address.

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 ($input: GenerateCustomerTokenAsAdminInput!) {
  generateCustomerTokenAsAdmin(input: $input) {
    customer_token
  }
}

Variables

{
  "input": {
    "customer_email": ""
  }
}

Every Magento dev tool, in one hosted workspace.

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