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_codeStringStore code
6branch_codeStringBranch code
7staff_codeStringStaff code
8transactionObjectTransaction information
9va_infoObjectVA information

Transaction Information

NoField NameData TypeRequiredDescription
1idIntegerBaokim transaction ID
2order_idIntegerBaokim order ID
3mrc_order_idStringMerchant order ID
4sub_merchant_feeIntegerSub merchant fee
5master_merchant_feeIntegerMaster merchant fee
6master_merchant_modelIntegerMaster merchant model
7user_feeIntegerUser fee
8total_amountIntegerTotal amount user needs to pay
9amountIntegerAmount merchant receives
10descriptionStringTransaction content
11statusIntegerTransaction status
12completed_atDatetimeTransaction completion time
13created_atDatetimeTransaction creation time
14updated_atDatetimeTransaction update time

VA_info Information

No.Field NameData TypeRequiredDescription
1bank_nameStringVA bank name
2bank_branchStringBranch
3acc_noStringVA account number
4acc_nameStringVA account name
5qr_stringTextQR code string
6qr_pathStringQR 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,
"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 returns to Baokim)

Main Parameters

NoField NameData TypeRequiredDescription
1codeString(3)Code returned to Baokim, ensuring merchant received it
2messageString(20)Message returned to Baokim
3dataObjectData merchant returns to Baokim if any

Response Example

{
"code": 0,
"message": "Success",
"data": null
}

Error Codes

Error CodeDescription
100Success
11Failed
101Baokim system error
103Signature authentication error
104JWT authentication error
422Invalid data
710Sub merchant does not exist
711Master merchant does not exist
712Sub merchant is inactive
713Master merchant is inactive