首页 > 开发文档 > SDK使用示例

SDK使用示例


JAVA SDK环境依赖

 JavaSE/EE 1.5及以上


JAVA SDK使用示例

 jingdong.pop.order.search接口获取订单信息为例

JdClient client=new DefaultJdClient("https://api.jd.com/routerjson",accessToken,appKey,appSecret);
PopOrderSearchRequest request=new PopOrderSearchRequest();
request.setStartDate("2018-11-14 10:00:00");
request.setEndDate("2018-11-22 12:00:00");
request.setOrderState("TRADE_CANCELED");
request.setOptionalFields("itemInfoList,orderId,isShipmenttype,scDT,idSopShipmenttype,orderStartTime");
request.setPage("1");
request.setPageSize("20");
request.setSortType(1);
request.setDateType(0);
PopOrderSearchResponse response=client.execute(request);



.NET SDK环境依赖

 .NET Framework2.0及以上


.NET SDK使用示例

 jingdong.pop.order.search接口获取订单信息为例

IJdClient client = new DefaultJdClient("https://api.jd.com/routerjson",accessToken,appKey,appSecret);
PopOrderSearchRequest req = new PopOrderSearchRequest();
req.startdate = "2018-11-14 10:00:00" ;
req.enddate = "2018-11-15 10:00:00" ;
req.orderstate = "TRADE_CANCELED" ;
req.optionalfields = " itemInfoList,orderId,isShipmenttype,scDT,idSopShipmenttype,orderStartTime " ;
req.sourceid = "abc" ;
req.page = "1" ;
req.pagesize = "20" ;
req.sortType = 123 ;
req.dateType = 123 ;
PopOrderSearchResponse response = client.Execute (req, token, DateTime.Now.ToLocalTime());



PHP SDK环境依赖

 PHP 5及以上


PHP SDK使用示例

 jingdong.pop.order.search接口获取订单信息为例

$c = new JdClient();
$c->appKey = appKey;
$c->appSecret = appSecret;
$c->accessToken = accessToken;
$c->serverUrl = SERVER_URL;
$req = new PopOrderSearchRequest();
$req->setStartDate("2018-11-14 10:00:00");
$req->setEndDate("2018-11-15 10:00:00");
$req->setOrderState("TRADE_CANCELED");
$req->setOptionalFields("itemInfoList,orderId,isShipmenttype,scDT,idSopShipmenttype,orderStartTime");
$req->setSourceId("abc");
$req->setPage(1);
$req->setPageSize(20);
$req->setSortType(123);
$req->setDateType(123);
$resp = $c->execute($req, $c->accessToken);



API服务地址

调用环境

服务地址(HTTP)

服务地址(HTTPS)

正式环境

https://api.jd.com/routerjson

https://api.jd.com/routerjson