蔔數開(kāi)放(fàng)平台API

API

下(xià)單

接口地(dì)址:http://e8dev.boudata.com/tss/tms/api/order/create

請求參數:

名稱說(shuō)明(míng)備注
paramsJson字符串Json字符串,具體(tǐ)見下(xià)面params參數說(shuō)明(míng)
uName對(duì)接賬号
uSign簽名MD5(uToken + timestamp)
timestamp時(shí)間(jiān)戳格式:2018-12-12 12:12:12

params參數:

名稱編碼類型必填示例
客戶單号ccodeStringErp0000001
寄件(jiàn)人(rén)send_manStringTRUE張三
寄件(jiàn)人(rén)電(diàn)話(huà)send_phoneStringTRUE18767166222
寄件(jiàn)省份send_provinceStringTRUE浙江省
寄件(jiàn)市(shì)send_cityStringTRUE杭州市(shì)
寄件(jiàn)區(qū)縣send_districtString江幹區(qū)
寄件(jiàn)鄉(xiāng)鎮send_townString
寄件(jiàn)具體(tǐ)地(dì)址send_street_noStringTRUE
收件(jiàn)人(rén)receive_manStringTRUE李四
收件(jiàn)人(rén)電(diàn)話(huà)receive_phoneStringTRUE18767166333
收件(jiàn)人(rén)公司receive_companyString
收件(jiàn)省份receive_provinceStringTRUE江蘇省
收件(jiàn)市(shì)receive_cityStringTRUE揚州市(shì)
收件(jiàn)區(qū)縣receive_districtString高(gāo)郵市(shì)
收件(jiàn)鄉(xiāng)鎮receive_townString
收件(jiàn)具體(tǐ)地(dì)址receive_street_noStringTRUExx小(xiǎo)區(qū)x幢
服務方式service_modeString派送, 站點自(zì)提, 中心自(zì)提, 自(zì)提
保價額insurance_limitDouble
支付方式settle_typeStringTRUE寄付, 到付, 月(yuè)結
代收貨款金(jīn)額codDouble
需要網點上(shàng)門提貨if_visitBooleanTRUE
快件(jiàn)if_fastBooleanDefault=false
備注remarkString
子(zǐ)單集合subOrdersObject
———件(jiàn)數amountInteger
———重量weightDouble
———體(tǐ)積volumeDouble
———貨物(wù)cargoString
———包裝packString

響應參數:

名稱編碼類型示例
結果resultBoolean
錯(cuò)誤信息errorMsgStringresult=false時(shí)會有(yǒu)該屬性
訂單dataStringE8單号

查軌迹

接口地(dì)址:http://e8dev.boudata.com/tss/tms/api/order/trace

請求參數:

名稱說(shuō)明(míng)備注
paramsJson字符串Json字符串,具體(tǐ)見下(xià)面params參數說(shuō)明(míng)
uName對(duì)接賬号
uSign簽名MD5(uToken + timestamp)
timestamp時(shí)間(jiān)戳格式:2018-12-12 12:12:12

params參數:

名稱編碼類型必填示例
E8單号codeStringTRUE兩者必填一個(gè)
客戶單号ccodeStringTRUE兩者必填一個(gè)

響應參數:

名稱編碼類型示例
軌迹dataList[{"scan_date": "2019-12-06 15:43:38","description": "新訂單","create_time": "2019-12-06 15:43:39"}]
結果resultBoolean
錯(cuò)誤信息errorMsgStringResult=false時(shí)會有(yǒu)該屬性

取消訂單(暫無)

接口地(dì)址:http://e8dev.boudata.com/tss/tms/api/order/cancel

請求參數:

名稱說(shuō)明(míng)備注
paramsJson字符串Json字符串,具體(tǐ)見下(xià)面params參數說(shuō)明(míng)
uName對(duì)接賬号
uSign簽名MD5(uToken + timestamp)
timestamp時(shí)間(jiān)戳格式:2018-12-12 12:12:12

params參數:

名稱編碼類型必填示例
E8單号codeStringE8單号和(hé)客戶單号必傳一個(gè)
客戶單号ccodeString

響應參數:

名稱編碼類型示例
結果resultBoolean
錯(cuò)誤信息errorMsgStringResult=false時(shí)會有(yǒu)該屬性

回單回傳

接口地(dì)址:對(duì)方提供

請求參數:

名稱說(shuō)明(míng)備注
codeE8單号
ccode客戶單号可能為(wèi)空
uName對(duì)接賬号對(duì)方提供, 下(xià)文(wén)uToken也是,對(duì)接方不校(xiào)驗也可不提供
uSign簽名MD5(uToken + timestamp)
timestamp時(shí)間(jiān)戳格式:2018-12-12 12:12:12
file文(wén)件(jiàn)格式為(wèi)Base64

響應參數要求:

名稱編碼類型示例
結果resultBoolean
錯(cuò)誤信息errorMsgStringResult=false時(shí)會有(yǒu)該屬性

Java調用

  public void xiadan() {
    String myCode = "ERP000004";
    JSONObject ov = new JSONObject();
    ov.put("ccode", myCode);
    ov.put("send_man", "張三");
    ov.put("send_phone", "18767166222");
    ov.put("send_province", "浙江省");
    ov.put("send_city", "杭州市(shì)");
    ov.put("send_district", "江幹區(qū)");
    ov.put("send_street_no", "一号大街(jiē)華媒科(kē)創園");
    ov.put("receive_man", "李四");
    ov.put("receive_phone", "18767166333");
    ov.put("receive_province", "北京市(shì)");
    ov.put("receive_city", "北京市(shì)");
    ov.put("receive_district", "東城(chéng)區(qū)");
    ov.put("receive_street_no", "中關村(cūn)");
    ov.put("amount", 3);
    ov.put("volume", 1.11);
    ov.put("weight", 100.5);
    ov.put("service_mode", "派送");
    ov.put("insurance_limit", 3000D);
    ov.put("pay_type", "寄付");
    ov.put("cod", 8999D);
    ov.put("if_visit", true);
    ov.put("remark", "請盡快上(shàng)門取貨");

    List<>> subOrders = new ArrayList<>();
    Map subOrder = new HashMap<>();
    subOrder.put("amount", "3");
    subOrder.put("weight", "2.11");
    subOrder.put("volume", "2.11");
    subOrder.put("cargo", "電(diàn)腦");
    subOrders.add(subOrder);

    subOrder = new HashMap<>();
    subOrder.put("amount", "1");
    subOrder.put("weight", "2.22");
    subOrder.put("volume", "2.22");
    subOrder.put("cargo", "音(yīn)響");
    subOrders.add(subOrder);
    ov.put("subOrders", subOrders);

    executePost(origin + "/tss/tms/api/order/create", ov);
  }

  private void executePost(String url, JSONObject ov) {
    PostMethod postMethod = new PostMethod(url);
    postMethod.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=utf-8");

    postMethod.setParameter("params", ov.toString());
    postMethod.setParameter("uName", uName);
    String time = DateUtil.formatCare2Second(new Date());
    postMethod.setParameter("timestamp", time);
    postMethod.setParameter("uSign", InfoEncoder.string2MD5(uToken + time));

    HttpClient httpClient = new HttpClient();
    try {
      httpClient.executeMethod(postMethod);
      String responseBody = postMethod.getResponseBodyAsString();
      System.out.println(responseBody);
    } catch (Exception e) {
      e.printStackTrace();
    }
  }