简要描述:

  • 立即购买

请求域名:

请求URL:

POST:route=plugin.store-cashier.frontend.pos.goods-buy

参数:

参数名 是否必须 类型 说明
buy_id int 购买者id
store_id int 门店ID
member_coupon_ids string 优惠券id(逗号分隔)
dispatch_type_id int 配送类型 2自提
商品数组goods
goods_id int 商品id
option_id int 规格id
total int 购买数量 (如果是称重商品则传克数)
amount number 称重总价(兼容称重商品)
orders 是否必须 类型 说明
pre_id int 预下单id
deduction_ids [deduction.code] 抵扣码 point积分 love爱心值
note string 订单备注

返回示例:

正确时返回:

{
    "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":[

        ],
        "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_coin_exchanges":  [
                     {
                         "code": "point",
                         "amount": "300.00",
                         "coin": "80.00",
                         "name": "积分全额抵扣"
                     }
                ],
                "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]] 订单集合
amount_items参数名 类型 说明
code string 代码
name string 名称
amount float 金额
fee_items参数名 类型 说明
name string 手续费名称
amount float 手续费金额
discount_amount_items参数名 类型 说明
code string 代码
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 商品总市场价
order_deductions 参数名 类型 说明
coin float 抵扣值
amount float 抵扣金额
code string 抵扣码
name string 抵扣名
checked int 是否选中
order_coin_exchanges 参数名 类型 说明
coin float 抵扣值
amount float 抵扣金额
code string 抵扣码
name string 抵扣名
has_one_dispatch_type 参数名 类型 说明
id int 配送方式id
name string 配送方式名
``

### 备注: