Magento – merge guest quote with customer quote(if custommer log in) magento 2 rest api

apimagento2quoterest

if 2 items in cart if customer login both item should need to add cart , Both quote (before login & after login) merge and create final quote which contain all item of customer quote

Refference links that i got in google

https://magento.stackexchange.com/a/62481

https://magento.stackexchange.com/a/30460

Best Answer

By default, Magento 2 in API side does not provide any API for Merge guest cart with customer card when the customer is login.

But you can replace the guest cart with customer cart.

API : (/V1/carts/:cartId) 
File : vendor/magento/module-quote/Model/QuoteManagement.php
Function : public function assignCustomer($cartId, $customerId, $storeId)

But if you want to develop functionality Merge cart Live Magento web side you need to create custom API.

Related Topic