1. Payload of shipment webhook information
{
"tracking_id": "HTC811619678C0",
"client_order_id": "EXT012313",
"partner_shop_id": "100012", // Shop ID on haravan, sapo, pancake ... empty if not link with TikiNOW
"service_code": "hns_standard",
"partner_code": "TNSL",
"shipping_fee": 33500,
"timestamp": "2022-11-30T08:38:57.151835Z", // RFC3339
"status": "returning",
"reason_code": "",
"description": "",
"driver": { // // Some status will not have driver information (e.g: allocating)
"name": "TNSL Driver",
"phone": "",
"license_plate": "",
"photo_url": "",
"current_coordinates": {
"latitude": 0,
"longitude": 0
},
"id": ""
},
"tracking_url": "https://tnsl-tracking.tiki.com.vn/?id=HTC811619678C0"
}
2. Payload of fee webhook information
{
"tnsl_seller_id": 1111,
"tnsl_order_id": "414124112",
"partner_shop_id": "1000002",
"client_order_id": "XZDADAW",
"fee_key": "standard_processing",
"fee_amount": 12500
}
Fee key description
Fee key | Name | Tên phí |
standard_delivery | Transportation Standard Delivery | Phí vận chuyển đơn hàng bình thường |
standard_delivery_failed_delivery | Standard Delivery Failed | Phí giao hàng đơn hàng bình thường giao thất bại |
standard_delivery_installation | Standard Delivery Installation | Phí cài đặt cho đơn hàng bình thường |
standard_delivery_price_declaration | Standard Delivery Price Declaration | Phí khai báo giá cho đơn hàng bình thường |
2h_delivery | Transportation 2h Delivery | Phí vận chuyển đơn hàng 2h |
2h_delivery_failed_delivery | 2h Delivery Failed | Phí giao hàng đơn hàng 2h giao thất bại |
2h_delivery_installation | 2h Delivery Installation | Phí cài đặt cho đơn hàng giao 2h |
2h_delivery_price_declaration | 2h Delivery Price Declaration | Phí khai báo giá cho đơn hàng giao 2h |
c2c_delivery | Transportation C2C Delivery | Phí vận chuyển đơn C2C |
transportation_c_return | Transportation C-Return | Phí trả hàng từ khách hàng |
c2c_delivery_failed_delivery | C2C Delivery Failed | Phí giao hàng cho đơn C2C giao thất bại |
c2c_delivery_installation | C2C Delivery Installation | Phí cài đặt cho đơn hàng C2C |
c2c_delivery_price_declaration | C2C Delivery Price Declaration | Phí khai báo giá cho đơn hàng C2C |
tikipro_delivery | Transportation TikiPro Delivery | Phí vận chuyển đơn hàng Tiki Pro |
tikipro_delivery_failed_delivery | Tikipro Delivery Failed | Phí giao hàng cho đơn hàng TikiPro giao thất bại |
tikipro_delivery_installation | Tikipro Delivery Installation | Phí cài đặt cho đơn hàng TikiPro |
tikipro_delivery_price_declaration | Tikipro Delivery Price Declaration | Phí khai báo giá cho đơn hàng giao hàng TikiPro |
transportation_b2b | Transportation B2B | Phí vận chuyển đơn hàng B2B |
b2b_delivery_failed_delivery | B2B Delivery Failed | Phí giao hàng cho đơn B2B giao thất bại |
b2b_delivery_price_declaration | B2B Delivery Price Declaration | Phí khai báo giá cho đơn B2B |
transportation_point_2_point | Transportation Point to Point | Phí vận chuyển đơn hàng Point to Point |
transportation_point_2_point_failed_delivery | Transportation Point to Point Failed | Phí vận chuyển đơn hàng Point to Point giao thất bại |
transportation_point_2_point_price_declaration | Transportation Point to Point Price Declaration | Phí khai báo giá cho đơn hàng Point to Point |
3. Authentication signature
Using HMAC-SHA1 signature. Webhook secret & URL get in step register webhook (See API Detail).
Formula generate HMAC-SHA1 signature. Using this signature to compare with signature on header request (key on header: x-signature).
Example Golang code
func GenerateSignature(secretToken, payloadBody string) string {
mac := hmac.New(sha1.New, []byte(secretToken))
mac.Write([]byte(payloadBody))
expectedMAC := mac.Sum(nil)
return "sha1=" + hex.EncodeToString(expectedMAC)
}
Return HTTP status 2xx when received successfully and 5xx when failed
Data response
HTTP Status Code | Description | Response |
2xx | Success | { “success”: true } |
4xx | Error | { “success”: false “error”: { “code”: “CLIENT_NOT_EXIST”, “message”: “Client doesn’t exist”, }, } |
5xx | Server error |