批量加入购物车
一次把多个商品加进购物车。
| 请求方式 | POST |
| 接口路径 | /api/cart/saveList |
| Content-Type | application/json |
| 鉴权 | X-Nideshop-Token |
请求体字段
| 字段 | 类型 | 必填 | 说明 |
checkedGoods | 对象数组 | 是 | - |
checkedGoods[].DELAY_DAY_7 | int | 否 | - |
checkedGoods[].id | Integer | 否 | - |
checkedGoods[].userId | Long | 否 | - |
checkedGoods[].goodsId | Long | 否 | 历史商品 id,不再入库 |
checkedGoods[].goodsSn | String | 否 | 商品编码 |
checkedGoods[].goodsName | String | 否 | 书名,按商品编码现查 图书档案 |
checkedGoods[].marketPrice | BigDecimal | 否 | 定价,现查 |
checkedGoods[].retailPrice | BigDecimal | 否 | 售价,现查后按学校系数计算 |
checkedGoods[].number | Integer | 否 | 数量 |
checkedGoods[].goodsSpecifitionIds | String | 否 | - |
checkedGoods[].checked | Integer | 否 | 是否选择下单 |
checkedGoods[].listPicUrl | String | 否 | 封面,现查 |
checkedGoods[].goodsCreator | Long | 否 | - |
checkedGoods[].goodsSpecifitionNameValue | String | 否 | - |
checkedGoods[].isSelfSell | Boolean | 否 | - |
checkedGoods[].goodsPageId | String | 否 | 详情页 id(书市商品),现查后拼出,不入库 |
checkedGoods[].addTime | LocalDateTime | 否 | - |
checkedGoods[].addType | 对象 | 否 | 添加类型:购物车、立即购买等 |
checkedGoods[].useRewardPoints | int | 否 | - |
checkedGoods[].shippingFee | BigDecimal | 否 | - |
checkedGoods[].bookCondition | String | 否 | 品相编码,现查 |
checkedGoods[].bookConditionText | String | 否 | 品相中文,现查 |
checkedGoods[].isbn | String | 否 | ISBN,现查 |
checkedGoods[].goodsNumber | Integer | 否 | 可售库存(校园预售仓:实库+超卖),不入库 |
checkedGoods[].delayDeliverDay | Integer | 否 | 预计延迟发货天数提示,不入库 |
curl 调用
curl -s 'https://www.8shu8.com/api/cart/saveList' \
-H 'X-Nideshop-Token: YOUR_LOGIN_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"checkedGoods": [
{
"DELAY_DAY_7": 1,
"id": 1,
"userId": 1,
"goodsId": 1,
"goodsSn": "string",
"goodsName": "string",
"marketPrice": 0.0,
"retailPrice": 0.0,
"number": 1,
"goodsSpecifitionIds": "string",
"checked": 1,
"listPicUrl": "string",
"goodsCreator": 1,
"goodsSpecifitionNameValue": "string",
"isSelfSell": true,
"goodsPageId": "string",
"addTime": "string",
"addType": "...",
"useRewardPoints": 1,
"shippingFee": 0.0,
"bookCondition": "string",
"bookConditionText": "string",
"isbn": "string",
"goodsNumber": 1,
"delayDeliverDay": 1
}
]
}'
响应示例
{
"code": 200,
"message": "操作成功",
"success": true,
"data": true
}