立即购买-第一步
发生场景: 在商品详情, 点击"立即购买"按钮, 对应普通商品的cart2函数
URL地址 | http://www.tpbbc2_0.com/index.php?m=Api&c=cart&a=cart2 |
请求方式 | post |
参数列表
参数 | 是否必须 | 说明 |
| goods_id | 必选 | 商品ID |
| item_id | 必选 | 规格组合ID |
| goods_num | 必选 | 购买数量 |
| action | 可选 | 固定值, 立即购买必传:"buy_now" |
| prom_type | 可选 | 立即购买必传 |
示例
成功示例
{
"status": 1,
"msg": "获取成功",
"result": {
"addressList": {
"address_id": 970, //地址ID
"province": 5827, //省
"city": 6542, //市
"district": 6596, //县(区)
"total_address": "辽宁省丹东市东港市1111111" //详细地址
},
"userCartCouponList": [],
"cartGoodsTotalNum": 1,
"storeShippingCartList": [
{
"store_id": 14, //店铺ID
"store_name": "影子爱人-YA", //名称
"cartList": [ //店铺下的商品列表
{
"user_id": 1, //用户ID
"session_id":"5dcj8muamp", //sessionID
"goods_id": 103, //商品ID
"goods_name": "珂兰钻石 18K金", //名称
"market_price":"2099.00", //市场价格
"goods_price":"1999.00", //店铺价
"member_goods_price":"1999.00", //会员价
"goods_num":1, //购买数量
"add_time":1511426411,
"prom_type": 0, //活动类型
"prom_id": 0, //活动ID
"store_id":14, //店铺ID
"prom_goods":null,
"goods": {
"goods_id":103, //商品ID
"cat_id1": 25, //分类ID
"store_id": 14, //店铺ID
"cat_id2": 26, //分类ID
"cat_id3": 29, //分类ID
"goods_name": "珂兰钻石 18K ", //名称
"market_price":"2099.00", //市场价格
"shop_price":"1999.00", //店铺价
}
}
],
"store_total_price":45,
"store_goods_price":45,
"store_cut_price": 0,
"store_goods_weight":100,
"shippingAreaList": [ //物流列表
{
"shipping_area_id": 42,
"shipping_area_name": "全国其他地区",
"shipping_code": "shunfeng",
"config":"a:4:{s:12:\"first_weight\"; }",
"update_time":"2017-05-26 17:13:53",
"is_default":1,
"is_close":1,
"store_id":14,
"plugin": {
"code":"shunfeng",
"name":"顺丰物流",
}
}
]
}
],
"storeCartTotalPrice": 45,
"userInfo": {
"user_id": 135,
"user_money": "90550.21", //用户余额
"pay_points": 19262, //用户积分
}
}
}
失败示例
{
"status": 1,
"msg": "请求方式错误",
"result": ""
}