Balance
Request
API URL: /merchant/v2/{GUID}/balance
Note
{GUID} Obtained from the merchant backend (API Docking -> GUID)
✅ Required ⭕ Optional ❌ Not used
| Header | Content | Description |
|---|---|---|
| Content-Type | text/plain | |
| X-Transaction-Signature | {transaction_signature} | Please refer to Transaction Signature |
| Param | Type | Required | Sign | Description |
|---|---|---|---|---|
| user_id | String | ✅ | ✅ | Merchant identification |
| balance_mode | Integer | ⭕ | ❌ | 0 = Return total balance(Default) 1 = Return available balance 2 = Return total balance and available balance |
| timestamp | Integer | ✅ | ✅ | Request timestamp (10 digits), If the time difference is allowed to be 5 seconds, it will fail. |
| sign | String | ✅ | ❌ | Signature string. Please refer to Data Signature and Verification |
Response
| Param | Type | Required | Sign | Description |
|---|---|---|---|---|
| user_id | String | ✅ | ✅ | Merchant identification |
| PHP | Object | ⭕ | ❌ | Display channels and balances on them (Please refer to Response Example) |
| sign | String | ✅ | ❌ | Signature string. Please refer to Data Signature and Verification |
Response Example
- balance_mode = 0
- balance_mode = 1
- balance_mode = 2
{
"code": "1000",
"message": "Accepted",
"data": {
"user_id": "28",
"PHP": {
"MAYA": 68888
},
"sign": "QHnRqweqweeqw23aQmUGTfPCVNKLzels+..."
}
}
{
"code": "1000",
"message": "Accepted",
"data": {
"user_id": "28",
"PHP": {
"MAYA": 58888
},
"sign": "QHnRBlfzyIa72eaQmUGTfPCVNKLzels+..."
}
}
{
"code": "1000",
"message": "Accepted",
"data": {
"user_id": "28",
"PHP": {
"MAYA": {
"total": 68888,
"available": 58888
}
},
"sign": "KB5wsnyv64IL24GkSWUHIbdEG5QhdwFZqQa4Fn3..."
}
}