简要描述:

  • 立即购买

请求域名:

请求URL:

POST:route=order.goods-buy ,order.cart-buy,plugin.lease-toy.api.order.cart-buy,plugin.goods-package.frontend.package.package-buy.index,plugin.store-cashier.frontend.store.cart-buy

参数:

参数名 是否必须 类型 说明
dispatch_type_id int 配送方式
address json 地址信息
member_coupon_ids string 优惠券id(逗号分隔)
goods_id int 商品id
goods_option_id int 规格id
total int 购买数量
invoice_type int 发票类型(0:电子发票,1:纸质发票)
rise_type int 发票抬头(0:单位,1:个人)
call string 称呼
ncompany_numberote string 单位识别号
total_price float 合计
orders 是否必须 类型 说明
pre_id int 预下单id
deduction_ids [deduction.code] 抵扣码
note string 订单备注
address 是否必须 类型 说明
mobile int 商品id
username int 收件人姓名
province int 省份
city int 城市
district int 区县

返回示例:

正确时返回:

{
    "result": 1,
    "msg": "成功",
    "data": {
        "amount_items": [
            {
                "code": "total_goods_price",
                "name": "订单总金额",
                "amount": "80.00"
            },
            {
                "code": "total_dispatch_price",
                "name": "总运费",
                "amount": "0.00"
            }
        ],
        "discount_amount_items": [],
        "fee_items": [],
        "total_price": "80.00",
        "orders": [
            {
                "id": null,
                "uid": 1,
                "uniacid": 2,
                "dispatch_type_id": "1",
                "mark": "0",
                "goods_price": "100.00",
                "price": "80.00",
                "order_goods_price": "80.00",
                "cost_amount": "10.00",
                "discount_price": "0.00",
                "fee_amount": "0.00",
                "deduction_price": "0.00",
                "dispatch_price": "0.00",
                "goods_total": 1,
                "is_virtual": false,
                "order_sn": "SN20190604141409du",
                "create_time": "2019-06-04 14:14:09",
                "note": null,
                "shop_name": "芸众商城",
                "need_address": false,
                "invoice_type": null,
                "rise_type": null,
                "collect_name": null,
                "company_number": null,
                "pre_id": "99aa1d832e305a88104d7843ebe22c6b",
                "order_settings": [],
                "order_address": {
                    "street_id": 440111005,
                    "zipcode": "",
                    "mobile": "13111221122",
                    "province_id": 440000,
                    "city_id": 440100,
                    "district_id": 440111,
                    "address": "广东省 广州市 白云区 同德街道 测试",
                    "realname": "测试"
                },
                "order_goods": [
                    {
                        "goods_option_id": 0,
                        "goods_option_title": "",
                        "comment_status": 0,
                        "goods_id": 24,
                        "total": 1,
                        "uid": 1,
                        "uniacid": 2,
                        "title": "经销商商品测试",
                        "thumb": "https://dev5.yunzshop.com/attachment/images/2/2018/07/HwEPwVomaJXJ0jEE0JO00Va0QZjeI0.jpg",
                        "goods_sn": "",
                        "product_sn": "",
                        "goods_price": "100.00",
                        "price": "80.00",
                        "goods_cost_price": "10.00",
                        "goods_market_price": "10.00",
                        "coupon_price": "0.00",
                        "need_address": 0,
                        "payment_amount": "80.00",
                        "buttons": [
                            {
                                "name": "评价",
                                "api": "",
                                "value": ""
                            }
                        ],
                        "order_goods_discounts": [
                            {
                                "discount_code": "independentGoodsMemberLevel",
                                "amount": "20.00",
                                "name": "商品独立会员等级优惠",
                                "uid": 1
                            },
                            {
                                "discount_code": "singleEnoughReduce",
                                "amount": "0.00",
                                "name": "单品满减优惠",
                                "uid": 1
                            },
                            {
                                "discount_code": "enoughReduce",
                                "amount": "0.00",
                                "name": "全场满减优惠",
                                "uid": 1
                            }
                        ],
                        "goods_option": null,
                        "order_goods_deductions": {
                            "0": {
                                "name": "爱心值123",
                                "code": "love",
                                "uid": 1,
                                "usable_amount": "0.00",
                                "usable_coin": 0,
                                "used_amount": "0.00",
                                "used_coin": 0
                            },
                            "1": {
                                "name": "积分",
                                "code": "point",
                                "uid": 1,
                                "usable_amount": "20.00",
                                "usable_coin": 20,
                                "used_amount": "0.00",
                                "used_coin": 0
                            },
                            "2": {
                                "name": "华侨币",
                                "code": "coin",
                                "uid": 1,
                                "usable_amount": "0.00",
                                "usable_coin": 0,
                                "used_amount": "0.00",
                                "used_coin": 0
                            },
                            "3": {
                                "name": "消费积分",
                                "code": "integral",
                                "uid": 1,
                                "usable_amount": "0.00",
                                "usable_coin": 0,
                                "used_amount": "0.00",
                                "used_coin": 0
                            }
                        }
                    }
                ],
                "order_coupons": [],
                "order_discounts": [
                    {
                        "discount_code": "coupon",
                        "amount": "0.00",
                        "name": "优惠券优惠",
                        "uid": 1
                    },
                    {
                        "discount_code": "enoughReduce",
                        "amount": "0.00",
                        "name": "全场满减优惠",
                        "uid": 1
                    },
                    {
                        "discount_code": "package",
                        "amount": "0.00",
                        "name": "商品套餐优惠",
                        "uid": 1
                    },
                    {
                        "discount_code": "singleEnoughReduce",
                        "amount": "0.00",
                        "name": "单品满减优惠",
                        "uid": 1
                    }
                ],
                "order_deductions": {
                    "1": {
                        "code": "point",
                        "name": "积分",
                        "amount": "20.00",
                        "coin": 20,
                        "checked": false
                    }
                },
                "has_one_dispatch_type": {
                    "id": 1,
                    "name": "快递",
                    "plugin": 0,
                    "need_send": 1
                },
                "order_fees": [
                    {
                        "fee_code": "goods_fee",
                        "amount": "0.00",
                        "name": "服务费",
                        "uid": 1
                    }
                ]
            }
        ],
        "discount": {
            "member_coupons": [
                {
                    "id": 652,
                    "uid": "1",
                    "coupon_id": 31,
                    "used": 0,
                    "use_time": 0,
                    "get_time": "2019-05-29 10:46:36",
                    "is_member_deleted": 0,
                    "valid": true,
                    "checked": false,
                    "time_start": "2019-05-29",
                    "time_end": "2019-06-08",
                    "belongs_to_coupon": {
                        "id": 31,
                        "uniacid": 2,
                        "cat_id": 0,
                        "name": "满30减3",
                        "get_type": 1,
                        "level_limit": -1,
                        "get_max": 5,
                        "use_type": 0,
                        "return_type": 0,
                        "bgcolor": "",
                        "enough": 30,
                        "coupon_type": 0,
                        "time_limit": 0,
                        "time_days": 10,
                        "time_start": "2019-05-23",
                        "time_end": "2019-05-30",
                        "coupon_method": 1,
                        "discount": "0.00",
                        "deduct": "3.00",
                        "back_type": 0,
                        "back_money": "",
                        "back_credit": "",
                        "back_redpack": "",
                        "back_when": 0,
                        "thumb": "",
                        "desc": null,
                        "total": 300,
                        "status": 1,
                        "money": "0.00",
                        "resp_desc": null,
                        "resp_thumb": "",
                        "resp_title": "",
                        "resp_url": "",
                        "credit": 0,
                        "usecredit2": 0,
                        "remark": "",
                        "descnoset": 0,
                        "display_order": 24,
                        "supplier_uid": 0,
                        "getcashier": 0,
                        "cashiersids": null,
                        "cashiersnames": null,
                        "category_ids": null,
                        "categorynames": null,
                        "goods_names": [
                            "测试满额包邮  满99包邮"
                        ],
                        "goods_ids": [
                            "756"
                        ],
                        "storeids": null,
                        "storenames": null,
                        "getstore": 0,
                        "getsupplier": 0,
                        "supplierids": null,
                        "suppliernames": null,
                        "createtime": 0,
                        "created_at": "2019-05-23",
                        "updated_at": "2019-05-31",
                        "deleted_at": null,
                        "is_complex": 1,
                        "plugin_id": 0
                    }
                }
            ]
        },
        "dispatch": {
            "default_member_address": {
                "id": 77,
                "uniacid": 2,
                "uid": 1,
                "username": "测试",
                "mobile": "13111221122",
                "zipcode": "",
                "province": "广东省",
                "city": "广州市",
                "district": "白云区",
                "street": "同德街道",
                "address": "测试",
                "isdefault": 1
            }
        }
    }
}

