Account / Withdrawal
Inquiry account balance
shell
GET
https://api.nihaopay.com/v1.2/accountsRequest
shell
$ curl https://api.nihaopay.com/v1.2/accounts \
-H "Authorization: Bearer <TOKEN>"Request
Properties as URL GET parameters.
Response
json
{
"accounts": [
{
"balance": "100.00",
"currency": "USD",
"pending_amount": "12.40",
"freeze_amount": "0.00"
}
]
}Response
Returns merchant account object.
| Property | Description |
|---|---|
currencystring | Account currency |
balancestring | Currently account balance |
pending_amountstring | Currently unsettled purchase amount |
freeze_amountstring | Currently unsettled refund amount |
Inquiry withdrawal history
shell
GET
https://api.nihaopay.com/v1.2/withdrawal/historyRequest
shell
$ curl https://api.nihaopay.com/v1.2/withdrawal/history/?start_date=20170101&end_date=20170105 \
-H "Authorization: Bearer <TOKEN>"Request
Properties as URL GET parameters.
| Property | Description |
|---|---|
start_dateRequired | Start date, formatted as YYYYMMDD. |
end_dateRequired | End date, formatted as YYYYMMDD. |
Response
json
{
"withdrawal": [
{
"id": "bn2345nb53454kjb",
"status": "completed",
"amount": "100.00",
"currency": "USD",
"fee": "0.30",
"fee_currency":"USD",
"date": "20170101"
}
]
}Response
Return an array of withdrawal object. If no transactions are available, returns an empty array.
| Property | Description |
|---|---|
idstring | NihaoPay withdrawal ID |
statusstring | Withdrawal status. Included processing and completed. |
amountint | Withdrawal amount |
currencystring | Withdrawal currency |
feestring | Withdrawal fee |
fee_currencystring | Withdrawal fee currency type. |
datestring | Withdrawal date, formatted as YYYYMMDD |
Withdrawal Details
shell
GET
https://api.nihaopay.com/v1.2/withdrawal/detail/{withdrawal_id}According to the withdrawal_id to get the corresponding data
Request
shell
$ curl https://api.nihaopay.com/v1.2/withdrawal/detail/{withdrawal_id} \
-H "Authorization: Bearer <TOKEN>"Request
withdrawal_id : ID generated by 'Apply Withdrawal' request, and send this ID as parameter.
Resonse
Convert return data to a CSV file which conclude all the data.
