scandipwa / quote-graphql
N/A
Installs: 206 772
Dependents: 3
Suggesters: 0
Security: 0
Stars: 7
Watchers: 4
Forks: 32
Type:magento2-module
Requires
- magento/framework: *
- magento/module-authorization: *
- magento/module-bundle: *
- magento/module-bundle-graph-ql: ^100.3
- magento/module-catalog-rule: *
- magento/module-checkout: *
- magento/module-customer: *
- magento/module-integration: *
- magento/module-inventory-configuration-api: *
- magento/module-inventory-reservations-api: *
- magento/module-inventory-sales-api: *
- magento/module-quote: *
- magento/module-quote-graph-ql: ^100.3
- magento/module-sales: *
- magento/module-webapi: *
- scandipwa/performance: ^1.0
- dev-master
- 3.1.0
- 3.0.6
- 3.0.5
- 3.0.4
- 3.0.3
- 3.0.2
- 3.0.1
- 3.0.0
- 2.19.26
- 2.19.25
- 2.19.24
- 2.19.23
- 2.19.22
- 2.19.21
- 2.19.20
- 2.19.19
- 2.19.18
- 2.19.17
- 2.19.16
- 2.19.15
- 2.19.14
- 2.19.13
- 2.19.12
- 2.19.11
- 2.19.10
- 2.19.9
- 2.19.8
- 2.19.7
- 2.19.6
- 2.19.5
- 2.19.4
- 2.19.3
- 2.19.2
- 2.19.1
- 2.19.0
- 2.18.2
- 2.18.1
- 2.18.0
- 2.17.9
- 2.17.8
- 2.17.7
- 2.17.6
- 2.17.5
- 2.17.4
- 2.17.3
- 2.17.2
- 2.17.1
- 2.17.0
- 2.16.0
- 2.15.2
- 2.15.1
- 2.15.0
- 2.14.1
- 2.14.0
- 2.13.0
- 2.12.1
- 2.12.0
- 2.11.0
- 2.10.2
- 2.10.1
- 2.10.0
- 2.9.2
- 2.9.1
- 2.9.0
- 2.8.0
- 2.7.0
- 2.6.0
- 2.5.0
- 2.4.1
- 2.4.0
- 2.3.0
- 2.2.0
- 2.1.1
- 2.0.5
- 2.0.4
- 2.0.3
- 2.0.2
- 2.0.1
- 2.0.0
- 1.0.6
- 1.0.5
- 1.0.4
- 1.0.2
- 1.0.1
- dev-m-2.4.1
- dev-pr/ainarssondors/30-2
- dev-performance
- dev-revert-18-klarna
- dev-braintree
This package is auto-updated.
Last update: 2025-03-14 21:56:15 UTC
README
QuoteGraphQl provides basic types and resolvers for Checkout steps.
Endpoint description
All endpoints here should accept the same data as the API does. For an api reference, please follow this link
IMPORTANT NOTE: every following mutation and query work without specifying the
quote_id
param (orquoteId
). If none quote id is specified the resolver will attempt to load the quote id from Auth header, where auth token should be present. If quoteId is passed, it will treat it as a guest request, so thequote_id
should be encoded.
IMPORTANT NOTE: this endpoint is an alternative for Magento 2 GraphQL Quote endpoint that is storing
quote_id
for authorized customer on server (using state-full approach).
getCartForCustomer
This endpoint allows to get full cart data (items + totals).
query GetCartForCustomer ($_guestCartId_0: String) { getCartForCustomer(guestCartId: $_guestCartId_0) { id tax_amount subtotal discount_amount subtotal_with_discount grand_total items { item_id qty product { price { maximalPrice { amount { value currency } adjustments { code amount { value currency } } } } } } } }
{ "_guestCartId_0":"xIXmScRLWb5ntIEsYe2ymzrVXYraivGx" }
saveCartItem
type cartItem
now implements sub-type of CartItemId, that allows to reference by one of many:
item_id or product SKU. This will become non-nullable in the future releases, when "sku" and "item_id" will be dropped.
This endpoint allows to submit items to cart following the default API payload schema. In beneath example is a simple product option addition to cart.
mutation SaveCartItem ($_cartItem_0: CartItemInput!, $_guestCartId_0: String) { saveCartItem(cartItem: $_cartItem_0, guestCartId: $_guestCartId_0) { getCartForCustomer(guestCartId: $_guestCartId_0) { id tax_amount subtotal discount_amount subtotal_with_discount grand_total items { item_id qty product { price { maximalPrice { amount { value currency } adjustments { code amount { value currency } } } } } } } } }
{ "_cartItem_0":{ "sku":"Test simple product", "product_type":"simple", "qty":1, "product_option": { "extension_attributes":{} } }, "_guestCartId_0":"xIXmScRLWb5ntIEsYe2ymzrVXYraivGx" }
removeCartItem
mutation RemoveCartItem($item_id: Int!, $_guestCartId_0: String) { removeCartItem(item_id: $item_id, guestCartId: $_guestCartId_0) { getCartForCustomer(guestCartId: $_guestCartId_0) { id tax_amount subtotal discount_amount subtotal_with_discount grand_total items { item_id qty product { price { maximalPrice { amount { value currency } adjustments { code amount { value currency } } } } } } } } }
{ "item_id": 1, "quoteId": "s44Xcnya8dmbysAeNTOozFsZCh8tyCH9" }
estimateShippingCosts
mutation EstimateShippingCosts( $guestCartId: String! $address: EstimateShippingCostsAddress! ) { estimateShippingCosts(address: $address, guestCartId: $guestCartId) { carrier_code method_code carrier_title method_title error_message amount base_amount price_excl_tax price_incl_tax available } }
{ "guestCartId": "s44Xcnya8dmbysAeNTOozFsZCh8tyCH9", "address": { "region": "New York", "region_id": 43, "region_code": "NY", "country_id": "US", "street": [ "123 Oak Ave" ], "postcode": "10577", "city": "Purchase", "firstname": "Jane", "lastname": "Doe", "customer_id": 4, "email": "jdoe@example.com", "telephone": "(512) 555-1111", "same_as_billing": 1 } }
saveAddressInformation
mutation SaveAddressInformation( $addressInformation: SaveAddressInformation! $guestCartId: String ) { saveAddressInformation( addressInformation: $addressInformation, guestCartId: $guestCartId ) { payment_methods { code title } totals { grand_total items { name qty } } } }
{ "guestCartId": "s44Xcnya8dmbysAeNTOozFsZCh8tyCH9", "addressInformation":{ "shipping_address":{ "region":"New York", "region_id":43, "region_code":"NY", "country_id":"US", "street":[ "123 Oak Ave" ], "postcode":"10577", "city":"Purchase", "firstname":"Jane", "lastname":"Doe", "email":"jdoe@example.com", "telephone":"512-555-1111" }, "billing_address":{ "region":"New York", "region_id":43, "region_code":"NY", "country_id":"US", "street":[ "123 Oak Ave" ], "postcode":"10577", "city":"Purchase", "firstname":"Jane", "lastname":"Doe", "email":"jdoe@example.com", "telephone":"512-555-1111" }, "shipping_carrier_code":"flatrate", "shipping_method_code":"flatrate" } }
savePaymentInformationAndPlaceOrder
mutation SavePaymentInformationAndPlaceOrder( $paymentInformation: PaymentInformation!, $guestCartId: String, ) { savePaymentInformationAndPlaceOrder( paymentInformation: $paymentInformation, guestCartId: $guestCartId ) { orderID } }
{ "guestCartId": "s44Xcnya8dmbysAeNTOozFsZCh8tyCH9", "paymentInformation": { "paymentMethod": { "method": "checkmo" }, "billing_address":{ "region":"New York", "region_id":43, "region_code":"NY", "country_id":"US", "street":[ "123 Oak Ave" ], "postcode":"10577", "city":"Purchase", "firstname":"Jane", "lastname":"Doe", "email":"jdoe@example.com", "telephone":"512-555-1111" } } }