Through the JAVA docking domestic 1200 express delivery companies for express delivery operation, the JAVA express delivery interface support SF, Jingdong, Yunda, Shentong, YTO, Post, every day, the best and other mainstream express companies.

The following is the specific example code of the express interface. If you have any questions, you can contact the official operation personnel at any time.

  • Note:

The key can only be obtained after registering the express 100API Enterprise Edition. Remember to obtain the key before testing, otherwise it will fail to be retrieved.

https://api.kuaidi100.com/reg…

  • Official document of express delivery interface:

http://api.kuaidi100.com/docu…

package com.kuaidi100.sdk.api; import com.google.gson.Gson; import com.google.gson.reflect.TypeToken; import com.kuaidi100.sdk.core.BaseClient; import com.kuaidi100.sdk.request.BaseRequest; import com.kuaidi100.sdk.contant.ApiInfoConstant; import com.kuaidi100.sdk.pojo.HttpResult; import com.kuaidi100.sdk.request.PrintReq; import com.kuaidi100.sdk.response.BOrderQueryData; import com.kuaidi100.sdk.response.BOrderResp; import com.kuaidi100.sdk.response.PrintBaseResp; import org.apache.commons.lang3.StringUtils; import org.apache.http.HttpStatus; import java.util.Map; /** * Merchant Mail (Preferred Mail) ** @Author: api.kuaidi100.com * @date: 2020-09-17 11:14 */ public class BOrder extends BaseClient { @Override public String getApiUrl(BaseRequest request) { return ApiInfoConstant.B_ORDER_URL; } public PrintBaseResp transportCapacity(PrintReq param) throws Exception{ HttpResult httpResult = execute(param); if (httpResult.getStatus() == HttpStatus.SC_OK && StringUtils.isNotBlank(httpResult.getBody())){ return new Gson().fromJson(httpResult.getBody(),new TypeToken<PrintBaseResp<BOrderQueryData>>(){}.getType()); } return null; } public PrintBaseResp order(PrintReq param) throws Exception{ HttpResult httpResult = execute(param); if (httpResult.getStatus() == HttpStatus.SC_OK && StringUtils.isNotBlank(httpResult.getBody())){ return new Gson().fromJson(httpResult.getBody(),new TypeToken<PrintBaseResp<BOrderResp>>(){}.getType()); } return null; } public PrintBaseResp getCode(PrintReq param) throws Exception{ HttpResult httpResult = execute(param); if (httpResult.getStatus() == HttpStatus.SC_OK && StringUtils.isNotBlank(httpResult.getBody())){ return new Gson().fromJson(httpResult.getBody(),new TypeToken<PrintBaseResp<Map<String,String>>>(){}.getType()); } return null; } public PrintBaseResp cancel(PrintReq param) throws Exception{ HttpResult httpResult = execute(param); if (httpResult.getStatus() == HttpStatus.SC_OK && StringUtils.isNotBlank(httpResult.getBody())){ return new Gson().fromJson(httpResult.getBody(),new TypeToken<PrintBaseResp>(){}.getType()); } return null; }}