登录
退出
首页
开放版图
苏宁有货
商家后台
文档中心
文档中心
API文档
消息中心
平台公告
工单
我的工单
提交工单
控制台
SDK调用示例
suning.integrate.culitem.add/
调用示例(JAVA)
复制全部代码
import com.suning.api.entity.integrate.CulitemAddRequest; import com.suning.api.entity.integrate.CulitemAddResponse; CulitemAddRequest request = new CulitemAddRequest(); request.setAfterSaleServiceDec("七天内包退换"); request.setAlertQty("10"); request.setAssortCode("11111"); request.setAuditFlag("X"); request.setBrandCode("000C"); request.setCategoryCode("R00001"); request.setCmTitle("111"); DetailModule detailModule= new DetailModule(); detailModule.setContent("模块化详情内容"); detailModule.setModuleId("123"); detailModule.setModuleName("模块名称"); detailModule.setNum("1"); detailModule.setType("cat_mod"); List
detailModuleList =new ArrayList
(); detailModuleList.add(detailModule); request.setDetailModule(detailModuleList); request.setIntroduction("111"); request.setInvQty("100"); request.setItemCode("12233"); Pars pars= new Pars(); pars.setParCode("111"); pars.setParValue("111"); List
parsList =new ArrayList
(); parsList.add(pars); request.setPars(parsList); request.setPeopleNum("2"); request.setPingouPrice("20.00"); request.setPrice("20.00"); request.setProductName("平凡的世界"); request.setPurchaseMax("10"); request.setPurchaseMin("5"); request.setSaleCatalogCode("262676"); request.setSaleDate("2014-01-06"); request.setSaleSet("0"); request.setSellPoint("好品质"); request.setSupplierImgAUrl("11"); request.setSupplierImgBUrl("11"); request.setSupplierImgCUrl("11"); request.setSupplierImgDUrl("111"); request.setSupplierImgEUrl("111"); //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 { CulitemAddResponse response = client.excute(request); System.out.println("返回json/xml格式数据 :" + response.getBody()); } catch (SuningApiException e) { e.printStackTrace(); }
调用示例(PHP)
复制全部代码
$req = new CulitemAddRequest(); $req -> setAfterSaleServiceDec("七天内包退换"); $req -> setAlertQty("10"); $req -> setAssortCode("11111"); $req -> setAuditFlag("X"); $req -> setBrandCode("000C"); $req -> setCategoryCode("R00001"); $req -> setCmTitle("111"); $detailModule= new DetailModule(); $detailModule-> setContent("模块化详情内容"); $detailModule-> setModuleId("123"); $detailModule-> setModuleName("模块名称"); $detailModule-> setNum("1"); $detailModule-> setType("cat_mod"); $req -> setDetailModule(array($detailModule)); $req -> setIntroduction("111"); $req -> setInvQty("100"); $req -> setItemCode("12233"); $pars= new Pars(); $pars-> setParCode("111"); $pars-> setParValue("111"); $req -> setPars(array($pars)); $req -> setPeopleNum("2"); $req -> setPingouPrice("20.00"); $req -> setPrice("20.00"); $req -> setProductName("平凡的世界"); $req -> setPurchaseMax("10"); $req -> setPurchaseMin("5"); $req -> setSaleCatalogCode("262676"); $req -> setSaleDate("2014-01-06"); $req -> setSaleSet("0"); $req -> setSellPoint("好品质"); $req -> setSupplierImgAUrl("11"); $req -> setSupplierImgBUrl("11"); $req -> setSupplierImgCUrl("11"); $req -> setSupplierImgDUrl("111"); $req -> setSupplierImgEUrl("111"); //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.CustomIntegrateRequest; using suning_api_sdk.BizResponse.CustomIntegrateResponse; using suning_api_sdk.Models.CustomIntegrateModel; CulitemAddRequest request = new CulitemAddRequest(); request.afterSaleServiceDec="七天内包退换"; request.alertQty="10"; request.assortCode="11111"; request.auditFlag="X"; request.brandCode="000C"; request.categoryCode="R00001"; request.cmTitle="111"; CulitemAddDetailModuleReq detailModule= new CulitemAddDetailModuleReq(); detailModule.content="模块化详情内容"; detailModule.moduleId="123"; detailModule.moduleName="模块名称"; detailModule.num="1"; detailModule.type="cat_mod"; List
detailModuleList =new ArrayList
(); detailModuleList.add(detailModule); request.detailModule=detailModuleList; request.introduction="111"; request.invQty="100"; request.itemCode="12233"; CulitemAddParsReq pars= new CulitemAddParsReq(); pars.parCode="111"; pars.parValue="111"; List
parsList =new ArrayList
(); parsList.add(pars); request.pars=parsList; request.peopleNum="2"; request.pingouPrice="20.00"; request.price="20.00"; request.productName="平凡的世界"; request.purchaseMax="10"; request.purchaseMin="5"; request.saleCatalogCode="262676"; request.saleDate="2014-01-06"; request.saleSet="0"; request.sellPoint="好品质"; request.supplierImgAUrl="11"; request.supplierImgBUrl="11"; request.supplierImgCUrl="11"; request.supplierImgDUrl="111"; request.supplierImgEUrl="111"; //开启日志调试,当测试稳定之后建议设置为 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); CulitemAddResponse response = client.Execute(request);
调用示例(PYTHON)
复制全部代码
# -*- coding: utf-8 -*- import suning.api request = suning.api.integrate.CulitemAddRequest() request.afterSaleServiceDec="七天内包退换"; request.alertQty="10"; request.assortCode="11111"; request.auditFlag="X"; request.brandCode="000C"; request.categoryCode="R00001"; request.cmTitle="111"; request. detailModule= [{ content:"模块化详情内容", moduleId:"123", moduleName:"模块名称", num:"1", type:"cat_mod", }]; request.introduction="111"; request.invQty="100"; request.itemCode="12233"; request. pars= [{ parCode:"111", parValue:"111", }]; request.peopleNum="2"; request.pingouPrice="20.00"; request.price="20.00"; request.productName="平凡的世界"; request.purchaseMax="10"; request.purchaseMin="5"; request.saleCatalogCode="262676"; request.saleDate="2014-01-06"; request.saleSet="0"; request.sellPoint="好品质"; request.supplierImgAUrl="11"; request.supplierImgBUrl="11"; request.supplierImgCUrl="11"; request.supplierImgDUrl="111"; request.supplierImgEUrl="111"; 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)