[关闭]
@sewise-dev 2019-06-28T02:42:32.000000Z 字数 9509 阅读 594

启业家政支付接口文档

启业


更新历史

编号 版本 说明 作者 日期
1 v1.0 1.创建文档 Seven 2019-04-24


目录


【备注】

1. 全局返回码说明

每次调用接口时,可能获得正确或错误的返回码,开发者可以根据返回码信息调试接口,排查错误。

返回码 说明
-1 系统繁忙,此时请开发者稍候再试
0 请求失败
1 请求成功
200 响应成功
403 禁止访问
404 异常错误
500 数据验证错误
40001 不合法的凭证,或者access_token无效。
40004 不合法请求

HTTP请求状态返回格式

返回字段 字段类型 说明
status Integer 请求返回码(详细请见状态表)
message String 返回描述
data Array 返回结果

错误样例
{
"status": 40013,
"message": {"0":"invalid appid"}
}
成功样例
{
"status": 200,
"data": {"access_token":"ACCESS_TOKEN","expires_in":7200}
}


1.阿姨预定

1.1 计算费用

接口地址

/v1/cost/calculate

HTTP Content-Type / 请求方式

application/json
POST

请求参数
参数 必选 类型 说明
RequestBody
access_token String 用户授权签名
type Integer 类型: 1.月嫂 2.育婴师 3.保姆
resident Integer 是否住家: 1. 住家(默认) 2. 不住家
level Integer 等级: ( 0 : 初级, 1 : 一星 2 : 二星 3 : 三星 4 : 四星 5 : 五星 9 : 金牌)
twinAddition Integer 是否双胞胎: 1. 是 0. 不是(默认)
mode String 雇佣方式 : day month year
years String 年数(mode='year'必传)
months String 月数(mode='month'必传)
days String 天数(mode='day'必传)
HTTP 响应状态

200

返回字段 字段类型 说明
status int 返回状态码
message String 返回错误信息
data Array 返回结果
接口示例

Request
curl -X GET -H "Content-Type:application/json" -d http://api.xxx.com/v1/cost/calculate
Response
{
"status": 200,
"data": {
"employee": {
"tip": "8600/15天",
"item": [
{
"name": "阿姨基本工资(15天)",
"price": "6800"
},
{
"name": "双胞胎加收(15天)",
"price": "1800"
}
]
},
"platform": {
"tip": 1305,
"item": [
{
"name": "服务费(工资 × 15%)",
"price": 1290
},
{
"name": "保险费(15/15天)",
"price": "15"
}
]
}
}
}

1.2 微信账号注册平台账户

接口地址

/v1/weixin/register

HTTP Content-Type / 请求方式

application/json
POST

请求参数
参数 必选 类型 说明
RequestBody
code String 授权码
platform String 平台(weixin)
avatar String 头像
nickName String 微信名
HTTP 响应状态

200

返回字段 字段类型 说明
status int 返回状态码
message String 返回错误信息
data Array 返回结果
接口示例

Request
curl -X GET -H "Content-Type:application/json" -d http://api.xxx.com/v1/weixin/register
Response
{"status":200,"message":"\u4e0b\u5355\u6210\u529f\uff0c\u5df2\u652f\u4ed8"}

2.经济

2.1 我的账号情况 (收益 + 已提现 + 余额)

接口地址

/v1/wallet/myProfit?access_token={access_token}

HTTP Content-Type / 请求方式

application/json
GET/POST

请求参数
参数 必选 类型 说明
RequestBody
access_token string 用户授权码
HTTP 响应状态

200

返回字段 字段类型 说明
status int 返回状态码
message String 返回错误信息
data Array 返回结果
接口示例

Request
curl -X POST -H "Content-Type:application/json" -d http://v.sewise.com/v1/wallet/myProfit?access_token=fPodlcWfHfUfGiLhZ4rhw6Qyd2xjzUkoXXDRYlZA
Response
{"status":200,"data":{"activeAmount":"28.01","extractAmount":"0.00","incomeAmount":"0.05"}}
参数说明
"activeAmount":"可用金额",
"extractAmount":"已提现金额",
"incomeAmount":"总收入金额"

2.2 微信小程序下单

接口地址

/v1/wxpay/miniUnifiedOrder?access_token={access_token}

HTTP Content-Type / 请求方式

application/json
POST

请求参数
参数 必选 类型 说明
RequestBody
access_token String 用户授权签名
openid String 用户openid,如果access_token没有则必须传
orderName String 订单/商品描述
orderType String 订单类型:housekeep(家政服务)
totalFee decimal 订单金额(元)
productId String 阿姨用户id
HTTP 响应状态

