登录
退出
首页
开放版图
苏宁有货
商家后台
文档中心
文档中心
API文档
消息中心
平台公告
工单
我的工单
提交工单
控制台
SDK调用示例
suning.custom.merorderdirect.add/
调用示例(JAVA)
复制全部代码
import com.suning.api.entity.custom.MerOrderDirectAddRequest; import com.suning.api.entity.custom.MerOrderDirectAddResponse; MerOrderDirectAddRequest request = new MerOrderDirectAddRequest(); request.setCityCode("025"); request.setCmmdtyQaType("0"); request.setConsignee("张三"); request.setExtdCmmdtyBand("0000137D5"); request.setExtdCmmdtyCtgry("R0125658"); request.setExtdCommodityCode("42346869"); request.setExtdCommodityName("挂壁式空调"); request.setFaultTypeCode("B1202004"); request.setMobPhoneNum("18551600409"); request.setOrderChannel("ZL"); request.setOrderTime("20160414175115"); request.setPhoneNum("073586131462"); request.setProName("02"); request.setSaleDate("20130222162020"); request.setSaleQty("5"); request.setSalesPerson("75324568"); request.setSapOrderType("ZS01"); request.setServiceTime("20160420093018"); request.setSourceOrderItemId("752316542542535"); request.setSrvAddress("随机数字;小区/大厦/单位/村;市;区/县/开发区;镇/街道办;路/道/街;巷/弄;号;详细地址"); request.setSrvAreaCode("0250199"); request.setSrvMemo("需要带支架,需要维修"); //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 { MerOrderDirectAddResponse response = client.excute(request); System.out.println("返回json/xml格式数据 :" + response.getBody()); } catch (SuningApiException e) { e.printStackTrace(); }
调用示例(PHP)
复制全部代码
$req = new MerOrderDirectAddRequest(); $req -> setCityCode("025"); $req -> setCmmdtyQaType("0"); $req -> setConsignee("张三"); $req -> setExtdCmmdtyBand("0000137D5"); $req -> setExtdCmmdtyCtgry("R0125658"); $req -> setExtdCommodityCode("42346869"); $req -> setExtdCommodityName("挂壁式空调"); $req -> setFaultTypeCode("B1202004"); $req -> setMobPhoneNum("18551600409"); $req -> setOrderChannel("ZL"); $req -> setOrderTime("20160414175115"); $req -> setPhoneNum("073586131462"); $req -> setProName("02"); $req -> setSaleDate("20130222162020"); $req -> setSaleQty("5"); $req -> setSalesPerson("75324568"); $req -> setSapOrderType("ZS01"); $req -> setServiceTime("20160420093018"); $req -> setSourceOrderItemId("752316542542535"); $req -> setSrvAddress("随机数字;小区/大厦/单位/村;市;区/县/开发区;镇/街道办;路/道/街;巷/弄;号;详细地址"); $req -> setSrvAreaCode("0250199"); $req -> setSrvMemo("需要带支架,需要维修"); //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.CustomCustomRequest; using suning_api_sdk.BizResponse.CustomCustomResponse; using suning_api_sdk.Models.CustomCustomModel; MerOrderDirectAddRequest request = new MerOrderDirectAddRequest(); request.cityCode="025"; request.cmmdtyQaType="0"; request.consignee="张三"; request.extdCmmdtyBand="0000137D5"; request.extdCmmdtyCtgry="R0125658"; request.extdCommodityCode="42346869"; request.extdCommodityName="挂壁式空调"; request.faultTypeCode="B1202004"; request.mobPhoneNum="18551600409"; request.orderChannel="ZL"; request.orderTime="20160414175115"; request.phoneNum="073586131462"; request.proName="02"; request.saleDate="20130222162020"; request.saleQty="5"; request.salesPerson="75324568"; request.sapOrderType="ZS01"; request.serviceTime="20160420093018"; request.sourceOrderItemId="752316542542535"; request.srvAddress="随机数字;小区/大厦/单位/村;市;区/县/开发区;镇/街道办;路/道/街;巷/弄;号;详细地址"; request.srvAreaCode="0250199"; request.srvMemo="需要带支架,需要维修"; //开启日志调试,当测试稳定之后建议设置为 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); MerOrderDirectAddResponse response = client.Execute(request);
调用示例(PYTHON)
复制全部代码
# -*- coding: utf-8 -*- import suning.api request = suning.api.custom.MerOrderDirectAddRequest() request.cityCode="025"; request.cmmdtyQaType="0"; request.consignee="张三"; request.extdCmmdtyBand="0000137D5"; request.extdCmmdtyCtgry="R0125658"; request.extdCommodityCode="42346869"; request.extdCommodityName="挂壁式空调"; request.faultTypeCode="B1202004"; request.mobPhoneNum="18551600409"; request.orderChannel="ZL"; request.orderTime="20160414175115"; request.phoneNum="073586131462"; request.proName="02"; request.saleDate="20130222162020"; request.saleQty="5"; request.salesPerson="75324568"; request.sapOrderType="ZS01"; request.serviceTime="20160420093018"; request.sourceOrderItemId="752316542542535"; request.srvAddress="随机数字;小区/大厦/单位/村;市;区/县/开发区;镇/街道办;路/道/街;巷/弄;号;详细地址"; request.srvAreaCode="0250199"; request.srvMemo="需要带支架,需要维修"; 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)