Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.

Commit 40c163b

Browse files
authored
Break symlink (#8102)
1 parent 0d4a6c2 commit 40c163b

File tree

1 file changed

+80
-1
lines changed

1 file changed

+80
-1
lines changed

src/guides/v2.4/graphql/mutations/generate-customer-token.md

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
---
2+
group: graphql
3+
title: generateCustomerToken mutation
4+
---
5+
6+
Use the `generateCustomerToken` mutation to create a new customer token.
7+
8+
To return or modify information about a customer, Magento recommends you use customer tokens in the header of your GraphQL calls. However, you also can use [session authentication]({{ page.baseurl }}/get-started/authentication/gs-authentication-session.html).
9+
10+
## Syntax
11+
12+
```graphql
13+
mutation {
14+
generateCustomerToken(
15+
email: String!
16+
password: String!
17+
) {
18+
CustomerToken
19+
}
20+
}
21+
```
22+
23+
## Example usage
24+
25+
The following call creates a new customer token.
26+
27+
**Request:**
28+
29+
```graphql
30+
mutation {
31+
generateCustomerToken(
32+
email: "bobloblaw@example.com"
33+
password: "b0bl0bl@w"
34+
) {
35+
token
36+
}
37+
}
38+
```
39+
40+
**Response:**
41+
42+
```json
43+
{
44+
"data": {
45+
"generateCustomerToken": {
46+
"token": "ar4116zozoagxty1xjn4lj13kim36r6x"
47+
}
48+
}
49+
}
50+
```
51+
52+
## Input attributes
53+
54+
The `generateCustomerToken` mutation requires the following inputs:
55+
56+
Attribute | Data Type | Description
57+
--- | --- | ---
58+
`email` | String | The customer's email address
59+
`password` | String | The customer's password
60+
61+
## Output attributes
62+
63+
The `generateCustomerToken` mutation returns a valid token for the customer.
64+
65+
Attribute | Data Type | Description
66+
--- | --- | ---
67+
`token` | String | The customer token
68+
69+
## Errors
70+
71+
Error | Description
72+
--- | ---
73+
`Specify the "email" value.` | The value specified in the `email` argument is empty.
74+
`Specify the "password" value.` | The value specified value in the `password` argument is empty.
75+
`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.
76+
77+
## Related topics
78+
79+
* [customer query]({{page.baseurl}}/graphql/queries/customer.html)
80+
* [revokeCustomerToken mutation]({{page.baseurl}}/graphql/mutations/revoke-customer-token.html)

0 commit comments

Comments
 (0)