余额
字段可选
M:must 必填
O:optional 选填
C: conditional 某些条件下必选
搜索余额
接口名
/finance/balance
Method
GET
请求
query_data O string 查询内容,支持客户ID(K001或者1)
offset O int 分页缩进,默认0
limit O int 分页每页数量,默认10
响应
code M int 返回码,0表示成功,其他表示错误
msg M string 错误信息
data M string 返回json数据
[
{
"cellphone" M string 客户手机号
"name" M string 客户名
"deposit" M float 押金
"liquidity" M float 流动余额
"total_balance" M float 总余额
"id" M string 客户ID
}
]
示例
request
http://test.guanmai.cn:8888/finance/balance?query_data=K1&offset=0&limit=10
response
{
"data": [{
"name": "hahasadf",
"cellphone": "23223123",
"liquidity": 3.01,
"id": "K00001",
"deposit": 7.68,
"total_balance": 10.69
}],
"code": 0,
"pagination": {
"offset": 0,
"count": 80,
"limit": 10
},
"msg": "ok"
}
余额明细
接口名
/finance/balance/detail
Method
GET
请求
id M string 客户ID
响应
code M int 返回码,0表示成功,其他表示错误
msg M string 错误信息
data M string 返回json数据
"total_balance" M float 总余额
"deposit" M float 押金余额
"company" M string 公司名
"cellphone" M string 手机号
"name" M string 开户人
"liquidity" M float 流动余额
"id" M string 客户ID
"deposit_log": [{ M list 押金流水
"operator_name" M string 操作人名
"operate_time" M datetime 操作时间
"remain" M float 剩余金额
"change" M float 变动金额
"remark" M string 备注
"origin" M float 原始金额
}],
"liquidity_log": [{ M list 流动余额流水
"operator_name" M string 操作人名
"operate_time" M datetime 操作时间
"remain" M float 剩余金额
"change" M float 变动金额
"remark" M string 备注
"origin" M float 原始金额
}]
示例
request
http://test.guanmai.cn:8888/finance/balance/detail?id=K00001
response
{
"data": {
"name": "hahasadf",
"cellphone": "23223123",
"liquidity": 3.01,
"company": "test",
"deposit_log": [{
"operator_name": "superman",
"operate_time": "2016-09-16 19:30",
"remain": 10.0,
"change": 10.0,
"remark": "押金",
"origin": 0.0
}],
"liquidity_log": [{
"operator_name": "superman",
"operate_time": "2016-09-20 14:50",
"remain": -0.99,
"change": 0.13,
"remark": "",
"origin": -1.12
}],
"id": "K00001",
"deposit": 7.68,
"total_balance": 10.69
},
"code": 0,
"msg": "ok"
}
更新余额
接口名
/finance/balance/update
Method
POST
请求
"id" M string 客户ID
"type" M int 余额变动类型(1:押金;2:流动余额)
"change" M int 变动金额(分)
"remark" M string 备注
响应
code M int 返回码,0表示成功,其他表示错误
msg M string 错误信息
data M string 无
示例
request
http://test.guanmai.cn:8888/customer/create
form-data
id: K2
type: "1"
change: "-100"
remark: "dfafadf"
response
{
"data": "",
"code": 0,
"msg": "ok"
}
余额基础信息
接口名
/finance/balance/base_info
Method
GET
请求
无
响应
code M int 返回码,0表示成功,其他表示错误
msg M string 错误信息
data M string 基础信息
示例
request
127.0.0.1:8888/finance/balance/base_info
response
{
"data": {
"type": {
"REVERSE": 3,
"LIQUIDITY_REVERSED": 5,
"LIQUIDITY": 2,
"DEPOSIT_REVERSED": 4,
"DEPOSIT": 1
}
},
"code": 0,
"msg": "ok"
}
客户流动余额
接口名
/finance/balance/liquidity
Method
GET
请求
id M string 客户ID
响应
code M int 返回码,0表示成功,其他表示错误
msg M string 错误信息
data M float 流动余额
示例
request
127.0.0.1:8888/finance/balance/liquidity?id=K1
response
{
"data": 1.11,
"code": 0,
"msg": "ok"
}