简要描述:

  • 商品套餐立即购买接口

请求域名:

  • https://dev4.yunzshop.com

请求URL:

GET/获取商品套餐信息:route=plugin.goods-package.frontend.package.package-buy.index

参数:

参数名 是否必须 类型 说明
package_id int 套餐ID
goods json 购买的商品信息
关联的goods参数 是否必须 类型 说明
goods_id int 商品ID
total int 购买的商品数量,最小为1
option_id 条件 int 规格项id,有规格的商品必须要规格项id,没有规格则不需要

返回示例:

正确时返回:

  {
    "result": 1,
    "msg": "成功",
    "data": {
        "total_price": "349.12",
        "total_goods_price": "360.00",
        "total_dispatch_price": "0.00",
        "total_discount_price": "10.88",
        "total_deduction_price": "0.00",
        "package_id": "2",
        "orders": [
            {
                "id": null,
                "uid": 2677,
                "uniacid": 8,
                "dispatch_type_id": 0,
                "mark": "",
                "goods_price": "360.00",
                "price": "349.12",
                "order_goods_price": "360.00",
                "cost_amount": "160.00",
                "discount_price": "10.88",
                "deduction_price": "0.00",
                "dispatch_price": "0.00",
                "is_virtual": false,
                "goods_total": 7,
                "order_sn": "SN20190116110842XX",
                "create_time": "2019-01-16 11:08:42",
                "note": null,
                "shop_name": "aa",
                "pre_id": "d7cbef2acb56ee7f81838bdfc153170e",
                "order_settings": [],
                "order_address": {
                    "street_id": 0
                },
                "order_goods": [
                    {
                        "goods_option_id": 0,
                        "goods_option_title": "",
                        "comment_status": 0,
                        "goods_id": 300,
                        "total": 1,
                        "uid": 2677,
                        "uniacid": 8,
                        "goods_sn": "",
                        "title": "美币测试100",
                        "thumb": "https://dev4.yunzshop.com/attachment/images/8/2018/11/SKZlV3vEkxVeavbOivKu5oB4elBiiE.jpg",
                        "goods_price": "100.00",
                        "price": "100.00",
                        "goods_cost_price": "100.00",
                        "goods_market_price": "100.00",
                        "coupon_price": "0.00",
                        "buttons": [
                            {
                                "name": "评价",
                                "api": "",
                                "value": ""
                            }
                        ],
                        "order_goods_discounts": [
                            {
                                "discount_code": "independentGoodsMemberLevel",
                                "amount": "0.00",
                                "name": "商品独立会员等级优惠",
                                "uid": 2677
                            }
                        ],
                        "order_goods_deductions": [
                            {
                                "uid": 2677,
                                "code": "coin",
                                "name": "0",
                                "usable_amount": "0.00",
                                "usable_coin": null
                            },
                            {
                                "uid": 2677,
                                "code": "point",
                                "name": "积分",
                                "usable_amount": "0.00",
                                "usable_coin": null
                            },
                            {
                                "uid": 2677,
                                "code": "love",
                                "name": "兑换值",
                                "usable_amount": "0.00",
                                "usable_coin": null
                            }
                        ],
                        "goods_option": null
                    },
                    {
                        "goods_option_id": 0,
                        "goods_option_title": "",
                        "comment_status": 0,
                        "goods_id": 289,
                        "total": 2,
                        "uid": 2677,
                        "uniacid": 8,
                        "goods_sn": "",
                        "title": "推广员测试2",
                        "thumb": "https://dev4.yunzshop.com/attachment/images/8/2018/11/LzhnG5T7U9HzO2tuuOGG9Zqg7AltvZ.jpg",
                        "goods_price": "200.00",
                        "price": "200.00",
                        "goods_cost_price": "20.00",
                        "goods_market_price": "20.00",
                        "coupon_price": "0.00",
                        "buttons": [
                            {
                                "name": "评价",
                                "api": "",
                                "value": ""
                            }
                        ],
                        "order_goods_discounts": [
                            {
                                "discount_code": "independentGoodsMemberLevel",
                                "amount": "0.00",
                                "name": "商品独立会员等级优惠",
                                "uid": 2677
                            }
                        ],
                        "order_goods_deductions": [
                            {
                                "uid": 2677,
                                "code": "coin",
                                "name": "0",
                                "usable_amount": "0.00",
                                "usable_coin": null
                            },
                            {
                                "uid": 2677,
                                "code": "point",
                                "name": "积分",
                                "usable_amount": "0.00",
                                "usable_coin": null
                            },
                            {
                                "uid": 2677,
                                "code": "love",
                                "name": "兑换值",
                                "usable_amount": "0.00",
                                "usable_coin": null
                            }
                        ],
                        "goods_option": null
                    },
                    {
                        "goods_option_id": 0,
                        "goods_option_title": "",
                        "comment_status": 0,
                        "goods_id": 268,
                        "total": 2,
                        "uid": 2677,
                        "uniacid": 8,
                        "goods_sn": "",
                        "title": "商品库存测试",
                        "thumb": "https://dev4.yunzshop.com/attachment/images/8/2018/09/Rc9cHqZwtTX77fc6hT6tZFvwT7vvqv.jpg",
                        "goods_price": "20.00",
                        "price": "20.00",
                        "goods_cost_price": "20.00",
                        "goods_market_price": "20.00",
                        "coupon_price": "0.00",
                        "buttons": [
                            {
                                "name": "评价",
                                "api": "",
                                "value": ""
                            }
                        ],
                        "order_goods_discounts": [
                            {
                                "discount_code": "independentGoodsMemberLevel",
                                "amount": "0.00",
                                "name": "商品独立会员等级优惠",
                                "uid": 2677
                            }
                        ],
                        "order_goods_deductions": [
                            {
                                "uid": 2677,
                                "code": "coin",
                                "name": "0",
                                "usable_amount": "0.00",
                                "usable_coin": null
                            },
                            {
                                "uid": 2677,
                                "code": "point",
                                "name": "积分",
                                "usable_amount": "0.00",
                                "usable_coin": null
                            },
                            {
                                "uid": 2677,
                                "code": "love",
                                "name": "兑换值",
                                "usable_amount": "0.00",
                                "usable_coin": null
                            }
                        ],
                        "goods_option": null
                    },
                    {
                        "goods_option_id": 0,
                        "goods_option_title": "",
                        "comment_status": 0,
                        "goods_id": 270,
                        "total": 2,
                        "uid": 2677,
                        "uniacid": 8,
                        "goods_sn": "",
                        "title": "商品库存测试2",
                        "thumb": "https://dev4.yunzshop.com/attachment/images/8/2018/09/Rc9cHqZwtTX77fc6hT6tZFvwT7vvqv.jpg",
                        "goods_price": "40.00",
                        "price": "40.00",
                        "goods_cost_price": "20.00",
                        "goods_market_price": "20.00",
                        "coupon_price": "0.00",
                        "buttons": [
                            {
                                "name": "评价",
                                "api": "",
                                "value": ""
                            }
                        ],
                        "order_goods_discounts": [
                            {
                                "discount_code": "independentGoodsMemberLevel",
                                "amount": "0.00",
                                "name": "商品独立会员等级优惠",
                                "uid": 2677
                            }
                        ],
                        "order_goods_deductions": [
                            {
                                "uid": 2677,
                                "code": "coin",
                                "name": "0",
                                "usable_amount": "0.00",
                                "usable_coin": null
                            },
                            {
                                "uid": 2677,
                                "code": "point",
                                "name": "积分",
                                "usable_amount": "0.00",
                                "usable_coin": null
                            },
                            {
                                "uid": 2677,
                                "code": "love",
                                "name": "兑换值",
                                "usable_amount": "0.00",
                                "usable_coin": null
                            }
                        ],
                        "goods_option": null
                    }
                ],
                "order_coupons": [],
                "order_discounts": [
                    {
                        "discount_code": "singleEnoughReduce",
                        "amount": "0.00",
                        "name": "单品满减优惠",
                        "uid": 2677
                    },
                    {
                        "discount_code": "enoughReduce",
                        "amount": "0.00",
                        "name": "全场满减优惠",
                        "uid": 2677
                    },
                    {
                        "discount_code": "coupon",
                        "amount": "0.00",
                        "name": "优惠券优惠",
                        "uid": 2677
                    },
                    {
                        "discount_code": "package",
                        "amount": "10.88",
                        "name": "商品套餐优惠",
                        "uid": 2677
                    },
                    {
                        "discount_code": "independentGoodsMemberLevel",
                        "amount": "0.00",
                        "name": "商品独立会员等级优惠",
                        "uid": 2677
                    },
                    {
                        "discount_code": "deduction",
                        "amount": "0.00",
                        "name": "抵扣金额",
                        "uid": 2677
                    }
                ],
                "order_deductions": [],
                "has_one_dispatch_type": null
            }
        ],
        "discount": {
            "member_coupons": []
        },
        "dispatch": {
            "default_member_address": null
        }
    }
}

错误时返回:

  {
    "result": 0,
    "msg": "参数错误,套餐不存在"
  }
  更多错误信息请注意程序返回

返回参数说明:

参数名 类型 说明
total_price float 总金额
total_goods_price float 总商品金额
total_dispatch_price float 总运费
total_discount_price float 总优惠
total_deduction_price float 总抵扣
package_id int 套餐id
dispatch object 配送
discount object 优惠
orders [order]] 订单集合
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 是否选中
has_one_dispatch_type 参数名 类型 说明
id int 配送方式id
name string 配送方式名

备注:

  • 更多返回错误代码请看首页的错误代码描述