Query Balance
⚠️ This API uses the GET method, but the original documentation describes the parameters as a request body (
request_id,balance_type, ...) — according to the general convention on the Security page, the GET method requires signing on the alphabetically sorted query string, not a JSON body. Need to confirm with dev the actual way of passing parameters for this API.
Process
Merchant calls this API to query the Merchant's balance at the time of the call.
API Information
URL: /b2b/core/api/ext/balance/inquery
Method: GET
Request
Main Parameters Table
| No. | Field Name | Data Type | Required | Description |
|---|---|---|---|---|
| 1 | request_id | String | ✅ | Unique ID for each Request from MERCHANT to Baokim. |
| 2 | request_time | String | ✅ | Request sent time. Format: YYYY-MM-DD H:i:s |
| 3 | master_merchant_code | String | ✅ | Unique identifier for MASTER MERCHANT |
| 4 | sub_merchant_code | String | ✅ | Unique identifier for SUB MERCHANT |
| 5 | balance_type | Number | ✅ | 1: Estimated balance 2: Disbursement (debit) balance |
Request Example
{
"request_id": "MERCHANT050015588AXE014",
"request_time": "2025-08-11 14:41:00",
"master_merchant_code": "MERCHANTCODE_MASTER",
"sub_merchant_code": "MERCHANTCODE_SUB",
"balance_type": 2
}
Response
Main Parameters Table
| No. | Field Name | Data Type | Required | Description |
|---|---|---|---|---|
| 1 | code | Number | ✅ | Baokim error code |
| 2 | message | String | ✅ | Baokim error code message |
| 3 | data | Object | ✅ | Data returned by Baokim |
data Information
| No. | Field Name | Data Type | Required | Description |
|---|---|---|---|---|
| 1 | master_merchant_code | String | ✅ | Unique identifier for MASTER MERCHANT |
| 2 | sub_merchant_code | String | ✅ | Unique identifier for SUB MERCHANT |
| 3 | balance | Number | ✅ | Balance |
| 4 | created_at | DateTime | ✅ | Created date |
| 5 | updated_at | DateTime | ✅ | Updated date |
Response Example
{
"code": 100,
"message": "Success",
"data": {
"master_merchant_code": "MERCHANTCODE_MASTER",
"sub_merchant_code": "MERCHANTCODE_SUB",
"balance": 100000000,
"created_at": "2025-12-01 12:00:00",
"updated_at": "2025-12-01 12:00:00"
}
}
Error Codes
| Error Code | Description |
|---|---|
| 100 | Success |
| 11 | Failed |
| 401 | Merchant verify failed |
| 422 | Validation error |