Blogger Information
Blog 60
fans 0
comment 0
visits 100710
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
3步接入顺丰快递云打印电子面单接口API【快递100接口Java Demo】
快递100API
Original
1405 people have browsed it

顺丰目前提供了两种对接方式

一种是开发者自助对接顺丰的接口。
在顺丰丰桥上先注册账户后,申请成为开发者后,再根据顺丰的文档要求对接。然而,这种方式面单审核期长,整个流程较为繁琐,并且需要开发者长期维护接口,顺丰接口提供给用户自主打单的服务也仅提返回面单的pdf文件。

另一种方式是通过对接第三方快递电子面单打印API接口的服务商(例如快递100API)
如果对接的快递公司数量较多,那么接入这种已经封装好多家快递的电子面单打印接口的集成接口,是个更加方便快捷的选择。仅需通过几步,即可实现接入顺丰快递的云打印电子面单接口API,实现获取顺丰快递电子面单,打印电子面单,复打电子面单,打印接口回调等多种功能。而且面单返回形式也多样,提供pdf,图片,html等多种形式,轻松实现远程打印。

顺丰快递云打印电子面单接口API

顺丰快递电子面单接口

顺丰云打印电子面单API接口提供方:快递100API(详见技术文档

电子面单打印接口类型:顺丰电子面单打印接口,顺丰电子面单打印接口,顺丰电子面单复打接口,顺丰电子面单自定义打印接口,电子面单OCR识别接口

编程语言要求:Json。提供统一格式的HTTP POST或GET调用接口,并返回统一格式JSON数据。

一,顺丰快递云打印电子面单接口API功能介绍
顺丰快递电子面单API服务提供了获取物流单号、打印电子面单的功能,满足企业的快速打单、回传物流单号的需求。

顺丰快递电子面单API已升级迭代到V2版本,提供更简单易用的模板编辑工具,并在云打印服务方式上做了升级,新对接客户建议直接使用电子面单接口V2版接口(配套快递公司模板V2);

快递100的顺丰快递电子面单API支持45+家快递公司网点面单打印、主流电商平台(淘宝、京东、拼多多)面单打印以及国际快递公司面单打印。具体列表清查看参数字典

二,电子面单打印API应用场景:
商家通过接口打印电子面单,并对商品包装贴单,快递员取件发货;
商家可通过接口远程让仓库、发货点打单,不同部门也能调用同一台设备;
接口可自动回传单号到系统,省去操作员手动关联订单和运单,提升企业信息化水平。

三,接入顺丰快递电子面单接口API的三个步骤:
注册快递100企业版免费账号。注册后有50单电子面单调试单量赠送,客户无需充值可先调试对接;
沙箱测试。快递100管理后台-调试工具-电子面单-mock模式支持沙箱测试,填入的账号信息不会提交至快递公司校验;
调用接口。API接口调用无测试环境,但提交打印请求后不揽收不会计算快递费,快递公司对单号有一定的回收机制,客户接口调试只需在订单内备注、寄件人或收件人等写明“测试”或“无需取件”字段。

四:顺丰快递电子面单接口Demo示例代码:
1,电子面单提交打印请求接口示例:

  1. public void testLabelOrder() throws Exception {
  2. ManInfo recManInfo = new ManInfo();
  3. recManInfo.setName("张三");
  4. recManInfo.setMobile("15999566666");
  5. recManInfo.setPrintAddr("广东省深圳市南山区科技南十二路");
  6. ManInfo sendManInfo = new ManInfo();
  7. sendManInfo.setName("李四");
  8. sendManInfo.setMobile("15999566666");
  9. sendManInfo.setPrintAddr("北京市海淀区xxx路");
  10. OrderReq orderReq = new OrderReq();
  11. orderReq.setKuaidicom(CompanyConstant.ZJS);
  12. orderReq.setCount(1);
  13. orderReq.setSiid(siid);
  14. orderReq.setTempId("60f6c17c7c223700131d8bc3");
  15. orderReq.setSendMan(sendManInfo);
  16. orderReq.setRecMan(recManInfo);
  17. orderReq.setPrintType(PrintType.CLOUD);
  18. String param = new Gson().toJson(orderReq);
  19. String t = System.currentTimeMillis() + "";
  20. PrintReq printReq = new PrintReq();
  21. printReq.setT(t);
  22. printReq.setKey(key);
  23. printReq.setSign(SignUtils.printSign(param,t,key,secret));
  24. printReq.setMethod(ApiInfoConstant.ORDER);
  25. printReq.setParam(param);
  26. IBaseClient baseClient = new LabelV2();
  27. System.out.println(baseClient.execute(printReq));

2,电子面单复打接口
请求数据:

  1. public void testPrintOld() throws Exception {
  2. RepeatPrintReq repeatPrintReq = new RepeatPrintReq();
  3. repeatPrintReq.setTaskId("027B34AD22DE4F299643A13642B70D5F");
  4. String param = new Gson().toJson(repeatPrintReq);
  5. String t = System.currentTimeMillis() + "";
  6. PrintReq printReq = new PrintReq();
  7. printReq.setT(t);
  8. printReq.setKey(key);
  9. printReq.setSign(SignUtils.printSign(param,t,key,secret));
  10. printReq.setMethod(ApiInfoConstant.CLOUD_PRINT_OLD_METHOD);
  11. printReq.setParam(param);
  12. IBaseClient baseClient = new LabelV2();
  13. System.out.println(baseClient.execute(printReq));

3,电子面单取消:
请求数据:

  1. public void testLabelCancel() throws Exception{
  2. LabelCancelParam labelCancelParam = new LabelCancelParam();
  3. labelCancelParam.setPartnerId("test");
  4. labelCancelParam.setKuaidicom(CompanyConstant.SF);
  5. labelCancelParam.setKuaidinum("SF1342567604302");
  6. //快递公司订单号(对应提交打印请求时返回的kdComOrderNum,如果没有可以不传,否则必传)
  7. labelCancelParam.setOrderId("01639366271685GNkZEX");
  8. labelCancelParam.setReason("暂时不寄了");
  9. String param = new Gson().toJson(labelCancelParam);
  10. String t = System.currentTimeMillis() + "";
  11. PrintReq printReq = new PrintReq();
  12. printReq.setT(t);
  13. printReq.setKey(key);
  14. printReq.setMethod(ApiInfoConstant.CANCEL_METHOD);
  15. printReq.setSign(SignUtils.printSign(param,t,key,secret));
  16. printReq.setParam(param);
  17. IBaseClient baseClient = new LabelCancel();
  18. System.out.println(baseClient.execute(printReq));}

4,顺丰国际快递的电子面单云打印接口API

请求数据:

  1. public void testShipment() throws Exception {
  2. ShipmentReq shipmentReq = new ShipmentReq();
  3. shipmentReq.setPartnerId("");
  4. shipmentReq.setPartnerKey("");
  5. shipmentReq.setPartnerSecret("");
  6. shipmentReq.setCode("");
  7. shipmentReq.setKuaidicom("fedex");
  8. shipmentReq.setCargo("invoice");
  9. shipmentReq.setExpType("FedEx International First®");
  10. shipmentReq.setUnitOfMeasurement("SU");
  11. shipmentReq.setWeight(50.00);
  12. shipmentReq.setCustomsValue(1000.00);
  13. ManInfo sendMan = new ManInfo();
  14. sendMan.setName("test");
  15. sendMan.setMobile("16888888888");
  16. sendMan.setCountryCode("CN");
  17. sendMan.setCity("SHENZHEN");
  18. sendMan.setAddr("Kingdee Software Park");
  19. sendMan.setDistrict("Hi-tech Park,Nanshang District");
  20. sendMan.setZipcode("518057");
  21. sendMan.setEmail("test@qq.com");
  22. shipmentReq.setSendMan(sendMan);
  23. ManInfo recMan = new ManInfo();
  24. recMan.setName("test");
  25. recMan.setMobile("16888888888");
  26. recMan.setCountryCode("US");
  27. recMan.setCity("NEW YORK");
  28. recMan.setAddr(" 70 Washington Square South");
  29. recMan.setZipcode("10012");
  30. recMan.setEmail("test@qq.com");
  31. recMan.setStateOrProvinceCode("NY");
  32. shipmentReq.setRecMan(recMan);
  33. List<PackageInfo> packageInfoList = new ArrayList<>();
  34. PackageInfo packageInfo = new PackageInfo();
  35. packageInfo.setLength(10.00);
  36. packageInfo.setWidth(20.00);
  37. packageInfo.setHeight(10.00);
  38. packageInfo.setWeight(50.00);
  39. packageInfoList.add(packageInfo);
  40. shipmentReq.setPackageInfos(packageInfoList);
  41. List<ExportInfo> exportInfoList = new ArrayList<>();
  42. ExportInfo exportInfo = new ExportInfo();
  43. exportInfo.setDesc("test");
  44. exportInfo.setGrossWeight(50.00);
  45. exportInfo.setQuantity(1);
  46. exportInfo.setUnitPrice(1000.00);
  47. exportInfo.setQuantityUnitOfMeasurement("PCS");
  48. exportInfo.setManufacturingCountryCode("CN");
  49. exportInfoList.add(exportInfo);
  50. shipmentReq.setExportInfos(exportInfoList);
  51. CustomsClearance customsClearance = new CustomsClearance();
  52. customsClearance.setPurpose("GIFT");
  53. customsClearance.setDocument(true);
  54. String param = new Gson().toJson(shipmentReq);
  55. String t = System.currentTimeMillis() + "";
  56. String sign = SignUtils.printSign(param,t,key,secret);
  57. PrintReq printReq = new PrintReq();
  58. printReq.setKey(key);
  59. printReq.setMethod(ApiInfoConstant.ELECTRONIC_ORDER_PIC_METHOD);
  60. printReq.setSign(sign);
  61. printReq.setParam(param);
  62. printReq.setT(t);
  63. IBaseClient baseClient = new InternationalShipment();
  64. //国际面单耗时比较长,尽量调整10s以上
  65. baseClient.setTimeOut(1000,10000);
  66. System.out.println(baseClient.execute(printReq));}

官方技术支持https://api.kuaidi100.com/document/5eb9f5b686b0df41883139f4.html

Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post