Getting a new cart after adding the product in decoupled frontend I'm using the headless Craft together with decoupled frontend on Nuxt.js.
I have to implement Craft Commerce 3 cart logic on the frontend, for that purpose I'm using graphQl/axios requests.
However each time I call http://example.com?action=commerce/cart/update-cart&amp;note=from+ajax with cart payload it returns me a new cart with added product (doesn't update the current cart, but returns a new cart each time).
Is there something I'm missing in my payload/headers to keep the same cart?
UPD: after some hours of research I found the solution in this topic:
CORS preflight check failing for AJAX login form on different domain
Also I had to pass the orderNumber parameter with the value of cart number in payload.
However I have a different issue now. First I call ?action=commerce/cart/load-cart&amp;note=from+ajax&amp;number={number} to load my stored card into the session. Then I call action=commerce/cart/get-cart&amp;note=from+ajax to get the content of the cart I loaded in step one, but it returns me a new empty cart. I suppose there is something to deal with the CraftSessionId in headers, am I right?