Query Disbursement Result
Process
Description:
- CashPlus calls this API to get the current status of disbursement orders. Send one of the two:
ReferenceId: returns 1 order.TransactionId: returns the registered allocation and all orders of the transaction, including the order created automatically by Baokim after cutoff (Source=AUTO) and manual disbursement orders (Source=MANUAL).
- Should be used when:
- Did not receive response from Disbursement order (timeout).
- Order is at
Status=99and no disbursement result webhook received. - Did not receive the webhook of an
AUTOorder (this order has noReferenceIdand can only be queried byTransactionId).
- For orders at
Status=99, Baokim updates the latest status before returning the result. - Queries work after cutoff as well, with no time limit.
- Order with this
ReferenceIddoes not exist →137. In that case, if it is still before cutoff, CashPlus can call the disbursement order again.
API Information
Method: POST
URL: {BASE_URL}/transaction/v2/spend-result
Header: Signature — RSA-SHA1 signature of raw body (see Security).
Request
Main Parameters
| Field Name | Data Type | Required | Description |
|---|---|---|---|
| RequestId | String | ✅ | Request ID. Maximum 50 characters, only letters, numbers and - |
| RequestTime | Datetime | ✅ | Request time. Format: YYYY-MM-DD HH:mm:ss. Must not differ by more than 5 minutes from Baokim time |
| PartnerCode | String | ✅ | Sub-merchant code of the collection transaction |
| ReferenceId | String | ⚠️ | CashPlus disbursement order ID. Send one of ReferenceId or TransactionId |
| TransactionId | String | ⚠️ | Baokim collection transaction ID |
Request Example — By ReferenceId
{
"RequestId": "CP20250115103001",
"RequestTime": "2025-01-15 10:30:01",
"PartnerCode": "SHOP123",
"ReferenceId": "CPSPEND0001"
}
Request Example — By TransactionId
{
"RequestId": "CP20250116090001",
"RequestTime": "2025-01-16 09:00:01",
"PartnerCode": "SHOP123",
"TransactionId": "BK6AB9B10B92C04SZ"
}
Response
note
HTTP 200 - Success
Main Parameters
| Field Name | Data Type | Required | Description |
|---|---|---|---|
| ResponseCode | Integer | ✅ | 200 = success |
| ResponseMessage | String | ✅ | Message |
| Data | Object | ❌ | Only present when ResponseCode=200. Query by ReferenceId: one Disbursement order. Query by TransactionId: {Allocation, Orders} |
Disbursement order
| Field Name | Data Type | Description |
|---|---|---|
| TransactionId | String | Collection transaction ID |
| ReferenceId | String | CashPlus disbursement order ID. null for AUTO orders. MANUAL orders carry the ReferenceId of the original order |
| TransIdPayment | String | Baokim disbursement order ID |
| Receiver | Integer | Recipient: 1 = User, 2 = Merchant, 3 = CashPlus |
| Type | Integer | Disbursement type: 1 = realtime, 2 = T+1 |
| Status | Integer | Order status: 0, 99, 200, 11 (see Error Codes) |
| ErrorCode | String | Detailed error code when Status=11 |
| Retryable | Boolean | Only present when Status=11 |
| RequestAmount | Integer | Requested amount |
| FeeAmount | Integer | Disbursement fee |
| SpendAmount | Integer | Actual amount transferred |
| Source | String | PARTNER, AUTO, or MANUAL |
| AccountNo | String | Recipient account number |
| BankNo | String | Recipient bank code |
Allocation (when querying by TransactionId)
TransactionId, AmountAfterFee (N), User.Amount, Merchant.Amount, Merchant.Type, Partner.Amount, UnallocatedAmount. If the transaction has not been registered: ResponseCode=200, Allocation = null, Orders empty (or containing only the AUTO order if Baokim has created it).
Orders is an array of Disbursement order objects and may be empty.
Response Example — By ReferenceId
{
"ResponseCode": 200,
"ResponseMessage": "Success",
"Data": {
"TransactionId": "BK6AB9B10B92C04SZ",
"ReferenceId": "CPSPEND0001",
"TransIdPayment": "TP2501151005010001",
"Receiver": 2,
"Type": 1,
"Status": 200,
"ErrorCode": null,
"RequestAmount": 6860,
"FeeAmount": 0,
"SpendAmount": 6860,
"Source": "PARTNER",
"AccountNo": "0123******89",
"BankNo": "970436"
}
}
Response Example — By TransactionId, with an AUTO order
{
"ResponseCode": 200,
"ResponseMessage": "Success",
"Data": {
"Allocation": {
"TransactionId": "BK6AB9B10B92C04SZ",
"AmountAfterFee": 14010,
"User": { "Amount": 7000 },
"Merchant": { "Amount": 6860, "Type": 1 },
"Partner": { "Amount": 150 },
"UnallocatedAmount": 0
},
"Orders": [
{
"TransactionId": "BK6AB9B10B92C04SZ",
"ReferenceId": "CPSPEND0001",
"TransIdPayment": "TP2501151005010001",
"Receiver": 2,
"Type": 1,
"Status": 200,
"ErrorCode": null,
"RequestAmount": 6860,
"FeeAmount": 0,
"SpendAmount": 6860,
"Source": "PARTNER",
"AccountNo": "0123******89",
"BankNo": "970436"
},
{
"TransactionId": "BK6AB9B10B92C04SZ",
"ReferenceId": null,
"TransIdPayment": "TP2501152350590003",
"Receiver": 2,
"Type": 2,
"Status": 0,
"ErrorCode": null,
"RequestAmount": 7150,
"FeeAmount": 0,
"SpendAmount": 7150,
"Source": "AUTO",
"AccountNo": "0123******89",
"BankNo": "970436"
}
]
}
}
Response Example — Order not found
{
"ResponseCode": 137,
"ResponseMessage": "Disbursement order does not exist"
}
Error Codes
| Error Code | Description |
|---|---|
| 200 | Success |
| 11 | Both ReferenceId and TransactionId missing, or both sent |
| 101 | Error during Baokim processing. Retry after a few minutes |
| 102 | RequestId or RequestTime is invalid (wrong format or time difference exceeds 5 minutes) |
| 110 | Partner Code is invalid |
| 112 | Transaction ID does not exist or does not belong to PartnerCode |
| 120 | Signature is invalid |
| 137 | Disbursement order does not exist |
| 138 | ReferenceId is invalid |