Skip to main content

Webhook

Flow​

Description:

  • Webhook is a method to notify transaction results to Merchant via HTTP POST request.
  • Webhook URL is configured when Merchant provides information to Baokim.
  • If Merchant receives webhook and processes it successfully, please respond with code = 0.
  • If Merchant responds with code other than 0, Baokim will resend webhook within 10 times, each time 5 minutes apart.

Steps to verify and process webhook receipt

  1. Verify data integrity via Signature.
  2. Verify order/transaction status, payment amount.
  3. Actively verify and avoid recording duplicate transactions when receiving webhook multiple times.

API Information​

Method: POST

URL: (URL configured by Merchant with Baokim)

Request Headers:

HeaderDescription
SignatureDigital signature to verify data integrity

Request​

(Baokim sends to Merchant)

Main Parameters Table​

Field NameData TypeRequiredDescription
request_idString✅Request ID
request_timeDatetime✅Request time. Format: YYYY-MM-DD HH:mm:ss
merchant_codeString✅Merchant identifier code
operationString✅Operation type. PAYMENT_TRANS = payment transaction
payment_resultObject✅Payment result
token_resultObject❌Token information (NULL if not token payment)

Order Information (payment_result)​

FieldTypeRequiredDescription
result_codeinteger✅Transaction processing result code. 200 = success
result_messagestring✅Transaction result description
orderobject✅Order information
transactionarray<object>✅List of transactions from order

Order Information (payment_result.order)​

FieldTypeRequiredDescription
idinteger✅Order ID in system
mrc_order_idstring✅Merchant's order ID
total_amountinteger✅Total order value (VND)
payment_methodinteger✅Payment method
statusinteger✅Order status. 1 = completed
completed_atstring❌Completion time (YYYY-MM-DD HH:mm:ss)
created_atstring✅Order creation time (YYYY-MM-DD HH:mm:ss)
updated_atstring✅Last update time (YYYY-MM-DD HH:mm:ss)

Transaction Information (payment_result.transaction)​

FieldTypeRequiredDescription
idinteger✅Transaction ID in system
order_idinteger✅Associated order ID
mrc_order_idstring✅Merchant's order ID
typeinteger✅Transaction type. 1 = payment
payment_methodinteger✅Payment method
merchant_feeinteger✅Merchant fee (VND)
user_feeinteger✅User fee (VND)
amountinteger✅Original order amount (VND)
total_amountinteger✅Total amount user actually paid = amount + user_fee (VND)
descriptionstring / null❌Transaction description
statusinteger✅Transaction status. 1 = completed
bnplobject / null❌BNPL payment information (if applicable)
installmentobject / null❌Installment payment information (if applicable)
completed_atstring❌Transaction completion time (YYYY-MM-DD HH:mm:ss)
created_atstring✅Transaction creation time (YYYY-MM-DD HH:mm:ss)
updated_atstring✅Last update time (YYYY-MM-DD HH:mm:ss)

Token Information (token_result)​

Field NameData TypeRequiredDescription
tokenString❌Card token saved on Baokim
card.bank_nameString❌Full issuing bank name
card.holder_nameString❌Card holder name
card.issue_dateString❌Card expiration date
card.numberString❌Masked card number (e.g.: 970407xxxxxx1234)
card.bank_short_nameString❌Issuing bank short name

Request Example​

{
"request_id": "B2B6A278C9815BD7EQ4AVPVZCI",
"request_time": "2026-06-09 10:46:32",
"merchant_code": "123workvn",
"operation": "PAYMENT_TRANS",
"payment_result": {
"result_code": 200,
"result_message": "Payment successful",
"order": {
"id": 991186,
"mrc_order_id": "MERCHANT_DEPOSIT_48_1780976739_UXWUUAIE",
"total_amount": 10000,
"payment_method": 1,
"status": 1,
"completed_at": "2026-06-09 10:46:32",
"created_at": "2026-06-09 10:45:41",
"updated_at": "2026-06-09 10:46:32"
},
"transaction": [
{
"id": 940826,
"order_id": 991186,
"mrc_order_id": "MERCHANT_DEPOSIT_48_1780976739_UXWUUAIE",
"type": 1,
"payment_method": 1,
"merchant_fee": 0,
"user_fee": 330,
"total_amount": 10330,
"amount": 10000,
"description": null,
"status": 1,
"bnpl": null,
"installment": null,
"completed_at": "2026-06-09 10:46:32",
"created_at": "2026-06-09 10:45:45",
"updated_at": "2026-06-09 10:46:32"
}
]
},
"token_result": null
}

Response​

(Merchant responds to Baokim)

Main Parameters Table​

Field NameData TypeRequiredDescription
codeInteger✅Result code. 0 = Merchant processed webhook successfully
messageString✅Processing result message
dataObject❌Returned data (if any)

Response Example​

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