Webhook
Process Description
Baokim sends webhooks to the partner's system using the POST method, with data signed according to the mechanism described in the Security Method section. Baokim records the webhook as successfully sent when the response body contains the parameter code with a value of 0, 100 or 200 (the Partner responded with Success).
Cases where the webhook is considered failed include:
- http_code is 4xx or 5xx (HTTP connection error)
- http_code = 200 but the response body contains a code other than 0, 100 or 200
If the webhook is recorded as failed, Baokim will resend the webhook for up to 9 more attempts, with the interval between attempts based on the Fibonacci sequence, for example the retry schedule:
- Attempt 1: 1 minute after the initial send
- Attempt 2: 2 minutes after attempt 1
- Attempt 3: 3 minutes after attempt 2
- Attempt 4: 5 minutes after attempt 3
- ...
Response
(Returned by the Merchant to Baokim)
note
HTTP 200 - Success
Main Parameters Table
| Field Name | Data Type | Required | Description |
|---|---|---|---|
| code | Integer | ✅ | 0, 100 or 200 = success, 99 = Baokim will resend the webhook |
| message | String | ✅ | Response content |
| data | Object | ❌ | Attached data (if any) |
Successful Response Example
{
"code": 100,
"message": "Success",
"data": { }
}
Failed Response Example
{
"code": 99,
"message": "Failure",
"data": { }
}
Error Codes
| Error Code | Description |
|---|---|
| 0, 100 or 200 | Success |
| 99 | Failure (retry required) |