余额
橙旭园儿童编程
获取余额
whoami 接口也会返回余额,字段名 balance
Method and URL Structure
Method |
Resource URL |
Authorization |
GET |
/server/balance/ |
YES |
cURL Example
curl -X GET http://localhost/server/balance/
Response Data
Name |
Description |
pk |
id |
owner |
用户 |
amount |
金额 |
withdraw_amount |
已结算金额 |
record_amount |
交易总额 |
Response
{
"pk":1,
"owner":"test_003",
"amount":"19.80",
"withdraw_amount": "10.00",
"record_amount": "29.80",
"create_time":"2018-03-30T10:49:19.543563"
}
获取余额记录
whoami 接口也会返回余额,字段名 balance
Method and URL Structure
Method |
Resource URL |
Authorization |
GET |
/server/balance/record/ |
YES |
cURL Example
curl -X GET http://localhost/server/balance/record/
Response Data
Name |
Description |
pk |
id |
owner |
用户 |
amount |
金额 |
record_type |
类型 |
extra |
备注 |
Response
{
"count":4,
"next":null,
"previous":null,
"results":[{
"pk":6,
"owner":"test_003",
"amount":"-3.90",
"extra":"",
"record_type":"支付",
"create_time":"2017-11-13T16:34:29.433586"
},{
"pk":5,
"owner":"test_003",
"amount":"9.90",
"extra":"",
"record_type":"奖学金",
"create_time":"2017-11-13T16:34:29.431315"
},{
"pk":4,
"owner":"test_003",
"amount":"-3.90",
"extra":"",
"record_type":"支付",
"create_time":"2017-11-13T16:34:29.429003"
},{
"pk":3,
"owner":"test_003",
"amount":"9.90",
"extra":"",
"record_type":"奖学金",
"create_time":"2017-11-13T16:34:29.426718"
}]
}
提现
Method and URL Structure
Method |
Resource URL |
Authorization |
POST |
/server/balance/withdraw/ |
YES |
cURL Example
curl -X POST --data '{...}' http://localhost/server/balance/withdraw/
Request Pramaters
Name |
Description |
amount |
金额 |
extra |
备注:支付账号等信息 |
Request Data
{
"amount": 33.3,
"extra": "支付宝:xxxx_yyy,
名字:小明,
日期:2018-03-30"
}
Response
`
{
"message": "",
"status": 0,
}