登录
退出
首页
开放版图
苏宁有货
商家后台
文档中心
文档中心
API文档
消息中心
平台公告
工单
我的工单
提交工单
控制台
SDK调用示例
suning.selfmarket.applycuxiao.create/
调用示例(JAVA)
复制全部代码
import com.suning.api.entity.selfmarket.ApplycuxiaoCreateRequest; import com.suning.api.entity.selfmarket.ApplycuxiaoCreateResponse; ApplycuxiaoCreateRequest request = new ApplycuxiaoCreateRequest(); request.setActionDescribe("活动描述"); ActivityDetailList activityDetailList= new ActivityDetailList(); CommodityList commodityList= new CommodityList(); commodityList.setBrandCode("D396"); commodityList.setComments("备注"); commodityList.setCommodityCode("102271946"); List
commodityListList =new ArrayList
(); commodityListList.add(commodityList); activityDetailList.setCommodityList(commodityListList); PromotionList promotionList= new PromotionList(); promotionList.setActivityMode("02"); promotionList.setBounsAmount("20.00"); promotionList.setBounsLimit("400.00"); promotionList.setLevelId("1"); promotionList.setSingleMaxRewardAmount("100.00"); List
promotionListList =new ArrayList
(); promotionListList.add(promotionList); activityDetailList.setPromotionList(promotionListList); List
activityDetailListList =new ArrayList
(); activityDetailListList.add(activityDetailList); request.setActivityDetailList(activityDetailListList); request.setActivityEndTime("2024-01-31 23:59:59"); request.setActivityStartTime("2024-01-01 00:00:00"); request.setActivityType("1"); request.setApplyLevel("01"); request.setAreaCompanyCode("5400"); CityShopList cityShopList= new CityShopList(); cityShopList.setCityCode("000001000000"); cityShopList.setShopCode("9ABL"); List
cityShopListList =new ArrayList
(); cityShopListList.add(cityShopList); request.setCityShopList(cityShopListList); request.setCouponsEndTime("2024-01-31 23:59:59"); request.setCouponsStartTime("2024-01-01 00:00:00"); request.setExpandingChannels("50"); request.setExpenseBudgetCode("91320115249801110621"); request.setFactoryAssumeScale("0.67"); request.setInvoiceContent("01"); request.setLastPayDate("2024-02-29"); request.setPdfContent("JVBERi0xLjQKJeLjz9MKMiAwIG9iago8PC9MZW5ndGggMTM4MS9GaWx0ZXIvRmxhdGVEZWN"); request.setSettleCompanyCode("1002"); request.setSettlementType("S04"); request.setSupplierApplicationCode("HDIC180622599"); request.setSupplierCode("10138968"); //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 { ApplycuxiaoCreateResponse response = client.excute(request); System.out.println("返回json/xml格式数据 :" + response.getBody()); } catch (SuningApiException e) { e.printStackTrace(); }
调用示例(PHP)
复制全部代码
$req = new ApplycuxiaoCreateRequest(); $req -> setActionDescribe("活动描述"); $activityDetailList= new ActivityDetailList(); $commodityList= new CommodityList(); $commodityList-> setBrandCode("D396"); $commodityList-> setComments("备注"); $commodityList-> setCommodityCode("102271946"); $activityDetailList-> setCommodityList(array($commodityList)); $promotionList= new PromotionList(); $promotionList-> setActivityMode("02"); $promotionList-> setBounsAmount("20.00"); $promotionList-> setBounsLimit("400.00"); $promotionList-> setLevelId("1"); $promotionList-> setSingleMaxRewardAmount("100.00"); $activityDetailList-> setPromotionList(array($promotionList)); $req -> setActivityDetailList(array($activityDetailList)); $req -> setActivityEndTime("2024-01-31 23:59:59"); $req -> setActivityStartTime("2024-01-01 00:00:00"); $req -> setActivityType("1"); $req -> setApplyLevel("01"); $req -> setAreaCompanyCode("5400"); $cityShopList= new CityShopList(); $cityShopList-> setCityCode("000001000000"); $cityShopList-> setShopCode("9ABL"); $req -> setCityShopList(array($cityShopList)); $req -> setCouponsEndTime("2024-01-31 23:59:59"); $req -> setCouponsStartTime("2024-01-01 00:00:00"); $req -> setExpandingChannels("50"); $req -> setExpenseBudgetCode("91320115249801110621"); $req -> setFactoryAssumeScale("0.67"); $req -> setInvoiceContent("01"); $req -> setLastPayDate("2024-02-29"); $req -> setPdfContent("JVBERi0xLjQKJeLjz9MKMiAwIG9iago8PC9MZW5ndGggMTM4MS9GaWx0ZXIvRmxhdGVEZWN"); $req -> setSettleCompanyCode("1002"); $req -> setSettlementType("S04"); $req -> setSupplierApplicationCode("HDIC180622599"); $req -> setSupplierCode("10138968"); //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.CustomSelfmarketRequest; using suning_api_sdk.BizResponse.CustomSelfmarketResponse; using suning_api_sdk.Models.CustomSelfmarketModel; ApplycuxiaoCreateRequest request = new ApplycuxiaoCreateRequest(); request.actionDescribe="活动描述"; ApplycuxiaoCreateActivityDetailListReq activityDetailList= new ApplycuxiaoCreateActivityDetailListReq(); ApplycuxiaoCreateCommodityListReq commodityList= new ApplycuxiaoCreateCommodityListReq(); commodityList.brandCode="D396"; commodityList.comments="备注"; commodityList.commodityCode="102271946"; List
commodityListList =new ArrayList
(); commodityListList.add(commodityList); activityDetailList.commodityList=commodityListList; ApplycuxiaoCreatePromotionListReq promotionList= new ApplycuxiaoCreatePromotionListReq(); promotionList.activityMode="02"; promotionList.bounsAmount="20.00"; promotionList.bounsLimit="400.00"; promotionList.levelId="1"; promotionList.singleMaxRewardAmount="100.00"; List
promotionListList =new ArrayList
(); promotionListList.add(promotionList); activityDetailList.promotionList=promotionListList; List
activityDetailListList =new ArrayList
(); activityDetailListList.add(activityDetailList); request.activityDetailList=activityDetailListList; request.activityEndTime="2024-01-31 23:59:59"; request.activityStartTime="2024-01-01 00:00:00"; request.activityType="1"; request.applyLevel="01"; request.areaCompanyCode="5400"; ApplycuxiaoCreateCityShopListReq cityShopList= new ApplycuxiaoCreateCityShopListReq(); cityShopList.cityCode="000001000000"; cityShopList.shopCode="9ABL"; List
cityShopListList =new ArrayList
(); cityShopListList.add(cityShopList); request.cityShopList=cityShopListList; request.couponsEndTime="2024-01-31 23:59:59"; request.couponsStartTime="2024-01-01 00:00:00"; request.expandingChannels="50"; request.expenseBudgetCode="91320115249801110621"; request.factoryAssumeScale="0.67"; request.invoiceContent="01"; request.lastPayDate="2024-02-29"; request.pdfContent="JVBERi0xLjQKJeLjz9MKMiAwIG9iago8PC9MZW5ndGggMTM4MS9GaWx0ZXIvRmxhdGVEZWN"; request.settleCompanyCode="1002"; request.settlementType="S04"; request.supplierApplicationCode="HDIC180622599"; request.supplierCode="10138968"; //开启日志调试,当测试稳定之后建议设置为 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); ApplycuxiaoCreateResponse response = client.Execute(request);
调用示例(PYTHON)
复制全部代码
# -*- coding: utf-8 -*- import suning.api request = suning.api.selfmarket.ApplycuxiaoCreateRequest() request.actionDescribe="活动描述"; request. activityDetailList= [{ commodityList: [{ brandCode:"D396", comments:"备注", commodityCode:"102271946", }], promotionList: [{ activityMode:"02", bounsAmount:"20.00", bounsLimit:"400.00", levelId:"1", singleMaxRewardAmount:"100.00", }], }]; request.activityEndTime="2024-01-31 23:59:59"; request.activityStartTime="2024-01-01 00:00:00"; request.activityType="1"; request.applyLevel="01"; request.areaCompanyCode="5400"; request. cityShopList= [{ cityCode:"000001000000", shopCode:"9ABL", }]; request.couponsEndTime="2024-01-31 23:59:59"; request.couponsStartTime="2024-01-01 00:00:00"; request.expandingChannels="50"; request.expenseBudgetCode="91320115249801110621"; request.factoryAssumeScale="0.67"; request.invoiceContent="01"; request.lastPayDate="2024-02-29"; request.pdfContent="JVBERi0xLjQKJeLjz9MKMiAwIG9iago8PC9MZW5ndGggMTM4MS9GaWx0ZXIvRmxhdGVEZWN"; request.settleCompanyCode="1002"; request.settlementType="S04"; request.supplierApplicationCode="HDIC180622599"; request.supplierCode="10138968"; 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)