Skip to main content

Disbursement Result Webhook

Process​

Description:

  • Baokim sends a webhook to CashPlus when a disbursement order has a final result: Status=200 (success) or Status=11 (failure).
  • Applies to all orders:
OrderSourceReferenceIdWhen sent
Realtime order called by CashPlusPARTNERThe order's ownWhen the final result is available, even if 200/11 was already returned in the response
T+1 order called by CashPlus (Merchant Type=2, CashPlus)PARTNERThe order's ownAfter the T+1 settlement period has been processed
Order created automatically by Baokim at 00:05 on day T+1 for undisbursed amountsAUTOnullAfter the T+1 settlement period has been processed
Manual disbursement order (order at 99 past cutoff that then failed, or T+1 order that failed during settlement)MANUALThe original order'sWhen Baokim completes the manual disbursement, with a new TransIdPayment. Receiver is the actual recipient: the original receiver, or 2 (Merchant) if the original order had Retryable=false or re-disbursement failed
  • Each order has one final result. Due to retry mechanism, CashPlus may receive the same webhook multiple times → process idempotently by TransIdPayment.
  • The order of webhooks across different orders is not guaranteed.

Retry:

  • Baokim considers success when CashPlus returns HTTP 200 with JSON body ResponseCode=200 within 30 seconds.
  • Otherwise, Baokim retries: up to 6 times (1 initial + 5 retries), at least 1 minute apart.
  • After exhausting retries without success, CashPlus uses Query Disbursement Result (for AUTO orders: query by TransactionId).

API Information​

Method: POST

URL: Disbursement result webhook URL provided by CashPlus to Baokim.

Header: Signature — RSA-SHA1 signature of raw body using Baokim's private key. CashPlus verifies using Baokim's public key (see Security).

Request​

(Baokim sends to CashPlus)

Main Parameters​

Field NameData TypeRequiredDescription
RequestIdString✅Request ID
RequestTimeDatetime✅Send time. Format: YYYY-MM-DD HH:mm:ss
PartnerCodeString✅Sub-merchant code of the collection transaction
TransactionIdString✅Collection transaction ID
ReferenceIdString❌CashPlus disbursement order ID. null for AUTO orders
TransIdPaymentString✅Baokim disbursement order ID
SourceString✅PARTNER, AUTO, or MANUAL
ReceiverInteger✅Recipient: 1 = User, 2 = Merchant, 3 = CashPlus
TypeInteger✅Disbursement type: 1 = realtime, 2 = T+1
StatusInteger✅200 = success, 11 = failure
ErrorCodeString❌Detailed error code when Status=11 (see Error Codes)
RetryableBoolean❌Only present when Status=11
CodeString❌User code (User orders)
RequestAmountInteger✅Requested amount
FeeAmountInteger✅Disbursement fee
SpendAmountInteger✅Actual amount transferred
AccountNoString✅Recipient account number
BankNoString✅Recipient bank code
CreatedAtDatetime✅Order creation time
UpdatedAtDatetime✅Time the final result was reached

Request Example — Order called by CashPlus​

{
"RequestId": "BK20250115100512",
"RequestTime": "2025-01-15 10:05:12",
"PartnerCode": "SHOP123",
"TransactionId": "BK6AB9B10B92C04SZ",
"ReferenceId": "CPSPEND0001",
"TransIdPayment": "TP2501151005010001",
"Source": "PARTNER",
"Receiver": 2,
"Type": 1,
"Status": 200,
"ErrorCode": null,
"Code": null,
"RequestAmount": 6860,
"FeeAmount": 0,
"SpendAmount": 6860,
"AccountNo": "0123******89",
"BankNo": "970436",
"CreatedAt": "2025-01-15 10:05:01",
"UpdatedAt": "2025-01-15 10:05:10"
}

Request Example — AUTO order​

{
"RequestId": "BK20250116103015",
"RequestTime": "2025-01-16 10:30:15",
"PartnerCode": "SHOP123",
"TransactionId": "BK6AB9B10B92C04SZ",
"ReferenceId": null,
"TransIdPayment": "TP2501152350590003",
"Source": "AUTO",
"Receiver": 2,
"Type": 2,
"Status": 200,
"ErrorCode": null,
"Code": null,
"RequestAmount": 7150,
"FeeAmount": 0,
"SpendAmount": 7150,
"AccountNo": "0123******89",
"BankNo": "970436",
"CreatedAt": "2025-01-15 23:50:59",
"UpdatedAt": "2025-01-16 10:30:00"
}

Response​

(CashPlus returns to Baokim)

note

HTTP 200 - Success

Main Parameters​

Field NameData TypeRequiredDescription
ResponseCodeInteger✅200 = received. Other codes → Baokim retries
ResponseMessageString✅Message

Response Example​

{
"ResponseCode": 200,
"ResponseMessage": "Success"
}

CashPlus Processing​

  1. Verify Signature. Invalid signature → do not process, return ResponseCode != 200.
  2. Already processed this TransIdPayment before → return ResponseCode=200, do not reprocess.
  3. Status=200 → record successful disbursement.
  4. Status=11:
    • Retryable=true and still before cutoff: may call a new Disbursement order with a new ReferenceId. If not called, that share goes to the Merchant on T+1.
    • Retryable=false: do not retry. For User orders: notify the customer; the User share goes to the Merchant on T+1.
    • Order at 99 past cutoff that then failed: cannot be retried (past cutoff). Baokim will disburse manually and send an additional webhook with Source=MANUAL.
  5. Source=AUTO → record that the transaction's undisbursed amount has been settled to the Merchant.
  6. Source=MANUAL with a Receiver different from the original order → the share has been disbursed to the Merchant instead of the original receiver. For User orders: notify the customer.