简要描述:
请求接口路由:
POST/order/buy
参数:
参数名 |
是否必须 |
类型 |
说明 |
uid |
是 |
int |
商城会员ID |
goods |
是 |
array |
下单商品集合 |
dispatch_type_id |
否 |
int |
配送方式:暂时只支持传 1 |
member_coupon_ids |
是 |
string |
优惠券id(逗号分隔) |
orders |
否 |
json |
使用抵扣 |
order_goods |
否 |
json |
订单商品表单 |
address |
是 |
urlencode |
地址信息 |
invoice_type |
否 |
int |
发票类型(0:电子发票,1:纸质发票) |
rise_type |
否 |
int |
发票抬头(0:单位,1:个人) |
call |
否 |
string |
发票称呼 |
ncompany_numberote |
否 |
string |
发票单位识别号 |
goods |
是否必须 |
类型 |
说明 |
goods_id |
是 |
int |
商品id |
option_id |
否 |
int |
规格id |
total |
是 |
int |
购买数量 |
orders |
是否必须 |
类型 |
说明 |
pre_id |
是 |
string |
预下单id 接口返回 |
deduction_ids |
[deduction.code] |
array |
抵扣码 |
service_fee |
[order_service_fee.code] |
array |
服务费码 |
note |
否 |
string |
订单备注 |
order_goods |
是否必须 |
类型 |
说明 |
pre_id |
是 |
string |
预下单id |
diyform_data_id |
是 |
int |
自定义表单数据id |
address参数必须转成json格式再进行URL编码(urlencode)
address |
是否必须 |
类型 |
说明 |
mobile |
是 |
int |
联系电话 |
username |
是 |
string |
收件人姓名 |
province |
是 |
string |
省名称 |
city |
是 |
string |
市名称 |
district |
是 |
string |
区县名称 |
street |
否 |
string |
街道名称 |
address |
是 |
string |
地址详细描述 |
请求参数示例:
//address参数地址原文
{
"mobile": "150132454657",
"username": "收货人",
"province": "广东省",
"city": "广州市",
"district": "白云区",
"street": "黄石街道",
"address": "新市二街 1003 号"
}
//请求参数
{
"app_id": "2022010600605642",
"uid": 2455,
"no_deduction_ids":1,
"goods": [{
"goods_id": "164",
"total": "2",
"option_id": "0"
}, {
"goods_id": "99",
"total": "2",
"option_id": "0"
}],
"dispatch_type_id":0,
"member_coupon_ids":"",
"orders":"[{\"pre_id\":\"101e36c8e82057bd9b40c387d07e5577\",\"deduction_ids\":[\"point\"],\"service_fee\":[],\"note\":\"\"}]"
"order_goods":'[]',
"address":"%7B%22mobile%22%3A%22150132454657%22%2C%22username%22%3A%22%E6%94%B6%E8%B4%A7%E4%BA%BA%22%2C%22province%22%3A%22%E5%B9%BF%E4%B8%9C%E7%9C%81%22%2C%22city%22%3A%22%E5%B9%BF%E5%B7%9E%E5%B8%82%22%2C%22district%22%3A%22%E7%99%BD%E4%BA%91%E5%8C%BA%22%2C%22street%22%3A%22%E9%BB%84%E7%9F%B3%E8%A1%97%E9%81%93%22%2C%22address%22%3A%22%E6%96%B0%E5%B8%82%E4%BA%8C%E8%A1%97+1003+%E5%8F%B7%22%7D"
}
返回示例:
{
"result": 1,
"msg": "成功",
"data": {
"amount_items": [{
"code": "total_goods_price",
"name": "订单总金额",
"amount": "400.00"
}, {
"code": "total_dispatch_price",
"name": "总运费",
"amount": "0.00"
}, {
"code": "total_deduction_price",
"name": "总抵扣",
"amount": "100.00"
}],
"discount_amount_items": [],
"fee_items": [],
"service_fee_items": [],
"total_price": "300.00",
"balance": "120.00",
"orders": [{
"id": null,
"dispatch_type_id": 0,
"mark": "",
"goods_price": "400.00",
"price": "300.00",
"order_goods_price": "400.00",
"cost_amount": "140.00",
"discount_price": "0.00",
"fee_amount": "0.00",
"service_fee_amount": "0.00",
"deduction_price": "100.00",
"dispatch_price": "0.00",
"goods_total": 4,
"is_virtual": false,
"no_refund": 0,
"order_sn": "SN22032311394377AB",
"create_time": "2022-03-23 11:39:32",
"note": null,
"shop_name": "哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈",
"need_address": false,
"invoice_type": null,
"rise_type": null,
"collect_name": null,
"company_number": null,
"pre_id": "101e36c8e82057bd9b40c387d07e5577",
"order_settings": [],
"order_invoice": {
"uniacid": "6",
"email": null,
"collect_name": "",
"company_number": ""
},
"order_address": {
"street_id": 0,
"zipcode": "",
"mobile": "150132454657",
"province_id": 440000,
"city_id": 440100,
"district_id": 440111,
"address": "广东省 广州市 白云区 新市二街 1003 号",
"realname": "收货人",
"longitude": "",
"latitude": ""
},
"order_goods": [{
"goods_option_id": 0,
"goods_option_title": "",
"comment_status": 0,
"goods_id": 164,
"total": 2,
"uid": 2455,
"uniacid": 6,
"title": "本地的哈哈步164",
"thumb": "http:\/\/demo.yun.cn\/static\/upload\/images\/6\/2018\/06\/hZqM1jQqjFmBhQ5JqQ48qSF5dmMMQZ.jpg",
"goods_sn": "",
"product_sn": "",
"goods_price": "200.00",
"price": "200.00",
"goods_cost_price": "100.00",
"goods_market_price": "2426.00",
"coupon_price": "0.00",
"need_address": 0,
"payment_amount": "200.00",
"pre_id": "164-0",
"points": "",
"goods_option": null,
"order_goods_deductions": {
"0": {
"name": "爱心值",
"code": "love",
"uid": 2455,
"usable_amount": "0.00",
"usable_coin": 0,
"used_amount": "0.00",
"used_coin": 0
},
"1": {
"name": "积分",
"code": "point",
"uid": 2455,
"usable_amount": "0.00",
"usable_coin": 0,
"used_amount": "0.00",
"used_coin": 0
},
"3": {
"name": "哈哈币",
"code": "balance",
"uid": 2455,
"usable_amount": "200.00",
"usable_coin": 200,
"used_amount": "0.00",
"used_coin": 0
},
"4": {
"name": "消积分",
"code": "integral",
"uid": 2455,
"usable_amount": "0.00",
"usable_coin": 0,
"used_amount": "0.00",
"used_coin": 0
}
},
"order_goods_discounts": []
}, {
"goods_option_id": 0,
"goods_option_title": "",
"comment_status": 0,
"goods_id": 99,
"total": 2,
"uid": 2455,
"uniacid": 6,
"title": "本地123",
"thumb": "http:\/\/demo.yun.cn\/static\/upload\/images\/6\/2018\/04\/yCfnKfcWicKXATi5fKI0watW8K0tz0.jpg",
"goods_sn": "",
"product_sn": "",
"goods_price": "200.00",
"price": "200.00",
"goods_cost_price": "40.00",
"goods_market_price": "400.00",
"coupon_price": "0.00",
"need_address": 0,
"payment_amount": "100.00",
"pre_id": "99-0",
"points": "",
"goods_option": null,
"order_goods_deductions": {
"0": {
"name": "爱心值",
"code": "love",
"uid": 2455,
"usable_amount": "100.00",
"usable_coin": 100,
"used_amount": "100.00",
"used_coin": 100
},
"1": {
"name": "积分",
"code": "point",
"uid": 2455,
"usable_amount": "0.00",
"usable_coin": 0,
"used_amount": "0.00",
"used_coin": 0
},
"3": {
"name": "哈哈币",
"code": "balance",
"uid": 2455,
"usable_amount": "0.00",
"usable_coin": 0,
"used_amount": "0.00",
"used_coin": 0
},
"4": {
"name": "消积分",
"code": "integral",
"uid": 2455,
"usable_amount": "0.00",
"usable_coin": 0,
"used_amount": "0.00",
"used_coin": 0
}
},
"order_goods_discounts": []
}],
"order_plugin": {
"main_plugin_id": 0,
"sub_plugin_id": 0
},
"order_coupons": [],
"order_discounts": [],
"order_deductions": {
"0": {
"code": "love",
"name": "爱心值",
"amount": "100.00",
"coin": 100,
"checked": true
},
"3": {
"code": "balance",
"name": "哈哈币",
"amount": "120.00",
"coin": 120,
"checked": false
}
},
"order_fees": [],
"order_service_fees": []
}],
"discount": {
"whether_show_coupon": "1",
"coupon_show": null,
"deduction_lang": "抵扣",
"default_deduction": 0,
"member_coupons": [{
"id": 10,
"uid": 2455,
"coupon_id": 13,
"used": 0,
"use_time": 0,
"get_time": "2021-11-01 00:00:00",
"is_member_deleted": 0,
"is_expired": 0,
"near_expiration": 0,
"expired_at": 2499609600,
"coupon_qr": "",
"small_qr": "",
"coupon_qr_sn": "",
"valid": true,
"checked": false,
"time_start": "2021-11-01",
"time_end": "不限时间",
"belongs_to_coupon": {
"id": 13,
"uniacid": 6,
"cat_id": 0,
"name": "减0折",
"get_type": 0,
"level_limit": -1,
"get_max": 1,
"get_limit_max": 1,
"get_limit_type": 0,
"use_type": 0,
"return_type": 0,
"bgcolor": "",
"enough": 100,
"coupon_type": 0,
"time_limit": 0,
"time_days": 0,
"time_start": "2021-11-01",
"time_end": "2021-11-08",
"coupon_method": 2,
"discount": "0.00",
"deduct": "0.00",
"back_type": 0,
"back_money": "",
"back_credit": "",
"back_redpack": "",
"back_when": 0,
"thumb": "",
"desc": null,
"total": -1,
"status": 1,
"money": "0.00",
"resp_desc": null,
"resp_thumb": "",
"resp_title": "",
"resp_url": "",
"credit": 0,
"usecredit2": 0,
"remark": "",
"descnoset": 0,
"display_order": 0,
"supplier_uid": 0,
"getcashier": 0,
"cashiersids": null,
"cashiersnames": null,
"category_ids": [],
"categorynames": [],
"goods_names": [],
"goods_ids": [],
"storenames": [],
"member_tags_ids": null,
"member_tags_names": null,
"getstore": 0,
"getsupplier": 0,
"supplierids": null,
"suppliernames": null,
"createtime": 0,
"created_at": "2021-11-01",
"updated_at": "2021-11-01",
"deleted_at": null,
"is_complex": 0,
"plugin_id": 0,
"use_conditions": "N;",
"is_integral_exchange_coupon": 0,
"exchange_coupon_integral": null,
"coupon_type_name": "平台商品"
}
}, {
"id": 9,
"uid": 2455,
"coupon_id": 12,
"used": 0,
"use_time": 0,
"get_time": "2021-06-16 00:00:00",
"is_member_deleted": 0,
"is_expired": 0,
"near_expiration": 0,
"expired_at": 2487686400,
"coupon_qr": "",
"small_qr": "",
"coupon_qr_sn": "",
"valid": true,
"checked": false,
"time_start": "2021-06-16",
"time_end": "不限时间",
"belongs_to_coupon": {
"id": 12,
"uniacid": 6,
"cat_id": 0,
"name": "测试",
"get_type": 0,
"level_limit": -1,
"get_max": 1,
"get_limit_max": 0,
"get_limit_type": 0,
"use_type": 0,
"return_type": 0,
"bgcolor": "",
"enough": 5,
"coupon_type": 0,
"time_limit": 0,
"time_days": 0,
"time_start": "2021-06-16",
"time_end": "2021-06-23",
"coupon_method": 1,
"discount": "0.00",
"deduct": "5.00",
"back_type": 0,
"back_money": "",
"back_credit": "",
"back_redpack": "",
"back_when": 0,
"thumb": "",
"desc": null,
"total": 3,
"status": 1,
"money": "0.00",
"resp_desc": null,
"resp_thumb": "",
"resp_title": "",
"resp_url": "",
"credit": 0,
"usecredit2": 0,
"remark": "",
"descnoset": 0,
"display_order": 0,
"supplier_uid": 0,
"getcashier": 0,
"cashiersids": null,
"cashiersnames": null,
"category_ids": [],
"categorynames": [],
"goods_names": [],
"goods_ids": [],
"storenames": [],
"member_tags_ids": null,
"member_tags_names": null,
"getstore": 0,
"getsupplier": 0,
"supplierids": null,
"suppliernames": null,
"createtime": 0,
"created_at": "2021-06-16",
"updated_at": "2021-06-16",
"deleted_at": null,
"is_complex": 0,
"plugin_id": 0,
"use_conditions": "N;",
"is_integral_exchange_coupon": 0,
"exchange_coupon_integral": null,
"coupon_type_name": "平台商品"
}
}, {
"id": 8,
"uid": 2455,
"coupon_id": 7,
"used": 0,
"use_time": 0,
"get_time": "2020-12-02 00:00:00",
"is_member_deleted": 0,
"is_expired": 0,
"near_expiration": 0,
"expired_at": 2470752000,
"coupon_qr": "",
"small_qr": "",
"coupon_qr_sn": "",
"valid": true,
"checked": false,
"time_start": "2020-12-02",
"time_end": "不限时间",
"belongs_to_coupon": {
"id": 7,
"uniacid": 6,
"cat_id": 0,
"name": "满100件10",
"get_type": 1,
"level_limit": -1,
"get_max": -1,
"get_limit_max": 0,
"get_limit_type": 0,
"use_type": 2,
"return_type": 0,
"bgcolor": "",
"enough": 100,
"coupon_type": 0,
"time_limit": 0,
"time_days": 0,
"time_start": "2017-11-29",
"time_end": "2017-12-06",
"coupon_method": 1,
"discount": "0.00",
"deduct": "10.00",
"back_type": 0,
"back_money": "",
"back_credit": "",
"back_redpack": "",
"back_when": 0,
"thumb": "",
"desc": null,
"total": 100,
"status": 1,
"money": "0.00",
"resp_desc": "",
"resp_thumb": "",
"resp_title": "",
"resp_url": "",
"credit": 0,
"usecredit2": 0,
"remark": "",
"descnoset": 0,
"display_order": 0,
"supplier_uid": 0,
"getcashier": 0,
"cashiersids": null,
"cashiersnames": null,
"category_ids": [],
"categorynames": [],
"goods_names": ["本地的哈哈步164"],
"goods_ids": [164],
"storenames": [],
"member_tags_ids": null,
"member_tags_names": null,
"getstore": 0,
"getsupplier": 0,
"supplierids": null,
"suppliernames": null,
"createtime": 0,
"created_at": "2017-11-29",
"updated_at": "2020-12-02",
"deleted_at": null,
"is_complex": 1,
"plugin_id": 0,
"use_conditions": null,
"is_integral_exchange_coupon": 0,
"exchange_coupon_integral": null,
"coupon_type_name": "指定商品"
}
}, {
"id": 4,
"uid": 2455,
"coupon_id": 9,
"used": 0,
"use_time": 0,
"get_time": "2018-05-02 00:00:00",
"is_member_deleted": 0,
"is_expired": 0,
"near_expiration": 0,
"expired_at": 2389104000,
"coupon_qr": "",
"small_qr": "",
"coupon_qr_sn": "",
"valid": true,
"checked": false,
"time_start": "2018-05-02",
"time_end": "不限时间",
"belongs_to_coupon": {
"id": 9,
"uniacid": 6,
"cat_id": 0,
"name": "满110立减50",
"get_type": 1,
"level_limit": -1,
"get_max": 10,
"get_limit_max": 0,
"get_limit_type": 0,
"use_type": 2,
"return_type": 0,
"bgcolor": "",
"enough": 110,
"coupon_type": 0,
"time_limit": 0,
"time_days": 0,
"time_start": "2018-04-28",
"time_end": "2018-05-05",
"coupon_method": 1,
"discount": "0.00",
"deduct": "50.00",
"back_type": 0,
"back_money": "",
"back_credit": "",
"back_redpack": "",
"back_when": 0,
"thumb": "",
"desc": null,
"total": 100,
"status": 1,
"money": "0.00",
"resp_desc": null,
"resp_thumb": "",
"resp_title": "",
"resp_url": "",
"credit": 0,
"usecredit2": 0,
"remark": "",
"descnoset": 0,
"display_order": 0,
"supplier_uid": 0,
"getcashier": 0,
"cashiersids": null,
"cashiersnames": null,
"category_ids": [],
"categorynames": [],
"goods_names": ["本地123"],
"goods_ids": [99],
"storenames": [],
"member_tags_ids": null,
"member_tags_names": null,
"getstore": 0,
"getsupplier": 0,
"supplierids": null,
"suppliernames": null,
"createtime": 0,
"created_at": "2018-04-28",
"updated_at": "2020-12-02",
"deleted_at": null,
"is_complex": 1,
"plugin_id": 0,
"use_conditions": null,
"is_integral_exchange_coupon": 0,
"exchange_coupon_integral": null,
"coupon_type_name": "指定商品"
}
}, {
"id": 3,
"uid": 2455,
"coupon_id": 7,
"used": 0,
"use_time": 0,
"get_time": "2018-05-02 00:00:00",
"is_member_deleted": 0,
"is_expired": 0,
"near_expiration": 0,
"expired_at": 2389104000,
"coupon_qr": "",
"small_qr": "",
"coupon_qr_sn": "",
"valid": true,
"checked": false,
"time_start": "2018-05-02",
"time_end": "不限时间",
"belongs_to_coupon": {
"id": 7,
"uniacid": 6,
"cat_id": 0,
"name": "满100件10",
"get_type": 1,
"level_limit": -1,
"get_max": -1,
"get_limit_max": 0,
"get_limit_type": 0,
"use_type": 2,
"return_type": 0,
"bgcolor": "",
"enough": 100,
"coupon_type": 0,
"time_limit": 0,
"time_days": 0,
"time_start": "2017-11-29",
"time_end": "2017-12-06",
"coupon_method": 1,
"discount": "0.00",
"deduct": "10.00",
"back_type": 0,
"back_money": "",
"back_credit": "",
"back_redpack": "",
"back_when": 0,
"thumb": "",
"desc": null,
"total": 100,
"status": 1,
"money": "0.00",
"resp_desc": "",
"resp_thumb": "",
"resp_title": "",
"resp_url": "",
"credit": 0,
"usecredit2": 0,
"remark": "",
"descnoset": 0,
"display_order": 0,
"supplier_uid": 0,
"getcashier": 0,
"cashiersids": null,
"cashiersnames": null,
"category_ids": [],
"categorynames": [],
"goods_names": ["本地的哈哈步164"],
"goods_ids": [164],
"storenames": [],
"member_tags_ids": null,
"member_tags_names": null,
"getstore": 0,
"getsupplier": 0,
"supplierids": null,
"suppliernames": null,
"createtime": 0,
"created_at": "2017-11-29",
"updated_at": "2020-12-02",
"deleted_at": null,
"is_complex": 1,
"plugin_id": 0,
"use_conditions": null,
"is_integral_exchange_coupon": 0,
"exchange_coupon_integral": null,
"coupon_type_name": "指定商品"
}
}]
},
"dispatch": {
"delivery_method": [{
"dispatch_type_id": 1,
"name": "快递"
}],
"recommend_goods": [],
"use_wechat_address": false,
"default_member_address": {
"mobile": "150132454657",
"username": "收货人",
"province": "广东省",
"city": "广州市",
"district": "白云区",
"address": "新市二街 1003 号"
}
}
}
}
返回参数说明:
参数名 |
类型 |
说明 |
amount_items |
array |
金额项 |
discount_amount_items |
array |
优惠金额项 |
dispatch |
object |
配送 |
discount |
object |
优惠 |
orders |
[order] |
订单集合 |
is_agency_restock |
int |
是否是代理商进货订单(代理商进货订单不需要地址):0-否、1-是 |
amount_items参数名 |
类型 |
说明 |
code |
string |
代码 |
name |
string |
名称 |
amount |
float |
金额 |
fee_items参数名 |
类型 |
说明 |
name |
string |
手续费名称 |
amount |
float |
手续费金额 |
service_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 ] |
订单抵扣集合 |
order_fees |
[order_fees ] |
订单手续费集合 |
order_service_fees |
[order_service_fees ] |
订单服务费集合 |
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 |
是否选中 |
order_coin_exchanges 参数名 |
类型 |
说明 |
coin |
float |
抵扣值 |
amount |
float |
抵扣金额 |
code |
string |
抵扣码 |
name |
string |
抵扣名 |
has_one_dispatch_type 参数名 |
类型 |
说明 |
id |
int |
配送方式id |
name |
string |
配送方式名 |
diy_form 参数名 |
类型 |
说明 |
form_id |
int |
表单id |
form_data_id |
int |
表单数据id |