Appearance
6、MerchantBalance
6.1、MerchantBalance interface
URL: https://${domain}/api/mch/balance
Please replace ${domain} with your actual service domain name.
Type:POST
Content-Type:application/json
Description: This API is used to check merchant balances.
Body-parameters:
| Parameter | Type | limit | Required | Description |
|---|---|---|---|---|
| mchNo | string | 32 | true | Merchant number |
| appId | string | 32 | true | Application ID |
| sign | String | 256 | true | sign |
| reqTime | Int | 11 | true | Request timestamp (seconds) |
Request-example:
js
{
"mchNo": "M1735112701",
"appId": "676bb7fefb715596544e2210",
"sign": "B5C3EC55B093C9DE54EBB1199D0FFE7D",
"reqTime": "1739413509"
}6.1、MerchantBalance results
response format:Content-Type:application/json
Response-fields:
| Parameter | Type | Description |
|---|---|---|
| code | Int | Call result: 0 indicates success, other values indicate failure |
| data | Object | Contains specific data information |
| msg | string | Result description |
| sign | string | Signature, used to verify the integrity and authenticity of data |
data object field:
| Parameter | Type | Description |
|---|---|---|
| balanceAvailable | string | Available Balance |
| balanceFrozen | string | Frozen balance |
Response-example:
js
{
"code": 0,
"data": {
"balanceAvailable": 29140100,
"balanceFrozen": 2275300
},
"msg": "SUCCESS",
"sign": "1DF59653BF8091715B88AADC9F40FF53"
}TIP
•After receiving the response, be sure to validate the sign field to ensure the data has not been tampered with.
•Determine the payment status of the current order based on the value of state, and take corresponding business logic processing.
•Use HTTPS protocol to ensure the security of data transmission.