错误时返回:

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

返回参数说明:

参数名 类型 说明
discount_amount_items array 优惠金额项
dispatch object 配送
amount_items array 底部金额项
fee_items array 服务费
discount object 优惠
total_price string 总价格(合计)
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参数名 类型 说明
isdefault int 是否默认
mobile int 联系电话
province int
city int 城市
district int 区县
street int 街道
address string 地址
username string 用户姓名(优先)
realname string 姓名(username没有的时候再取)
province_id int 身份id
city_id int 城市id
district_id int 区县id
street_id int 街道id
discount参数名 类型 说明
member_coupons [member_coupon] 用户优惠券集合
member_coupons参数名 类型 说明
id int 用户优惠券id
coupon_id int 优惠券id
get_time string 领取时间
checked bool 是否选中
valid bool 是否可以选择
time_start string 开始使用时间
time_end string 过期时间
belongs_to_coupon object 所属优惠券
belongs_to_coupon参数名 类型 说明
id int 用户优惠券id
name string 优惠券名
coupon_method number 优惠券类型(金额满减还是折扣满减)
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 配送费
order_fees array 单个订单的服务费
is_virtual int 是否为虚拟订单
goods_total int 商品总件数
note string 商品备注
need_address bool 是否需要收货地址 (false是显示)
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 数量
thumb string 商品图片
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_fees参数名 类型 说明
name string 服务费名称
amount float 服务费金额
has_one_dispatch_type 参数名 类型 说明
id int 配送方式id
name string 配送方式名

备注: