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

Commit c82d8d1

Browse files
authored
Merge branch '2.4.1-develop' into kh_graphql-giftcard-idv2
2 parents e7f6065 + ca00b80 commit c82d8d1

14 files changed

+566
-28
lines changed

src/_data/toc/graphql.yml

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,10 @@ pages:
172172
- label: createCustomer mutation
173173
url: /graphql/mutations/create-customer.html
174174

175+
- label: createCustomerV2 mutation
176+
url: /graphql/mutations/create-customer-v2.html
177+
exclude_versions: ["2.3"]
178+
175179
- label: createCustomerAddress mutation
176180
url: /graphql/mutations/create-customer-address.html
177181

@@ -243,13 +247,13 @@ pages:
243247
- label: sendEmailToFriend mutation
244248
url: /graphql/mutations/send-email-to-friend.html
245249

246-
- label: subscribeEmailToNewsletter mutation
247-
url: /graphql/mutations/subscribe-email-to-newsletter.html
248-
exclude_versions: ["2.3"]
249-
250250
- label: setBillingAddressesOnCart mutation
251251
url: /graphql/mutations/set-billing-address.html
252252

253+
- label: setGiftOptionsOnCart mutation
254+
url: /graphql/mutations/set-gift-options.html
255+
exclude_versions: ["2.3"]
256+
253257
- label: setGuestEmailOnCart mutation
254258
url: /graphql/mutations/set-guest-email.html
255259

@@ -265,12 +269,24 @@ pages:
265269
- label: setShippingMethodsOnCart mutation
266270
url: /graphql/mutations/set-shipping-method.html
267271

272+
- label: subscribeEmailToNewsletter mutation
273+
url: /graphql/mutations/subscribe-email-to-newsletter.html
274+
exclude_versions: ["2.3"]
275+
268276
- label: updateCartItems mutation
269277
url: /graphql/mutations/update-cart-items.html
270278

271279
- label: updateCustomer mutation
272280
url: /graphql/mutations/update-customer.html
273281

282+
- label: updateCustomerEmail mutation
283+
url: /graphql/mutations/update-customer-email.html
284+
exclude_versions: ["2.3"]
285+
286+
- label: updateCustomerV2 mutation
287+
url: /graphql/mutations/update-customer-v2.html
288+
exclude_versions: ["2.3"]
289+
274290
- label: updateCustomerAddress mutation
275291
url: /graphql/mutations/update-customer-address.html
276292

src/_includes/graphql/cart-object-24.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,18 @@ Attribute | Data Type | Description
55
`applied_gift_cards` | [[`AppliedGiftCard`]][AppliedGiftCard] | An array of `AppliedGiftCard` objects. An `AppliedGiftCard` object contains the `code` text attribute, which specifies the gift card code. `applied_gift_cards` is a Commerce-only attribute, defined in the GiftCardAccountGraphQl module
66
`applied_reward_points`| [`RewardPointsAmount`][RewardPointsAmount] | The amount of reward points applied to the cart
77
`applied_store_credit` | [`AppliedStoreCredit`][AppliedStoreCredit] | Contains store credit information applied to the cart. `applied_store_credit` is a Commerce-only attribute, defined in the CustomerBalanceGraphQl module
8+
`available_gift_wrappings` | [GiftWrapping]! | The list of available gift wrapping options for the cart
89
`available_payment_methods` | [[AvailablePaymentMethod]][AvailablePaymentMethod] | Available payment methods
910
`billing_address` | [BillingCartAddress][BillingCartAddress] | Contains the billing address specified in the customer's cart
1011
`email` | String | The customer's email address
1112
`gift_message` | [GiftMessage][GiftMessage] | A gift message added to the cart
13+
`gift_receipt_included` | Boolean! | Indicates if the customer requested a gift receipt for the cart
14+
`gift_wrapping` | GiftWrapping | The selected gift wrapping for the cart
1215
`id` | ID! | The ID of the cart
1316
`is_virtual` | Boolean! | Indicates whether the cart contains only virtual products
1417
`items` | [[CartItemInterface]][CartItemInterface] | Contains the items in the customer's cart
1518
`prices` | [CartPrices][CartPrices] | Contains subtotals and totals
19+
`printed_card_included` | Boolean! | Indicates if the customer requested a printed card for the cart
1620
`selected_payment_method` | [SelectedPaymentMethod][SelectedPaymentMethod] | Selected payment method
1721
`shipping_addresses` | [[ShippingCartAddress]][ShippingCartAddress]! | Contains one or more shipping addresses
1822
`total_quantity` | Float! | Total Quantity of products in the cart

