清单运费查询
此功能主要是根据订单号查询清单运费。
一、请求参数
POST https://kf.fw199.com/gateway/sfexpress/order/getsubmailno
| 参数名 | 类型 | 说明 | 示例 |
|---|---|---|---|
| appid | String | 合作伙伴AppId | uwkahf@jfs92 |
| timestamp | String | 当前时间戳 | |
| request_data | String | json格式的业务参数 | 见下表1.1 |
| client_code | String | 顺丰的客户编码 | |
| check_word | String | 顺丰的校验码 | |
| sign | String | 接口签名 | 如何计算生成见示例代码 |
一(一)、参数request_data 的说明
| # | 字段 | 类型 | 必填 | 描述 |
|---|---|---|---|---|
| 1 | trackingType | String | 是 | 1:表示按订单查询 2:表示按运单查询 |
| 2 | trackingNum | String | 是 | 订单号或运单号; |
| 3 | phone | String | 条件 | 配置校验手机号时必传,支持最高6个收寄方电话后4位下发, 每个电话号码使用英文逗号分隔 |
| 4 | bizTemplateCode | String | 否 | 业务配置代码,针对客户业务需求配置的一套接口处理逻辑,一个接入编码可对应多个业务配置代码 |
二、请求示例代码
Java
/** * 清单运费查询接口 * @throws Exception */ @Test public void queryOrderWayBill() throws Exception {
String result =""; // dealType:2表示取消 String jsonData = "{\"trackingNum\":\"QIAO-20200605-200\",\"trackingType\":\"1\"}";
CloseableHttpClient httpclient = HttpClients.createDefault(); HttpPost httpPost = new HttpPost( Config.SFExpressQueryOrderWaybillsUrl ); //业务参数 Map<String, String> data = new HashMap<String, String>(); data.put("appid", Config.AppId); data.put("request_data", jsonData); data.put("client_code", Config.SFClientCode); data.put("check_word", Config.SFCheckWord); Long timestamp = System.currentTimeMillis() / 1000; data.put("timestamp", timestamp.toString());
// 参数签名 data.put("sign", Utils.Sign(data,Config.AppSecret)); List<BasicNameValuePair> params = new ArrayList<BasicNameValuePair>(); for (Map.Entry<String, String> entry : data.entrySet()) { params.add(new BasicNameValuePair(entry.getKey(), entry.getValue())); } //发起POST请求 try { httpPost.setEntity(new UrlEncodedFormEntity(params, "UTF-8")); HttpResponse httpResponse = httpclient.execute(httpPost); if (httpResponse.getStatusLine().getStatusCode() == HttpStatus.SC_OK) { result = EntityUtils.toString(httpResponse.getEntity()); } else { result = ("doPost Error Response: " + httpResponse.getStatusLine().toString()); } } catch (Exception e) { e.printStackTrace();
}
System.out.println(result);
}三、返回结果
{ "code": 0, "message": "ok", "data": { "apiErrorMsg": "", "apiResponseID": "00017A8A2E92983FD314FEE1C764663F", "apiResultCode": "A1000", "apiResultData": "{\"errorCode\":\"S0000\",\"msgData\":{\"waybillFeeList\":[{\"customerAcctCode\":\"9999999999\",\"name\":\"保费\",\"paymentTypeCode\":\"1\",\"settlementTypeCode\":\"2\",\"type\":\"1\",\"value\":205.0},{\"customerAcctCode\":\"9999999999\",\"paymentTypeCode\":\"2\",\"settlementTypeCode\":\"2\",\"type\":\"3\",\"value\":2.0}],\"waybillInfo\":{\"addresseeAddr\":\"北京市-市辖区-朝阳区-十里河文化园a座9楼\",\"addresseeContName\":\"好先生\",\"addresseeMobile\":\"13976655900\",\"billHigh\":0.0,\"billLong\":0.0,\"billWidth\":0.0,\"cargoTypeCode\":\"SP636\",\"consignorAddr\":\"广东省深圳市福田上沙东村0号\",\"consignorContName\":\"潘俊儒\",\"consignorMobile\":\"17688939300\",\"consignorPhone\":\"17688939300\",\"customerAcctCode\":\"9999999999\",\"destZoneCode\":\"755\",\"expressTypeCode\":\"B2\",\"limitTypeCode\":\"T6\",\"meterageWeightQty\":1.0,\"orderId\":\"QIAO-20200605-200\",\"realWeightQty\":1.0,\"shieldFlg\":\"0\",\"sourceZoneCode\":\"755A\",\"volume\":35000.0}},\"success\":true}" }, "trace_id": "3bhaFUztVptFIrFluwNp"}说明: code为0表示成功,非0为失败,message会包含失败原因。
四、元素 apiResultData
| # | 属性名 | 类型(约束) | 必填 | 默认值 | 描述 |
|---|---|---|---|---|---|
| 1 | success | boolean | 是 | 返回状态 true/false | |
| 2 | errorCode | Integer | 条件 | 错误代码 | |
| 3 | errorMsg | String | 条件 | 错误详细信息 | |
| 4 | msgData | Object | 条件 | 如果success为true,这个字段代表筛单结果;Success为false时,此字段为空 |
四(一)、返回参数msgData说明
| # | 属性名 | 类型(约束) | 默认值 | 描述 |
|---|---|---|---|---|
| 1 | waybillInfo | object | 运单信息 | |
| 2 | errorCode | list |
四(二)、返回参数waybillInfo 的说明
| # | 属性名 | 类型(约束) | 描述 |
|---|---|---|---|
| 1 | waybillNo | String(30) | 运单号 |
| 2 | orderId | String(64) | 客户订单号 |
| 3 | waybillChilds | String | 子单号,英文逗号分隔 |
| 4 | customerAcctCode | String(64) | 月结帐号 |
| 5 | meterageWeightQty | Double | 计费重量 |
| 6 | realWeightQty | Double | 实际重量 |
| 7 | consigneeEmpCode | String(30) | 收件员工号 |
| 8 | deliverEmpCode | String(30) | 派件员工号 |
| 9 | cargoTypeCode | String(30) | 快件内容 |
| 10 | cargoTypeName | String(30) | 快件内容名称 |
| 11 | limitTypeCode | String(30) | 时效类型 |
| 12 | limitName | String(30) | 时效类型名称 |
| 13 | expressTypeCode | String(30) | 业务类型 |
| 14 | expressTypeName | String(30) | 业务类型名称 |
| 15 | consValue | Double | 声明价值 |
| 16 | consValueCurrencyCode | String(30) | 声明价值币种 |
| 17 | productCode | String(30) | 产品代码 |
| 18 | productName | String(30) | 产品名称 |
| 19 | jProvince | String(30) | 寄件省份 |
| 20 | jCity | String(30) | 寄件城市 |
| 21 | consignorAddr | String(30) | 寄件详细地址 |
| 22 | consignorContName | String(30) | 寄件联系人 |
| 23 | consignorPhone | String(30) | 寄件电话号码 |
| 24 | consignorMobile | String(30) | 寄件手机号 |
| 25 | dProvince | String(30) | 收件省份 |
| 26 | dCity | String(30) | 收件城市 |
| 27 | addresseeAddr | String(30) | 收件详细地址 |
| 28 | addresseeContName | String(30) | 收件联系人 |
| 29 | addresseePhone | String(30) | 收件电话号码 |
| 30 | addresseeMobile | String(30) | 收件手机号 |
| 31 | shieldFlg | String(30) | 丰巢屏蔽标识,1表示不允许投柜 |
| 32 | noticeShieldTemplateCode | String(30) | 禁止投柜提示码 |
| 33 | sourceZoneCode | String(30) | 原寄地 |
| 34 | sourceZoneName | String(30) | 原寄地网点名称 |
| 35 | destZoneCode | String(30) | 目的地 |
| 36 | destZoneName | String(30) | 目的地网点名称 |
| 37 | sourceCountry | String(30) | 原寄地的国家 |
| 38 | destCountry | String(30) | 目的地国家 |
| 39 | quantity | Double | 件数 |
| 40 | distanceTypeCode | String(30) | 区域类型 |
| 41 | distanceTypeName | String(30) | 区域类型名称 |
| 42 | transportTypeCode | String(30) | 运输类型 |
| 43 | transportTypeName | String(30) | 运输类型名称 |
| 44 | ackbillTypeCode | String(30) | 回单类型 |
| 45 | volume | Double | 体积 |
| 46 | billLong | Double | 长 |
| 47 | billWidth | Double | 宽 |
| 48 | billHigh | Double | 高 |
| 49 | unitWeight | String(30) | 重量单位 |
| 50 | waybillStatus | String(30) | 运单状态 |
| 51 | clientCode | String(30) | 客户端代码 |
| 52 | sourceCityCode | String(30) | 原寄地城市编码 |
| 53 | sourceDeptCode | String(30) | 原寄地机构编码 |
| 54 | destCityCode | String(30) | 目的地城市编码 |
| 55 | destDeptCode | String(30) | 目的地机构编码 |
| 56 | sourceHqCode | String(30) | 原寄地所属经营本部编码 |
| 57 | sourceAreaCode | String(30) | 原寄地所属区部编码 |
| 58 | destHqCode | String(30) | 目的地所属经营本部编码 |
| 59 | destAreaCode | String(30) | 目的地所属区部编码 |
| 60 | signedBackWaybillNo | String(30) | 签回单号 |
| 61 | orderType | String(30) | 订单类型 |
| 62 | secondSysOrderNo | String(30) | 换一体服务:第二联系统订单号(要退换货物的原始系统订单 |
| 63 | subscriberName | String(30) | 签收人 |
| 64 | signinTm | Date | 签收时间 |
| 65 | cvsCode | String(30) | 寄方便利店编码 |
| 66 | receiptCvsCode | String(30) | 到方便利店编码 |
| 67 | wpProductCode | String(30) | 微派产品信息 |
| 68 | refundExchangeGoodsFlg | Integer | 退换货一体标记 |
| 67 | appointWay | String | CX预约方式:1:消息推送入口;2:收件方式入口;3:更改派送入口; |
| 68 | hiddenAddressFlag | String | 隐址件标识,1、是,0、否; |
| 69 | commandType | String | 口令类型:1、口令;2、身份证;3、口令/身份证 |
| 70 | sourceWaybillNo | String | 源单号 |
| 71 | totalFee | Double | 总费用(根据客户与顺丰约定配置的费用项,返回总额); |
四(三)、元素 waybillFeeList
| # | 属性名 | 类型(约束 | 描述 |
|---|---|---|---|
| 1 | feeTypeCode | String(3) | 费用类型(丰巢接入码返回); |
| 2 | feeAmt | Double | 费用(丰巢接入码返回); |
| 3 | type | String(3) | 费用类型(非丰巢接入码返回); |
| 4 | name | String(30) | 费用名称(非丰巢接入码返回); |
| 5 | value | Double | 费用金额(非丰巢接入码返回); |
| 6 | paymentTypeCode | String(1) | 付款类型:1、寄付;2、到付;3、第三方付 |
| 7 | settlementTypeCode | String(1) | 结算类型:1为现结;2为月结 |
| 8 | serviceProdCode | String(30) | 增值服务代码 |
| 9 | insuredValue | String(30) | 保价金额 |
| 10 | customerAcctCode | String(30) | 月结账号 |
| 11 | paymentChangeTypeCode | String(30) | 支付变更类型 |
| 12 | currencyCode | String(30) | 费用单位 |
| 13 | currencyName | String(30) | 费用名称 |
| 14 | gatherEmpCode | String(30) | 交款人 |
| 15 | isLaterPay | String(30) | 是否后付费 |
| 16 | feeAmtInd | Double | 个性化费用 |
代码说明
| 原因代码 | 描述 | 分类 |
|---|---|---|
| S0000 | 成功 | 是 |
| S0001 | 非法的JSON格式 | 系统错误 |
| S0002 | 必填参数为空 | 系统错误 |
| S0003 | 系统发生数据错误或运行时异常 | 系统错误 |
| B0001 | Ak校验不通过 | 业务错误 |
| B0002 | 收派员数据不存在 | 业务错误 |
| B0003 | 收派员姓名不一致 | 业务错误 |
| B0004 | 收派员手机号不一致 | 业务错误 |
| B0005 | 收派员身份证不一致 | 业务错误 |
四(四)、元素 waybillInfo
| # | 属性名 | 类型(约束) | 必填 | 默认值 | 描述 |
|---|---|---|---|---|---|
| 1 | orderId | String(64) | 否 | 返回客户订单号 | |
| 2 | waybillNo | String(30) | 是 | 返回运单号 | |
| 3 | waybillChilds | String | 否 | 子单号,多个英文逗号分隔 | |
| 4 | customerAcctCode | String(64) | 否 | 月结帐号 | |
| 5 | meterageWeightQty | NUMBER(10,3) | 是 | 计费重量 | |
| 6 | realWeightQty | NUMBER(10,3) | 是 | 实际重量 | |
| 7 | consigneeEmpCode | String(30) | 否 | 收件员工号 | |
| 8 | deliverEmpCode | String(30) | 否 | 派件员工号 | |
| 9 | cargoTypeCode | String(30) | 否 | 快件内容 | |
| 10 | cargoTypeName | String(30) | 否 | 快件内容名称 | |
| 11 | limitTypeCode | String(30) | 否 | 时效类型 | |
| 12 | limitName | String(30) | 否 | 时效类型名称 | |
| 13 | expressTypeCode | String(30) | 否 | 业务类型 | |
| 14 | expressTypeName | String(30) | 否 | 业务类型名称 | |
| 15 | consValue | String(30) | 否 | 声明价值 | |
| 16 | consValueCurrencyCode | String(30) | 否 | 声明价值币种 | |
| 17 | productCode | String(30) | 否 | 产品代码 | |
| 18 | prodName | String(30) | 否 | 产品名称 | |
| 19 | sourceProvince | String(30) | 否 | 寄件省份 | |
| 20 | sourceCity | String(30) | 否 | 寄件城市 | |
| 21 | consignorAddr | String(30) | 否 | 寄件详细地址 | |
| 22 | consignorContName | String(30) | 否 | 寄件联系人 | |
| 23 | consignorPhone | String(30) | 否 | 寄件电话号码 | |
| 24 | consignorMobile | String(30) | 否 | 寄件手机号 | |
| 25 | addresseeProvince | String(30) | 否 | 收件省份 | |
| 26 | addresseeCity | String(30) | 否 | 收件城市 | |
| 27 | addresseeAddr | String(30) | 否 | 收件详细地址 | |
| 28 | addresseeContName | String(30) | 否 | 收件联系人 | |
| 29 | addresseePhone | String(30) | 否 | 收件电话号码 | |
| 30 | addresseeMobile | String(30) | 否 | 收件手机号 |
四(五)、元素 waybillFeeList
| # | 属性名 | 类型(约束) | 必填 | 默认值 | 描述 |
|---|---|---|---|---|---|
| 1 | type | String(3) | 是 | 费用类型 | |
| 2 | name | String(30) | 是 | 费用名称 | |
| 3 | value | NUMBER(10,3) | 是 | 费用金额 | |
| 4 | paymentTypeCode | String(1) | 是 | 付款类型:1.寄付2.到付3.第三方付 | |
| 5 | settlementTypeCode | String(1) | 否 | 结算类型:1为现结2为月结 | |
| 6 | serviceProdCode | String(30) | 否 | 增值服务代码 | |
| 7 | insuredValue | NUMBER(10,3) | 否 | 保价金额 | |
| 8 | customerAcctCode | String(30) | 否 | 月结账号 |