@mit3233 This is also what I"m doing now - it actually works rather well. For anyone looking for a quick solution:
/**
* @Route("/set/{cartId}", name="frontend.cart-transfer.set", methods={"GET"}, defaults={"XmlHttpRequest"=true})
*/
public function setCart($cartId, Request $request, SalesChannelContext $context): Response
{
$swContextToken = $this->get('session')->get('sw-context-token');
if ($swContextToken != $cartId)
$this->get('session')->set('sw-context-token', $cartId);
return $this->redirectToRoute("frontend.checkout.cart.page");
}
$cartId is the sw-context-token
from the API.