首页 考试资料幻灯片工程技术公务员考试小学教学中学教学大学教学外语资料
基于PHP的韵达电子面单接口文档94


基于 PHP 的韵达电子面单接口文档
1.接口类型说明 1)接口支持的消息接收方式:HTTP POST 2)请求方法的编码格式(utf-8):"application/x-www-form-urlencoded;charset=utf-8" 3)API 地址:http://api.kdniao.cc/Ebusiness/EbusinessOrderHandle.aspx 4)接口提供:快递鸟 5)快递编码:YD 2.请求系统级参数
参数名称 类型 说明 请求内容需进行 URL(utf-8)编码。请求内容 JSON 格式,须和 DataType 一 致。 必须要求

RequestData String EBusinessID

R R R R O

String 商户 ID,请在我的服务页面查看。

RequestType String 请求指令类型:1007 DataSign DataType String 数据内容签名: 把(请求内容(未编码)+AppKey)进行 MD5 加密, 然后 Base64 编码,最后进行 URL(utf-8)编码。详细过程请查看 Demo。

String 请求、返回数据类型:只支持 JSON 格式

备注: R-必填 (Required) , O-可选 (Optional) , C-报文中该参数在一定条件下可选 (Conditional) 。 3.对接示例 1)JSON 请求示例

{ "OrderCode": "ShipperCode": "PayType": 1, "ExpType": 1, "Cost": 1.0, "OtherCost": 1.0, "Sender": { "Company": "Name": "Mobile": "CityName": "Address": "LV", "15018442396", "上海", "青浦区", "上海", "明珠路 73 号" "Taylor", "012657700387", "HTKY",

"ProvinceName": "ExpAreaName":

}, "Receiver": { "Company": "Name": "Mobile": "CityName": "Address": }, "Commodity": [ { "GoodsName": "鞋子", "Goodsquantity": 1, "GoodsWeight": 1.0 } ], "AddService": [ { "Name": "Value": } ], "Weight": 1.0, "Quantity": 1, "Volume": 0.0, "Remark": }
2)JSON 返回示例

"GCCUI", "15018442396", "北京", "朝阳区", "北京", "三里屯街道雅秀大厦"

"Yann",

"ProvinceName": "ExpAreaName":

"COD", "1020"

"小心轻放",

"IsReturnPrintTemplate":1

失败: { "EBusinessID": "ResultCode": "1237100", "105",

"Reason": " }

"订单号已存在,请勿重复操作",

"UniquerRequestNumber":"5e66486b-8fbc-4131-b875-9b13d2ad1354

成功: { "EBusinessID": "Order": { "OrderCode": "ShipperCode": "LogisticCode": "OriginCode": "OriginName": "PackageCode": }, "PrintTemplate":"此处省略打印模板 HTML 内容", "EstimatedDeliveryTime":"2016-03-06", "Callback":"调用时传入的 Callback", "Success": "Reason": }
4.PHP 对接源码
<?php

"1237100", "012657700387", "HTKY", "50002498503427", "京-朝阳(京-1)", "200000", "上海分拨中心", "北京"

"MarkDestination":

true, "100", "成功"

"ResultCode":

//电商 ID defined('EBusinessID') or define('EBusinessID', '请申请

http://www.kdniao.com/ServiceApply.aspx'); //电商加密私钥,注意保管,不要泄漏 defined('AppKey') or define('AppKey', '请申请 http://www.kdniao.com/ServiceApply.aspx'); //请求 url,接口正式地址:http://api.kdniao.cc/api/Eorderservice defined('ReqURL') or define('ReqURL', 'http://testapi.kdniao.cc:8081/api/Eorderservice');

//调用获取物流轨迹 //-------------------------------------------------------------

//构造电子面单提交信息 $eorder = []; $eorder["ShipperCode"] = "YD"; $eorder["OrderCode"] = "PM201604062341"; $eorder["PayType"] = 1; $eorder["ExpType"] = 1;

$sender = []; $sender["Name"] = "李先生"; $sender["Mobile"] = "18888888888"; $sender["ProvinceName"] = "李先生"; $sender["CityName"] = "深圳市"; $sender["ExpAreaName"] = "福田区"; $sender["Address"] = "赛格广场 5401AB";

$receiver = []; $receiver["Name"] = "李先生"; $receiver["Mobile"] = "18888888888"; $receiver["ProvinceName"] = "李先生"; $receiver["CityName"] = "深圳市"; $receiver["ExpAreaName"] = "福田区"; $receiver["Address"] = "赛格广场 5401AB";

$commodityOne = []; $commodityOne["GoodsName"] = "其他"; $commodity = []; $commodity[] = $commodityOne;

$eorder["Sender"] = $sender; $eorder["Receiver"] = $receiver; $eorder["Commodity"] = $commodity;

//调用电子面单 $jsonParam = json_encode($eorder, JSON_UNESCAPED_UNICODE);

//$jsonParam = JSON($eorder);//兼容 php5.2(含)以下

12

 


 

  【Top

最新搜索

 

基于PHP 的韵达电子面单接口文档 1.接口类型说明 1)接口支持的消息接收方式:HTTP POST 2)请求方法的编码格式(utf-8):"application/x-www-form-urlencoded;...

暂无评价|0人阅读|0次下载|举报文档基于PHP的韵达电子面单接口对接_计算机软件及应用_IT/计算机_专业资料。基于 PHP 的韵达电子面单接口对接 1.接口类型说明 1)...