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

Commit 24818b0

Browse files
authored
Merge pull request #5124 from magento/em_magedoc-3973
Migrating Customer endpoint to new directories as per Magedoc3973
2 parents b29dcf6 + f2ca438 commit 24818b0

22 files changed

+1019
-809
lines changed

_data/toc/graphql.yml

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ pages:
7171
- label: customAttributeMetadata query
7272
url: /graphql/queries/custom-attribute-metadata.html
7373

74+
- label: customer query
75+
url: /graphql/queries/customer.html
76+
7477
- label: customerOrders query
7578
url: /graphql/queries/customer-orders.html
7679

@@ -86,6 +89,9 @@ pages:
8689
- label: getPayflowLinkToken query
8790
url: /graphql/queries/get-payflow-link-token.html
8891

92+
- label: isEmailAvailable query
93+
url: /graphql/queries/is-email-available.html
94+
8995
- label: products query
9096
url: /graphql/queries/products.html
9197

@@ -106,12 +112,27 @@ pages:
106112
- label: applyStoreCreditToCart mutation
107113
url: /graphql/mutations/apply-store-credit.html
108114

115+
- label: changeCustomerPassword mutation
116+
url: /graphql/mutations/change-customer-password.html
117+
118+
- label: createCustomerAddress mutation
119+
url: /graphql/mutations/create-customer-address.html
120+
121+
- label: createCustomer mutation
122+
url: /graphql/mutations/create-customer.html
123+
109124
- label: createPayflowProToken mutation
110125
url: /graphql/mutations/create-payflow-pro-token.html
111126

127+
- label: deleteCustomerAddress mutation
128+
url: /graphql/mutations/delete-customer-address.html
129+
112130
- label: deletePaymentToken mutation
113131
url: /graphql/mutations/delete-payment-token.html
114132

133+
- label: generateCustomerToken mutation
134+
url: /graphql/mutations/generate-customer-token.html
135+
115136
- label: handlePayflowProResponse mutation
116137
url: /graphql/mutations/handle-payflow-pro-response.html
117138

@@ -124,6 +145,15 @@ pages:
124145
- label: removeStoreCreditFromCart mutation
125146
url: /graphql/mutations/remove-store-credit.html
126147

148+
- label: revokeCustomerToken mutation
149+
url: /graphql/mutations/revoke-customer-token.html
150+
151+
- label: updateCustomerAddress mutation
152+
url: /graphql/mutations/update-customer-address.html
153+
154+
- label: updateCustomer mutation
155+
url: /graphql/mutations/update-customer.html
156+
127157
- label: Product data types and interfaces
128158
children:
129159
- label: Product interface implementations
@@ -149,9 +179,6 @@ pages:
149179

150180
- label: Reference
151181
children:
152-
- label: Customer endpoint
153-
url: /graphql/reference/customer.html
154-
155182
- label: Quote endpoint (cart query)
156183
url: /graphql/reference/quote.html
157184
children:

