open api 订单相关接口
一、创建订单
1. 请求地址
环境 | 请求方式 | 请求地址 |
---|---|---|
正式 | POST | http://www.daoway.cn/daoway/rest/openapi/order/create |
测试 | POST | http://test.daoway.cn/daoway/rest/openapi/order/create |
2. 请求参数说明
名称 | 类型 | 是否必须 | 示例值 | 描述 |
---|---|---|---|---|
channel | string | 是 | nuomi | 渠道号,由到位分配 |
storeId | string | 是 | 店铺id | |
orderItems | string | 是 | [{"productId":"97803", "quantity":1}] | 购买项目(json格式的字符串) |
address | string | 是 | 下单地址,最少6个汉字 | |
phone | string | 是 | 联系手机 | |
addrLng | double | 是 | 下单地址纬度 | |
addrLat | double | 是 | 下单地址经度 | |
appointTime | string | 是 | 预约时间;例:2018-05-04 15:30:00 | |
contactPerson | string | 是 | 下单联系人姓名 | |
city | string | 是 | 下单城市 | |
street | string | 是 | 街道 | |
house | string | 是 | 门牌号 | |
note | string | 否 | 备注 | |
sign | string | 是 | rsa签名,所有参数参与签名,详见rsa签名与验签 |
3. 参数items说明
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
productId | string | 3280482 | 商品id |
quantity | int | 1 | 数量 |
4. 返回说明
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
status | string | ok | ok或error |
msg | string | 返回信息 | |
data | object | 返回数据 |
5. 返回数据data说明
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
orderId | string | 订单id | |
statusId | string | 状态id | |
statusTitle | string | 状态名称 | |
statusDesc | string | 状态说明 | |
address | string | 下单地址 | |
note | string | 下单备注 | |
sellerNote | string | 商家备注 | |
contactPerson | string | 联系人 | |
contactPhone | string | 联系电话 | |
storeId | string | 店铺id | |
storeName | string | 店铺名称 | |
storeImgUrl | string | 店铺图片地址 | |
createTime | date | 订单创建时间 | |
modifyTime | date | 订单修改时间 | |
appointTime | date | 预约时间 | |
sellerConfirmTime | date | 卖家接单时间 | |
buyerCompleteTime | date | 买家确认完成时间 | |
sellerCompleteTime | date | 卖家确认完成时间 | |
refundTime | date | 退款时间 | |
applyRefundReason | string | 申请退款原因 | |
rejectRefundReason | string | 拒绝退款原因 | |
rejectOrderReason | string | 拒绝订单原因 | |
cancelOrderReason | string | 取消订单原因 | |
paid | boolean | 是否已支付 | |
orderAmount | double | 订单总金额 | |
paymentAmount | double | 支付总金额 | |
buyer | object | 买家信息 | |
seller | object | 卖家信息 | |
items | array | 订单项目集合 |
6. 订单项目集合items说明
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
productId | string | 29052 | 服务项目id |
productName | string | 保洁 | 服务项目名称 |
unit | string | /次 | 单位 |
price | double | 40 | 价格 |
picUrl | string | 服务项目图片 | |
quantity | int | 1 | 购买数量 |
description | string | 服务项目说明 |
7. 买家buyer/卖家seller说明
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
userId | string | 用户id | |
nick | string | 用户昵称 | |
phone | string | 用户手机 |
8. 返回示例
{
"data": {
"orderId": "2017022816031886561614733835",
"statusId": "9",
"statusTitle": "PENDING_PAY",
"statusDesc": "待用户付款",
"address": "123456",
"note": null,
"sellerNote": null,
"contactPerson": null,
"contactPhone": null,
"storeId": "13f6d4f633a64d909c08df578be20d9b",
"storeName": "河马送水",
"storeImgUrl": "http://img.daoway.cn/img/2015/09/23/5d2dd5a3-e69a-4b12-817f-744abdda567a.jpg",
"createTime": 1488268998000,
"modifyTime": 1488268998000,
"appointTime": 1488279600000,
"buyerCompleteTime": null,
"sellerCompleteTime": null,
"sellerConfirmTime": null,
"refundTime": null,
"applyRefundReason": null,
"rejectRefundReason": null,
"rejectOrderReason": null,
"cancelOrderReason": null,
"paid": false,
"orderAmount": 42.9,
"paymentAmount": 0,
"buyer": {
"userId": "769c217f17244d93bd3f242eb0206416",
"nick": "18543344333",
"phone": "18543344333"
},
"seller": {
"userId": "d7699b3c28a0486988c8d3b3d14e479a",
"nick": "河马送水客服",
"phone": "13521839151"
},
"items": [
{
"productId": "97803",
"productName": "怡宝瓶装纯净水4.5L*4/箱",
"unit": "元/箱",
"price": 42.9,
"picUrl": "http://img.daoway.cn/img/2016/11/21/20a3d847-d672-431c-a80b-459aa414c72a.jpg",
"quantity": 1,
"description": null
}
]
},
"status": "ok"
}
二、订单支付接口
注:渠道方需提前在到位平台预充值方可调用该接口通知进行支付。
1. 请求地址
环境 | 请求方式 | 请求地址 |
---|---|---|
正式 | POST | http://www.daoway.cn/daoway/rest/openapi/pay |
测试 | POST | http://test.daoway.cn/daoway/rest/openapi/pay |
2. 请求参数说明
名称 | 类型 | 是否必须 | 示例值 | 描述 |
---|---|---|---|---|
channel | string | 是 | nuomi | 渠道号,由到位分配 |
orderId | string | 是 | 2017011215064442155179691603 | 到位平台订单号 |
storeId | string | 是 | 304f5ea4f3a74eec8e2cd7ff0b668628 | 商家id |
amount | int | 是 | 9400 | 金额,单位为分 |
sign | string | 是 | rsa签名,所有参数参与签名,详见rsa签名与验签 |
3. 返回说明
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
status | string | ok | ok或error |
msg | string | 返回信息 |
4. 返回示例
{
status: "ok"
}
三、用户取消订单
1. 请求地址
环境 | 请求方式 | 请求地址 |
---|---|---|
正式 | POST | http://www.daoway.cn/daoway/rest/openapi/order/buyer_cancel |
测试 | POST | http://test.daoway.cn/daoway/rest/openapi/order/buyer_cancel |
2. 请求参数说明
名称 | 类型 | 是否必须 | 示例值 | 描述 |
---|---|---|---|---|
channel | string | 是 | nuomi | 渠道号,由到位分配 |
orderId | string | 是 | 订单id | |
sign | string | 是 | rsa签名,所有参数参与签名,详见rsa签名与验签 |
3. 返回说明
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
status | string | ok | ok或error |
msg | string | 返回信息 | |
data | object | 返回数据 |
4. 返回数据data说明
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
orderId | string | 订单id | |
statusId | string | 状态id | |
statusTitle | string | 状态名称 | |
statusDesc | string | 状态说明 | |
modifyTime | date | 修改时间 | |
appointTime | date | 预约时间 | |
contactPerson | string | 联系人 |
5. 返回示例
{
"data": {
"orderId": "2017022816031886561614733835",
"statusId": "5",
"statusTitle": "CANCELED_CAUSE_NOT_PAY",
"statusDesc": "未支付取消",
"modifyTime": 1488269487991,
"appointTime": 1488279600000,
"contactPerson": null
},
"status": "ok"
}
四、用户申请退款
1. 请求地址
环境 | 请求方式 | 请求地址 |
---|---|---|
正式 | POST | http://www.daoway.cn/daoway/rest/openapi/order/buyer_apply_refund |
测试 | POST | http://test.daoway.cn/daoway/rest/openapi/order/buyer_apply_refund |
2. 请求参数说明
名称 | 类型 | 是否必须 | 示例值 | 描述 |
---|---|---|---|---|
channel | string | 是 | nuomi | 渠道号,由到位分配 |
orderId | string | 是 | 订单id | |
sign | string | 是 | rsa签名,所有参数参与签名,详见rsa签名与验签 |
3. 返回说明
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
status | string | ok | ok或error |
msg | string | 返回信息 | |
data | object | 返回数据 |
4. 返回数据data说明
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
orderId | string | 订单id | |
statusId | string | 状态id | |
statusTitle | string | 状态名称 | |
statusDesc | string | 状态说明 | |
modifyTime | date | 修改时间 | |
appointTime | date | 预约时间 | |
contactPerson | string | 联系人 |
5. 返回示例
{
"data": {
"orderId": "2017022816270709438471345581",
"statusId": "11",
"statusTitle": "PENDING_REFUND",
"statusDesc": "申请退款",
"modifyTime": 1488272384895,
"appointTime": 1488279600000,
"contactPerson": null
},
"status": "ok"
}
五、用户取消申请退款
1. 请求地址
环境 | 请求方式 | 请求地址 |
---|---|---|
正式 | POST | http://www.daoway.cn/daoway/rest/openapi/order/buyer_cancel_apply_refund |
测试 | POST | http://test.daoway.cn/daoway/rest/openapi/order/buyer_cancel_apply_refund |
2. 请求参数说明
名称 | 类型 | 是否必须 | 示例值 | 描述 |
---|---|---|---|---|
channel | string | 是 | nuomi | 渠道号,由到位分配 |
orderId | string | 是 | 订单id | |
sign | string | 是 | rsa签名,所有参数参与签名,详见rsa签名与验签 |
3. 返回说明
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
status | string | ok | ok或error |
msg | string | 返回信息 | |
data | object | 返回数据 |
4. 返回数据data说明
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
orderId | string | 订单id | |
statusId | string | 状态id | |
statusTitle | string | 状态名称 | |
statusDesc | string | 状态说明 | |
modifyTime | date | 修改时间 | |
appointTime | date | 预约时间 | |
contactPerson | string | 联系人 |
5. 返回示例
{
"data": {
"orderId": "2017022816270709438471345581",
"statusId": "1",
"statusTitle": "CONFIRMED",
"statusDesc": "商家已确认",
"modifyTime": 1488272428508,
"appointTime": 1488279600000,
"contactPerson": null
},
"status": "ok"
}
六、获取订单详情
1. 请求地址
环境 | 请求方式 | 请求地址 |
---|---|---|
正式 | POST | http://www.daoway.cn/daoway/rest/openapi/order/detail |
测试 | POST | http://test.daoway.cn/daoway/rest/openapi/order/detail |
2. 请求参数说明
名称 | 类型 | 是否必须 | 示例值 | 描述 |
---|---|---|---|---|
channel | string | 是 | nuomi | 渠道号,由到位分配 |
orderId | string | 是 | 订单id | |
sign | string | 是 | rsa签名,所有参数参与签名,详见rsa签名与验签 |
3. 返回说明
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
status | string | ok | ok或error |
msg | string | 返回信息 | |
data | object | 返回数据 |
4. 返回数据data说明
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
orderId | string | 订单id | |
statusId | string | 状态id | |
statusTitle | string | 状态名称 | |
statusDesc | string | 状态说明 | |
address | string | 下单地址 | |
note | string | 下单备注 | |
sellerNote | string | 商家备注 | |
contactPerson | string | 联系人 | |
contactPhone | string | 联系电话 | |
storeId | string | 店铺id | |
storeName | string | 店铺名称 | |
storeImgUrl | string | 店铺图片地址 | |
createTime | date | 订单创建时间 | |
modifyTime | date | 订单修改时间 | |
appointTime | date | 预约时间 | |
sellerConfirmTime | date | 卖家接单时间 | |
buyerCompleteTime | date | 买家确认完成时间 | |
sellerCompleteTime | date | 卖家确认完成时间 | |
refundTime | date | 退款时间 | |
applyRefundReason | string | 申请退款原因 | |
rejectRefundReason | string | 拒绝退款原因 | |
rejectOrderReason | string | 拒绝订单原因 | |
cancelOrderReason | string | 取消订单原因 | |
paid | boolean | 是否已支付 | |
orderAmount | double | 订单总金额 | |
paymentAmount | double | 支付总金额 | |
buyer | object | 买家信息 | |
seller | object | 卖家信息 | |
items | array | 订单项目集合 |
5. 订单项目集合items说明
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
productId | string | 29052 | 服务项目id |
productName | string | 保洁 | 服务项目名称 |
unit | string | /次 | 单位 |
price | double | 40 | 价格 |
picUrl | string | 服务项目图片 | |
quantity | int | 1 | 购买数量 |
description | string | 服务项目说明 |
6. 买家buyer/卖家seller说明
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
userId | string | 用户id | |
nick | string | 用户昵称 | |
phone | string | 用户手机 |
7. 返回示例
{
"data": {
"orderId": "2017022816031886561614733835",
"statusId": "5",
"statusTitle": "CANCELED_CAUSE_NOT_PAY",
"statusDesc": "未支付取消",
"address": "123456",
"note": null,
"sellerNote": null,
"contactPerson": null,
"contactPhone": null,
"storeId": "13f6d4f633a64d909c08df578be20d9b",
"storeName": "河马送水",
"storeImgUrl": "http://img.daoway.cn/img/2015/09/23/5d2dd5a3-e69a-4b12-817f-744abdda567a.jpg",
"createTime": 1488268998000,
"modifyTime": 1488269487000,
"appointTime": 1488279600000,
"buyerCompleteTime": null,
"sellerCompleteTime": null,
"sellerConfirmTime": null,
"refundTime": null,
"applyRefundReason": null,
"rejectRefundReason": null,
"rejectOrderReason": null,
"cancelOrderReason": null,
"paid": false,
"orderAmount": 42.9,
"paymentAmount": 0,
"buyer": {
"userId": "769c217f17244d93bd3f242eb0206416",
"nick": "18543344333",
"phone": "18543344333"
},
"seller": {
"userId": "d7699b3c28a0486988c8d3b3d14e479a",
"nick": "河马送水客服",
"phone": "13521839151"
},
"items": [
{
"productId": "97803",
"productName": "怡宝瓶装纯净水4.5L*4/箱",
"unit": "元/箱",
"price": 42.9,
"picUrl": "http://img.daoway.cn/img/2016/11/21/20a3d847-d672-431c-a80b-459aa414c72a.jpg",
"quantity": 1,
"description": null
}
]
},
"status": "ok"
}
七、用户确认订单
1. 请求地址
环境 | 请求方式 | 请求地址 |
---|---|---|
正式 | POST | http://www.daoway.cn/daoway/rest/openapi/order/buyer_confirm |
测试 | POST | http://test.daoway.cn/daoway/rest/openapi/order/buyer_confirm |
2. 请求参数说明
名称 | 类型 | 是否必须 | 示例值 | 描述 |
---|---|---|---|---|
channel | string | 是 | nuomi | 渠道号,由到位分配 |
orderId | string | 是 | 订单id | |
sign | string | 是 | rsa签名,所有参数参与签名,详见rsa签名与验签 |
3. 返回说明
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
status | string | ok | ok或error |
msg | string | 返回信息 | |
data | object | 返回数据 |
4. 返回数据data说明
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
orderId | string | 订单id | |
statusId | string | 状态id | |
statusTitle | string | 状态名称 | |
statusDesc | string | 状态说明 | |
modifyTime | date | 修改时间 | |
appointTime | date | 预约时间 | |
contactPerson | string | 联系人 |
5. 返回示例
{
"data": {
"orderId": "2017022816031886561614733835",
"statusId": "5",
"statusTitle": "CANCELED_CAUSE_NOT_PAY",
"statusDesc": "未支付取消",
"modifyTime": 1488269487991,
"appointTime": 1488279600000,
"contactPerson": null
},
"status": "ok"
}
九、订单状态变更通知接口
该接口需由渠道合作方提供接口地址,用以接收到位平台(商家)发起的订单状态变更通知。
1. 通知触发条件
订单由商家操作发生变化时,到位将通知合作方订单状态变更信息。
2. 通知参数说明
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
orderId | string | 订单id | |
statusId | string | 状态id | |
statusTitle | string | 状态名称 | |
statusDesc | string | 状态说明 | |
note | string | 备注 | |
sign | string | 是 | rsa签名,所有参数参与签名,详见rsa签名与验签 |
3. 业务方接收注意事项
1. 到位平台是用POST方式发送通知信息。
2. 当http请求成功时(即http status = 200),即视为通知成功。