Skip to main content

Webhook Transaction Notification

Process​

Baokim calls Merchant's webhook API to send transaction notification.

API Information​

Method: POST

URL: Merchant provides

Header:

  • Content-Type: application/json
  • Signature: $signature

Request​

(Parameters Baokim sends)

Main Parameters​

NoField NameData TypeRequiredDescription
1request_idString(100)✅Unique request ID from merchant to Baokim
2request_timeString(20)✅Request time. Format: YYYY-MM-DD H:i:s
3master_merchant_codeString(50)✅Unique identifier for master merchant
4sub_merchant_codeString(50)✅Unique identifier for sub merchant
5store_codeString❌Store code
6branch_codeString❌Branch code
7staff_codeString❌Staff code
8transactionObject✅Transaction information
9va_infoObject✅VA information

Transaction Information​

NoField NameData TypeRequiredDescription
1idInteger✅Baokim transaction ID
2order_idInteger✅Baokim order ID
3mrc_order_idString✅Merchant order ID
4sub_merchant_feeInteger✅Sub merchant fee
5master_merchant_feeInteger✅Master merchant fee
6master_merchant_modelInteger✅Master merchant model
7user_feeInteger✅User fee
8total_amountInteger✅Total amount user needs to pay
9amountInteger✅Amount merchant receives
10descriptionString✅Transaction content
11statusInteger✅Transaction status
12completed_atDatetime✅Transaction completion time
13created_atDatetime✅Transaction creation time
14updated_atDatetime✅Transaction update time

VA_info Information​

No.Field NameData TypeRequiredDescription
1bank_nameString✅VA bank name
2bank_branchString❌Branch
3acc_noString✅VA account number
4acc_nameString✅VA account name
5qr_stringText✅QR code string
6qr_pathString✅QR code image path

Example request from Baokim to Merchant:

{
"request_id": "MERCHANT050015588AXE012",
"request_time": "2020-08-11 14:41:00",
"master_merchant_code": "MASTERMERCHANT",
"sub_merchant_code": "SUBMERCHANT",
"store_code": null,
"branch_code": null,
"staff_code": null,
"transaction": {
"id": 5567261,
"order_id": 1870436,
"mrc_order_id": "TT1790305520_VA6AB5E5034028DO",
"sub_merchant_fee": 2200,
"master_merchant_fee": 1100,
"master_merchant_model": 1,
"user_fee": 0,
"total_amount": 200000,
"amount": 200000,
"description": "NGUYEN VAN A chuyen tien",
"status": 1,
"completed_at": "2020-08-11 14:41:00",
"created_at": "2020-08-11 14:41:00",
"updated_at": "2020-08-11 15:41:00"
},
"va_info": {
"bank_name": "Ngân hàng TMCP Ngoại Thương Việt Nam (Vietcombank)",
"bank_branch": "Chi nhánh Hà Nội",
"acc_no": "01234567890123",
"acc_name": "BAOKIM NGUYEN VAN A",
"qr_string": "00020101021238550010A0000007270123000697040300000000000020386304C3A4",
"qr_path": "https://sandbox.baokim.vn/qr/BK1234567890.png"
}
}

Response​

(Merchant's reply to Baokim)

Main Parameters Table​

No.Field NameData TypeRequiredDescription
1codeInteger✅Result code. 0, 100 or 200 = Success
2messageString✅Processing result message
3dataObject❌Returned data (if any)

Response Example​

{
"code": 200,
"message": "Successfully",
"data": null
}