登录
退出
首页
开放版图
苏宁有货
商家后台
文档中心
文档中心
API文档
消息中心
平台公告
工单
我的工单
提交工单
控制台
SDK调用示例
suning.custom.culitem.add/
调用示例(JAVA)
复制全部代码
import com.suning.api.entity.custom.CulitemAddRequest; import com.suning.api.entity.custom.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.setFreightTemplateId("111"); request.setHighlightWordone("亮点词1"); request.setHighlightWordthree("亮点词3"); request.setHighlightWordtwo("亮点词2"); request.setIntroduction("111"); request.setInvQty("100"); request.setItemCode("12233"); request.setMainPicVideoCode("主图视频编码"); Pars pars= new Pars(); pars.setParCode("111"); pars.setParValue("111"); List
parsList =new ArrayList
(); parsList.add(pars); request.setPars(parsList); request.setPrice("20.00"); request.setProductName("平凡的世界"); 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 -> setFreightTemplateId("111"); $req -> setHighlightWordone("亮点词1"); $req -> setHighlightWordthree("亮点词3"); $req -> setHighlightWordtwo("亮点词2"); $req -> setIntroduction("111"); $req -> setInvQty("100"); $req -> setItemCode("12233"); $req -> setMainPicVideoCode("主图视频编码"); $pars= new Pars(); $pars-> setParCode("111"); $pars-> setParValue("111"); $req -> setPars(array($pars)); $req -> setPrice("20.00"); $req -> setProductName("平凡的世界"); $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.CustomCustomRequest; using suning_api_sdk.BizResponse.CustomCustomResponse; using suning_api_sdk.Models.CustomCustomModel; 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.freightTemplateId="111"; request.highlightWordone="亮点词1"; request.highlightWordthree="亮点词3"; request.highlightWordtwo="亮点词2"; request.introduction="111"; request.invQty="100"; request.itemCode="12233"; request.mainPicVideoCode="主图视频编码"; CulitemAddParsReq pars= new CulitemAddParsReq(); pars.parCode="111"; pars.parValue="111"; List
parsList =new ArrayList
(); parsList.add(pars); request.pars=parsList; request.price="20.00"; request.productName="平凡的世界"; 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.custom.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.freightTemplateId="111"; request.highlightWordone="亮点词1"; request.highlightWordthree="亮点词3"; request.highlightWordtwo="亮点词2"; request.introduction="111"; request.invQty="100"; request.itemCode="12233"; request.mainPicVideoCode="主图视频编码"; request. pars= [{ parCode:"111", parValue:"111", }]; request.price="20.00"; request.productName="平凡的世界"; 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)