update existing cart via ajax creates new cart Running craft cms 2 as a backend with react as the front end I am able to create a cart via an ajax post request to actions/commerce/cart/updateCart.

However, I'm not sure how to then update that cart. Every request to updateCart creates a new cart.

What do I need to pass to updateCart for it to update instead of create a new cart?
Craft 3
This is how Craft Commerce fetches the Card
if ($orderNumber = $request-&gt;getBodyParam('orderNumber')) {
    // Get the cart from the order number
    $cart = Order::find()-&gt;number($orderNumber)-&gt;isCompleted(false)-&gt;one();
}

You have to include an orderNumber parameter
Craft 2
$number = $this-&gt;_getSessionCartNumber();

if ($cart = $this-&gt;_getCartRecordByNumber($number))
{
    $this-&gt;_cart = Commerce_OrderModel::populateModel($cart);
}
else
{
    $this-&gt;_cart = new Commerce_OrderModel;
    $this-&gt;_cart-&gt;number = $number;
}

/**
 * @return mixed|string
 */
private function _getSessionCartNumber()
{
    $cookieId = $this-&gt;cookieCartId;
    $cartNumber = craft()-&gt;userSession-&gt;getStateCookieValue($cookieId);

    if (!$cartNumber)
    {
        $cartNumber = md5(uniqid(mt_rand(), true));
        $configInterval = craft()-&gt;config-&gt;get('cartCookieDuration', 'commerce');
        $interval = new DateInterval($configInterval);
        $cartExpiry = date_create('@0')-&gt;add($interval)-&gt;getTimestamp();
        craft()-&gt;userSession-&gt;saveCookie($cookieId, $cartNumber, $cartExpiry);
    }

    return $cartNumber;
}

I think you'll have to change the cookie