Read shopping cart data
SDK
apifm
Development reference
```javascript
WXAPI.shippingCarInfo(token, type)
```
+ token is the user credential returned by calling the login interface, used to identify which user's shopping cart;
+ type Shopping cart can distinguish types, or this parameter can not be passed. If not, all types of shopping cart data will be obtained;
In actual application, depending on business needs, it may be necessary to provide customers with two different shopping carts (for example, two separate shopping carts for dine-in and delivery), then you can use the type parameter to implement a multi-shopping cart scenario.
The interface returns:
```json
{
"code": 0,
"data": {
"number": 3, // number of items
"score": 0, // How many points need to be consumed
"shopList": [ // Store information to which the product belongs
{
"id": 6041,
"latitude": 30.29966,
"longitude": 120.107697,
"name": "Hangzhou West Yintai City MALL"
},
{
"id": 6040,
"latitude": 30.359991,
"longitude": 120.057228,
"name": "Hangzhou Liangzhu Yongwang Mall",
"pic": "https://cdn.it120.cc/cuser/951/2017/10/31/18ae947f52231f328f4564dffbc7d72f.png"
},
{
"id": 0,
"name": "other",
"serviceDistance": 99999999
}
],
"goodsStatus": [ // The status of the goods
{
"id": 810285,
"sellEnd": false, // Whether to stop selling
"sellStart": true, // Whether to start selling
"status": 0,
"statusStr": "on shelves",
"stores": 9999956
},
{
"id": 435060,
"sellEnd": false,
"sellStart": true,
"status": 0,
"statusStr": "on shelves",
"stores": 9983
},
{
"id": 235853,
"sellEnd": false,
"sellStart": true,
"status": 0,
"statusStr": "on shelves",
"stores": 5
}
],
"price": 848,
"items": [
{
"key": "5b2a16e8d15d25b416e87f228b6d50f3", // Shopping cart record unique number
"goodsId": 810285, // Product ID
"number": 1, // Product quantity
"sku": [
{
"optionId": 30899,
"optionValueId": 320215,
"optionName": "Network Type",
"optionValueName": "WIFI"
},
{
"optionId": 30900,
"optionValueId": 320217,
"optionName": "New order prompt",
"optionValueName": "Didi sound"
},
{
"optionId": 30901,
"optionValueId": 320220,
"optionName": "Paper cutting method",
"optionValueName": "Tear off paper manually"
}
],
"additions": [
{
"id": 2833,
"name": "Connect yourself",
"pid": 852,
"pname": "Docking method",
"price": 0
}
],
"categoryId": 1875, // Category ID
"shopId": 6041, // Store ID
"score": 0,
"pic": "https://dcdn.it120.cc/2020/04/15/0a86e7ef-3680-4f9f-a22c-2afb26672b7d.png",
"name": "Factory customized version of receipt printer",
"minBuyNumber": 1, // At least a few items need to be purchased
"weight": 0,
"logisticsId": 386,
"price": 299,
"selected": true, // Whether to select
"stores": 999969, // Remaining inventory"status": 0,
"statusStr": "On shelves"
},
{
"key": "d27a3ad5b78ad3edb4f51b6b23de7a07",
"goodsId": 435060,
"number": 1,
"additions": [
{
"id": 41,
"name": "Connect yourself",
"pid": 24,
"pname": "Docking service",
"price": 0
}
],
"categoryId": 1875,
"shopId": 0,
"score": 0,
"pic": "https://dcdn.it120.cc/2020/05/22/83618213-99b6-42ce-a672-becf466aa515.png",
"name": "WiFi cloud tag machine FP-N20W",
"minBuyNumber": 1,
"weight": 0,
"logisticsId": 386,
"price": 499,
"selected": true,
"stores": 9983,
"status": 0,
"statusStr": "On shelves"
},
{
"key": "2096702b2b8b596ef5a4950e26be5085",
"goodsId": 235853,
"number": 1,
"sku": [
{
"optionId": 869,
"optionValueId": 1698,
"optionName": "Design",
"optionValueName": "Pink Leaves"
},
{
"optionId": 871,
"optionValueId": 1588,
"optionName": "Color",
"optionValueName": "red"
}
],
"categoryId": 1875,
"shopId": 6040,
"score": 0,
"pic": "https://dcdn.it120.cc/2019/12/06/ebf49ac6-4521-4bcc-92fd-8bbbd4131167.jpg",
"name": "3-minute hourglass "Children's toothbrushing timer"",
"subName": "alias la la la",
"minBuyNumber": 1,
"weight": 1.5,
"logisticsId": 51089,
"price": 50,
"selected": true,
"stores": 9989,
"status": 0,
"statusStr": "On shelves"
}
]
},
"msg": "success"
}
```