title: WooCommerce Add to cart products via co-cart plugin
body: <p>I am new to WooCommerce REST API. I want to add product to cart and list all products of cart. I have added Co-Cart plugin to my server and I am using Co-Cart APIs for cart related functionality.</p>
  
  <p>Issue I am facing is, I am not able to view cart products in my react native application. Here are the APIs I am using right now:</p>
  
  <p><strong>1. Add product to cart:</strong></p>
  
  <p>Method:POST</p>
  
  <p>URL: <a href="https://www.myhost.com/wp-json/wc/v2/cart/add?token=user_token" rel="nofollow noreferrer">https://www.myhost.com/wp-json/wc/v2/cart/add?token=user_token</a></p>
  
  <p>Parameteres:  {
    "product_id": "9168",
    "quantity": "1"
  }</p>
  
  <p>Response:{
      "key": "af086cdab7954f11a518e3af68XXXXX",
      "product_id": 111,
      "variation_id": 0,
      "variation": [],
      "quantity": 1,
      "data": {},
      "data_hash": "b5c1d5ca8bae6d4896cf1807cdfXXXX",
      "line_tax_data": {
          "subtotal": [],
          "total": []
      },
      "line_subtotal": 50000,
      "line_subtotal_tax": 0,
      "line_total": 50000,
      "line_tax": 0
  }</p>
  
  <p>Getting proper response with status code 200 while adding product to cart from application.</p>
  
  <p><strong>2. View cart content</strong></p>
  
  <p>Method: GET</p>
  
  <p>URL: <a href="https://www.myhost.com/wp-json/wc/v2/cart?token=user_token" rel="nofollow noreferrer">https://www.myhost.com/wp-json/wc/v2/cart?token=user_token</a></p>
  
  <p>Response: [] (Blank JSON array)</p>
  
  <p>I don't  know where are the products which are added to cart using same user. I don't how it manages session from mobile application or what extra parameters it requires to fetch cart items.</p>
  
  <p>Please let me know where I am going wrong. I am using Co-Cart plugin API only.</p>
  
  <p>**</p>
  
  <blockquote>
    <p>EDIT</p>
  </blockquote>
  
  <p>**</p>
  
  <pre><code>fetch(url, {
          method: methodName,
          async: true,
          crossDomain: true,
          headers: new Headers({
            "Content-Type": "application/json",
            "cache-control": "no-cache",
          }),
          body:data
        }).then((response) =&gt; {
          const statusCode = response.status;
          console.log("fetchData StatusCode : "+statusCode);
          console.log("fetchData response1 : " + JSON.stringify(response));
          console.log("fetchData response2 : " + response);
          return response.json();
        }).then((responseJson) =&gt; {
          console.log("fetchData responseJson : "+responseJson);
          var response = JSON.stringify(responseJson);
          console.log("fetchData responseJson stringify : " + response);
          response = JSON.parse(response);
          if (callBack != null) {
            callBack("", response);
          }
        }).catch((error) =&gt; {
          console.log("fetchData Api error : "+error);
          if (callBack != null) {
            console.log("fetchData Api error callBack != null 2");
            callBack("Error", "");
          }
        });
  </code></pre>
  
  <p>url is a URL to send, data is raw data in JSON string format and method is either GET or POST.</p>