-
Notifications
You must be signed in to change notification settings - Fork 9.4k
/
Copy pathschema.graphqls
560 lines (479 loc) · 41.2 KB
/
schema.graphqls
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
# Copyright 2024 Adobe
# All Rights Reserved.
type Query {
"""phpcs:ignore Magento2.GraphQL.ValidArgumentName"""
cart(cart_id: String! @doc(description: "The unique ID of the cart to query.")): Cart @resolver (class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\Cart") @doc(description:"Return information about the specified shopping cart.") @cache(cacheable: false)
customerCart: Cart! @resolver (class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\CustomerCart") @doc(description:"Return information about the customer's shopping cart.") @cache(cacheable: false)
}
type Mutation {
createGuestCart(input: CreateGuestCartInput): CreateGuestCartOutput @doc(description: "Create a new shopping cart") @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\CreateGuestCart")
createEmptyCart(input: createEmptyCartInput @doc(description: "An optional input object that assigns the specified ID to the cart.")): String @deprecated(reason: "Use `Mutation.createGuestCart` or `Query.customerCart` for logged in customer") @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\CreateEmptyCart") @doc(description:"Create an empty shopping cart for a guest or logged in user")
addSimpleProductsToCart(input: AddSimpleProductsToCartInput @doc(description: "An input object that defines which simple products to add to the cart.")): AddSimpleProductsToCartOutput @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\AddSimpleProductsToCart") @doc(description:"Add one or more simple products to the specified cart. We recommend using `addProductsToCart` instead.")
addVirtualProductsToCart(input: AddVirtualProductsToCartInput @doc(description: "An input object that defines which virtual products to add to the cart.")): AddVirtualProductsToCartOutput @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\AddSimpleProductsToCart") @doc(description:"Add one or more virtual products to the specified cart. We recommend using `addProductsToCart` instead.")
applyCouponToCart(input: ApplyCouponToCartInput @doc(description: "An input object that defines the coupon code to apply to the cart.")): ApplyCouponToCartOutput @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\ApplyCouponToCart") @doc(description:"Apply a pre-defined coupon code to the specified cart.")
removeCouponFromCart(input: RemoveCouponFromCartInput @doc(description: "An input object that defines which coupon code to remove from the cart.")): RemoveCouponFromCartOutput @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\RemoveCouponFromCart") @doc(description:"Remove a previously-applied coupon from the cart. The cart must contain at least one item in order to remove the coupon.")
updateCartItems(input: UpdateCartItemsInput @doc(description: "An input object that defines products to be updated.")): UpdateCartItemsOutput @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\UpdateCartItems") @doc(description:"Modify items in the cart.")
removeItemFromCart(input: RemoveItemFromCartInput @doc(description: "An input object that defines which products to remove from the cart.")): RemoveItemFromCartOutput @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\RemoveItemFromCart") @doc(description:"Delete the entire quantity of a specified item from the cart. If you remove all items from the cart, the cart continues to exist.")
setShippingAddressesOnCart(input: SetShippingAddressesOnCartInput @doc(description: "An input object that defines one or more shipping addresses to be assigned to the cart.")): SetShippingAddressesOnCartOutput @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\SetShippingAddressesOnCart") @doc(description:"Set one or more shipping addresses on a specific cart.")
setBillingAddressOnCart(input: SetBillingAddressOnCartInput @doc(description: "An input object that defines the billing address to be assigned to the cart.")): SetBillingAddressOnCartOutput @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\SetBillingAddressOnCart") @doc(description:"Set the billing address on a specific cart.")
setShippingMethodsOnCart(input: SetShippingMethodsOnCartInput @doc(description: "An input object that applies one or more shipping methods to the cart.")): SetShippingMethodsOnCartOutput @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\SetShippingMethodsOnCart") @doc(description:"Set one or more delivery methods on a cart.")
setPaymentMethodOnCart(input: SetPaymentMethodOnCartInput @doc(description: "An input object that defines which payment method to apply to the cart.")): SetPaymentMethodOnCartOutput @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\SetPaymentMethodOnCart") @doc(description:"Apply a payment method to the cart.")
setGuestEmailOnCart(input: SetGuestEmailOnCartInput @doc(description: "An input object that defines a guest email address.")): SetGuestEmailOnCartOutput @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\SetGuestEmailOnCart") @doc(description:"Assign the email address of a guest to the cart.")
setPaymentMethodAndPlaceOrder(input: SetPaymentMethodAndPlaceOrderInput): PlaceOrderOutput @deprecated(reason: "Should use setPaymentMethodOnCart and placeOrder mutations in single request.") @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\SetPaymentAndPlaceOrder") @doc(description:"Set the cart payment method and convert the cart into an order.")
"""phpcs:ignore Magento2.GraphQL.ValidArgumentName"""
assignCustomerToGuestCart(cart_id: String!): Cart! @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\AssignCustomerToGuestCart") @doc(description:"Assign a logged-in customer to the specified guest shopping cart.")
"""phpcs:ignore Magento2.GraphQL.ValidArgumentName"""
mergeCarts(source_cart_id: String! @doc(description: "The guest's cart ID before they login."), destination_cart_id: String @doc(description: "The cart ID after the guest logs in.")): Cart! @doc(description:"Transfer the contents of a guest cart into the cart of a logged-in customer.") @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\MergeCarts")
placeOrder(input: PlaceOrderInput @doc(description: "An input object that defines the shopper's cart ID.")): PlaceOrderOutput @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\PlaceOrder") @doc(description:"Convert the quote into an order.")
addProductsToCart(cartId: String! @doc(description: "The cart ID of the shopper."), cartItems: [CartItemInput!]! @doc(description: "An array that defines the products to add to the cart.")): AddProductsToCartOutput @doc(description:"Add any type of product to the cart.") @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\AddProductsToCart")
estimateTotals(input: EstimateTotalsInput! @doc(description: "An input object that specifies details for cart totals estimation")): EstimateTotalsOutput! @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\EstimateTotals") @doc(description: "Estimate totals for cart based on the address")
estimateShippingMethods(input: EstimateTotalsInput! @doc(description: "An input object that specifies details for estimation of available shipping methods")): [AvailableShippingMethod] @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\EstimateShippingMethods") @doc(description: "Estimate shipping method(s) for cart based on address")
}
input CreateGuestCartInput {
cart_uid: ID @doc(description: "Optional client-generated ID")
}
input createEmptyCartInput @doc(description: "Assigns a specific `cart_id` to the empty cart.") {
cart_id: String @doc(description: "The ID to assign to the cart.")
}
input AddSimpleProductsToCartInput @doc(description: "Defines the simple and group products to add to the cart.") {
cart_id: String! @doc(description: "The unique ID of a `Cart` object.")
cart_items: [SimpleProductCartItemInput!]! @doc(description: "An array of simple and group items to add.")
}
input SimpleProductCartItemInput @doc(description: "Defines a single product to add to the cart.") {
data: CartItemInput! @doc(description: "An object containing the `sku`, `quantity`, and other relevant information about the product.")
customizable_options:[CustomizableOptionInput!] @doc(description: "An array that defines customizable options for the product.")
}
input AddVirtualProductsToCartInput @doc(description: "Defines the virtual products to add to the cart.") {
cart_id: String! @doc(description: "The unique ID of a `Cart` object.")
cart_items: [VirtualProductCartItemInput!]! @doc(description: "An array of virtual products to add.")
}
input VirtualProductCartItemInput @doc(description: "Defines a single product to add to the cart.") {
data: CartItemInput! @doc(description: "An object containing the `sku`, `quantity`, and other relevant information about the product.")
customizable_options:[CustomizableOptionInput!] @doc(description: "An array that defines customizable options for the product.")
}
input CartItemInput @doc(description: "Defines an item to be added to the cart.") {
sku: String! @doc(description: "The SKU of the product.")
quantity: Float! @doc(description: "The amount or number of an item to add.")
parent_sku: String @doc(description: "For a child product, the SKU of its parent product.")
selected_options: [ID!] @doc(description: "The selected options for the base product, such as color or size, using the unique ID for an object such as `CustomizableRadioOption`, `CustomizableDropDownOption`, or `ConfigurableProductOptionsValues`.")
entered_options: [EnteredOptionInput!] @doc(description: "An array of entered options for the base product, such as personalization text.")
}
enum SortQuoteItemsEnum @doc(description: "Specifies the field to use for sorting quote items") {
ITEM_ID
CREATED_AT
UPDATED_AT
PRODUCT_ID
SKU
NAME
DESCRIPTION
WEIGHT
QTY
PRICE
BASE_PRICE
CUSTOM_PRICE
DISCOUNT_PERCENT
DISCOUNT_AMOUNT
BASE_DISCOUNT_AMOUNT
TAX_PERCENT
TAX_AMOUNT
BASE_TAX_AMOUNT
ROW_TOTAL
BASE_ROW_TOTAL
ROW_TOTAL_WITH_DISCOUNT
ROW_WEIGHT
PRODUCT_TYPE
BASE_TAX_BEFORE_DISCOUNT
TAX_BEFORE_DISCOUNT
ORIGINAL_CUSTOM_PRICE
PRICE_INC_TAX
BASE_PRICE_INC_TAX
ROW_TOTAL_INC_TAX
BASE_ROW_TOTAL_INC_TAX
DISCOUNT_TAX_COMPENSATION_AMOUNT
BASE_DISCOUNT_TAX_COMPENSATION_AMOUNT
FREE_SHIPPING
}
input QuoteItemsSortInput @doc(description: "Specifies the field to use for sorting quote items") {
field: SortQuoteItemsEnum! @doc(description: "Specifies the quote items field to sort by")
order: SortEnum! @doc(description: "Specifies the order of quote items' sorting")
}
input CustomizableOptionInput @doc(description: "Defines a customizable option.") {
uid: ID @doc(description: "The unique ID for a `CartItemInterface` object.")
id: Int @deprecated(reason: "Use `uid` instead.") @doc(description: "The customizable option ID of the product.")
value_string: String! @doc(description: "The string value of the option.")
}
input ApplyCouponToCartInput @doc(description: "Specifies the coupon code to apply to the cart.") {
cart_id: String! @doc(description: "The unique ID of a `Cart` object.")
coupon_code: String! @doc(description: "A valid coupon code.")
}
input UpdateCartItemsInput @doc(description: "Modifies the specified items in the cart.") {
cart_id: String! @doc(description: "The unique ID of a `Cart` object.")
cart_items: [CartItemUpdateInput!]! @doc(description: "An array of items to be updated.")
}
input CartItemUpdateInput @doc(description: "A single item to be updated.") {
cart_item_id: Int @doc(description: "Deprecated. Use `cart_item_uid` instead.")
cart_item_uid: ID @doc(description: "The unique ID for a `CartItemInterface` object.")
quantity: Float @doc(description: "The new quantity of the item.")
customizable_options: [CustomizableOptionInput!] @doc(description: "An array that defines customizable options for the product.")
}
input RemoveItemFromCartInput @doc(description: "Specifies which items to remove from the cart.") {
cart_id: String! @doc(description: "The unique ID of a `Cart` object.")
cart_item_id: Int @doc(description: "Deprecated. Use `cart_item_uid` instead.")
cart_item_uid: ID @doc(description: "Required field. The unique ID for a `CartItemInterface` object.")
}
input SetShippingAddressesOnCartInput @doc(description: "Specifies an array of addresses to use for shipping.") {
cart_id: String! @doc(description: "The unique ID of a `Cart` object.")
shipping_addresses: [ShippingAddressInput!]! @doc(description: "An array of shipping addresses.")
}
input ShippingAddressInput @doc(description: "Defines a single shipping address.") {
customer_address_id: Int @doc(description: "An ID from the customer's address book that uniquely identifies the address to be used for shipping.")
address: CartAddressInput @doc(description: "Defines a shipping address.")
customer_notes: String @doc(description: "Text provided by the shopper.")
}
input SetBillingAddressOnCartInput @doc(description: "Sets the billing address.") {
cart_id: String! @doc(description: "The unique ID of a `Cart` object.")
billing_address: BillingAddressInput! @doc(description: "The billing address.")
}
input BillingAddressInput @doc(description: "Defines the billing address.") {
customer_address_id: Int @doc(description: "An ID from the customer's address book that uniquely identifies the address to be used for billing.")
address: CartAddressInput @doc(description: "Defines a billing address.")
use_for_shipping: Boolean @doc(description: "Indicates whether to set the shipping address to be the same as this billing address.")
same_as_shipping: Boolean @doc(description: "Indicates whether to set the billing address to be the same as the existing shipping address on the cart.")
}
input CartAddressInput @doc(description: "Defines the billing or shipping address to be applied to the cart.") {
firstname: String! @doc(description: "The first name of the customer or guest.")
lastname: String! @doc(description: "The last name of the customer or guest.")
company: String @doc(description: "The company specified for the billing or shipping address.")
street: [String!]! @doc(description: "An array containing the street for the billing or shipping address.")
city: String! @doc(description: "The city specified for the billing or shipping address.")
region: String @doc(description: "A string that defines the state or province of the billing or shipping address.")
region_id: Int @doc(description: "An integer that defines the state or province of the billing or shipping address.")
postcode: String @doc(description: "The ZIP or postal code of the billing or shipping address.")
country_code: String! @doc(description: "The country code and label for the billing or shipping address.")
telephone: String @doc(description: "The telephone number for the billing or shipping address.")
vat_id: String @doc(description: "The VAT company number for billing or shipping address.")
save_in_address_book: Boolean @doc(description: "Determines whether to save the address in the customer's address book. The default value is true.")
fax: String @doc(description: "The customer's fax number.")
middlename: String @doc(description: "The middle name of the person associated with the billing/shipping address.")
prefix: String @doc(description: "An honorific, such as Dr., Mr., or Mrs.")
suffix: String @doc(description: "A value such as Sr., Jr., or III.")
}
input SetShippingMethodsOnCartInput @doc(description: "Applies one or shipping methods to the cart.") {
cart_id: String! @doc(description: "The unique ID of a `Cart` object.")
shipping_methods: [ShippingMethodInput!]! @doc(description: "An array of shipping methods.")
}
input ShippingMethodInput @doc(description: "Defines the shipping carrier and method.") {
carrier_code: String! @doc(description: "A string that identifies a commercial carrier or an offline delivery method.")
method_code: String! @doc(description: "A string that indicates which service a commercial carrier will use to ship items. For offline delivery methods, this value is similar to the label displayed on the checkout page.")
}
input SetPaymentMethodAndPlaceOrderInput @doc(description: "Applies a payment method to the quote.") {
cart_id: String! @doc(description: "The unique ID of a `Cart` object.")
payment_method: PaymentMethodInput! @doc(description: "The payment method data to apply to the cart.")
}
input PlaceOrderInput @doc(description: "Specifies the quote to be converted to an order.") {
cart_id: String! @doc(description: "The unique ID of a `Cart` object.")
}
input SetPaymentMethodOnCartInput @doc(description: "Applies a payment method to the cart.") {
cart_id: String! @doc(description: "The unique ID of a `Cart` object.")
payment_method: PaymentMethodInput! @doc(description: "The payment method data to apply to the cart.")
}
input PaymentMethodInput @doc(description: "Defines the payment method.") {
code: String! @doc(description: "The internal name for the payment method.")
purchase_order_number: String @doc(description:"The purchase order number. Optional for most payment methods.")
}
input SetGuestEmailOnCartInput @doc(description: "Defines the guest email and cart.") {
cart_id: String! @doc(description: "The unique ID of a `Cart` object.")
email: String! @doc(description: "The email address of the guest.")
}
type CartPrices @doc(description: "Contains details about the final price of items in the cart, including discount and tax information.") {
grand_total: Money @doc(description: "The total, including discounts, taxes, shipping, and other fees.")
grand_total_excluding_tax: Money @doc(description: "The total of the cart, including discounts, shipping, and other fees without tax.")
subtotal_including_tax: Money @doc(description: "The subtotal including any applied taxes.")
subtotal_excluding_tax: Money @doc(description: "The subtotal without any applied taxes.")
discount: CartDiscount @deprecated(reason: "Use discounts instead.")
subtotal_with_discount_excluding_tax: Money @doc(description: "The subtotal with any discounts applied, but not taxes.")
applied_taxes: [CartTaxItem] @doc(description: "An array containing the names and amounts of taxes applied to each item in the cart.")
discounts: [Discount] @doc(description:"An array containing cart rule discounts, store credit and gift cards applied to the cart.") @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\Discounts")
}
type CartTaxItem @doc(description: "Contains tax information about an item in the cart.") {
amount: Money! @doc(description: "The amount of tax applied to the item.")
label: String! @doc(description: "The description of the tax.")
}
type CartDiscount @doc(description: "Contains information about discounts applied to the cart.") {
amount: Money! @doc(description: "The amount of the discount applied to the item.")
label: [String!]! @doc(description: "The description of the discount.")
}
type CreateGuestCartOutput {
cart: Cart @doc(description: "The newly created cart.")
}
type SetPaymentMethodOnCartOutput @doc(description: "Contains details about the cart after setting the payment method.") {
cart: Cart! @doc(description: "The cart after setting the payment method.")
}
type SetBillingAddressOnCartOutput @doc(description: "Contains details about the cart after setting the billing address.") {
cart: Cart! @doc(description: "The cart after setting the billing address.")
}
type SetShippingAddressesOnCartOutput @doc(description: "Contains details about the cart after setting the shipping addresses.") {
cart: Cart! @doc(description: "The cart after setting the shipping addresses.")
}
type SetShippingMethodsOnCartOutput @doc(description: "Contains details about the cart after setting the shipping methods.") {
cart: Cart! @doc(description: "The cart after setting the shipping methods.")
}
type ApplyCouponToCartOutput @doc(description: "Contains details about the cart after applying a coupon.") {
cart: Cart! @doc(description: "The cart after applying a coupon.")
}
type PlaceOrderOutput @doc(description: "Contains the results of the request to place an order.") {
order: Order @deprecated(reason: "Use `orderV2` instead.") @doc(description: "The ID of the order.")
orderV2: CustomerOrder @doc(description: "Full order information.")
errors: [PlaceOrderError!]! @doc(description:"An array of place order errors.")
}
type PlaceOrderError @doc(description:"An error encountered while placing an order."){
message: String! @doc(description: "A localized error message.")
code: PlaceOrderErrorCodes! @doc(description: "An error code that is specific to place order.")
}
type Cart @doc(description: "Contains the contents and other details about a guest or customer cart.") {
id: ID! @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\MaskedCartId") @doc(description: "The unique ID for a `Cart` object.")
items: [CartItemInterface] @deprecated(reason: "Use `itemsV2` instead.") @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\CartItems") @doc(description: "An array of products that have been added to the cart.")
itemsV2(pageSize: Int = 20, currentPage: Int = 1, sort: QuoteItemsSortInput): CartItems @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\CartItemsPaginated")
applied_coupon: AppliedCoupon @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\AppliedCoupon") @deprecated(reason: "Use `applied_coupons` instead.")
applied_coupons: [AppliedCoupon] @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\AppliedCoupons") @doc(description:"An array of `AppliedCoupon` objects. Each object contains the `code` text attribute, which specifies the coupon code.")
email: String @resolver (class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\CartEmail") @doc(description: "The email address of the guest or customer.")
shipping_addresses: [ShippingCartAddress]! @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\ShippingAddresses") @doc(description: "An array of shipping addresses assigned to the cart.")
billing_address: BillingCartAddress @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\BillingAddress") @doc(description: "The billing address assigned to the cart.")
available_payment_methods: [AvailablePaymentMethod] @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\AvailablePaymentMethods") @doc(description: "An array of available payment methods.")
selected_payment_method: SelectedPaymentMethod @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\SelectedPaymentMethod") @doc(description: "Indicates which payment method was applied to the cart.")
prices: CartPrices @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\CartPrices") @doc(description: "Pricing details for the quote.")
total_quantity: Float! @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\CartTotalQuantity") @doc(description: "The total number of items in the cart.")
is_virtual: Boolean! @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\CartIsVirtual") @doc(description: "Indicates whether the cart contains only virtual products.")
}
type CartItems {
items: [CartItemInterface]! @doc(description: "An array of products that have been added to the cart.")
page_info: SearchResultPageInfo @doc(description: "Metadata for pagination rendering.")
total_count: Int! @doc(description: "The number of returned cart items.")
}
interface CartAddressInterface @typeResolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\CartAddressTypeResolver") {
uid: String! @doc(description: "The unique id of the customer address.")
id: Int @doc(description: "Id of the customer address.")
firstname: String! @doc(description: "The first name of the customer or guest.")
lastname: String! @doc(description: "The last name of the customer or guest.")
company: String @doc(description: "The company specified for the billing or shipping address.")
street: [String!]! @doc(description: "An array containing the street for the billing or shipping address.")
city: String! @doc(description: "The city specified for the billing or shipping address.")
region: CartAddressRegion @doc(description: "An object containing the region label and code.")
postcode: String @doc(description: "The ZIP or postal code of the billing or shipping address.")
country: CartAddressCountry! @doc(description: "An object containing the country label and code.")
telephone: String @doc(description: "The telephone number for the billing or shipping address.")
vat_id: String @doc(description: "The VAT company number for billing or shipping address.")
fax: String @doc(description: "The customer's fax number.")
middlename: String @doc(description: "The middle name of the person associated with the billing/shipping address.")
prefix: String @doc(description: "An honorific, such as Dr., Mr., or Mrs.")
suffix: String @doc(description: "A value such as Sr., Jr., or III.")
}
type ShippingCartAddress implements CartAddressInterface @doc(description: "Contains shipping addresses and methods.") {
available_shipping_methods: [AvailableShippingMethod] @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\ShippingAddress\\AvailableShippingMethods") @doc(description: "An array that lists the shipping methods that can be applied to the cart.")
selected_shipping_method: SelectedShippingMethod @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\ShippingAddress\\SelectedShippingMethod") @doc(description: "An object that describes the selected shipping method.")
customer_notes: String @doc(description: "Text provided by the shopper.")
items_weight: Float @deprecated(reason: "This information should not be exposed on the frontend.")
cart_items: [CartItemQuantity] @deprecated(reason: "Use `cart_items_v2` instead.")
cart_items_v2: [CartItemInterface] @doc(description: "An array that lists the items in the cart.")
same_as_billing: Boolean! @doc(description: "Indicates whether the shipping address is same as billing address.")
}
type BillingCartAddress implements CartAddressInterface @doc(description: "Contains details about the billing address.") {
customer_notes: String @deprecated (reason: "The field is used only in shipping address.")
}
type CartItemQuantity @doc(description: "Deprecated: The `ShippingCartAddress.cart_items` field now returns `CartItemInterface`.") {
cart_item_id: Int! @deprecated(reason: "The `ShippingCartAddress.cart_items` field now returns `CartItemInterface`.")
quantity: Float! @deprecated(reason: "The `ShippingCartAddress.cart_items` field now returns `CartItemInterface`.")
}
type CartAddressRegion @doc(description: "Contains details about the region in a billing or shipping address.") {
code: String @doc(description: "The state or province code.")
label: String @doc(description: "The display label for the region.")
region_id: Int @doc(description: "The unique ID for a pre-defined region.")
}
type CartAddressCountry @doc(description: "Contains details the country in a billing or shipping address.") {
code: String! @doc(description: "The country code.")
label: String! @doc(description: "The display label for the country.")
}
type SelectedShippingMethod @doc(description: "Contains details about the selected shipping method and carrier.") {
carrier_code: String! @doc(description: "A string that identifies a commercial carrier or an offline shipping method.")
method_code: String! @doc(description: "A shipping method code associated with a carrier.")
carrier_title: String! @doc(description: "The label for the carrier code.")
method_title: String! @doc(description: "The label for the method code.")
amount: Money! @doc(description: "The cost of shipping using this shipping method.")
base_amount: Money @deprecated(reason: "The field should not be used on the storefront.")
price_excl_tax: Money! @doc(description: "The cost of shipping using this shipping method, excluding tax.")
price_incl_tax: Money! @doc(description: "The cost of shipping using this shipping method, including tax.")
}
type AvailableShippingMethod @doc(description: "Contains details about the possible shipping methods and carriers.") {
carrier_code: String! @doc(description: "A string that identifies a commercial carrier or an offline shipping method.")
carrier_title: String! @doc(description: "The label for the carrier code.")
method_code: String @doc(description: "A shipping method code associated with a carrier. The value could be null if no method is available.")
method_title: String @doc(description: "The label for the shipping method code. The value could be null if no method is available.")
error_message: String @doc(description: "Describes an error condition.")
amount: Money! @doc(description: "The cost of shipping using this shipping method.")
base_amount: Money @deprecated(reason: "The field should not be used on the storefront.")
price_excl_tax: Money! @doc(description: "The cost of shipping using this shipping method, excluding tax.")
price_incl_tax: Money! @doc(description: "The cost of shipping using this shipping method, including tax.")
available: Boolean! @doc(description: "Indicates whether this shipping method can be applied to the cart.")
}
type AvailablePaymentMethod @doc(description: "Describes a payment method that the shopper can use to pay for the order.") {
code: String! @doc(description: "The payment method code.")
title: String! @doc(description: "The payment method title.")
}
type SelectedPaymentMethod @doc(description: "Describes the payment method the shopper selected.") {
code: String! @doc(description: "The payment method code.")
title: String! @doc(description: "The payment method title.")
purchase_order_number: String @doc(description: "The purchase order number.")
}
type AppliedCoupon @doc(description: "Contains the applied coupon code.") {
code: String! @doc(description: "The coupon code the shopper applied to the card.")
}
input RemoveCouponFromCartInput @doc(description: "Specifies the cart from which to remove a coupon.") {
cart_id: String! @doc(description: "The unique ID of a `Cart` object.")
}
type RemoveCouponFromCartOutput @doc(description: "Contains details about the cart after removing a coupon.") {
cart: Cart @doc(description: "The cart after removing a coupon.")
}
type AddSimpleProductsToCartOutput @doc(description: "Contains details about the cart after adding simple or group products.") {
cart: Cart! @doc(description: "The cart after adding products.")
}
type AddVirtualProductsToCartOutput @doc(description: "Contains details about the cart after adding virtual products.") {
cart: Cart! @doc(description: "The cart after adding products.")
}
type UpdateCartItemsOutput @doc(description: "Contains details about the cart after updating items.") {
cart: Cart! @doc(description: "The cart after updating products.")
errors: [CartUserInputError!]! @doc(description: "Contains errors encountered while updating an item to the cart.")
}
type RemoveItemFromCartOutput @doc(description: "Contains details about the cart after removing an item.") {
cart: Cart! @doc(description: "The cart after removing an item.")
}
type SetGuestEmailOnCartOutput @doc(description: "Contains details about the cart after setting the email of a guest.") {
cart: Cart! @doc(description: "The cart after setting the guest email.")
}
type SimpleCartItem implements CartItemInterface @doc(description: "An implementation for simple product cart items.") {
customizable_options: [SelectedCustomizableOption]! @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\CustomizableOptions") @doc(description: "An array containing the customizable options the shopper selected.")
}
type VirtualCartItem implements CartItemInterface @doc(description: "An implementation for virtual product cart items.") {
customizable_options: [SelectedCustomizableOption]! @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\CustomizableOptions") @doc(description: "An array containing customizable options the shopper selected.")
}
interface CartItemInterface @typeResolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\CartItemTypeResolver") @doc(description: "An interface for products in a cart.") {
id: String! @deprecated(reason: "Use `uid` instead.")
uid: ID! @doc(description: "The unique ID for a `CartItemInterface` object.")
quantity: Float! @doc(description: "The quantity of this item in the cart.")
is_available: Boolean! @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\CheckProductStockAvailability") @doc(description: "True if requested quantity is less than available stock, false otherwise.")
prices: CartItemPrices @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\CartItemPrices") @doc(description: "Contains details about the price of the item, including taxes and discounts.")
product: ProductInterface! @doc(description: "Details about an item in the cart.")
errors: [CartItemError!] @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\CartItemErrors") @doc(description: "An array of errors encountered while loading the cart item")
}
type CartItemError {
code: CartItemErrorType! @doc(description: "An error code that describes the error encountered")
message: String! @doc(description: "A localized error message")
}
enum CartItemErrorType {
UNDEFINED
ITEM_QTY
ITEM_INCREMENTS
}
type Discount @doc(description:"Defines an individual discount. A discount can be applied to the cart as a whole or to an item, shipping.") {
amount: Money! @doc(description:"The amount of the discount.")
applied_to: CartDiscountType! @doc(description:"The type of the entity the discount is applied to.")
label: String! @doc(description:"A description of the discount.")
}
enum CartDiscountType {
ITEM
SHIPPING
}
type CartItemPrices @doc(description: "Contains details about the price of the item, including taxes and discounts.") {
price: Money! @doc(description: "The price of the item before any discounts were applied. The price that might include tax, depending on the configured display settings for cart.")
price_including_tax: Money! @doc(description: "The price of the item before any discounts were applied. The price that might include tax, depending on the configured display settings for cart.")
row_total: Money! @doc(description: "The value of the price multiplied by the quantity of the item.")
row_total_including_tax: Money! @doc(description: "The value of `row_total` plus the tax applied to the item.")
discounts: [Discount] @doc(description: "An array of discounts to be applied to the cart item.")
total_item_discount: Money @doc(description: "The total of all discounts applied to the item.")
original_item_price: Money! @doc(description: "The value of the original unit price for the item, including discounts.")
original_row_total: Money! @doc(description: "The value of the original price multiplied by the quantity of the item.")
catalog_discount: ProductDiscount @doc(description: "The price discount for the unit price of the item represents the difference between its regular price and final price.") @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\CatalogDiscount")
row_catalog_discount: ProductDiscount @doc(description: "The price discount multiplied by the item quantity represents the total difference between the regular price and the final price for the entire quote item.") @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\RowCatalogDiscount")
}
type SelectedCustomizableOption @doc(description: "Identifies a customized product that has been placed in a cart.") {
id: Int! @deprecated(reason: "Use `SelectedCustomizableOption.customizable_option_uid` instead.")
customizable_option_uid: ID! @doc(description: "The unique ID for a specific `CustomizableOptionInterface` object, such as a `CustomizableFieldOption`, `CustomizableFileOption`, or `CustomizableAreaOption` object.")
label: String! @doc(description: "The display name of the selected customizable option.")
type: String! @doc(description: "The type of `CustomizableOptionInterface` object.")
is_required: Boolean! @doc(description: "Indicates whether the customizable option is required.")
values: [SelectedCustomizableOptionValue!]! @doc(description: "An array of selectable values.")
sort_order: Int! @doc(description: "A value indicating the order to display this option.")
}
type SelectedCustomizableOptionValue @doc(description: "Identifies the value of the selected customized option.") {
id: Int! @deprecated(reason: "Use `SelectedCustomizableOptionValue.customizable_option_value_uid` instead.")
customizable_option_value_uid: ID! @doc(description: "The unique ID for a value object that corresponds to the object represented by the `customizable_option_uid` attribute.")
label: String! @doc(description: "The display name of the selected value.")
value: String! @doc(description: "The text identifying the selected value.")
price: CartItemSelectedOptionValuePrice! @doc(description: "The price of the selected customizable value.")
}
type CartItemSelectedOptionValuePrice @doc(description: "Contains details about the price of a selected customizable value.") {
value: Float! @doc(description: "A price value.")
units: String! @doc(description: "A string that describes the unit of the value.")
type: PriceTypeEnum! @doc(description: "Indicates whether the price type is fixed, percent, or dynamic.")
}
type Order @doc(description: "Contains the order ID.") {
order_number: String! @doc(description: "The unique ID for an `Order` object.")
order_id: String @deprecated(reason: "Use `order_number` instead.")
}
interface Error @typeResolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\CartErrorTypeResolver") @doc(description:"An error encountered while adding an item to the the cart.") {
message: String! @doc(description: "A localized error message.")
code: CartUserInputErrorType! @doc(description: "A cart-specific error code.")
}
type CartUserInputError implements Error {
}
type InsufficientStockError implements Error {
quantity: Float @doc(description: "Amount of available stock")
}
type AddProductsToCartOutput @doc(description: "Contains details about the cart after adding products to it.") {
cart: Cart! @doc(description: "The cart after products have been added.")
user_errors: [Error!]! @doc(description: "Contains errors encountered while adding an item to the cart.")
}
enum CartUserInputErrorType {
PRODUCT_NOT_FOUND
NOT_SALABLE
INSUFFICIENT_STOCK
COULD_NOT_FIND_CART_ITEM
REQUIRED_PARAMETER_MISSING
INVALID_PARAMETER_VALUE
UNDEFINED
}
enum PlaceOrderErrorCodes {
CART_NOT_FOUND
CART_NOT_ACTIVE
GUEST_EMAIL_MISSING
UNABLE_TO_PLACE_ORDER
UNDEFINED
}
type StoreConfig {
is_guest_checkout_enabled: Boolean @doc(description: "checkout/options/guest_checkout: whether the guest checkout is enabled or not.")
is_one_page_checkout_enabled: Boolean @doc(description: "checkout/options/onepage_checkout_enabled: whether the one page checkout is enabled or not")
max_items_in_order_summary: Int @doc(description: "checkout/options/max_items_display_count: maximum number of items to display in order summary.")
cart_summary_display_quantity: Int @doc(description: "checkout/cart_link/use_qty: what to show in the display cart summary, number of items or item quantities.")
minicart_display: Boolean @doc(description: "checkout/sidebar/display: whether to display the minicart or not.")
minicart_max_items: Int @doc(description: "checkout/sidebar/count: maximum number of items to show in minicart.")
cart_expires_in_days: Int @doc(description: "checkout/cart/delete_quote_after: quote lifetime in days.")
grouped_product_image: ProductImageThumbnail! @doc(description: "checkout/cart/grouped_product_image: which image to use for grouped products.") @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\StoreConfig")
configurable_product_image: ProductImageThumbnail! @doc(description: "checkout/cart/configurable_product_image: which image to use for configurable products.") @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\StoreConfig")
is_checkout_agreements_enabled: Boolean! @doc(description: "Configuration data from checkout/options/enable_agreements")
}
enum ProductImageThumbnail {
ITSELF @doc(description: "Use thumbnail of product as image.")
PARENT @doc(description: "Use thumbnail of product's parent as image.")
}
input EstimateTotalsInput {
cart_id: String! @doc(description: "The unique ID of the cart to query.")
address: EstimateAddressInput! @doc(description: "Customer's address to estimate totals.")
shipping_method: ShippingMethodInput @doc(description: "Selected shipping method to estimate totals.")
}
type EstimateTotalsOutput @doc(description: "Estimate totals output.") {
cart: Cart @doc(description: "Cart after totals estimation")
}
input EstimateAddressInput @doc(description: "Contains details about an address.") {
country_code: CountryCodeEnum! @doc(description: "The two-letter code representing the customer's country.")
region: CustomerAddressRegionInput @doc(description: "An object containing the region name, region code, and region ID.")
postcode: String @doc(description: "The customer's ZIP or postal code.")
}