200

返回字段 字段类型 说明
status int 返回状态码
message String 返回错误信息
data Array 返回结果
接口示例

Request
curl -X GET -H "Content-Type:application/json" -d http://v.sewise.com/v1/wxpay/miniUnifiedOrder
Response
{"status":200,"message":"\u4e0b\u5355\u6210\u529f","data":{"appId":"wx1e77d8b41a555b54","nonceStr":"e4e01muc40v0ad593ea7dgmq2n66k4yr","package":"prepay_id=wx20171222113926b5a05da8a60215295518","signType":"MD5","timeStamp":"1513913966","paySign":"4F27E577A9B40303AA91E6380528A6FD"}}

2.3 我的支出账单

接口地址

/v1/order/buyList??access_token={access_token}

HTTP Content-Type / 请求方式

application/json
GET/POST

请求参数
参数 必选 类型 说明
RequestBody
page int 页数,默认1
pageSize int 页码,默认20
order String 排序:orderId desc
q String 关键字搜索
orderType int 订单类型:normal(普通),speech(语音识别),course(课程),swl(课时),knowledge(知识点),live(直播)
payStatus int 支付状态: 1.下单成功(未支付) 2.已支付
startTime String 开始时间
endTime String 结束时间
HTTP 响应状态

200

返回字段 字段类型 说明
status int 返回状态码
message String 返回错误信息
data Array 返回结果
接口示例

Request
{"status":200,"data":{"total_page":1,"page":1,"pagesize":20,"total_record":1,"total_amount":"5.00","record":[{"orderId":"856","orderName":"\u7535\u529b\u7cfb\u7edf\u9884\u6d4b\u8bfe\u7a0b","outTradeNo":"1492814002201809071633291555","orderNo":"1492814002201809071633291555","orderType":"toy","payMode":"WXPAY","number":"2","totalFee":"4.50","originalFee":"5.00","payStatus":"2","tradeType":"JSAPI","userId":"628","productId":"79080a09-5147-417d-b0b6-23a8cddf29dc","payDate":null,"businessUserId":"1011","business":"\u4e01\u7ea2\u8273","creationDate":"2018-09-07 16:33:29","username":"yanshan-teacher","nickName":"\u4e01\u7ea2\u8273"}]}}

2.4 我的收入账单

接口地址

/v1/order/list?access_token={access_token}

HTTP Content-Type / 请求方式

application/json
GET/POST

请求参数
参数 必选 类型 说明
RequestBody
page int 页数,默认1
pageSize int 页码,默认20
order String 排序:orderId desc
q String 关键字搜索
orderType int 订单类型:normal(普通),speech(语音识别),course(课程),swl(课时),knowledge(知识点),live(直播),toy(玩具)
payStatus int 支付状态: 1.下单成功(未支付) 2.已支付
startTime String 开始时间
endTime String 结束时间
HTTP 响应状态

200

返回字段 字段类型 说明
status int 返回状态码
message String 返回错误信息
data Array 返回结果
接口示例

