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_idStringRequest ID
request_timeDatetimeRequest time. Format: YYYY-MM-DD HH:mm:ss
merchant_codeStringMerchant identifier code
operationStringOperation type. PAYMENT_TRANS = payment transaction
payment_resultObjectPayment result
token_resultObjectToken information (NULL if not token payment)

Order Information (payment_result)

FieldTypeRequiredDescription
result_codeintegerTransaction processing result code. 200 = success
result_messagestringTransaction result description
orderobjectOrder information
transactionarray<object>List of transactions from order

Order Information (payment_result.order)

FieldTypeRequiredDescription
idintegerOrder ID in system
mrc_order_idstringMerchant's order ID
total_amountintegerTotal order value (VND)
payment_methodintegerPayment method
statusintegerOrder status. 1 = completed
completed_atstringCompletion time (YYYY-MM-DD HH:mm:ss)
created_atstringOrder creation time (YYYY-MM-DD HH:mm:ss)
updated_atstringLast update time (YYYY-MM-DD HH:mm:ss)

Transaction Information (payment_result.transaction)

FieldTypeRequiredDescription
idintegerTransaction ID in system
order_idintegerAssociated order ID
mrc_order_idstringMerchant's order ID
typeintegerTransaction type. 1 = payment
payment_methodintegerPayment method
merchant_feeintegerMerchant fee (VND)
user_feeintegerUser fee (VND)
amountintegerOriginal order amount (VND)
total_amountintegerTotal amount user actually paid = amount + user_fee (VND)
descriptionstring / nullTransaction description
statusintegerTransaction status. 1 = completed
bnplobject / nullBNPL payment information (if applicable)
installmentobject / nullInstallment payment information (if applicable)
completed_atstringTransaction completion time (YYYY-MM-DD HH:mm:ss)
created_atstringTransaction creation time (YYYY-MM-DD HH:mm:ss)
updated_atstringLast update time (YYYY-MM-DD HH:mm:ss)

Token Information (token_result)

Field NameData TypeRequiredDescription
tokenStringCard token saved on Baokim
card.bank_nameStringFull issuing bank name
card.holder_nameStringCard holder name
card.issue_dateStringCard expiration date
card.numberStringMasked card number (e.g.: 970407xxxxxx1234)
card.bank_short_nameStringIssuing 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 returns to Baokim)

note

HTTP 200 - Success

Main Parameters Table

Field NameData TypeRequiredDescription
codeInteger0 = success, other = Baokim will resend webhook
messageStringResponse content
dataObjectAdditional data (if any)

Success Response Example

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

Error Codes

Error CodeDescription
104Authentication error
105Invalid digital signature