Top
Developers Your place to code all things handmade

Welcome to the Shopclues Developer Platform

We believe in code as craft. Join the community of developers, creators and build tools that enrich the ways you can shop, sell and connect with the India's largest merchant base most easily.

Get Started

Register, Upload, Search and Connect

Explore Shopclues' marketplace of over 8.5 million products from over 3.5 lakh merchants. Connect buyers with the items they'll love.

Learn More About Catalog Management

Login, Integrate and Create

Build the best tools for Shopclues merchants. Simply login, Integrate and start developing you own apps.

Learn More About Start Developing
<
>
Jump to: navigation, search

Get Cart

This API use for get cart details.

Method= POST

Authorization : “Bearer bc1f461de4f193”
Content-Type : ”application/json”

Headers

Field name Description Mandatory
Header - “Authorization” Access token is passed to identify the user. Eg- ”Bearer bc1f461de4f193" Yes
Header - “Content-Type” Input Content Type here it would be “application/json" Yes

Field Description:

Field name Description Mandatory
plateform plateform of user (D is desktop) Yes
user_id user_id of user Yes
payment_option_id payment option id (56 is COD) Yes
visitor_id address of user No

Details of return parameters :

Variable Description
status Api status if 1: implies success , 0:implies fail error.
message Text response message
data Array of user with basic parameters. For detailed information about a user.

  • JSON
  • PHP
Production Url:
https://developer.shopclues.com/api/v2/cart/getCart
Sandbox Url:
 https://sandbox.shopclues.com/api/v2/cart/getCart 

Sample request:

{
    "platform":"M",
    "user_id":12312312,
    "get_cod_fee":1,
    "payment_option_id":56,
    "exclude_nss_products":1,
    "meta_data":{
      "cart_data":{
      "visitor_id":"8734737shd8434883"
      }
    },
    "cart_service_id":1,
    "return_cart":1,
    "coupon_codes" : ["EXTRA5"]
}


Sample response:

 {  
 "status": 1,  
 "code": 200,  
 "message": "success",  
 "data": {  
   "count": 1,  
   "cart_id": 34076470,  
   "plaform": "A",  
   "max_purchase_qty": 999,  
   "products": [  
     {  
       "product_id": "1238864",  
       "name": "Accu-ChekActive Glucose Monitor",  
       "company_id": "1877",  
       "weight": "1000",  
       "seo_name": "accu-chek-active-glucose-monitor-11",  
       "product_group": "0",  
       "min_qty": "0",  
       "category_name": "Sports & Health",  
       "product_level_price_total": 999,  
       "product_level_price_total_without_discount": 999,  
       "product_level_discount": 0,  
       "per_product_avg_price_without_shipping": 999,  
       "per_product_avg_price_with_shipping": 999,  
       "item_id": "2332300494",  
       "amount": "441",  
       "is_cod": "1",  
       "reward_info": {  
         "reward_point_id": "1220",  
         "object_id": "0",  
         "amount_type": "P",  
         "object_type": "G",  
         "amount": "2"  
       },  
       "quantity": 1,  
       "selling_price": 999,  
       "price": [  
         {  
           "price": "999.00",  
           "quantity": 1  
         }  
       ],  
       "product_pre_price_total": 999,  
       "product_pre_price_total_discount": 0,  
       "previous_third_price": "0.00",  
       "shipping": {  
         "per_product_shipping_amt": 0,  
         "total_shipping_amt": 0,  
         "shipping_delta_amount": 0,  
         "shipping_delta_type": "delta_shipping_fee",  
         "per_product_previous_shipping_amt": 0,  
         "change_in_shipping": "0"  
       },  
       "icon_images": {  
         "0": {  
           "icon_image_path": "http://cdn.shopclues.com/images/thumbnails/1464/160/160/1238864119182ACAC1381392853.jpg",  
           "alt": ""  
         }  
       },  
       "tp_info": {  
         "tp": {  
           "product_id": "1238864",  
           "tp": "1200",  
           "type": "tp",  
           "start_date": "1484505000",  
           "end_date": "1485801000",  
           "latest": "1",  
           "user": "28561945"  
         }  
       }  
     }  
   ],  
   "cart_product_group": {  
     "0": "0"  
   },  
   "order_discount": 0,  
   "total_shipping": 0,  
   "is_cod": 1,  
   "without_discount_total": 999,  
   "without_payment_condition_total": 999,  
   "without_payment_pre_total": 999,  
   "total_discount": 0,  
   "pre_discount": 0,  
   "subtotal": 999,  
   "product_count": 1,  
   "total": 999,  
   "payment_condition_price_change": {  
     "invalid_for_cod": {  
       "products": []  
     },  
     "in_invalid_cod_coupons": []  
   },  
   "cart_reward_points": 19  
 },  
 "extra": null  
}              

Click here for access token documentation.

<?php
$curl = curl_init();
  $token="<token>";
  curl_setopt_array($curl, array(
  CURLOPT_URL => " https://sandbox.shopclues.com/api/v2/cart/getCart",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => '{
    "platform":"M",
    "user_id":12312312,
    "get_cod_fee":1,
    "payment_option_id":56,
    "exclude_nss_products":1,
    "meta_data":{
      "cart_data":{
      "visitor_id":"8734737shd8434883"
      }
    },
    "cart_service_id":1,
    "return_cart":1,
    "coupon_codes" : ["EXTRA5"]
}',
        

  CURLOPT_HTTPHEADER => array(
    "authorization: Bearer .$token",
    "content-type: application/json",
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}

?>

</div

Looking for ShopClues Apps?

Check out our new
App Gallery!

It's the best way to find cool and useful tools built upon Shopclues's API.