Skip to content

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:

ParameterTypelimitRequiredDescription
mchNostring32trueMerchant number
appIdstring32trueApplication ID
signString256truesign
reqTimeInt11trueRequest 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:

ParameterTypeDescription
codeIntCall result: 0 indicates success, other values ​​indicate failure
dataObjectContains specific data information
msgstringResult description
signstringSignature, used to verify the integrity and authenticity of data

data object field:

ParameterTypeDescription
balanceAvailablestringAvailable Balance
balanceFrozenstringFrozen 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.