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

Commit 2b4898d

Browse files
committed
fix merge conflict
2 parents eb85ce0 + 151c05f commit 2b4898d

File tree

4 files changed

+349
-29
lines changed

4 files changed

+349
-29
lines changed

src/_data/toc/graphql.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,17 @@ pages:
147147
- label: addVirtualProductsToCart mutation
148148
url: /graphql/mutations/add-virtual-products.html
149149

150+
- label: applyCouponToCart mutation
151+
url: /graphql/mutations/apply-coupon.html
152+
150153
- label: applyGiftCardToCart mutation
151154
url: /graphql/mutations/apply-giftcard.html
152155
edition: ee-only
153156

154-
- label: applyCouponToCart mutation
155-
url: /graphql/mutations/apply-coupon.html
157+
- label: applyRewardPointsToCart mutation
158+
url: /graphql/mutations/apply-reward-points.html
159+
edition: ee-only
160+
exclude_versions: ["2.3"]
156161

157162
- label: applyStoreCreditToCart mutation
158163
url: /graphql/mutations/apply-store-credit.html
@@ -211,6 +216,11 @@ pages:
211216
- label: removeItemFromCart mutation
212217
url: /graphql/mutations/remove-item.html
213218

219+
- label: removeRewardPointsFromCart mutation
220+
url: /graphql/mutations/remove-reward-points.html
221+
edition: ee-only
222+
exclude_versions: ["2.3"]
223+
214224
- label: removeStoreCreditFromCart mutation
215225
url: /graphql/mutations/remove-store-credit.html
216226
edition: ee-only

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

