登录
退出
首页
开放版图
苏宁有货
商家后台
文档中心
文档中心
API文档
消息中心
平台公告
工单
我的工单
提交工单
控制台
SDK调用示例
suning.fourps.orderdelivery.add/
调用示例(JAVA)
复制全部代码
import com.suning.api.entity.fourps.OrderDeliveryAddRequest; import com.suning.api.entity.fourps.OrderDeliveryAddResponse; OrderDeliveryAddRequest request = new OrderDeliveryAddRequest(); request.setOutOrderId("123456"); request.setOrderSource("201"); request.setScheduleType("1"); request.setDeliveryType("LLPS"); request.setScheduleDay("2014-01-14 12:20:00"); request.setScheduleStart("2014-01-14 12:20:00"); request.setScheduleEnd("2014-01-14 12:20:00"); request.setReceiverZipCode("839333"); request.setReceiverProvince("浙江"); request.setReceiverCity("杭州"); request.setReceiverArea("余杭"); request.setReceiverTown("余杭"); request.setReceiverAddress("余杭"); request.setReceiverName("李四"); request.setReceiverMobile("13828020288"); request.setReceiverPhone("0571-38338988"); request.setCarCode("17.5m T320"); request.setOrderFlag("1"); request.setCustSelectNumber("10000"); request.setWarehouseCode("123456"); request.setOrderItemId("555555"); request.setItemCode("111111"); request.setOuterItemId("37901"); request.setItemName("商品"); request.setInventoryType("1"); request.setItemQuantity("12"); request.setDeliverNo("222222"); request.setActualPrice("112"); request.setColourNumber("1"); request.setProduceCode("1"); //api入参校验逻辑开关,当测试稳定之后建议设置为 false 或者删除该行 request.setCheckParam(true); String serverUrl = "https://openpre.cnsuning.com/api/http/sopRequest"; String appKey = "你的appKey"; String appSecret = "你的appSecret"; DefaultSuningClient client = new DefaultSuningClient(serverUrl, appKey,appSecret, "json"); try { OrderDeliveryAddResponse response = client.excute(request); System.out.println("返回json/xml格式数据 :" + response.getBody()); } catch (SuningApiException e) { e.printStackTrace(); }
调用示例(PHP)
复制全部代码
$req = new OrderDeliveryAddRequest(); $req -> setOutOrderId("123456"); $req -> setOrderSource("201"); $req -> setScheduleType("1"); $req -> setDeliveryType("LLPS"); $req -> setScheduleDay("2014-01-14 12:20:00"); $req -> setScheduleStart("2014-01-14 12:20:00"); $req -> setScheduleEnd("2014-01-14 12:20:00"); $req -> setReceiverZipCode("839333"); $req -> setReceiverProvince("浙江"); $req -> setReceiverCity("杭州"); $req -> setReceiverArea("余杭"); $req -> setReceiverTown("余杭"); $req -> setReceiverAddress("余杭"); $req -> setReceiverName("李四"); $req -> setReceiverMobile("13828020288"); $req -> setReceiverPhone("0571-38338988"); $req -> setCarCode("17.5m T320"); $req -> setOrderFlag("1"); $req -> setCustSelectNumber("10000"); $req -> setWarehouseCode("123456"); $req -> setOrderItemId("555555"); $req -> setItemCode("111111"); $req -> setOuterItemId("37901"); $req -> setItemName("商品"); $req -> setInventoryType("1"); $req -> setItemQuantity("12"); $req -> setDeliverNo("222222"); $req -> setActualPrice("112"); $req -> setColourNumber("1"); $req -> setProduceCode("1"); //api入参校验逻辑开关,当测试稳定之后建议设置为 false 或者删除该行 $req -> setCheckParam('true'); $serverUrl = "https://openpre.cnsuning.com/api/http/sopRequest"; $appKey = "你的appKey"; $appSecret = "你的appSecret"; $client = new DefaultSuningClient($serverUrl,$appKey,$appSecret,'json'); $resp = $client -> execute($req); print_r("返回响应报文:".$resp);
调用示例(.NET)
复制全部代码
using suning_api_sdk.BizRequest.CustomFourpsRequest; using suning_api_sdk.BizResponse.CustomFourpsResponse; using suning_api_sdk.Models.CustomFourpsModel; OrderDeliveryAddRequest request = new OrderDeliveryAddRequest(); request.outOrderId="123456"; request.orderSource="201"; request.scheduleType="1"; request.deliveryType="LLPS"; request.scheduleDay="2014-01-14 12:20:00"; request.scheduleStart="2014-01-14 12:20:00"; request.scheduleEnd="2014-01-14 12:20:00"; request.receiverZipCode="839333"; request.receiverProvince="浙江"; request.receiverCity="杭州"; request.receiverArea="余杭"; request.receiverTown="余杭"; request.receiverAddress="余杭"; request.receiverName="李四"; request.receiverMobile="13828020288"; request.receiverPhone="0571-38338988"; request.carCode="17.5m T320"; request.orderFlag="1"; request.custSelectNumber="10000"; request.warehouseCode="123456"; request.orderItemId="555555"; request.itemCode="111111"; request.outerItemId="37901"; request.itemName="商品"; request.inventoryType="1"; request.itemQuantity="12"; request.deliverNo="222222"; request.actualPrice="112"; request.colourNumber="1"; request.produceCode="1"; //开启日志调试,当测试稳定之后建议设置为 false 或者删除该行 SuningLogger.IsLogDebug = true; string serverUrl = "https://openpre.cnsuning.com/api/http/sopRequest"; string appKey = "你的appKey"; string appSecret = "你的appSecret"; ISuningClient client = new DefaultSuningClient(serverUrl, appKey,appSecret); OrderDeliveryAddResponse response = client.Execute(request);
调用示例(PYTHON)
复制全部代码
# -*- coding: utf-8 -*- import suning.api request = suning.api.fourps.OrderDeliveryAddRequest() request.outOrderId="123456" request.orderSource="201" request.scheduleType="1" request.deliveryType="LLPS" request.scheduleDay="2014-01-14 12:20:00" request.scheduleStart="2014-01-14 12:20:00" request.scheduleEnd="2014-01-14 12:20:00" request.receiverZipCode="839333" request.receiverProvince="浙江" request.receiverCity="杭州" request.receiverArea="余杭" request.receiverTown="余杭" request.receiverAddress="余杭" request.receiverName="李四" request.receiverMobile="13828020288" request.receiverPhone="0571-38338988" request.carCode="17.5m T320" request.orderFlag="1" request.custSelectNumber="10000" request.warehouseCode="123456" request.orderItemId="555555" request.itemCode="111111" request.outerItemId="37901" request.itemName="商品" request.inventoryType="1" request.itemQuantity="12" request.deliverNo="222222" request.actualPrice="112" request.colourNumber="1" request.produceCode="1" domain = "https://openpre.cnsuning.com" appKey = "你的appKey" appSecret = "你的appSecret" request.setDomainInfo(domain,"80") request.setAppInfo(appKey,appSecret) try: result=request.getResponse() print(result) except Exception as e: print(e)