简要描述:

  • 门店商品购物车预下单

请求方法:

POST

请求URL:

https://你的域名/addons/yun_shop/api.php?i={{平台id}}&route=plugin.store-cashier.frontend.store.cart-buy

参数:

参数名 是否必须 类型 说明
store_id int 门店id
dispatch_type_id int 配送方式
address json 地址信息
member_coupon_ids string 优惠券id(逗号分隔)
cart_ids string 购物车id(逗号分隔)
invoice_type int 发票类型(0:电子发票,1:纸质发票)
rise_type int 发票抬头(0:单位,1:个人)
call string 称呼
ncompany_numberote string 单位识别号
orders 是否必须 类型 说明
pre_id int 预下单id
deduction_ids [deduction.code] array 抵扣码
service_fee [order_service_fee.code] array 服务费码
note string 订单备注
order_goods 是否必须 类型 说明
pre_id int 预下单id
diyform_data_id int 自定义表单数据id
address 是否必须 类型 说明
mobile int 商品id
username int 收件人姓名
province int 省份
city int 城市
district int 区县

返回示例:

正确时返回:

{
    "result":1,
    "msg":"成功",
    "data":{
        "amount_items":[
            {
                "code":"total_price",
                "name":"订单总金额",
                "amount":"110.00"
            },
            {
                "code":"total_dispatch_price",
                "name":"总运费",
                "amount":"10.00"
            },
            {
                "code":"total_deduction_price",
                "name":"总抵扣",
                "amount":"0.00"
            }
        ],
        "discount_amount_items":[
            {
                "code":"enough_reduce",
                "name":"全场满减",
                "amount":"1.00"
            }
        ],
        "fee_items ":[
            {
                "code":"goods_fee",
                "name":"商品手续费",
                "amount":"100000.00 "
            }
        ],
        "orders":[
            {
                "id":null,
                "uid":17,
                "uniacid":1,
                "dispatch_type_id":"1",
                "mark":"0",
                "goods_price":"100.00",
                "price":"110.00",
                "order_goods_price":"100.00",
                "cost_amount":"50.00",
                "discount_price":"0.00",
                "deduction_price":"0.00",
                "dispatch_price":"10.00",
                "goods_total":1,
                "is_virtual":true,
                "order_sn":"SN20190423180036Ag",
                "create_time":"2019-04-23 18:00:36",
                "note":null,
                "shop_name":"亚太美购",
                "need_address":true,
                "invoice_type":null,
                "rise_type":null,
                "collect_name":null,
                "company_number":null,
                "pre_id":"c447965a7bcff256b6be873de4e9a664",
                "order_settings":[

                ],
                "order_address":{
                    "street_id":420102002,
                    "zipcode":"",
                    "mobile":"13720209587",
                    "province_id":420000,
                    "city_id":420100,
                    "district_id":420102,
                    "address":"湖北省 武汉市 江岸区 大智街办事处 徐东大街联发国际",
                    "realname":"姚友"
                },
                "order_goods":[
                    {
                        "goods_option_id":0,
                        "goods_option_title":"",
                        "comment_status":0,
                        "goods_id":747,
                        "total":1,
                        "uid":17,
                        "uniacid":1,
                        "title":"1212报名,超声刀、自体脂肪填充二选一加观摩会门票",
                        "thumb":"https://yataimeigou.oss-cn-beijing.aliyuncs.com/images/1/2018/12/UDd1DrT16BP1pbR7fA717B8PHtrrHX.jpg",
                        "goods_sn":"",
                        "product_sn":"",
                        "goods_price":"100.00",
                        "price":"100.00",
                        "goods_cost_price":"50.00",
                        "goods_market_price":"1212.00",
                        "coupon_price":"0.00",
                        "need_address":1,
                        "payment_amount":"100.00",
                        "buttons":[
                            {
                                "name":"评价",
                                "api":"",
                                "value":""
                            }
                        ],
                        "order_goods_discounts":[
                            {
                                "discount_code":"independentGoodsMemberLevel",
                                "amount":"0.00",
                                "name":"商品独立会员等级优惠",
                                "uid":17
                            },
                            {
                                "discount_code":"singleEnoughReduce",
                                "amount":"0.00",
                                "name":"单品满减优惠",
                                "uid":17
                            },
                            {
                                "discount_code":"enoughReduce",
                                "amount":"0.00",
                                "name":"全场满减优惠",
                                "uid":17
                            }
                        ],
                        "goods_option":null,
                        "order_goods_deductions":[
                            {
                                "name":"美币",
                                "code":"love",
                                "uid":17,
                                "usable_amount":"0.00",
                                "usable_coin":0,
                                "used_amount":"0.00",
                                "used_coin":0
                            },
                            {
                                "name":"积分",
                                "code":"point",
                                "uid":17,
                                "usable_amount":"100.00",
                                "usable_coin":100,
                                "used_amount":"0.00",
                                "used_coin":0
                            }
                        ]
                    }
                ],
                "order_coupons":[

                ],
                "order_discounts":[
                    {
                        "discount_code":"singleEnoughReduce",
                        "amount":"0.00",
                        "name":"单品满减优惠",
                        "uid":17
                    },
                    {
                        "discount_code":"enoughReduce",
                        "amount":"0.00",
                        "name":"全场满减优惠",
                        "uid":17
                    },
                    {
                        "discount_code":"coupon",
                        "amount":"0.00",
                        "name":"优惠券优惠",
                        "uid":17
                    },
                    {
                        "discount_code":"package",
                        "amount":"0.00",
                        "name":"商品套餐优惠",
                        "uid":17
                    },
                    {
                        "discount_code":"deduction",
                        "amount":"0.00",
                        "name":"抵扣金额",
                        "uid":17
                    }
                ],
                "order_deductions":{
                    "1":{
                        "code":"point",
                        "name":"积分",
                        "amount":"100.00",
                        "coin":100,
                        "checked":false
                    }
                },
                "has_one_dispatch_type":{
                    "id":1,
                    "name":"快递",
                    "plugin":0,
                    "need_send":1
                }
            }
        ],
        "discount":{
            "member_coupons":[

            ]
        },
        "dispatch":{
            "default_member_address":{
                "id":1,
                "uniacid":1,
                "uid":17,
                "username":"姚友",
                "mobile":"13720209587",
                "zipcode":"",
                "province":"湖北省",
                "city":"武汉市",
                "district":"江岸区",
                "street":"大智街办事处",
                "address":"徐东大街联发国际",
                "isdefault":1
            }
        }
    }
}