Lines changed: 105 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Attribute | Data type | Description
4343
--- | --- | ---
4444
`billing_address` | [OrderAddress](#OrderAddress) | The billing address for the order
4545
`carrier` | String | The shipping carrier for the order delivery
46-
`comments` | [[CommentItem](#CommentItem)] | Comments on the order
46+
`comments` | [[SalesCommentItem](#SalesCommentItem)] | Comments on the order
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
@@ -69,7 +69,7 @@ The deprecated attributes were previously defined in the `CustomerOrder` object
6969

7070
#### BundleCreditMemoItem attributes {#BundleCreditMemoItem}
7171

72-
The `BundleCreditMemoItem` object implements the [`CreditMemoInterface`](#CreditMemoInterface). It also defines the following attribute:
72+
The `BundleCreditMemoItem` object implements the [`CreditMemoItemInterface`](#CreditMemoItemInterface). It also defines the following attribute:
7373

7474
Attribute | Data type | Description
7575
--- | --- | ---
@@ -99,28 +99,19 @@ Attribute | Data type | Description
9999
--- | --- | ---
100100
`bundle_options` | [[ItemSelectedBundleOption]](#ItemSelectedBundleOption) | A list of bundle options that are assigned to the bundle product
101101

102-
#### CommentItem attributes {#CommentItem}
103-
104-
The `CommentItem` object contains details about a comment applied to an order.
105-
106-
Attribute | Data type | Description
107-
--- | --- | ---
108-
`message` | String!| The text of the message
109-
`timestamp` | String! | The timestamp of the comment
110-
111102
#### CreditMemo attributes {#CreditMemo}
112103

113104
The `CreditMemo` object contains details about credit memos applied to an order.
114105

115106
Attribute | Data type | Description
116107
--- | --- | ---
117-
`comments` | [[CommentItem](#CommentItem)] | Comments on the credit memo
108+
`comments` | [[SalesCommentItem](#SalesCommentItem)] | Comments on the credit memo
118109
`id` | ID! | The unique ID of the credit memo
119110
`items` | [[CreditMemoItem](#CreditMemoItem)] | An array containing details about refunded items
120111
`number` | String! | The sequential credit memo number
121112
`total` | [CreditMemoTotal](#CreditMemoTotal) | Contains details about the total refunded amount
122113

123-
#### CreditMemoInterface attributes {#CreditMemoInterface}
114+
#### CreditMemoItemInterface attributes {#CreditMemoItemInterface}
124115

125116
The `CreditMemoItemInterface` describes a specific credit memo.
126117

@@ -135,7 +126,7 @@ Attribute | Data type | Description
135126

136127
#### CreditMemoItem attributes {#CreditMemoItem}
137128

138-
The `CreditMemoItem` object implements the [`CreditMemoInterface`](#CreditMemoInterface).
129+
The `CreditMemoItem` object implements the [`CreditMemoItemInterface`](#CreditMemoItemInterface).
139130

140131
#### CreditMemoTotal attributes {#CreditMemoTotal}
141132

@@ -162,6 +153,84 @@ Attribute | Data type | Description
162153
`amount` | Money! | The amount of the discount
163154
`label` | String! | A description of the discount
164155

156+
#### DownloadableCreditMemoItem attributes {#DownloadableCreditMemoItem}
157+
158+
The `DownloadableCreditMemoItem` object implements the [`CreditMemoItemInterface`](#CreditMemoItemInterface). It also defines the following attribute:
159+
160+
Attribute | Data type | Description
161+
--- | --- | ---
162+
`downloadable_links` | [[DownloadableItemsLinks]](#DownloadableItemsLinks) | A list of downloadable links that were refunded from the downloadable product
163+
164+
#### DownloadableItemsLinks attributes {#DownloadableItemsLinks}
165+
166+
The `DownloadableProductLinks` object defines characteristics of a downloadable product.
167+
168+
Attribute | Data type | Description
169+
--- | --- | ---
170+
`sort_order` | Int | A number indicating the sort order
171+
`title`| String | The display name of the link
172+
`uid` | ID! | A string that encodes option details
173+
174+
#### DownloadableInvoiceItem attributes {#DownloadableInvoiceItem}
175+
176+
The `DownloadableInvoiceItem` object implements the [`InvoiceItemInterface`](#InvoiceItemInterface). It also defines the following attribute:
177+
178+
Attribute | Data type | Description
179+
--- | --- | ---
180+
`downloadable_links` | [[DownloadableItemsLinks]](#DownloadableItemsLinks) | A list of downloadable links that were invoiced from the downloadable product
181+
182+
#### DownloadableOrderItem attributes {#DownloadableOrderItem}
183+
184+
The `DownloadableOrderItem` object implements the [`OrderItemInterface`](#OrderItemInterface). It also defines the following attribute:
185+
186+
Attribute | Data type | Description
187+
--- | --- | ---
188+
`downloadable_links` | [[DownloadableItemsLinks]](#DownloadableItemsLinks) | A list of downloadable links that were ordered from the downloadable product
189+
190+
#### GiftCardItem attributes {#GiftCardItem}
191+
192+
The `GiftCardItem` object contains selected buyer-entered gift card properties for an order item.
193+
194+
Attribute | Data type | Description
195+
--- | --- | ---
196+
`message`| String | A message provided by the sender to the recipient
197+
`recipient_email` | String | The email provided for the recipient of a virtual gift card
198+
`recipient_name` | String | The name provided for the recipient of a physical or virtual gift card
199+
`sender_email` | String | The sender email provided for a virtual gift card
200+
`sender_name` | String | The sender name provided for a physical or virtual gift card
201+
202+
#### GiftCardCreditMemoItem attributes {#GiftCardOrderItem}
203+
204+
The `GiftCardCreditMemoItem` object implements the [`CreditMemoItemInterface`](#CreditMemoItemInterface). It also defines the following attribute:
205+
206+
Attribute | Data type | Description
207+
--- | --- | ---
208+
`gift_card` | [GiftCardItem](#GiftCardItem) | Selected gift card properties for a refunded item
209+
210+
#### GiftCardInvoiceItem attributes {#GiftCardInvoiceItem}
211+
212+
The `GiftCardInvoiceItem` object implements the [`InvoiceItemInterface`](#InvoiceItemInterface). It also defines the following attribute:
213+
214+
Attribute | Data type | Description
215+
--- | --- | ---
216+
`gift_card` | [GiftCardItem](#GiftCardItem) | Selected gift card properties for an invoiced item
217+
218+
#### GiftCardOrderItem attributes {#GiftCardOrderItem}
219+
220+
The `GiftCardOrderItem` object implements the [`OrderItemInterface`](#OrderItemInterface). It also defines the following attribute:
221+
222+
Attribute | Data type | Description
223+
--- | --- | ---
224+
`gift_card` | [GiftCardItem](#GiftCardItem) | Selected gift card properties for an order item
225+
226+
#### GiftCardShipmentItem attributes {#GiftCardShipmentItem}
227+
228+
The `GiftCardShipmentItem` object implements the [`ShipmentItemInterface`](#ShipmentItemInterface). It also defines the following attribute:
229+
230+
Attribute | Data type | Description
231+
--- | --- | ---
232+
`gift_card` | [GiftCardItem](#GiftCardItem) | Selected gift card properties for a shipped item
233+
165234
### GiftMessage attributes {#GiftMessage}
166235

167236
{% include graphql/gift-message.md %}
@@ -176,7 +245,7 @@ The `Invoice` object provides details about a customer invoice.
176245

177246
Attribute | Data type | Description
178247
--- | --- | ---
179-
`comments` | [[CommentItem](#CommentItem)] | Comments on the invoice
248+
`comments` | [[SalesCommentItem](#SalesCommentItem)] | Comments on the invoice
180249
`id` | ID! | The internal ID of the invoice
181250
`items` | [[InvoiceItemInterface](#InvoiceItemInterface)]! | Contains details about invoiced products
182251
`number` | String! | The sequential number of the invoice
@@ -298,14 +367,24 @@ Attribute | Data type | Description
298367

299368
Attribute | Data type | Description
300369
--- | --- | ---
301-
`id` | String! | The name of the option
370+
`label` | String! | The name of the option
302371
`value` | String! | The value of the option
303372

373+
#### OrderPaymentMethod attributes {#OrderPaymentMethod}
374+
375+
The OrderPaymentMethod data type contains details about the payment method used to pay for the order.
376+
377+
Attribute | Data type | Description
378+
--- | --- | ---
379+
`additional_data` | [[KeyValue](#KeyValue)] | Additional data per payment method type
380+
`name` | String! | The label that describes the payment method
381+
`type` | String! | The payment method code that indicates how the order was paid for
382+
304383
#### OrderShipment attributes {#OrderShipment}
305384

306385
Attribute | Data type | Description
307386
--- | --- | ---
308-
`comments` | [[CommentItem](#CommentItem)] | Comments added to the shipment
387+
`comments` | [[SalesCommentItem](#SalesCommentItem)] | Comments added to the shipment
309388
`id` | ID! | The unique ID of the shipment
310389
`items` | [[ShipmentItemInterface](#ShipmentItemInterface)] | Contains items included in the shipment
311390
`number` | String! | The sequential credit shipment number
@@ -326,16 +405,6 @@ Attribute | Data type | Description
326405
`total_shipping` | Money! | The shipping costs for the order
327406
`total_tax` | Money! | The amount of tax applied to the order
328407

329-
#### PaymentMethod attributes {#PaymentMethod}
330-
331-
The PaymentMethod data type contains details about the payment method used to pay for the order.
332-
333-
Attribute | Data type | Description
334-
--- | --- | ---
335-
`additional_data` | [[KeyValue](#KeyValue)] | Additional data per payment method type
336-
`name` | String! | The label that describes the payment method
337-
`type` | String! | The payment method code that indicates how the order was paid for
338-
339408
#### RewardPoints attributes {#RewardPoints}
340409

341410
The `RewardPoints` object provides details about the customer's reward points balance, history, and related information.
@@ -394,6 +463,15 @@ Attribute | Data type | Description
394463
`balance_updates` | RewardPointsSubscriptionStatusesEnum! | Customer subscription status to 'Reward points balance updates' emails
395464
`points_expiration_notifications` | RewardPointsSubscriptionStatusesEnum! | Customer subscription status to 'Reward points expiration notifications' emails
396465

466+
#### SalesCommentItem attributes {#SalesCommentItem}
467+
468+
The `SalesCommentItem` object contains details about a comment applied to an order.
469+
470+
Attribute | Data type | Description
471+
--- | --- | ---
472+
`message` | String!| The text of the message
473+
`timestamp` | String! | The timestamp of the comment
474+
397475
#### SalesItemOption attributes {#SalesItemOption}
398476

399477
The `SalesItemOption` data type contains the ID and value for the selected or entered options.
Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
---
2+
group: graphql
3+
title: applyRewardPointsToCart mutation
4+
ee_only: True
5+
---
6+
7+
The `applyRewardPointsToCart` mutation applies reward points to the customer's cart. You cannot specify a quantity of reward points. If the reward points balance is less than the cart total, Magento applies the entire reward points balance. Otherwise, Magento applies as many reward points needed to bring the total to 0. Fractional reward points are discarded.
8+
9+
Use the [`removeRewardPointsFromCart` mutation]({{page.baseurl}}/graphql/mutations/remove-reward-points.html) to undo the results of the `applyRewardPointsToCart` mutation.
10+
11+
## Syntax
12+
13+
`mutation: applyRewardPointsToCart(cartId: ID!): ApplyRewardPointsToCartOutput`
14+
15+
## Example usage
16+
17+
The following example applies $5 to the cart. In this example, the exchange rate is defined as 25 reward points equals $5.
18+
19+
**Request:**
20+
21+
```graphql
22+
mutation {
23+
applyRewardPointsToCart(cartId: "8k0Q4MpH2IGahWrTRtqM61YV2MtLPApz")
24+
{
25+
cart {
26+
items {
27+
quantity
28+
product {
29+
sku
30+
name
31+
price_range {
32+
maximum_price {
33+
final_price {
34+
currency
35+
value
36+
}
37+
}
38+
}
39+
}
40+
}
41+
applied_reward_points {
42+
money {
43+
currency
44+
value
45+
}
46+
points
47+
}
48+
prices {
49+
grand_total {
50+
currency
51+
value
52+
}
53+
applied_taxes {
54+
amount {
55+
currency
56+
value
57+
}
58+
}
59+
}
60+
}
61+
}
62+
}
63+
```
64+
65+
**Response:**
66+
67+
```json
68+
{
69+
"data": {
70+
"applyRewardPointsToCart": {
71+
"cart": {
72+
"items": [
73+
{
74+
"quantity": 1,
75+
"product": {
76+
"sku": "WJ04",
77+
"name": "Ingrid Running Jacket",
78+
"price_range": {
79+
"maximum_price": {
80+
"final_price": {
81+
"currency": "USD",
82+
"value": 84
83+
}
84+
}
85+
}
86+
}
87+
}
88+
],
89+
"applied_reward_points": {
90+
"money": {
91+
"currency": "USD",
92+
"value": 5
93+
},
94+
"points": 25
95+
},
96+
"prices": {
97+
"grand_total": {
98+
"currency": "USD",
99+
"value": 90.93
100+
},
101+
"applied_taxes": [
102+
{
103+
"amount": {
104+
"currency": "USD",
105+
"value": 6.93
106+
}
107+
}
108+
]
109+
}
110+
}
111+
}
112+
}
113+
}
114+
```
115+
116+
## Input attributes
117+
118+
The `applyRewardPointsToCart` mutation requires the `cart_id` attribute.
119+
120+
Attribute | Data Type | Description
121+
--- | --- | ---
122+
`cart_id` | String! | The unique ID that identifies the customer's cart
123+
124+
## Output attributes
125+
126+
The `ApplyRewardPointsToCartOutput` object contains the `Cart` object.
127+
128+
Attribute | Data Type | Description
129+
--- | --- | ---
130+
`cart` |[Cart!](#CartObject) | Describes the contents of the specified shopping cart
131+
132+
### Cart object {#CartObject}
133+
134+
{% include graphql/cart-object-24.md %}
135+
136+
[Cart query output]({{page.baseurl}}/graphql/queries/cart.html#cart-output) provides more information about the `Cart` object.

0 commit comments

Comments
 (0)