2.1 o2o订单下发接口

基本信息

1.下发时需要下发发货仓信息,分两种场景,一种是菜鸟站点作为前置仓,需要提前将众配宝站点信息同步到商家系统,下发时必传siteCode;另外一种是商家仓作为前置仓,下发时必传发件方名称、详细地址和经纬度。如果两个发件方信息都携带下发,以商家仓名称和详细地址为准。

2.如果下发了省市区名称,则必须下发省市区id。

3.如只下发发件人经纬度,不下发发件人省市区,TOM会以经纬度反查省市区,如同时下发了省市区和经纬度,会优先以省市区为准。

4.根据省市区名称查询id的链接:

http://groups.alidemo.cn/ccc/address-select/demo.html

接口名称 TMS_WAYBILL_NOTIFY
请求方式 post application/x-www-form-urlencoded
功能描述 O2O商家将运单信息推送给菜鸟速递EDI
编码 UTF-8

入参

项目 名称 类型 必填 描述
对接码 logistic_provider_id String 双方约定
签名 data_digest String Base64(Md5(logistics_interface+双方约定的secretKey)) ,具体方法参见文档最后
业务报文 logistics_interface String  

logistics_interface内容

项目 名称 类型 必填 描述
运单信息 waybills List<Waybill> 运单信息
Waybill内容
项目 名称 类型 必填 描述
客户(客户编码) waybill-->order-->customerCode String
客户订单号 waybill-->order-->storeOrderCode String
订单创建时间 waybill-->order-->orderCreateTime String yyyy-MM-dd HH:mm:ss
发件方地址id(最小地址id) waybill-->sender-->senderDid String
发件人省id waybill-->sender-->senderDid String
发件人省id waybill-->sender-->extendFields(senderProvinceId) String
发件人市id waybill-->sender-->extendFields(senderProvinceId) String
发件人区县id waybill-->sender-->extendFields(senderAreaId) String
发件人省 waybill-->sender-->senderProvince String
发件人市 waybill-->sender-->senderCity String
发件人区县 waybill-->sender-->senderArea String
发件方详细地址 waybill-->sender-->senderAddress String
发件方名称 waybill-->sender-->senderName String
发件方手机 waybill-->sender-->senderMobile String
发件方电话 waybill-->sender-->senderPhone String
发件方经度 waybill-->sender-->extendFields(senderLng) String
发件方纬度 waybill-->sender-->extendFields(senderLat) String
站点编码 waybill-->sortingInfo-->siteCode String 开头所说的场景一必须传正确的siteCode,场景二siteCode写死为“default”
收件方地址id(最小地址id) waybill-->receiver-->receiverDid String
收件人省id waybill-->receiver-->extendFields(receiverProvinceId) String
收件人市id waybill-->receiver-->extendFields(receiverCityId) String
收件人区县id waybill-->receiver-->extendFields(receiverAreaId) String
收件人省 waybill-->receiver-->receiverProvince String
收件人市 waybill-->receiver-->receiverCity String
收件人区县 waybill-->receiver-->receiverArea String
收件方详细地址 waybill-->receiver-->receiverAddress String
收件方名称 waybill-->receiver-->receiverName String
收件方手机 waybill-->receiver-->receiverMobile String 电话和手机不能都为空
收件方电话 waybill-->receiver-->receiverPhone String 电话和手机不能都为空
收件方经度 waybill-->receiver-->extendFields(receiverLng) String
收件方纬度 waybill-->receiver-->extendFields(receiverLat) String
时效服务 waybill-->sortingInfo-->scheduleType String
要求送达时间 waybill-->sortingInfo-->sortingRequireTimes-->expectArrivalTime String yyyy-MM-dd HH:mm:ss
预约开始时间 waybill-->sortingInfo-->sortingRequireTimes-->earliestArrivalTime String serviceType为001时必填 yyyy-MM-dd HH:mm:ss
预约结束时间 waybill-->sortingInfo-->sortingRequireTimes-->latestArrivalTime String serviceType为001时必填 yyyy-MM-dd HH:mm:ss
运单重量 waybill-->packageInfo-->weight(g) String
运单体积 waybill-->packageInfo-->volume(cm³立方厘米) String
运单消费者备注 waybill-->remark String
配送费用 waybill-->extendFields(freight) String
实时调用配送日志id(双方) waybill-->extendFields(deliveryLogId) String
订单金额 waybill-->extendFields(orderAmount) String
实付金额 waybill-->extendFields(actualPayAmount) String
取件码 waybill-->extendFields(pickUpCode) String
商品id waybill-->packageInfo-->goodsItems-->itemId String
商品名称 waybill-->packageInfo-->goodsItems-->itemName String
数量 waybill-->packageInfo-->goodsItems-->itemNum String
单价 waybill-->packageInfo-->goodsItems-->itemUnitPrice String
商品体积 waybill-->packageInfo-->goodsItems-->volume String
商品重量 waybill-->packageInfo-->goodsItems-->weight String
服务类型 waybill-->extendFields(serviceType) String 001-预约配 可多选,多个用逗号分隔,如"001,002"