错误时返回:

  • 缺少访问参数 - 商品ID
{
    "result": 0,
    "msg": "缺少访问参数",
    "data": [ ]
}
  • 未找到数据
{
    "result": 0,
    "msg": "未找到数据",
    "data": [ ]
}

返回参数说明:

参数名 类型 说明
amount_items array 金额项
discount_amount_items array 优惠金额项
dispatch object 配送
discount object 优惠
orders [order]] 订单集合
total_price float 合计
amount_items参数名 类型 说明
:----- :----- -----
code string 代码
name string 名称
amount float 金额
discount_amount_items参数名 类型 说明
code string 代码
name string 名称
amount float 金额
fee_items参数名 类型 说明
name string 手续费名称
amount float 手续费金额
service_fee_items参数名 类型 说明
name string 服务费名称
amount float 服务费金额
dispatch参数名 类型 说明
default_member_address object 用户默认地址
default_member_address参数名 类型 说明
street_id int 街道id
mobile int 联系电话
province_id int 身份id
city_id int 城市id
district_id int 区县id
address string 地址
realname string 姓名
discount参数名 类型 说明
member_coupons [member_coupon] 用户优惠券集合
member_coupon参数名 类型 说明
id int 用户优惠券id
coupon_id int 优惠券id
get_time string 领取时间
checked bool 是否选中
time_start string 开始使用时间
time_end string 过期时间
belongs_to_coupon object 所属优惠券
belongs_to_coupon参数名 类型 说明
id int 用户优惠券id
name string 优惠券名
bgcolor string 背景色
discount float 优惠折扣哦
enough float 金额限制
deduct float 优惠金额
thumb string 缩略图
desc string 描述
categorynames string 适用分类名
goods_names string 适用商品名
storenames string 适用门店名
suppliernames string 适用供应商名
created_at string 领取时间
order参数名 类型 说明
dispatch_type_id int 配送方式id
price float 订单价
goods_price float 商品总价
cost_amount float 成本价
discount_price float 优惠金额
deduction_price float 抵扣金额
dispatch_price float 配送费
is_virtual int 是否为虚拟订单
goods_total int 商品总件数
note string 商品备注
shop_name string 店铺名
pre_id sring 预下单id
order_goods [order_goods] 订单商品集合
order_deductions [order_deductions ] 订单抵扣集合
has_one_dispatch_type object 配送方式
order_goods参数名 类型 说明
title string 商品名
total int 数量
goods_sn string 商品编号
goods_id int 商品id
goods_option_id int 商品规格id
goods_option_title string 商品规格标题
goods_option_id string 商品缩略图地址
goods_price float 商品总原价
price float 商品总成交价
goods_cost_price float 商品总成本价
goods_market_price float 商品总市场价
pre_id string 预下单id
diy_form object 自定义表单参数
order_fees参数名 类型 说明
fee_code string 手续费码
amount float 手续费金额
name float 手续费名称
order_service_fees参数名 类型 说明
code string 服务费码
amount float 服务费金额
name float 服务费名称
checked bool 是否选中: true 是 false 否
show bool 是否显示:true 是 false 否
order_deductions 参数名 类型 说明
coin float 抵扣值
amount float 抵扣金额
code string 抵扣码
name string 抵扣名
checked int 是否选中
has_one_dispatch_type 参数名 类型 说明
id int 配送方式id
name string 配送方式名
diy_form 参数名 类型 说明
form_id int 表单id
form_data_id int 表单数据id

**错误时返回:**

- 缺少访问参数 - 商品ID

{ "result": 0, "msg": "缺少访问参数", "data": [ ] }


- 未找到数据

{ "result": 0, "msg": "未找到数据", "data": [ ] }



### 返回参数说明:

|参数名|类型|说明|
|:-----  |:-----|-----|
| id  | int | 订单 ID |

### 备注: