We are in a project where Magento 2 CE is used as the commerce service provider. Usually when a guest user who has items in Cart login the cart gets merged to the customer's cart and the guest cart will be deleted. How can the same be achieved using Rest APIs in Magento 2? I know that in WCS, we needed to pass the guest token as a header to the Registered user login Rest API. Can someone help us on this?
I got stuck on the same thing. I didn't have any issues using the Magento REST API when I was logged-in but I ran into a bunch of problems using the guest cart API including connecting a guest cart initialized from the REST API to the user session in the backend and transitioning the cart from the guest state to the logged-in state.
In the end I created a custom web service module so that I could do this logic in PHP.
This approach worked well for me so I wanted to put it out there as an option. I find that the Magento documentation for its REST API isn't as good as it could be.