c.出参

项目 名称 类型 必填
成功标识 success boolean
错误码 errorCode String
错误说明 errorMsg String

d.示例报文

url:
http://edi-daily.xpm.cainiao.com/ext/gateway/O2oStandardReceive/o2oStandardReceive/api
请求:

场景1(菜鸟站点作为前置仓):

logistic_provider_id: edi_test_o2o_json

logistics_interface:

{
    "waybills": [{
        "receiver": {
            "receiverName": "paul",
            "receiverMobile": "15920187277",
            "receiverAddress": "余杭街道中南村东南方向",
            "extendFields": [{
                "key": "receiverLng",
                "value": "119.9295043945"
            }, {
                "key": "receiverLat",
                "value": "30.2638118408"
            }]
        },
        "packageInfo": {
            "volume": "0.0",
            "goodsItems": [{
                "itemUnitPrice": "20",
                "itemNum": "1",
                "itemName": "魔法苏打水",
                "itemId": "12095582"
            }, {
                "itemUnitPrice": "10",
                "itemNum": "1",
                "itemName": "魔法泉水",
                "itemId": "12095581"
            }]
        },
        "sortingInfo": {
            "siteCode": "QLL_ZD001",
            "sortingRequireTimes": {
                "expectArrivalTime": "2018-12-10 10:28:06"
            }
        },
        "extendFields": [{
            "key": "freight",
            "value": "1"
        }, {
            "key": "deliveryLogId",
            "value": "15444070871081019"
        }, {
            "key": "orderAmount",
            "value": "30"
        }, {
            "key": "actualPayAmount",
            "value": "31.3"
        }, {
            "key": "pickUpCode",
            "value": "1"
        }],
        "remark": "",
        "order": {
            "storeOrderCode": "15444070871081019",
            "customerCode": "36",
            "orderCreateTime": "2018-12-12 18:06:09"
        }
    }]
}

data_digest: bUS2FF0BjNcrl8u7NCJGyQ==

场景2(商家仓作为前置仓):

logistic_provider_id: edi_test_o2o_json

logistics_interface:

{
    "waybills": [{
        "receiver": {
            "receiverName": "m**",
            "receiverMobile": "17098907653,125",
            "receiverAddress": "文一西路588号西溪首座",
            "extendFields": [{
                "key": "receiverLng",
                "value": "120.1633071899"
            }, {
                "key": "receiverLat",
                "value": "30.2884209683"
            }]
        },
        "sender": {
            "senderName": "testCainiao",
            "senderPhone": "12345678910",
            "senderMobile": "5565656",
            "senderAddress": "中节能·西溪首座",
            "extendFields": [{
                "key": "senderLng",
                "value": "120.074832"
            }, {
                "key": "senderLat",
                "value": "30.288679"
            }]
        },
        "packageInfo": {
            "volume": "0",
            "goodsItems": [{
                "itemUnitPrice": "0.01",
                "itemNum": "1",
                "itemName": "紫苏鸭",
                "itemId": "2223"
            }]
        },
        "sortingInfo": {
            "siteCode": "default",
            "sortingRequireTimes": {
                "expectArrivalTime": "2018-12-21 17:47:14"
            }
        },
        "extendFields": [{
            "key": "freight",
            "value": "0.0"
        }, {
            "key": "deliveryLogId",
            "value": "181221170214071469"
        }, {
            "key": "orderAmount",
            "value": "0.01"
        }, {
            "key": "actualPayAmount",
            "value": "0.01"
        }, {
            "key": "pickUpCode",
            "value": "7"
        }],
        "remark": "",
        "order": {
            "storeOrderCode": "100300122468",
            "customerCode": "37",
            "orderCreateTime": "2018-12-21 17:00:44"
        }
    }]
}

data_digest: cT9MqnxHPKsK9gYe+7dmkg==

返回:
{"success":true}