Skip to main content

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=99 and no disbursement result webhook received.
    • Did not receive the webhook of an AUTO order (this order has no ReferenceId and can only be queried by TransactionId).
  • 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 ReferenceId does 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 NameData TypeRequiredDescription
RequestIdString✅Request ID. Maximum 50 characters, only letters, numbers and -
RequestTimeDatetime✅Request time. Format: YYYY-MM-DD HH:mm:ss. Must not differ by more than 5 minutes from Baokim time
PartnerCodeString✅Sub-merchant code of the collection transaction
ReferenceIdString⚠️CashPlus disbursement order ID. Send one of ReferenceId or TransactionId
TransactionIdString⚠️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 NameData TypeRequiredDescription
ResponseCodeInteger✅200 = success
ResponseMessageString✅Message
DataObject❌Only present when ResponseCode=200. Query by ReferenceId: one Disbursement order. Query by TransactionId: {Allocation, Orders}

Disbursement order​

Field NameData TypeDescription
TransactionIdStringCollection transaction ID
ReferenceIdStringCashPlus disbursement order ID. null for AUTO orders. MANUAL orders carry the ReferenceId of the original order
TransIdPaymentStringBaokim disbursement order ID
ReceiverIntegerRecipient: 1 = User, 2 = Merchant, 3 = CashPlus
TypeIntegerDisbursement type: 1 = realtime, 2 = T+1
StatusIntegerOrder status: 0, 99, 200, 11 (see Error Codes)
ErrorCodeStringDetailed error code when Status=11
RetryableBooleanOnly present when Status=11
RequestAmountIntegerRequested amount
FeeAmountIntegerDisbursement fee
SpendAmountIntegerActual amount transferred
SourceStringPARTNER, AUTO, or MANUAL
AccountNoStringRecipient account number
BankNoStringRecipient 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 CodeDescription
200Success
11Both ReferenceId and TransactionId missing, or both sent
101Error during Baokim processing. Retry after a few minutes
102RequestId or RequestTime is invalid (wrong format or time difference exceeds 5 minutes)
110Partner Code is invalid
112Transaction ID does not exist or does not belong to PartnerCode
120Signature is invalid
137Disbursement order does not exist
138ReferenceId is invalid