账户/提款等
查询账户余额
shell
GET
https://api.nihaopay.com/v1.2/accounts该接口提供查询商家当前账户余额的功能。
请求示例
shell
$ curl https://api.nihaopay.com/v1.2/accounts \
-H "Authorization: Bearer <TOKEN>"请求
使用GET方式请求,无请求参数
返回示例
json
{
"accounts": [
{
"balance": "100.00",
"currency": "USD",
"pending_amount": "12.40",
"freeze_amount": "0.00"
}
]
}返回报文
如果请求成功,返回json格式的账户余额对象;如果请求失败,返回一个json格式的错误对象。
| 字段 | 说明 |
|---|---|
currencystring | 账户币种 |
balancestring | 当前账户余额 |
pending_amountstring | 当前未结算消费金额 |
freeze_amountstring | 当前未结算退款金额 |
查询提现历史记录
shell
GET
https://api.nihaopay.com/v1.2/withdrawal/history返回满足要求的提现交易列表,返回按照时间倒序排列。最多可以查询6个月的提款记录
请求示例
shell
$ curl https://api.nihaopay.com/v1.2/withdrawal/history/?start_date=20170101&end_date=20170105 \
-H "Authorization: Bearer <TOKEN>"请求报文
使用GET方式请求。
| 字段 | 说明 |
|---|---|
start_date不为空 | 开始日期,格式为YYYYMMDD. |
end_date不为空 | 结束日期,格式为YYYYMMDD. |
返回示例
json
{
"withdrawal": [
{
"id": "bn2345nb53454kjb",
"status": "completed",
"amount": "100.00",
"currency": "USD",
"fee": "0.30",
"fee_currency":"USD",
"date": "20170101"
}
]
}返回报文
返回一个提款交易对象的数组,如果在请求的时间段内没有交易,则返回为空数组。
| 字段 | 说明 |
|---|---|
idstring | NihaoPay生成的withdrawal ID |
statusstring | 提款状态. 包括:处理中 processing, 完成completed |
amountint | 提款金额 |
currencystring | 到账币种 |
feestring | 提款手续费 |
fee_currencystring | 手续费扣费币种 |
datestring | 提款日期,格式:YYYYMMDD |
查询提现明细
shell
GET
https://api.nihaopay.com/v1.2/withdrawal/detail/{withdrawal_id}通过withdrawl_id取得相对应的交易金额以及明细
请求示例
shell
$ curl https://api.nihaopay.com/v1.2/withdrawal/detail/{withdrawal_id} \
-H "Authorization: Bearer <TOKEN>"请求报文
withdrawal_id 以申请提款生成的withdrawal ID作为URL请求参数.
返回报文
返回一个CSV文件
