登录
退出
首页
开放版图
苏宁有货
商家后台
文档中心
文档中心
API文档
消息中心
平台公告
工单
我的工单
提交工单
控制台
SDK调用示例
suning.custom.appoint.create/
调用示例(JAVA)
复制全部代码
import com.suning.api.entity.custom.AppointCreateRequest; import com.suning.api.entity.custom.AppointCreateResponse; AppointCreateRequest request = new AppointCreateRequest(); request.setActionEndTime("2019-10-01 00:00:01"); request.setActionId("2019102800001"); request.setActionName("预约活动名称"); request.setActionStartTime("2019-10-01 00:00:01"); request.setActionType("0:普通预约"); request.setAdapteTerminal("1:PC,2:移动,3:PC+移动"); request.setEnrollInfoCode("SU191028101810140135"); request.setExcludeCitys("9017,9264"); GoodsList goodsList= new GoodsList(); goodsList.setAppointPrice("3999"); goodsList.setCatengrpCode("000000000123456788"); goodsList.setColor("红色"); goodsList.setDefaultGoodsFlags("1"); goodsList.setMsgContent("您好,您预约的XXX将于XXX开始抢购......"); goodsList.setPartName("这是商品名称"); goodsList.setPartnumber("000000000123456789"); goodsList.setPersonBuyLimit("2"); goodsList.setPrice("3899"); goodsList.setPriceLabel("3??9"); goodsList.setStandard("42码"); goodsList.setTotalLimit("10000"); List
goodsListList =new ArrayList
(); goodsListList.add(goodsList); request.setGoodsList(goodsListList); GoodsSubList goodsSubList= new GoodsSubList(); goodsSubList.setCount("2"); goodsSubList.setSubAppointPrice("500"); goodsSubList.setSubPartName("这是子商品名称"); goodsSubList.setSubPartNumber("000000000123456789"); goodsSubList.setSubPrice("399"); goodsSubList.setSubTextPrice("299"); List
goodsSubListList =new ArrayList
(); goodsSubListList.add(goodsSubList); request.setGoodsSubList(goodsSubListList); request.setNoticePhone("11111111111"); request.setOperateType("01:新建,02:修改,03:停用"); request.setOperateUser("工号"); request.setOtherTerminalSale("0:否,1:是"); request.setPartType("00:普通单商品,01:通子码商品,02:蔟商品,03:套餐商品"); request.setPhoneShareContent("***商品正在做预约"); request.setPhoneShareImgUrl("url链接"); request.setPhoneShareTitle("我在苏宁易购预约了商品"); request.setPhoneShareUrl("url链接"); request.setPurchaseEndTime("2019-10-01 00:00:01"); request.setPurchaseStartTime("2019-10-01 00:00:01"); request.setReceiveSys("AAAA"); request.setScheduleEndTime("2019-10-01 00:00:01"); request.setScheduleStartTime("2019-10-01 00:00:01"); request.setSendScalperMsg("0:不发送,1:发送"); request.setSendUserMsg("0:不发送,1:发送"); request.setSupervipPurchaseStartTime("2019-10-01 00:00:01"); request.setTicketResaleStartTime("2019-10-01 00:00:01"); request.setTransitDate("2019-10-01 00:00:01"); request.setTransitFlag("2:否,1:是"); request.setVendorCode("0000000000"); request.setVendorName("商家名称"); request.setVendorType("00-自营,10-代表C模式,20-代表SWL模式,30-代表海外购模式,50-线上联营"); request.setVersionNumber("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 { AppointCreateResponse response = client.excute(request); System.out.println("返回json/xml格式数据 :" + response.getBody()); } catch (SuningApiException e) { e.printStackTrace(); }
调用示例(PHP)
复制全部代码
$req = new AppointCreateRequest(); $req -> setActionEndTime("2019-10-01 00:00:01"); $req -> setActionId("2019102800001"); $req -> setActionName("预约活动名称"); $req -> setActionStartTime("2019-10-01 00:00:01"); $req -> setActionType("0:普通预约"); $req -> setAdapteTerminal("1:PC,2:移动,3:PC+移动"); $req -> setEnrollInfoCode("SU191028101810140135"); $req -> setExcludeCitys("9017,9264"); $goodsList= new GoodsList(); $goodsList-> setAppointPrice("3999"); $goodsList-> setCatengrpCode("000000000123456788"); $goodsList-> setColor("红色"); $goodsList-> setDefaultGoodsFlags("1"); $goodsList-> setMsgContent("您好,您预约的XXX将于XXX开始抢购......"); $goodsList-> setPartName("这是商品名称"); $goodsList-> setPartnumber("000000000123456789"); $goodsList-> setPersonBuyLimit("2"); $goodsList-> setPrice("3899"); $goodsList-> setPriceLabel("3??9"); $goodsList-> setStandard("42码"); $goodsList-> setTotalLimit("10000"); $req -> setGoodsList(array($goodsList)); $goodsSubList= new GoodsSubList(); $goodsSubList-> setCount("2"); $goodsSubList-> setSubAppointPrice("500"); $goodsSubList-> setSubPartName("这是子商品名称"); $goodsSubList-> setSubPartNumber("000000000123456789"); $goodsSubList-> setSubPrice("399"); $goodsSubList-> setSubTextPrice("299"); $req -> setGoodsSubList(array($goodsSubList)); $req -> setNoticePhone("11111111111"); $req -> setOperateType("01:新建,02:修改,03:停用"); $req -> setOperateUser("工号"); $req -> setOtherTerminalSale("0:否,1:是"); $req -> setPartType("00:普通单商品,01:通子码商品,02:蔟商品,03:套餐商品"); $req -> setPhoneShareContent("***商品正在做预约"); $req -> setPhoneShareImgUrl("url链接"); $req -> setPhoneShareTitle("我在苏宁易购预约了商品"); $req -> setPhoneShareUrl("url链接"); $req -> setPurchaseEndTime("2019-10-01 00:00:01"); $req -> setPurchaseStartTime("2019-10-01 00:00:01"); $req -> setReceiveSys("AAAA"); $req -> setScheduleEndTime("2019-10-01 00:00:01"); $req -> setScheduleStartTime("2019-10-01 00:00:01"); $req -> setSendScalperMsg("0:不发送,1:发送"); $req -> setSendUserMsg("0:不发送,1:发送"); $req -> setSupervipPurchaseStartTime("2019-10-01 00:00:01"); $req -> setTicketResaleStartTime("2019-10-01 00:00:01"); $req -> setTransitDate("2019-10-01 00:00:01"); $req -> setTransitFlag("2:否,1:是"); $req -> setVendorCode("0000000000"); $req -> setVendorName("商家名称"); $req -> setVendorType("00-自营,10-代表C模式,20-代表SWL模式,30-代表海外购模式,50-线上联营"); $req -> setVersionNumber("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.CustomCustomRequest; using suning_api_sdk.BizResponse.CustomCustomResponse; using suning_api_sdk.Models.CustomCustomModel; AppointCreateRequest request = new AppointCreateRequest(); request.actionEndTime="2019-10-01 00:00:01"; request.actionId="2019102800001"; request.actionName="预约活动名称"; request.actionStartTime="2019-10-01 00:00:01"; request.actionType="0:普通预约"; request.adapteTerminal="1:PC,2:移动,3:PC+移动"; request.enrollInfoCode="SU191028101810140135"; request.excludeCitys="9017,9264"; AppointCreateGoodsListReq goodsList= new AppointCreateGoodsListReq(); goodsList.appointPrice="3999"; goodsList.catengrpCode="000000000123456788"; goodsList.color="红色"; goodsList.defaultGoodsFlags="1"; goodsList.msgContent="您好,您预约的XXX将于XXX开始抢购......"; goodsList.partName="这是商品名称"; goodsList.partnumber="000000000123456789"; goodsList.personBuyLimit="2"; goodsList.price="3899"; goodsList.priceLabel="3??9"; goodsList.standard="42码"; goodsList.totalLimit="10000"; List
goodsListList =new ArrayList
(); goodsListList.add(goodsList); request.goodsList=goodsListList; AppointCreateGoodsSubListReq goodsSubList= new AppointCreateGoodsSubListReq(); goodsSubList.count="2"; goodsSubList.subAppointPrice="500"; goodsSubList.subPartName="这是子商品名称"; goodsSubList.subPartNumber="000000000123456789"; goodsSubList.subPrice="399"; goodsSubList.subTextPrice="299"; List
goodsSubListList =new ArrayList
(); goodsSubListList.add(goodsSubList); request.goodsSubList=goodsSubListList; request.noticePhone="11111111111"; request.operateType="01:新建,02:修改,03:停用"; request.operateUser="工号"; request.otherTerminalSale="0:否,1:是"; request.partType="00:普通单商品,01:通子码商品,02:蔟商品,03:套餐商品"; request.phoneShareContent="***商品正在做预约"; request.phoneShareImgUrl="url链接"; request.phoneShareTitle="我在苏宁易购预约了商品"; request.phoneShareUrl="url链接"; request.purchaseEndTime="2019-10-01 00:00:01"; request.purchaseStartTime="2019-10-01 00:00:01"; request.receiveSys="AAAA"; request.scheduleEndTime="2019-10-01 00:00:01"; request.scheduleStartTime="2019-10-01 00:00:01"; request.sendScalperMsg="0:不发送,1:发送"; request.sendUserMsg="0:不发送,1:发送"; request.supervipPurchaseStartTime="2019-10-01 00:00:01"; request.ticketResaleStartTime="2019-10-01 00:00:01"; request.transitDate="2019-10-01 00:00:01"; request.transitFlag="2:否,1:是"; request.vendorCode="0000000000"; request.vendorName="商家名称"; request.vendorType="00-自营,10-代表C模式,20-代表SWL模式,30-代表海外购模式,50-线上联营"; request.versionNumber="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); AppointCreateResponse response = client.Execute(request);
调用示例(PYTHON)
复制全部代码
# -*- coding: utf-8 -*- import suning.api request = suning.api.custom.AppointCreateRequest() request.actionEndTime="2019-10-01 00:00:01"; request.actionId="2019102800001"; request.actionName="预约活动名称"; request.actionStartTime="2019-10-01 00:00:01"; request.actionType="0:普通预约"; request.adapteTerminal="1:PC,2:移动,3:PC+移动"; request.enrollInfoCode="SU191028101810140135"; request.excludeCitys="9017,9264"; request. goodsList= [{ appointPrice:"3999", catengrpCode:"000000000123456788", color:"红色", defaultGoodsFlags:"1", msgContent:"您好,您预约的XXX将于XXX开始抢购......", partName:"这是商品名称", partnumber:"000000000123456789", personBuyLimit:"2", price:"3899", priceLabel:"3??9", standard:"42码", totalLimit:"10000", }]; request. goodsSubList= [{ count:"2", subAppointPrice:"500", subPartName:"这是子商品名称", subPartNumber:"000000000123456789", subPrice:"399", subTextPrice:"299", }]; request.noticePhone="11111111111"; request.operateType="01:新建,02:修改,03:停用"; request.operateUser="工号"; request.otherTerminalSale="0:否,1:是"; request.partType="00:普通单商品,01:通子码商品,02:蔟商品,03:套餐商品"; request.phoneShareContent="***商品正在做预约"; request.phoneShareImgUrl="url链接"; request.phoneShareTitle="我在苏宁易购预约了商品"; request.phoneShareUrl="url链接"; request.purchaseEndTime="2019-10-01 00:00:01"; request.purchaseStartTime="2019-10-01 00:00:01"; request.receiveSys="AAAA"; request.scheduleEndTime="2019-10-01 00:00:01"; request.scheduleStartTime="2019-10-01 00:00:01"; request.sendScalperMsg="0:不发送,1:发送"; request.sendUserMsg="0:不发送,1:发送"; request.supervipPurchaseStartTime="2019-10-01 00:00:01"; request.ticketResaleStartTime="2019-10-01 00:00:01"; request.transitDate="2019-10-01 00:00:01"; request.transitFlag="2:否,1:是"; request.vendorCode="0000000000"; request.vendorName="商家名称"; request.vendorType="00-自营,10-代表C模式,20-代表SWL模式,30-代表海外购模式,50-线上联营"; request.versionNumber="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)