選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 
 
 
 
 

416 行
32 KiB

  1. # Copyright © Magento, Inc. All rights reserved.
  2. # See COPYING.txt for license details.
  3. type Query {
  4. """phpcs:ignore Magento2.GraphQL.ValidArgumentName"""
  5. 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)
  6. customerCart: Cart! @resolver (class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\CustomerCart") @doc(description:"Return information about the customer's shopping cart.") @cache(cacheable: false)
  7. }
  8. type Mutation {
  9. createEmptyCart(input: createEmptyCartInput @doc(description: "An optional input object that assigns the specified ID to the cart.")): String @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\CreateEmptyCart") @doc(description:"Create an empty shopping cart for a guest or logged in user")
  10. 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.")
  11. 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.")
  12. 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.")
  13. 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.")
  14. 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.")
  15. 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.")
  16. 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.")
  17. 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.")
  18. 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.")
  19. 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.")
  20. 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.")
  21. 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.")
  22. """phpcs:ignore Magento2.GraphQL.ValidArgumentName"""
  23. 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.")
  24. """phpcs:ignore Magento2.GraphQL.ValidArgumentName"""
  25. 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")
  26. 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.")
  27. 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")
  28. }
  29. input createEmptyCartInput @doc(description: "Assigns a specific `cart_id` to the empty cart.") {
  30. cart_id: String @doc(description: "The ID to assign to the cart.")
  31. }
  32. input AddSimpleProductsToCartInput @doc(description: "Defines the simple and group products to add to the cart.") {
  33. cart_id: String! @doc(description: "The unique ID of a `Cart` object.")
  34. cart_items: [SimpleProductCartItemInput!]! @doc(description: "An array of simple and group items to add.")
  35. }
  36. input SimpleProductCartItemInput @doc(description: "Defines a single product to add to the cart.") {
  37. data: CartItemInput! @doc(description: "An object containing the `sku`, `quantity`, and other relevant information about the product.")
  38. customizable_options:[CustomizableOptionInput!] @doc(description: "An array that defines customizable options for the product.")
  39. }
  40. input AddVirtualProductsToCartInput @doc(description: "Defines the virtual products to add to the cart.") {
  41. cart_id: String! @doc(description: "The unique ID of a `Cart` object.")
  42. cart_items: [VirtualProductCartItemInput!]! @doc(description: "An array of virtual products to add.")
  43. }
  44. input VirtualProductCartItemInput @doc(description: "Defines a single product to add to the cart.") {
  45. data: CartItemInput! @doc(description: "An object containing the `sku`, `quantity`, and other relevant information about the product.")
  46. customizable_options:[CustomizableOptionInput!] @doc(description: "An array that defines customizable options for the product.")
  47. }
  48. input CartItemInput @doc(description: "Defines an item to be added to the cart.") {
  49. sku: String! @doc(description: "The SKU of the product.")
  50. quantity: Float! @doc(description: "The amount or number of an item to add.")
  51. parent_sku: String @doc(description: "For a child product, the SKU of its parent product.")
  52. 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`.")
  53. entered_options: [EnteredOptionInput!] @doc(description: "An array of entered options for the base product, such as personalization text.")
  54. }
  55. input CustomizableOptionInput @doc(description: "Defines a customizable option.") {
  56. id: Int @doc(description: "The customizable option ID of the product.")
  57. value_string: String! @doc(description: "The string value of the option.")
  58. }
  59. input ApplyCouponToCartInput @doc(description: "Specifies the coupon code to apply to the cart.") {
  60. cart_id: String! @doc(description: "The unique ID of a `Cart` object.")
  61. coupon_code: String! @doc(description: "A valid coupon code.")
  62. }
  63. input UpdateCartItemsInput @doc(description: "Modifies the specified items in the cart.") {
  64. cart_id: String! @doc(description: "The unique ID of a `Cart` object.")
  65. cart_items: [CartItemUpdateInput!]! @doc(description: "An array of items to be updated.")
  66. }
  67. input CartItemUpdateInput @doc(description: "A single item to be updated.") {
  68. cart_item_id: Int @doc(description: "Deprecated. Use `cart_item_uid` instead.")
  69. cart_item_uid: ID @doc(description: "The unique ID for a `CartItemInterface` object.")
  70. quantity: Float @doc(description: "The new quantity of the item.")
  71. customizable_options: [CustomizableOptionInput!] @doc(description: "An array that defines customizable options for the product.")
  72. }
  73. input RemoveItemFromCartInput @doc(description: "Specifies which items to remove from the cart.") {
  74. cart_id: String! @doc(description: "The unique ID of a `Cart` object.")
  75. cart_item_id: Int @doc(description: "Deprecated. Use `cart_item_uid` instead.")
  76. cart_item_uid: ID @doc(description: "Required field. The unique ID for a `CartItemInterface` object.")
  77. }
  78. input SetShippingAddressesOnCartInput @doc(description: "Specifies an array of addresses to use for shipping.") {
  79. cart_id: String! @doc(description: "The unique ID of a `Cart` object.")
  80. shipping_addresses: [ShippingAddressInput!]! @doc(description: "An array of shipping addresses.")
  81. }
  82. input ShippingAddressInput @doc(description: "Defines a single shipping address.") {
  83. customer_address_id: Int @doc(description: "An ID from the customer's address book that uniquely identifies the address to be used for shipping.")
  84. address: CartAddressInput @doc(description: "Defines a shipping address.")
  85. customer_notes: String @doc(description: "Text provided by the shopper.")
  86. }
  87. input SetBillingAddressOnCartInput @doc(description: "Sets the billing address.") {
  88. cart_id: String! @doc(description: "The unique ID of a `Cart` object.")
  89. billing_address: BillingAddressInput! @doc(description: "The billing address.")
  90. }
  91. input BillingAddressInput @doc(description: "Defines the billing address.") {
  92. customer_address_id: Int @doc(description: "An ID from the customer's address book that uniquely identifies the address to be used for billing.")
  93. address: CartAddressInput @doc(description: "Defines a billing address.")
  94. use_for_shipping: Boolean @doc(description: "Indicates whether to set the shipping address to be the same as this billing address.")
  95. 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.")
  96. }
  97. input CartAddressInput @doc(description: "Defines the billing or shipping address to be applied to the cart.") {
  98. firstname: String! @doc(description: "The first name of the customer or guest.")
  99. lastname: String! @doc(description: "The last name of the customer or guest.")
  100. company: String @doc(description: "The company specified for the billing or shipping address.")
  101. street: [String!]! @doc(description: "An array containing the street for the billing or shipping address.")
  102. city: String! @doc(description: "The city specified for the billing or shipping address.")
  103. region: String @doc(description: "A string that defines the state or province of the billing or shipping address.")
  104. region_id: Int @doc(description: "An integer that defines the state or province of the billing or shipping address.")
  105. postcode: String @doc(description: "The ZIP or postal code of the billing or shipping address.")
  106. country_code: String! @doc(description: "The country code and label for the billing or shipping address.")
  107. telephone: String @doc(description: "The telephone number for the billing or shipping address.")
  108. save_in_address_book: Boolean @doc(description: "Determines whether to save the address in the customer's address book. The default value is true.")
  109. }
  110. input SetShippingMethodsOnCartInput @doc(description: "Applies one or shipping methods to the cart.") {
  111. cart_id: String! @doc(description: "The unique ID of a `Cart` object.")
  112. shipping_methods: [ShippingMethodInput!]! @doc(description: "An array of shipping methods.")
  113. }
  114. input ShippingMethodInput @doc(description: "Defines the shipping carrier and method.") {
  115. carrier_code: String! @doc(description: "A string that identifies a commercial carrier or an offline delivery method.")
  116. 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.")
  117. }
  118. input SetPaymentMethodAndPlaceOrderInput @doc(description: "Applies a payment method to the quote.") {
  119. cart_id: String! @doc(description: "The unique ID of a `Cart` object.")
  120. payment_method: PaymentMethodInput! @doc(description: "The payment method data to apply to the cart.")
  121. }
  122. input PlaceOrderInput @doc(description: "Specifies the quote to be converted to an order.") {
  123. cart_id: String! @doc(description: "The unique ID of a `Cart` object.")
  124. }
  125. input SetPaymentMethodOnCartInput @doc(description: "Applies a payment method to the cart.") {
  126. cart_id: String! @doc(description: "The unique ID of a `Cart` object.")
  127. payment_method: PaymentMethodInput! @doc(description: "The payment method data to apply to the cart.")
  128. }
  129. input PaymentMethodInput @doc(description: "Defines the payment method.") {
  130. code: String! @doc(description: "The internal name for the payment method.")
  131. purchase_order_number: String @doc(description:"The purchase order number. Optional for most payment methods.")
  132. }
  133. input SetGuestEmailOnCartInput @doc(description: "Defines the guest email and cart.") {
  134. cart_id: String! @doc(description: "The unique ID of a `Cart` object.")
  135. email: String! @doc(description: "The email address of the guest.")
  136. }
  137. type CartPrices @doc(description: "Contains details about the final price of items in the cart, including discount and tax information.") {
  138. grand_total: Money @doc(description: "The total, including discounts, taxes, shipping, and other fees.")
  139. subtotal_including_tax: Money @doc(description: "The subtotal including any applied taxes.")
  140. subtotal_excluding_tax: Money @doc(description: "The subtotal without any applied taxes.")
  141. discount: CartDiscount @deprecated(reason: "Use discounts instead.")
  142. subtotal_with_discount_excluding_tax: Money @doc(description: "The subtotal with any discounts applied, but not taxes.")
  143. applied_taxes: [CartTaxItem] @doc(description: "An array containing the names and amounts of taxes applied to each item in the cart.")
  144. discounts: [Discount] @doc(description:"An array containing all discounts applied to the cart.") @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\Discounts")
  145. }
  146. type CartTaxItem @doc(description: "Contains tax information about an item in the cart.") {
  147. amount: Money! @doc(description: "The amount of tax applied to the item.")
  148. label: String! @doc(description: "The description of the tax.")
  149. }
  150. type CartDiscount @doc(description: "Contains information about discounts applied to the cart.") {
  151. amount: Money! @doc(description: "The amount of the discount applied to the item.")
  152. label: [String!]! @doc(description: "The description of the discount.")
  153. }
  154. type SetPaymentMethodOnCartOutput @doc(description: "Contains details about the cart after setting the payment method.") {
  155. cart: Cart! @doc(description: "The cart after setting the payment method.")
  156. }
  157. type SetBillingAddressOnCartOutput @doc(description: "Contains details about the cart after setting the billing address.") {
  158. cart: Cart! @doc(description: "The cart after setting the billing address.")
  159. }
  160. type SetShippingAddressesOnCartOutput @doc(description: "Contains details about the cart after setting the shipping addresses.") {
  161. cart: Cart! @doc(description: "The cart after setting the shipping addresses.")
  162. }
  163. type SetShippingMethodsOnCartOutput @doc(description: "Contains details about the cart after setting the shipping methods.") {
  164. cart: Cart! @doc(description: "The cart after setting the shipping methods.")
  165. }
  166. type ApplyCouponToCartOutput @doc(description: "Contains details about the cart after applying a coupon.") {
  167. cart: Cart! @doc(description: "The cart after applying a coupon.")
  168. }
  169. type PlaceOrderOutput @doc(description: "Contains the results of the request to place an order.") {
  170. order: Order! @doc(description: "The ID of the order.")
  171. }
  172. type Cart @doc(description: "Contains the contents and other details about a guest or customer cart.") {
  173. id: ID! @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\MaskedCartId") @doc(description: "The unique ID for a `Cart` object.")
  174. items: [CartItemInterface] @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\CartItems") @doc(description: "An array of products that have been added to the cart.")
  175. applied_coupon: AppliedCoupon @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\AppliedCoupon") @deprecated(reason: "Use `applied_coupons` instead.")
  176. 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.")
  177. email: String @resolver (class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\CartEmail") @doc(description: "The email address of the guest or customer.")
  178. shipping_addresses: [ShippingCartAddress]! @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\ShippingAddresses") @doc(description: "An array of shipping addresses assigned to the cart.")
  179. billing_address: BillingCartAddress @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\BillingAddress") @doc(description: "The billing address assigned to the cart.")
  180. available_payment_methods: [AvailablePaymentMethod] @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\AvailablePaymentMethods") @doc(description: "An array of available payment methods.")
  181. selected_payment_method: SelectedPaymentMethod @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\SelectedPaymentMethod") @doc(description: "Indicates which payment method was applied to the cart.")
  182. prices: CartPrices @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\CartPrices") @doc(description: "Pricing details for the quote.")
  183. total_quantity: Float! @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\CartTotalQuantity") @doc(description: "The total number of items in the cart.")
  184. is_virtual: Boolean! @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\CartIsVirtual") @doc(description: "Indicates whether the cart contains only virtual products.")
  185. }
  186. interface CartAddressInterface @typeResolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\CartAddressTypeResolver") {
  187. firstname: String! @doc(description: "The first name of the customer or guest.")
  188. lastname: String! @doc(description: "The last name of the customer or guest.")
  189. company: String @doc(description: "The company specified for the billing or shipping address.")
  190. street: [String!]! @doc(description: "An array containing the street for the billing or shipping address.")
  191. city: String! @doc(description: "The city specified for the billing or shipping address.")
  192. region: CartAddressRegion @doc(description: "An object containing the region label and code.")
  193. postcode: String @doc(description: "The ZIP or postal code of the billing or shipping address.")
  194. country: CartAddressCountry! @doc(description: "An object containing the country label and code.")
  195. telephone: String @doc(description: "The telephone number for the billing or shipping address.")
  196. }
  197. type ShippingCartAddress implements CartAddressInterface @doc(description: "Contains shipping addresses and methods.") {
  198. 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.")
  199. selected_shipping_method: SelectedShippingMethod @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\ShippingAddress\\SelectedShippingMethod") @doc(description: "An object that describes the selected shipping method.")
  200. customer_notes: String @doc(description: "Text provided by the shopper.")
  201. items_weight: Float @deprecated(reason: "This information should not be exposed on the frontend.")
  202. cart_items: [CartItemQuantity] @deprecated(reason: "Use `cart_items_v2` instead.")
  203. cart_items_v2: [CartItemInterface] @doc(description: "An array that lists the items in the cart.")
  204. }
  205. type BillingCartAddress implements CartAddressInterface @doc(description: "Contains details about the billing address.") {
  206. customer_notes: String @deprecated (reason: "The field is used only in shipping address.")
  207. }
  208. type CartItemQuantity @doc(description: "Deprecated: The `ShippingCartAddress.cart_items` field now returns `CartItemInterface`.") {
  209. cart_item_id: Int! @deprecated(reason: "The `ShippingCartAddress.cart_items` field now returns `CartItemInterface`.")
  210. quantity: Float! @deprecated(reason: "The `ShippingCartAddress.cart_items` field now returns `CartItemInterface`.")
  211. }
  212. type CartAddressRegion @doc(description: "Contains details about the region in a billing or shipping address.") {
  213. code: String @doc(description: "The state or province code.")
  214. label: String @doc(description: "The display label for the region.")
  215. region_id: Int @doc(description: "The unique ID for a pre-defined region.")
  216. }
  217. type CartAddressCountry @doc(description: "Contains details the country in a billing or shipping address.") {
  218. code: String! @doc(description: "The country code.")
  219. label: String! @doc(description: "The display label for the country.")
  220. }
  221. type SelectedShippingMethod @doc(description: "Contains details about the selected shipping method and carrier.") {
  222. carrier_code: String! @doc(description: "A string that identifies a commercial carrier or an offline shipping method.")
  223. method_code: String! @doc(description: "A shipping method code associated with a carrier.")
  224. carrier_title: String! @doc(description: "The label for the carrier code.")
  225. method_title: String! @doc(description: "The label for the method code.")
  226. amount: Money! @doc(description: "The cost of shipping using this shipping method.")
  227. base_amount: Money @deprecated(reason: "The field should not be used on the storefront.")
  228. }
  229. type AvailableShippingMethod @doc(description: "Contains details about the possible shipping methods and carriers.") {
  230. carrier_code: String! @doc(description: "A string that identifies a commercial carrier or an offline shipping method.")
  231. carrier_title: String! @doc(description: "The label for the carrier code.")
  232. method_code: String @doc(description: "A shipping method code associated with a carrier. The value could be null if no method is available.")
  233. method_title: String @doc(description: "The label for the shipping method code. The value could be null if no method is available.")
  234. error_message: String @doc(description: "Describes an error condition.")
  235. amount: Money! @doc(description: "The cost of shipping using this shipping method.")
  236. base_amount: Money @deprecated(reason: "The field should not be used on the storefront.")
  237. price_excl_tax: Money! @doc(description: "The cost of shipping using this shipping method, excluding tax.")
  238. price_incl_tax: Money! @doc(description: "The cost of shipping using this shipping method, including tax.")
  239. available: Boolean! @doc(description: "Indicates whether this shipping method can be applied to the cart.")
  240. }
  241. type AvailablePaymentMethod @doc(description: "Describes a payment method that the shopper can use to pay for the order.") {
  242. code: String! @doc(description: "The payment method code.")
  243. title: String! @doc(description: "The payment method title.")
  244. }
  245. type SelectedPaymentMethod @doc(description: "Describes the payment method the shopper selected.") {
  246. code: String! @doc(description: "The payment method code.")
  247. title: String! @doc(description: "The payment method title.")
  248. purchase_order_number: String @doc(description: "The purchase order number.")
  249. }
  250. type AppliedCoupon @doc(description: "Contains the applied coupon code.") {
  251. code: String! @doc(description: "The coupon code the shopper applied to the card.")
  252. }
  253. input RemoveCouponFromCartInput @doc(description: "Specifies the cart from which to remove a coupon.") {
  254. cart_id: String! @doc(description: "The unique ID of a `Cart` object.")
  255. }
  256. type RemoveCouponFromCartOutput @doc(description: "Contains details about the cart after removing a coupon.") {
  257. cart: Cart @doc(description: "The cart after removing a coupon.")
  258. }
  259. type AddSimpleProductsToCartOutput @doc(description: "Contains details about the cart after adding simple or group products.") {
  260. cart: Cart! @doc(description: "The cart after adding products.")
  261. }
  262. type AddVirtualProductsToCartOutput @doc(description: "Contains details about the cart after adding virtual products.") {
  263. cart: Cart! @doc(description: "The cart after adding products.")
  264. }
  265. type UpdateCartItemsOutput @doc(description: "Contains details about the cart after updating items.") {
  266. cart: Cart! @doc(description: "The cart after updating products.")
  267. }
  268. type RemoveItemFromCartOutput @doc(description: "Contains details about the cart after removing an item.") {
  269. cart: Cart! @doc(description: "The cart after removing an item.")
  270. }
  271. type SetGuestEmailOnCartOutput @doc(description: "Contains details about the cart after setting the email of a guest.") {
  272. cart: Cart! @doc(description: "The cart after setting the guest email.")
  273. }
  274. type SimpleCartItem implements CartItemInterface @doc(description: "An implementation for simple product cart items.") {
  275. customizable_options: [SelectedCustomizableOption]! @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\CustomizableOptions") @doc(description: "An array containing the customizable options the shopper selected.")
  276. }
  277. type VirtualCartItem implements CartItemInterface @doc(description: "An implementation for virtual product cart items.") {
  278. customizable_options: [SelectedCustomizableOption]! @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\CustomizableOptions") @doc(description: "An array containing customizable options the shopper selected.")
  279. }
  280. interface CartItemInterface @typeResolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\CartItemTypeResolver") @doc(description: "An interface for products in a cart.") {
  281. id: String! @deprecated(reason: "Use `uid` instead.")
  282. uid: ID! @doc(description: "The unique ID for a `CartItemInterface` object.")
  283. quantity: Float! @doc(description: "The quantity of this item in the cart.")
  284. prices: CartItemPrices @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\CartItemPrices") @doc(description: "Contains details about the price of the item, including taxes and discounts.")
  285. product: ProductInterface! @doc(description: "Details about an item in the cart.")
  286. errors: [CartItemError!] @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\CartItemErrors") @doc(description: "An array of errors encountered while loading the cart item")
  287. }
  288. type CartItemError {
  289. code: CartItemErrorType! @doc(description: "An error code that describes the error encountered")
  290. message: String! @doc(description: "A localized error message")
  291. }
  292. enum CartItemErrorType {
  293. UNDEFINED
  294. ITEM_QTY
  295. ITEM_INCREMENTS
  296. }
  297. type Discount @doc(description:"Defines an individual discount. A discount can be applied to the cart as a whole or to an item.") {
  298. amount: Money! @doc(description:"The amount of the discount.")
  299. label: String! @doc(description:"A description of the discount.")
  300. }
  301. type CartItemPrices @doc(description: "Contains details about the price of the item, including taxes and discounts.") {
  302. 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.")
  303. 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.")
  304. row_total: Money! @doc(description: "The value of the price multiplied by the quantity of the item.")
  305. row_total_including_tax: Money! @doc(description: "The value of `row_total` plus the tax applied to the item.")
  306. discounts: [Discount] @doc(description: "An array of discounts to be applied to the cart item.")
  307. total_item_discount: Money @doc(description: "The total of all discounts applied to the item.")
  308. }
  309. type SelectedCustomizableOption @doc(description: "Identifies a customized product that has been placed in a cart.") {
  310. id: Int! @deprecated(reason: "Use `SelectedCustomizableOption.customizable_option_uid` instead.")
  311. customizable_option_uid: ID! @doc(description: "The unique ID for a specific `CustomizableOptionInterface` object, such as a `CustomizableFieldOption`, `CustomizableFileOption`, or `CustomizableAreaOption` object.")
  312. label: String! @doc(description: "The display name of the selected customizable option.")
  313. type: String! @doc(description: "The type of `CustomizableOptionInterface` object.")
  314. is_required: Boolean! @doc(description: "Indicates whether the customizable option is required.")
  315. values: [SelectedCustomizableOptionValue!]! @doc(description: "An array of selectable values.")
  316. sort_order: Int! @doc(description: "A value indicating the order to display this option.")
  317. }
  318. type SelectedCustomizableOptionValue @doc(description: "Identifies the value of the selected customized option.") {
  319. id: Int! @deprecated(reason: "Use `SelectedCustomizableOptionValue.customizable_option_value_uid` instead.")
  320. 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.")
  321. label: String! @doc(description: "The display name of the selected value.")
  322. value: String! @doc(description: "The text identifying the selected value.")
  323. price: CartItemSelectedOptionValuePrice! @doc(description: "The price of the selected customizable value.")
  324. }
  325. type CartItemSelectedOptionValuePrice @doc(description: "Contains details about the price of a selected customizable value.") {
  326. value: Float! @doc(description: "A price value.")
  327. units: String! @doc(description: "A string that describes the unit of the value.")
  328. type: PriceTypeEnum! @doc(description: "Indicates whether the price type is fixed, percent, or dynamic.")
  329. }
  330. type Order @doc(description: "Contains the order ID.") {
  331. order_number: String! @doc(description: "The unique ID for an `Order` object.")
  332. order_id: String @deprecated(reason: "Use `order_number` instead.")
  333. }
  334. type CartUserInputError @doc(description:"An error encountered while adding an item to the the cart.") {
  335. message: String! @doc(description: "A localized error message.")
  336. code: CartUserInputErrorType! @doc(description: "A cart-specific error code.")
  337. }
  338. type AddProductsToCartOutput @doc(description: "Contains details about the cart after adding products to it.") {
  339. cart: Cart! @doc(description: "The cart after products have been added.")
  340. user_errors: [CartUserInputError!]! @doc(description: "Contains errors encountered while adding an item to the cart.")
  341. }
  342. enum CartUserInputErrorType {
  343. PRODUCT_NOT_FOUND
  344. NOT_SALABLE
  345. INSUFFICIENT_STOCK
  346. UNDEFINED
  347. }