1. Home
  2. Docs
  3. TikiNOW Smart Logistics
  4. API References
  5. Lastmile Service Group
  6. Webhooks

Webhooks

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 keyNameTên phí
standard_deliveryTransportation Standard DeliveryPhí vận chuyển đơn hàng bình thường
standard_delivery_failed_deliveryStandard Delivery FailedPhí giao hàng đơn hàng bình thường giao thất bại
standard_delivery_installationStandard Delivery InstallationPhí cài đặt cho đơn hàng bình thường
standard_delivery_price_declarationStandard Delivery Price DeclarationPhí khai báo giá cho đơn hàng bình thường
2h_deliveryTransportation 2h DeliveryPhí vận chuyển đơn hàng 2h
2h_delivery_failed_delivery2h Delivery Failed Phí giao hàng đơn hàng 2h giao thất bại
2h_delivery_installation2h Delivery InstallationPhí cài đặt cho đơn hàng giao 2h
2h_delivery_price_declaration2h Delivery Price DeclarationPhí khai báo giá cho đơn hàng giao 2h
c2c_deliveryTransportation C2C DeliveryPhí vận chuyển đơn C2C
transportation_c_returnTransportation C-ReturnPhí trả hàng từ khách hàng
c2c_delivery_failed_deliveryC2C Delivery FailedPhí giao hàng cho đơn C2C giao thất bại
c2c_delivery_installationC2C Delivery InstallationPhí cài đặt cho đơn hàng C2C
c2c_delivery_price_declarationC2C Delivery Price DeclarationPhí khai báo giá cho đơn hàng C2C
tikipro_deliveryTransportation TikiPro DeliveryPhí vận chuyển đơn hàng Tiki Pro
tikipro_delivery_failed_deliveryTikipro Delivery FailedPhí giao hàng cho đơn hàng TikiPro giao thất bại
tikipro_delivery_installationTikipro Delivery InstallationPhí cài đặt cho đơn hàng TikiPro
tikipro_delivery_price_declarationTikipro Delivery Price DeclarationPhí khai báo giá cho đơn hàng giao hàng TikiPro
transportation_b2bTransportation B2BPhí vận chuyển đơn hàng B2B
b2b_delivery_failed_deliveryB2B Delivery FailedPhí giao hàng cho đơn B2B giao thất bại
b2b_delivery_price_declarationB2B Delivery Price DeclarationPhí khai báo giá cho đơn B2B
transportation_point_2_pointTransportation Point to PointPhí vận chuyển đơn hàng Point to Point
transportation_point_2_point_failed_deliveryTransportation Point to Point FailedPhí vận chuyển đơn hàng Point to Point giao thất bại
transportation_point_2_point_price_declarationTransportation Point to Point Price DeclarationPhí 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 CodeDescriptionResponse
2xxSuccess{
“success”: true
}
4xxError{
    “success”: false
    “error”: {
        “code”: “CLIENT_NOT_EXIST”,
        “message”: “Client doesn’t exist”,
    },
}
5xxServer error
Was this article helpful to you? Yes No

How can we help?

Leave a Reply

Your email address will not be published.