src/_includes/graphql/customer-orders-output.md

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,18 @@ Attribute | Data type | Description
4747
`created_at` | String | Deprecated. Use the `order_date` attribute instead
4848
`credit_memos` | [[CreditMemo](#CreditMemo)] | Contains a list of credit memos for the order
4949
`grand_total` | Float | Deprecated. Use the `totals.grand_total` attribute instead
50+
`gift_message` | [GiftMessage](#GiftMessage) | The entered gift message for the order
51+
`gift_receipt_included` | Boolean! | Indicates if the customer requested a gift receipt for the order
52+
`gift_wrapping` | [GiftWrapping](#GiftWrapping) | The selected gift wrapping for the order
5053
`id` | ID! | Unique identifier for the order
5154
`increment_id` | String | Deprecated. Use the `id` attribute instead
5255
`invoices` | [[Invoice](#Invoice)]! | Contains a list of invoices for the order
5356
`items` | [[OrderItemInterface](#OrderItemInterface)] | An array containing the items purchased in this order
5457
`number` | String! | The order number
5558
`order_date` | String! | The date the order was placed
5659
`order_number` | String! | Deprecated. Use the `number` attribute instead
57-
`payment_methods` | [[OrderPaymentMethod](#OrderPaymentMethod)] | Payment details for the order
60+
`payment_methods` | [[PaymentMethod](#PaymentMethod)] | Payment details for the order
61+
`printed_card_included` | Boolean! | Indicates if the customer requested a printed card for the order
5862
`shipments` | [[OrderShipment](#OrderShipment)] | Shipment list for the order
5963
`shipping_address` | [OrderAddress](#OrderAddress) | Shipping address for the order
6064
`shipping_method` | String | Shipping method for the order
@@ -227,6 +231,14 @@ Attribute | Data type | Description
227231
--- | --- | ---
228232
`gift_card` | [GiftCardItem](#GiftCardItem) | Selected gift card properties for a shipped item
229233

234+
### GiftMessage attributes {#GiftMessage}
235+
236+
{% include graphql/gift-message.md %}
237+
238+
### GiftWrapping attributes {#GiftWrapping}
239+
240+
{% include graphql/gift-wrapping.md %}
241+
230242
#### Invoice attributes {#Invoice}
231243

232244
The `Invoice` object provides details about a customer invoice.
@@ -358,16 +370,6 @@ Attribute | Data type | Description
358370
`label` | String! | The name of the option
359371
`value` | String! | The value of the option
360372

361-
#### OrderPaymentMethod attributes {#OrderPaymentMethod}
362-
363-
The OrderPaymentMethod data type contains details about the payment method used to pay for the order.
364-
365-
Attribute | Data type | Description
366-
--- | --- | ---
367-
`additional_data` | [[KeyValue](#KeyValue)] | Additional data per payment method type
368-
`name` | String! | The label that describes the payment method
369-
`type` | String! | The payment method code that indicates how the order was paid for
370-
371373
#### OrderShipment attributes {#OrderShipment}
372374

373375
Attribute | Data type | Description
@@ -393,6 +395,16 @@ Attribute | Data type | Description
393395
`total_shipping` | Money! | The shipping costs for the order
394396
`total_tax` | Money! | The amount of tax applied to the order
395397

398+
#### PaymentMethod attributes {#PaymentMethod}
399+
400+
The PaymentMethod data type contains details about the payment method used to pay for the order.
401+
402+
Attribute | Data type | Description
403+
--- | --- | ---
404+
`additional_data` | [[KeyValue](#KeyValue)] | Additional data per payment method type
405+
`name` | String! | The label that describes the payment method
406+
`type` | String! | The payment method code that indicates how the order was paid for
407+
396408
#### RewardPoints attributes {#RewardPoints}
397409

398410
The `RewardPoints` object provides details about the customer's reward points balance, history, and related information.

src/_includes/graphql/gift-message.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
The `GiftMessage` object can contain the following attributes.
2+
3+
Attribute | Data Type | Description
4+
--- | --- | ---
5+
`from` | String! | The name of the gift sender
6+
`message` | String! | The text of the gift message
7+
`to` | String! | The name of the gift recipient
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
The `GiftWrapping` object can contain the following attributes.
2+
3+
Attribute | Data Type | Description
4+
--- | --- | ---
5+
`design` | String! | The name of the gift wrapping design
6+
`id` | ID! | The unique identifier for the gift wrapping option
7+
`image` | [GiftWrappingImage](#GiftWrappingImage) | The preview image for the gift wrapping option
8+
`price` | Money! | The price of the gift wrapping option
9+
10+
### GiftWrappingImage object {#GiftWrappingImage}
11+
12+
The `GiftWrappingImage` object must contain the following attributes.
13+
14+
Attribute | Data Type | Description
15+
--- | --- | ---
16+
`label` | String! | The label of the gift wrapping preview image
17+
`url` | String! | The URL of the gift wrapping preview image
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
---
2+
group: graphql
3+
title: createCustomerV2 mutation
4+
---
5+
6+
The `createCustomerV2` mutation creates a customer account. Use the [`createCustomerAddress` mutation]({{page.baseurl}}/graphql/mutations/create-customer-address.html) to complete the customer profile and define billing and shipping addresses.
7+
8+
The `createCustomerV2` mutation replaces the `createCustomer` mutation as the means to create a customer account. The input objects differ between these two mutations. The `createCustomer` mutation required the `CustomerInput` object, as did the `updateCustomer` mutation. The attributes required for creating a customer are different than those for updating a customer, but you could not determine this by looking at the schema. The `createCustomerV2` mutation requires the `CustomerCreateInput` object, which it does not share with the [`updateCustomerV2` mutation]({{page.baseurl}}/graphql/mutations/update-customer-v2.html).
9+
10+
## Syntax
11+
12+
`mutation: {createCustomerV2(input: CustomerCreateInput!) {CustomerOutput}}`
13+
14+
## Example usage
15+
16+
The following call creates a new customer.
17+
18+
**Request:**
19+
20+
```graphql
21+
mutation {
22+
createCustomerV2(
23+
input: {
24+
firstname: "Bob"
25+
lastname: "Loblaw"
26+
27+
password: "b0bl0bl@w"
28+
is_subscribed: true
29+
}
30+
) {
31+
customer {
32+
firstname
33+
lastname
34+
email
35+
is_subscribed
36+
}
37+
}
38+
}
39+
```
40+
41+
**Response:**
42+
43+
```json
44+
{
45+
"data": {
46+
"createCustomer": {
47+
"customer": {
48+
"firstname": "Bob",
49+
"lastname": "Loblaw",
50+
"email": "[email protected]",
51+
"is_subscribed": true
52+
}
53+
}
54+
}
55+
}
56+
```
57+
58+
## Input attributes
59+
60+
The following table lists the attributes you can use as input for the `createCustomerV2` mutation.
61+
62+
Attribute | Data Type | Description
63+
--- | --- | ---
64+
`date_of_birth` | String | The customer’s date of birth
65+
`dob` | String | Deprecated. Use `date_of_birth` instead. The customer’s date of birth
66+
`email` | String! | The customer’s email address
67+
`firstname` | String! | The customer’s first name
68+
`gender` | Int | The customer's gender (Male - 1, Female - 2)
69+
`is_subscribed` | Boolean | Indicates whether the customer subscribes to the store's newsletter
70+
`lastname` | String! | The customer’s last name
71+
`middlename` | String | The customer’s middle name
72+
`password` | String | The customer's password
73+
`prefix` | String | An honorific, such as Dr., Mr., or Mrs.
74+
`suffix` | String | A value such as Sr., Jr., or III
75+
`taxvat` | String | The customer’s Tax/VAT number (for corporate customers)
76+
77+
## Output attributes
78+
79+
The `CustomerOutput` object contains the `Customer` object.
80+
81+
The following table lists the top-level attributes of the `customer` object. See the [`customer` query]({{page.baseurl}}/graphql/queries/customer.html) for complete details about this object.
82+
83+
{% include graphql/customer-output-24.md %}
84+
85+
## Errors
86+
87+
Error | Description
88+
--- | ---
89+
`A customer with the same email address already exists in an associated website.` | The email provided in the `input`.`email` argument belongs to an existing customer.
90+
`"Email" is not a valid email address.` | The value provided in the `input`.`email` argument has an invalid format.
91+
`Field CustomerInput.email of required type String! was not provided` | The `input`.`email` argument was omitted.
92+
`Field "xxx" is not defined by type CustomerInput.` | The `input`.`xxx` argument is undefined.
93+
`Required parameters are missing: First Name` | The `input`.`firstname` argument was omitted or contains an empty value.
94+
95+
## Related topics
96+
97+
* [customer query]({{page.baseurl}}/graphql/queries/customer.html)
98+
* [updateCustomerV2 mutation]({{page.baseurl}}/graphql/mutations/update-customer-v2.html)
99+
* [createCustomerAddress mutation]({{page.baseurl}}/graphql/mutations/create-customer-address.html)
100+
* [updateCustomerAddress mutation]({{page.baseurl}}/graphql/mutations/update-customer-address.html)
101+
* [deleteCustomerAddress mutation]({{page.baseurl}}/graphql/mutations/delete-customer-address.html)

src/guides/v2.4/graphql/mutations/create-customer.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ group: graphql
33
title: createCustomer mutation
44
---
55

6+
{:.bs-callout-warning}
7+
The `createCustomer` mutation has been deprecated. Use the [createCustomerV2]({{page.baseurl}}/graphql/mutations/create-customer-v2.html) mutation instead.
8+
69
Use the `createCustomer` mutation to create a new customer.
710

811
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).

0 commit comments

Comments
 (0)