商家根据订单信息,实时、批量获取指定物流服务商的电子面单号。
| 名称 | 类型 | 是否必须 | 示例值 | 更多限制 | 描述 |
|---|---|---|---|---|---|
| waybill_apply_new_request | WaybillApplyNewRequest | 必须 | 面单申请 | ||
|
| 名称 | 类型 | 示例值 | 描述 |
|---|---|---|---|
| waybill_apply_new_cols | WaybillApplyNewInfo [] | 面单申请接口返回信息 | |
|
TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
WlbWaybillIGetRequest req = new WlbWaybillIGetRequest();
WlbWaybillIGetRequest.WaybillApplyNewRequest obj1 = new WlbWaybillIGetRequest.WaybillApplyNewRequest();
obj1.setCpCode("ZTO");
WlbWaybillIGetRequest.WaybillAddress obj2 = new WlbWaybillIGetRequest.WaybillAddress();
obj2.setAddressDetail("朝阳路高井,财满街,财经中心9号楼21单元6013");
obj2.setArea("朝阳区");
obj2.setCity("北京市");
obj2.setProvince("北京");
obj2.setTown("八里庄");
obj1.setShippingAddress(obj2);
List<WlbWaybillIGetRequest.TradeOrderInfo> list4 = new ArrayList<WlbWaybillIGetRequest.TradeOrderInfo>();
WlbWaybillIGetRequest.TradeOrderInfo obj5 = new WlbWaybillIGetRequest.TradeOrderInfo();
list4.add(obj5);
WlbWaybillIGetRequest.WaybillAddress obj7 = new WlbWaybillIGetRequest.WaybillAddress();
obj7.setAddressDetail("朝阳路高井,财满街,财经中心9号楼21单元6013");
obj7.setArea("朝阳区");
obj7.setCity("北京市");
obj7.setProvince("北京");
obj7.setTown("八里庄");
list6.setConsigneeAddress(obj7);
obj5.setConsigneeName("张三");
obj5.setConsigneePhone("13242422352");
List<WlbWaybillIGetRequest.LogisticsService> list10 = new ArrayList<WlbWaybillIGetRequest.LogisticsService>();
WlbWaybillIGetRequest.LogisticsService obj11 = new WlbWaybillIGetRequest.LogisticsService();
list10.add(obj11);
obj11.setServiceCode("SVC-DELIVERY-ENV");
obj11.setServiceValue4Json("{ \"value\": \"100.00\",\"currency\": \"CNY\",\"ensure_type\": \"0\"}");
list8.setLogisticsServiceList(list10);
obj5.setOrderChannelsType("TB");
List<WlbWaybillIGetRequest.PackageItem> list14 = new ArrayList<WlbWaybillIGetRequest.PackageItem>();
WlbWaybillIGetRequest.PackageItem obj15 = new WlbWaybillIGetRequest.PackageItem();
list14.add(obj15);
obj15.setCount(123L);
obj15.setItemName("衣服");
list12.setPackageItems(list14);
obj5.setProductType("STANDARD_EXPRESS");
obj5.setSendName("李四");
obj5.setSendPhone("13242422352");
obj5.setTradeOrderList("12321321,12321321");
obj5.setRealUserId(13123L);
obj5.setVolume(123L);
obj5.setWeight(123L);
obj5.setPackageId("E12321321-1234567");
obj1.setTradeOrderInfoCols(list4);
req.setWaybillApplyNewRequest(obj1);
WlbWaybillIGetResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
<wlb_waybill_i_get_response>
<waybill_apply_new_cols>
<waybill_apply_new_info>
<consignee_branch_code>123132</consignee_branch_code>
<consignee_branch_name>余杭一部</consignee_branch_name>
<package_center_code>123321</package_center_code>
<package_center_name>杭州余杭</package_center_name>
<print_config>SDFASFAFSAFSADF</print_config>
<shipping_branch_code>123132</shipping_branch_code>
<shipping_branch_name>西湖二部</shipping_branch_name>
<short_address>hello world</short_address>
<trade_order_info>
<consignee_address>
<address_detail>朝阳路高井,财满街,财经中心9号楼21单元6013</address_detail>
<area>朝阳区</area>
<city>北京市</city>
<province>北京</province>
<town>八里庄</town>
</consignee_address>
<consignee_name>张三</consignee_name>
<consignee_phone>13242422352</consignee_phone>
<logistics_service_list>
<logistics_service>
<service_code>SVC-DELIVERY-ENV</service_code>
<service_value4_json>{ "value": "100.00","currency": "CNY","ensure_type": "0"}</service_value4_json>
</logistics_service>
</logistics_service_list>
<order_channels_type>TB</order_channels_type>
<package_id>E12321321-1234567</package_id>
<package_items>
<package_item>
<count>123</count>
<item_name>衣服</item_name>
</package_item>
</package_items>
<product_type>STANDARD_EXPRESS</product_type>
<send_name>李四</send_name>
<send_phone>13242422352</send_phone>
<trade_order_list>
<string>12321321</string>
<string>12321321</string>
</trade_order_list>
<real_user_id>123232</real_user_id>
<volume>123</volume>
<weight>123</weight>
</trade_order_info>
<waybill_code>hello world</waybill_code>
</waybill_apply_new_info>
</waybill_apply_new_cols>
</wlb_waybill_i_get_response>
<error_response>
<code>50</code>
<msg>Remote service error</msg>
<sub_code>isv.invalid-parameter</sub_code>
<sub_msg>非法参数</sub_msg>
</error_response>
| 错误码 | 错误描述 | 解决方案 |
|---|---|---|
| isv.province of consigneeAddress can not be null | 请求的省份为空 | 请添加省份信息 |
| isv.waybill account not enough | 电子面单单号余额不足 | 请联系对应网点进行充值 |
| isv.subscribe service not found | 没有开通对应快递公司的电子面单服务 | 请在卖家中心开通对应快递公司的电子面单服务 |
| isv.shipping address cannot match any service | 请求的发货地址与申请服务的地址不匹配 | 请检查参数 |
| isv.detail consigneeAddress can not be null | 详细地址不能为空 | 请检查参数 |
| isv.consignee_address_area_too_long | 收货地址太长 | 请检查参数 |
| isv.request bizOrderCode has cross for exist! | 申请的订单号已经被使用 | 请将重复申请的订单号删除 |
| isv.phone of consignee too long | 联系电话太长 | 联系电话请保持20位以内 |
| isv.trade item into can not be null | 商品信息不能为空 | 请检查参数 |
| isv.province of shippingAddress can not be null | 发件人的省份不能为空 | 请检查参数 |
| isv.phone of consignee can not be null | 联系人电话不能为空 | 请检查参数 |
| PACKAGE_NOT_REACHABLE | 该订单超出物流商承运范围 | 联系当地物流承运商 |
| trade order code too long | 商家请求参数非法,交易订单号太长(最长为40) | 检查入参是否错误 |
| subscribe service not found | 面单订购服务不存在 | 确认是否已订购,已订购请联系菜鸟排查 |
| consignee_address_province_too_long | 收货地址省份信息过长(最长20) | 检查参数中收货人省份信息长度,缩减长度 |
| waybill account not enough | 账户余额不足 | 请联系快递网点充值 |
| phone or mobile illegal | 电话或者手机号非法 | 检查手机号或者电话是否有误 |
| shipping address cannot match any service | 发货地址没有匹配的电子面单服务 | 请检查取号时的发货地址是否商家订购的地址,可通过订购关系查询接口获取 |
| BRAND_CODE_NULL | 品牌编码为空,顺丰新订购链路取号需要传品牌编码,顺丰速运传SF,顺丰快运传FOP,顺丰丰网传FW。 | 检查取号接口的brand_code入参 |
| phone of consignee too long | 字段长度超过限制 | 请参见白皮书字段长度限制 |
| consignee_address_detail_too_long | 收货地址详细地址信息过长 | 减少详细地址长度 |
| name of consignee too long | 收货人姓名长度超过限制(最长40) | 检查参数中收货人姓名长度,缩减长度 |
| name of consignee can not be null | 收件人姓名字段不能为空 | 请检查代码 |