Webhook创建及使用接口

创建

创建webhook

点击 添加
url填入您的回调地址, 测试请填 http://qianqianqian.applinzi.com/bstool/webhook_response.php

查看日志

双击打开webhook, 点击webhook log 的tab

双击打开某一条log, 查看详情

日志保留时长为1个月

请求格式

resource_type 类型:  CONSIGNMENT ,  PRODUCT , CLIENT_DISPATCH 三种
action 触发动作:  

CONSIGNMENT支持的动作为:  GET_DELIVERY_REFERENCE 获取到跟踪号 , UPDATE_TRACKING_EVENT 物流事件更新

PRODUCT支持的动作为:  CREATE 创建新产品 , UPDATE 修改产品 , DELETE 删除产品 , UPDATE_LIVE_STOCK 更新产品库存

CLIENT_DISPATCH支持的动作为:  CREATE 创建新发货单 , UPDATE 修改发货单 , DELETE 删除发货单

time 触发时间
data 请求内容

{
    "resource_type":"CONSIGNMENT",
    "action":"GET_DELIVERY_REFERENCE",
    "time":"2017-10-19 01:28:25",
    "data":{
        "type":"LOCAL",
        "id":"1710180020000008",
        "company_id":"2",
        "client_id":"1",
        "warehouse_id":null,
        "consignment_product_quantity":"1",
        "consignment_product_reference":"1",
        "delivery_service_id":"1471",
        "total_delivery_fee":"0.00",
        "total_handling_fee":"0.00",
        "total_weight":"30.00",
        "total_volume":"504000.00",
        "total_volume_weight":"504000.0000",
        "contact":"56787",
        "business_name":null,
        "address_line1":"官方活动和条件",
        "address_line2":null,
        "address_line3":null,
        "city":null,
        "county":null,
        "post_code":"M2 5BQ",
        "country_iso":"GB",
        "telephone":null,
        "email":null,
        "sender_contact":null,
        "sender_business_name":null,
        "sender_address_line1":null,
        "sender_address_line2":null,
        "sender_address_line3":null,
        "sender_city":null,
        "sender_county":null,
        "sender_post_code":null,
        "sender_country_iso":"GB",
        "sender_email":null,
        "sender_telephone":null,
        "sales_reference":null,
        "payment_reference":null,
        "delivery_reference":"1",
        "tracking_reference":null,
        "is_urgent":"0",
        "create_time":"2017-10-19 00:12:21",
        "finish_time":null,
        "arrive_time":null,
        "update_time":"2017-10-19 01:28:16",
        "status":"PENDING"
    }
}

返回值

返回的Content-Type必须为application/json, 必须包含 success  键, 且值必须为 true

{"success":true}

注意事项

当第一次请求失败后, 会再次请求, 再次失败后, 会请求第三次, 如果第三次失败, 则放弃.
当某个webhook一天内(00::00~23:59:59)的失败次数超过50次, 就会将webhook设置为失效, 将不再发送, 需要手动调整为"正常"