开放平台

扒书 ERP Open API

批量加入购物车

一次把多个商品加进购物车。

请求方式POST
接口路径/api/cart/saveList
Content-Typeapplication/json
鉴权X-Nideshop-Token

请求体字段

字段类型必填说明
checkedGoods对象数组是-
checkedGoods[].DELAY_DAY_7int否-
checkedGoods[].idInteger否-
checkedGoods[].userIdLong否-
checkedGoods[].goodsIdLong否历史商品 id,不再入库
checkedGoods[].goodsSnString否商品编码
checkedGoods[].goodsNameString否书名,按商品编码现查 图书档案
checkedGoods[].marketPriceBigDecimal否定价,现查
checkedGoods[].retailPriceBigDecimal否售价,现查后按学校系数计算
checkedGoods[].numberInteger否数量
checkedGoods[].goodsSpecifitionIdsString否-
checkedGoods[].checkedInteger否是否选择下单
checkedGoods[].listPicUrlString否封面,现查
checkedGoods[].goodsCreatorLong否-
checkedGoods[].goodsSpecifitionNameValueString否-
checkedGoods[].isSelfSellBoolean否-
checkedGoods[].goodsPageIdString否详情页 id(书市商品),现查后拼出,不入库
checkedGoods[].addTimeLocalDateTime否-
checkedGoods[].addType对象否添加类型:购物车、立即购买等
checkedGoods[].useRewardPointsint否-
checkedGoods[].shippingFeeBigDecimal否-
checkedGoods[].bookConditionString否品相编码,现查
checkedGoods[].bookConditionTextString否品相中文,现查
checkedGoods[].isbnString否ISBN,现查
checkedGoods[].goodsNumberInteger否可售库存(校园预售仓:实库+超卖),不入库
checkedGoods[].delayDeliverDayInteger否预计延迟发货天数提示,不入库

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
}