_includes/graphql/create-customer.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Attribute | Data Type | Description
2+
--- | --- | ---
3+
`dob` | String | The customer’s date of birth
4+
`email` | String | The customer’s email address. Required to create a customer
5+
`firstname` | String | The customer’s first name. Required to create a customer
6+
`gender` | Int | The customer's gender (Male - 1, Female - 2)
7+
`is_subscribed` | Boolean | The customer's new password
8+
`lastname` | String | The customer’s last name. Required to create a customer
9+
`middlename` | String | The customer’s middle name
10+
`password` | String | The customer's password. Required to create a customer
11+
`prefix` | String | An honorific, such as Dr., Mr., or Mrs.
12+
`suffix` | String | A value such as Sr., Jr., or III
13+
`taxvat` | String | The customer’s Tax/VAT number (for corporate customers)
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
### CustomerAddress input {#customerAddressInput}
2+
3+
The `CustomerAddress` input can contain the following attributes:
4+
5+
Attribute | Data Type | Description
6+
--- | --- | ---
7+
`city` | String | The city or town
8+
`company` | String | The customer's company
9+
`country_id` | String | The customer's country
10+
`custom_attributes` | [CustomerAddressAttribute](#customerAddressAttributeInput) | Address custom attributes
11+
`customer_id` | Int | The customer ID
12+
`default_billing` | Boolean | Indicates whether the address is the default billing address
13+
`default_shipping` | Boolean | Indicates whether the address is the default shipping address
14+
`extension_attributes` | [CustomerAddressAttribute](#customerAddressAttributeInput) | Address extension attributes
15+
`fax` | String | The fax number
16+
`firstname` | String | The first name of the person associated with the shipping/billing address
17+
`id` | Int | The ID assigned to the address object
18+
`lastname` | String | The family name of the person associated with the shipping/billing address
19+
`middlename` | String | The middle name of the person associated with the shipping/billing address
20+
`postcode` | String | The customer's ZIP or postal code
21+
`prefix` | String | An honorific, such as Dr., Mr., or Mrs.
22+
`region` | [CustomerAddressRegion](#customerAddressRegionInput) | An object that defines the customer's state or province
23+
`region_id` | Int | A number that uniquely identifies the state, province, or other area
24+
`street` | [String] | An array of strings that define the street number and name
25+
`suffix` | String | A value such as Sr., Jr., or III
26+
`telephone` | String | The telephone number
27+
`vat_id` | String | The customer's Tax/VAT number (for corporate customers)
28+
29+
### CustomerAddressAttribute input {#customerAddressAttributeInput}
30+
31+
The `CustomerAddressAttribute` input can contain the following attributes:
32+
33+
Attribute | Data Type | Description
34+
--- | --- | ---
35+
`attribute_code` | String | Attribute code
36+
`value` | String | Attribute value
37+
38+
### CustomerAddressRegion input {#customerAddressRegionInput}
39+
40+
The `customerAddressRegion` input can contain the following attributes:
41+
42+
Attribute | Data Type | Description
43+
--- | --- | ---
44+
`region_code` | String | The address region code
45+
`region` | String | The state or province name
46+
`region_id` | Int | Uniquely identifies the region
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
### CustomerAddress output {#customerAddressOutput}
2+
3+
The values assigned to attributes such as `firstname` and `lastname` in this object may be different from those defined in the `Customer` object.
4+
5+
The `CustomerAddress` output returns the following attributes:
6+
7+
Attribute | Data Type | Description
8+
--- | --- | ---
9+
`city` | String | The city or town
10+
`company` | String | The customer's company
11+
`country_id` | String | The customer's country
12+
`custom_attributes` | [CustomerAddressAttribute](#customerAddressAttributeOutput) | Address custom attributes
13+
`customer_id` | Int | The customer ID
14+
`default_billing` | Boolean | Indicates whether the address is the default billing address
15+
`default_shipping` | Boolean | Indicates whether the address is the default shipping address
16+
`extension_attributes` | [CustomerAddressAttribute](#customerAddressAttributeOutput) | Address extension attributes
17+
`fax` | String | The fax number
18+
`firstname` | String | The first name of the person associated with the shipping/billing address
19+
`id` | Int | The ID assigned to the address object
20+
`lastname` | String | The family name of the person associated with the shipping/billing address
21+
`middlename` | String | The middle name of the person associated with the shipping/billing address
22+
`postcode` | String | The customer's ZIP or postal code
23+
`prefix` | String | An honorific, such as Dr., Mr., or Mrs.
24+
`region` | [CustomerAddressRegion](#customerAddressRegionOutput) | An object that defines the customer's state or province
25+
`region_id` | Int | A number that uniquely identifies the state, province, or other area
26+
`street` | [String] | An array of strings that define the street number and name
27+
`suffix` | String | A value such as Sr., Jr., or III
28+
`telephone` | String | The telephone number
29+
`vat_id` | String | The customer's Tax/VAT number (for corporate customers)
30+
31+
### CustomerAddressAttribute output {#customerAddressAttributeOutput}
32+
33+
The `CustomerAddressAttribute` output returns the following attributes:
34+
35+
Attribute | Data Type | Description
36+
--- | --- | ---
37+
`attribute_code` | String | Attribute code
38+
`value` | String | Attribute value
39+
40+
### CustomerAddressRegion output {#customerAddressRegionOutput}
41+
42+
The `customerAddressRegion` output returns the following attributes:
43+
44+
Attribute | Data Type | Description
45+
--- | --- | ---
46+
`region_code` | String | The address region code
47+
`region` | String | The state or province name
48+
`region_id` | Int | Uniquely identifies the region

_includes/graphql/customer-input.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Attribute | Data Type | Description
2+
--- | --- | ---
3+
`addresses` | [CustomerAddress](#customerAddressInput) | An array containing the customer's shipping and billing addresses
4+
`created_at` | String | Timestamp indicating when the account was created
5+
`default_billing` | String | The ID assigned to the billing address
6+
`default_shipping` | String | The ID assigned to the shipping address
7+
`dob` | String | The customer's date of birth
8+
`email` | String | The customer's email address
9+
`firstname` | String | The customer's first name
10+
`gender` | Int | The customer's gender (Male - 1, Female - 2)
11+
`group_id` | Int | The group assigned to the user. Default values are 0 (Not logged in), 1 (General), 2 (Wholesale), and 3 (Retailer)
12+
`id` | Int | The ID assigned to the customer
13+
`is_subscribed` | Boolean | Indicates whether the customer is subscribed to the company's newsletter
14+
`lastname` | String | The customer's family name
15+
`middlename` |String | The customer's middle name
16+
`prefix` | String | An honorific, such as Dr., Mr., or Mrs.
17+
`suffix` | String | A value such as Sr., Jr., or III
18+
`taxvat` | String | The customer's Tax/VAT number (for corporate customers)
19+
20+
{% include graphql/customer-address-input.md %}

_includes/graphql/customer-output.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Attribute | Data Type | Description
2+
--- | --- | ---
3+
`addresses` | [CustomerAddress](#customerAddressOutput) | An array containing the customer's shipping and billing addresses
4+
`created_at` | String | Timestamp indicating when the account was created
5+
`default_billing` | String | The ID assigned to the billing address
6+
`default_shipping` | String | The ID assigned to the shipping address
7+
`dob` | String | The customer's date of birth
8+
`email` | String | The customer's email address
9+
`firstname` | String | The customer's first name
10+
`gender` | Int | The customer's gender (Male - 1, Female - 2)
11+
`group_id` | Int | The group assigned to the user. Default values are 0 (Not logged in), 1 (General), 2 (Wholesale), and 3 (Retailer)
12+
`id` | Int | The ID assigned to the customer
13+
`is_subscribed` | Boolean | Indicates whether the customer is subscribed to the company's newsletter
14+
`lastname` | String | The customer's family name
15+
`middlename` |String | The customer's middle name
16+
`prefix` | String | An honorific, such as Dr., Mr., or Mrs.
17+
`suffix` | String | A value such as Sr., Jr., or III
18+
`taxvat` | String | The customer's Tax/VAT number (for corporate customers)
19+
20+
{% include graphql/customer-address-output.md %}

guides/v2.3/graphql/get-customer-authorization-token.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,4 @@ You can now use this token in the Authorization request header field for any que
3535

3636
![GraphiQL Authorization Bearer]({{ page.baseurl }}/graphql/images/graphql-authorization.png)
3737

38-
If necessary, you also can [revoke the customer's token]({{ page.baseurl }}/graphql/reference/customer.html#revoke-a-customer-token).
38+
If necessary, you also can [revoke the customer's token]({{ page.baseurl }}/graphql/mutations/revoke-customer-token.html).

guides/v2.3/graphql/mutations/apply-store-credit.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ Attribute | Data Type | Description
9191

9292
## Output attributes
9393

94-
The `ApplyStoreCreditToCartOutput` object contains the `Cart` object.
94+
The `ApplyStoreCreditToCartOutput` object returns the `Cart` object.
9595

9696
Attribute | Data Type | Description
9797
--- | --- | ---
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
---
2+
group: graphql
3+
title: changeCustomerPassword mutation
4+
---
5+
6+
Use the `changeCustomerPassword` mutation to change the password for the logged-in customer.
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+
`mutation: {changeCustomerPassword(currentPassword: String!newPassword: String!) {Customer}}`
13+
14+
## Example usage
15+
16+
The following call updates the customer's password.
17+
18+
**Request**
19+
20+
```graphql
21+
mutation {
22+
changeCustomerPassword(
23+
currentPassword: "[email protected]"
24+
newPassword: "[email protected]"
25+
) {
26+
id
27+
email
28+
}
29+
}
30+
```
31+
32+
**Response**
33+
34+
```json
35+
{
36+
"data": {
37+
"changeCustomerPassword": {
38+
"id": 1,
39+
"email": "[email protected]"
40+
}
41+
}
42+
}
43+
```
44+
45+
## Input attributes
46+
47+
The `changeCustomerPassword` object requires the following inputs:
48+
49+
Attribute | Data Type | Description
50+
--- | --- | ---
51+
`currentPassword` | String | The customer's current password
52+
`newPassword` | String | The customer's new password
53+
54+
## Output attributes
55+
56+
The `changeCustomerPassword` mutation returns the `customer` object.
57+
58+
{% include graphql/customer-output.md %}
59+
60+
## Related topics
61+
62+
* [customer query]({{page.baseurl}}/graphql/queries/customer.html)
63+
* [createCustomer mutation]({{page.baseurl}}/graphql/mutations/create-customer.html)
64+
* [updateCustomer mutation]({{page.baseurl}}/graphql/mutations/update-customer.html)

0 commit comments

Comments
 (0)