Request
{"status":200,"data":{"total_page":7,"page":1,"pagesize":"3","total_record":19,"total_amount":"76.94","record":[{"orderId":"856","orderName":"\u7535\u529b\u7cfb\u7edf\u9884\u6d4b\u8bfe\u7a0b","outTradeNo":"1492814002201809071633291555","orderNo":"1492814002201809071633291555","orderType":"toy","payMode":"WXPAY","number":"2","totalFee":"4.50","originalFee":"5.00","platformIncomeFee":"4.50","relationIncomeFee":"0.50","distributorIncomeFee":"0.00","payStatus":"2","tradeType":"JSAPI","userId":"628","productId":"79080a09-5147-417d-b0b6-23a8cddf29dc","payDate":null,"businessUserId":"1011","business":"\u4e01\u7ea2\u8273","distributorUserId":"","distributor":"","relationId":"45555","relationUserId":"469","relationtor":"\u534e\u4f01\u8001\u5e08","recipients":"\u8521\u98de","mobile":"0","address":"\u5730\u5740\u6587\u4ef6\u662f\u6e21\u52ab\u53d1\u751f\u7684\u53d1","creationDate":"2018-09-07 16:33:29","username":"44442","nickName":"44442"},{"orderId":"840","orderName":"\u7ec8\u7aef\u7ba1\u7406\u8005\uff1a\u81ea\u8eab\u4fee\u70bc","outTradeNo":"1492814002201805261131235270","orderNo":"1492814002201805261131235270","orderType":"course","payMode":"WXPAY","number":"1","totalFee":"1.00","originalFee":"1.00","platformIncomeFee":"0.00","relationIncomeFee":"0.00","distributorIncomeFee":"0.00","payStatus":"1","tradeType":"JSAPI","userId":"28335","productId":"71995aab-48dc-4df1-b64a-bd3f14adf428","payDate":null,"businessUserId":"469","business":"\u534e\u4f01\u8001\u5e08","distributorUserId":null,"distributor":null,"relationId":null,"relationUserId":null,"relationtor":null,"recipients":null,"mobile":"0","address":null,"creationDate":"2018-05-26 11:31:23","username":"wx_2018032854539757","nickName":"xwz"},{"orderId":"839","orderName":"\u5546\u6807\u53ca\u5546\u4e1a\u79d8\u5bc6\u98ce\u9669\u7ba1\u7406","outTradeNo":"1492814002201805221147112648","orderNo":"4200000140201805222835223307","orderType":"course","payMode":"WXPAY","number":"1","totalFee":"9.90","originalFee":"9.90","platformIncomeFee":"0.00","relationIncomeFee":"0.00","distributorIncomeFee":"0.00","payStatus":"2","tradeType":"NATIVE","userId":"500","productId":"e6c290ac-59d3-491c-ae76-2f7790970e6a","payDate":"2018-05-22 11:47:27","businessUserId":"469","business":"\u534e\u4f01\u8001\u5e08","distributorUserId":null,"distributor":null,"relationId":null,"relationUserId":null,"relationtor":null,"recipients":null,"mobile":"0","address":null,"creationDate":"2018-05-22 11:47:11","username":"sewise01","nickName":"eric"}]}}

2.5 销售订单

接口地址

/v1/manager/orderList?access_token={access_token}

HTTP Content-Type / 请求方式

application/json
GET/POST

请求参数
参数 必选 类型 说明
RequestBody
page int 页数,默认1
pageSize int 页码,默认20
order String 排序:orderId desc
q String 关键字搜索
orderType int 订单类型:normal(普通),speech(语音识别),course(课程),swl(课时),knowledge(知识点),live(直播),toy(玩具)
payStatus int 支付状态: 1.下单成功(未支付) 2.已支付
startTime String 开始时间
endTime String 结束时间
HTTP 响应状态

200

返回字段 字段类型 说明
status int 返回状态码
message String 返回错误信息
data Array 返回结果
接口示例

Request
{"status":200,"data":{"total_page":144,"page":1,"pagesize":"2","total_record":287,"total_amount":"2279.84","record":[{"orderId":"856","orderName":"\u7535\u529b\u7cfb\u7edf\u9884\u6d4b\u8bfe\u7a0b","outTradeNo":"1492814002201809071633291555","orderNo":"1492814002201809071633291555","orderType":"toy","number":"2","totalFee":"4.50","originalFee":"5.00","platformIncomeFee":"4.50","relationIncomeFee":"0.50","distributorIncomeFee":"0.00","payStatus":"2","userId":"628","username":"44442","nickName":"44442","payDate":null,"businessUserId":"1011","business":"\u4e01\u7ea2\u8273","distributorUserId":"","distributor":"","relationId":"45555","relationUserId":"469","relationtor":"\u534e\u4f01\u8001\u5e08","recipients":"\u8521\u98de","mobile":"1867557703","address":"\u5730\u5740\u6587\u4ef6\u662f\u6e21\u52ab\u53d1\u751f\u7684\u53d1","creationDate":"2018-09-07 16:33:29","businessUserName":"yanshan-teacher","distributorUserName":"","relationUserName":"huaqilaoshi"},{"orderId":"839","orderName":"\u5546\u6807\u53ca\u5546\u4e1a\u79d8\u5bc6\u98ce\u9669\u7ba1\u7406","outTradeNo":"1492814002201805221147112648","orderNo":"4200000140201805222835223307","orderType":"course","number":"1","totalFee":"9.90","originalFee":"9.90","platformIncomeFee":"0.00","relationIncomeFee":"0.00","distributorIncomeFee":"0.00","payStatus":"2","userId":"500","username":"sewise01","nickName":"eric","payDate":"2018-05-22 11:47:27","businessUserId":"469","business":"\u534e\u4f01\u8001\u5e08","distributorUserId":null,"distributor":null,"relationId":null,"relationUserId":null,"relationtor":null,"recipients":null,"mobile":null,"address":null,"creationDate":"2018-05-22 11:47:11","businessUserName":"huaqilaoshi","distributorUserName":"","relationUserName":""}]}}

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注