登录
退出
首页
开放版图
苏宁有货
商家后台
文档中心
文档中心
API文档
消息中心
平台公告
工单
我的工单
提交工单
控制台
SDK调用示例
suning.custom.item.add/
调用示例(JAVA)
复制全部代码
import com.suning.api.entity.custom.itemAddRequest; import com.suning.api.entity.custom.itemAddResponse; itemAddRequest request = new itemAddRequest(); request.setAfterSaleServiceDec("7天内包退换"); request.setAlertQty("100"); request.setAssortCode("11111111"); request.setAutoRefund("0"); request.setBarpic("http://1.jpg..."); request.setBookingShop("0"); request.setBrandCode("A101"); request.setCarServiceType("1"); request.setCategoryCode("R6151001"); ChildItem childItem= new ChildItem(); childItem.setAleryQty("222"); childItem.setBarcode("1"); childItem.setBarpic("http://1.jpg"); childItem.setDeductiblePriceChild("1"); childItem.setInvQty("222"); childItem.setItemCode("222"); Pars pars= new Pars(); pars.setParCode("G00001"); pars.setParValue("1"); List
parsList =new ArrayList
(); parsList.add(pars); childItem.setPars(parsList); childItem.setPrice("100"); childItem.setSupplierImg1Url("http://1.jpg..."); List
childItemList =new ArrayList
(); childItemList.add(childItem); request.setChildItem(childItemList); request.setCmTitle("商品标题"); request.setDeductiblePrice("1"); DetailModule detailModule= new DetailModule(); detailModule.setContent("5aW95ZWG5ZOB"); detailModule.setModuleId("1"); detailModule.setModuleName("售后服务"); detailModule.setNum("1"); detailModule.setType(" usr_mod"); List
detailModuleList =new ArrayList
(); detailModuleList.add(detailModule); request.setDetailModule(detailModuleList); request.setEffectiveDay("99"); request.setExtractMode("01,10"); request.setFreightTemplateId("2da499d40cda4389817273ab0affdbed"); request.setHighlightWordone("亮点词1"); request.setHighlightWordthree("亮点词3"); request.setHighlightWordtwo("亮点词2"); request.setImg1Url("/"); request.setImg2Url("/"); request.setImg3Url("/"); request.setImg4Url("/"); request.setImg5Url("/"); request.setInsaleRefund("0"); request.setIntroduction("5aW95ZWG5ZOB"); request.setInvQty("100"); request.setItemCode("商家商品编码"); request.setMainPicVideoCode("108627"); Mobile mobile= new Mobile(); List list= new List(); list.setNum("1"); list.setPic("http://1.jpg"); list.setText("1"); List
listList =new ArrayList
(); listList.add(list); mobile.setList(listList); mobile.setSummary("1"); request.setMobile(mobile); MobileNew mobileNew= new MobileNew(); Module module= new Module(); module.setCouponId("1"); module.setImgUrl("http://1.jpg"); module.setModuleName("售后服务"); module.setModuleStatus("1"); module.setTuijianId("1"); List
moduleList =new ArrayList
(); moduleList.add(module); mobileNew.setModule(moduleList); request.setMobileNew(mobileNew); PackingList packingList= new PackingList(); packingList.setPackingListName("装箱清单名称"); packingList.setPackingListQty("1"); List
packingListList =new ArrayList
(); packingListList.add(packingList); request.setPackingList(packingListList); Pars pars= new Pars(); pars.setParCode("G00001"); pars.setParValue("1"); List
parsList =new ArrayList
(); parsList.add(pars); request.setPars(parsList); request.setPayTemplate("1"); request.setPrice("100"); request.setPriceType("01"); request.setProductName("商品名称"); request.setSaleDate("2013-09-15"); request.setSaleSet("0"); request.setSellChannel("01"); request.setSellPoint("商品卖点"); request.setSourceCountry("CN"); request.setSupplierImg10Url("http://1.jpg..."); request.setSupplierImg1Url("http://1.jpg..."); request.setSupplierImg2Url("http://1.jpg..."); request.setSupplierImg3Url("http://1.jpg..."); request.setSupplierImg4Url("http://1.jpg..."); request.setSupplierImg5Url("http://1.jpg..."); request.setSupplierImg6Url("http://1.jpg..."); request.setSupplierImg7Url("http://1.jpg..."); request.setSupplierImg8Url("http://1.jpg..."); request.setSupplierImg9Url("http://1.jpg..."); request.setValidEndDate("2019-08-13"); request.setValidStartDate("2019-02-03"); request.setVerticalPic("xx.jpg"); request.setVideoCode("108625"); request.setWriteoffPayment("0"); request.setWriteoffShop("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 { itemAddResponse response = client.excute(request); System.out.println("返回json/xml格式数据 :" + response.getBody()); } catch (SuningApiException e) { e.printStackTrace(); }
调用示例(PHP)
复制全部代码
$req = new itemAddRequest(); $req -> setAfterSaleServiceDec("7天内包退换"); $req -> setAlertQty("100"); $req -> setAssortCode("11111111"); $req -> setAutoRefund("0"); $req -> setBarpic("http://1.jpg..."); $req -> setBookingShop("0"); $req -> setBrandCode("A101"); $req -> setCarServiceType("1"); $req -> setCategoryCode("R6151001"); $childItem= new ChildItem(); $childItem-> setAleryQty("222"); $childItem-> setBarcode("1"); $childItem-> setBarpic("http://1.jpg"); $childItem-> setDeductiblePriceChild("1"); $childItem-> setInvQty("222"); $childItem-> setItemCode("222"); $pars= new Pars(); $pars-> setParCode("G00001"); $pars-> setParValue("1"); $childItem-> setPars(array($pars)); $childItem-> setPrice("100"); $childItem-> setSupplierImg1Url("http://1.jpg..."); $req -> setChildItem(array($childItem)); $req -> setCmTitle("商品标题"); $req -> setDeductiblePrice("1"); $detailModule= new DetailModule(); $detailModule-> setContent("5aW95ZWG5ZOB"); $detailModule-> setModuleId("1"); $detailModule-> setModuleName("售后服务"); $detailModule-> setNum("1"); $detailModule-> setType(" usr_mod"); $req -> setDetailModule(array($detailModule)); $req -> setEffectiveDay("99"); $req -> setExtractMode("01,10"); $req -> setFreightTemplateId("2da499d40cda4389817273ab0affdbed"); $req -> setHighlightWordone("亮点词1"); $req -> setHighlightWordthree("亮点词3"); $req -> setHighlightWordtwo("亮点词2"); $req -> setImg1Url("/"); $req -> setImg2Url("/"); $req -> setImg3Url("/"); $req -> setImg4Url("/"); $req -> setImg5Url("/"); $req -> setInsaleRefund("0"); $req -> setIntroduction("5aW95ZWG5ZOB"); $req -> setInvQty("100"); $req -> setItemCode("商家商品编码"); $req -> setMainPicVideoCode("108627"); $mobile= new Mobile(); $list= new List(); $list-> setNum("1"); $list-> setPic("http://1.jpg"); $list-> setText("1"); $mobile-> setList(array($list)); $mobile-> setSummary("1"); $req -> setMobile($mobile); $mobileNew= new MobileNew(); $module= new Module(); $module-> setCouponId("1"); $module-> setImgUrl("http://1.jpg"); $module-> setModuleName("售后服务"); $module-> setModuleStatus("1"); $module-> setTuijianId("1"); $mobileNew-> setModule(array($module)); $req -> setMobileNew($mobileNew); $packingList= new PackingList(); $packingList-> setPackingListName("装箱清单名称"); $packingList-> setPackingListQty("1"); $req -> setPackingList(array($packingList)); $pars= new Pars(); $pars-> setParCode("G00001"); $pars-> setParValue("1"); $req -> setPars(array($pars)); $req -> setPayTemplate("1"); $req -> setPrice("100"); $req -> setPriceType("01"); $req -> setProductName("商品名称"); $req -> setSaleDate("2013-09-15"); $req -> setSaleSet("0"); $req -> setSellChannel("01"); $req -> setSellPoint("商品卖点"); $req -> setSourceCountry("CN"); $req -> setSupplierImg10Url("http://1.jpg..."); $req -> setSupplierImg1Url("http://1.jpg..."); $req -> setSupplierImg2Url("http://1.jpg..."); $req -> setSupplierImg3Url("http://1.jpg..."); $req -> setSupplierImg4Url("http://1.jpg..."); $req -> setSupplierImg5Url("http://1.jpg..."); $req -> setSupplierImg6Url("http://1.jpg..."); $req -> setSupplierImg7Url("http://1.jpg..."); $req -> setSupplierImg8Url("http://1.jpg..."); $req -> setSupplierImg9Url("http://1.jpg..."); $req -> setValidEndDate("2019-08-13"); $req -> setValidStartDate("2019-02-03"); $req -> setVerticalPic("xx.jpg"); $req -> setVideoCode("108625"); $req -> setWriteoffPayment("0"); $req -> setWriteoffShop("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; itemAddRequest request = new itemAddRequest(); request.afterSaleServiceDec="7天内包退换"; request.alertQty="100"; request.assortCode="11111111"; request.autoRefund="0"; request.barpic="http://1.jpg..."; request.bookingShop="0"; request.brandCode="A101"; request.carServiceType="1"; request.categoryCode="R6151001"; itemAddChildItemReq childItem= new itemAddChildItemReq(); childItem.aleryQty="222"; childItem.barcode="1"; childItem.barpic="http://1.jpg"; childItem.deductiblePriceChild="1"; childItem.invQty="222"; childItem.itemCode="222"; itemAddParsReq pars= new itemAddParsReq(); pars.parCode="G00001"; pars.parValue="1"; List
parsList =new ArrayList
(); parsList.add(pars); childItem.pars=parsList; childItem.price="100"; childItem.supplierImg1Url="http://1.jpg..."; List
childItemList =new ArrayList
(); childItemList.add(childItem); request.childItem=childItemList; request.cmTitle="商品标题"; request.deductiblePrice="1"; itemAddDetailModuleReq detailModule= new itemAddDetailModuleReq(); detailModule.content="5aW95ZWG5ZOB"; detailModule.moduleId="1"; detailModule.moduleName="售后服务"; detailModule.num="1"; detailModule.type=" usr_mod"; List
detailModuleList =new ArrayList
(); detailModuleList.add(detailModule); request.detailModule=detailModuleList; request.effectiveDay="99"; request.extractMode="01,10"; request.freightTemplateId="2da499d40cda4389817273ab0affdbed"; request.highlightWordone="亮点词1"; request.highlightWordthree="亮点词3"; request.highlightWordtwo="亮点词2"; request.img1Url="/"; request.img2Url="/"; request.img3Url="/"; request.img4Url="/"; request.img5Url="/"; request.insaleRefund="0"; request.introduction="5aW95ZWG5ZOB"; request.invQty="100"; request.itemCode="商家商品编码"; request.mainPicVideoCode="108627"; itemAddMobileReq mobile= new itemAddMobileReq(); itemAddListReq list= new itemAddListReq(); list.num="1"; list.pic="http://1.jpg"; list.text="1"; List
listList =new ArrayList
(); listList.add(list); mobile.list=listList; mobile.summary="1"; request.mobile=mobile; itemAddMobileNewReq mobileNew= new itemAddMobileNewReq(); itemAddModuleReq module= new itemAddModuleReq(); module.couponId="1"; module.imgUrl="http://1.jpg"; module.moduleName="售后服务"; module.moduleStatus="1"; module.tuijianId="1"; List
moduleList =new ArrayList
(); moduleList.add(module); mobileNew.module=moduleList; request.mobileNew=mobileNew; itemAddPackingListReq packingList= new itemAddPackingListReq(); packingList.packingListName="装箱清单名称"; packingList.packingListQty="1"; List
packingListList =new ArrayList
(); packingListList.add(packingList); request.packingList=packingListList; itemAddParsReq pars= new itemAddParsReq(); pars.parCode="G00001"; pars.parValue="1"; List
parsList =new ArrayList
(); parsList.add(pars); request.pars=parsList; request.payTemplate="1"; request.price="100"; request.priceType="01"; request.productName="商品名称"; request.saleDate="2013-09-15"; request.saleSet="0"; request.sellChannel="01"; request.sellPoint="商品卖点"; request.sourceCountry="CN"; request.supplierImg10Url="http://1.jpg..."; request.supplierImg1Url="http://1.jpg..."; request.supplierImg2Url="http://1.jpg..."; request.supplierImg3Url="http://1.jpg..."; request.supplierImg4Url="http://1.jpg..."; request.supplierImg5Url="http://1.jpg..."; request.supplierImg6Url="http://1.jpg..."; request.supplierImg7Url="http://1.jpg..."; request.supplierImg8Url="http://1.jpg..."; request.supplierImg9Url="http://1.jpg..."; request.validEndDate="2019-08-13"; request.validStartDate="2019-02-03"; request.verticalPic="xx.jpg"; request.videoCode="108625"; request.writeoffPayment="0"; request.writeoffShop="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); itemAddResponse response = client.Execute(request);
调用示例(PYTHON)
复制全部代码
# -*- coding: utf-8 -*- import suning.api request = suning.api.custom.itemAddRequest() request.afterSaleServiceDec="7天内包退换"; request.alertQty="100"; request.assortCode="11111111"; request.autoRefund="0"; request.barpic="http://1.jpg..."; request.bookingShop="0"; request.brandCode="A101"; request.carServiceType="1"; request.categoryCode="R6151001"; request. childItem= [{ aleryQty:"222", barcode:"1", barpic:"http://1.jpg", deductiblePriceChild:"1", invQty:"222", itemCode:"222", pars: [{ parCode:"G00001", parValue:"1", }], price:"100", supplierImg1Url:"http://1.jpg...", }]; request.cmTitle="商品标题"; request.deductiblePrice="1"; request. detailModule= [{ content:"5aW95ZWG5ZOB", moduleId:"1", moduleName:"售后服务", num:"1", type:" usr_mod", }]; request.effectiveDay="99"; request.extractMode="01,10"; request.freightTemplateId="2da499d40cda4389817273ab0affdbed"; request.highlightWordone="亮点词1"; request.highlightWordthree="亮点词3"; request.highlightWordtwo="亮点词2"; request.img1Url="/"; request.img2Url="/"; request.img3Url="/"; request.img4Url="/"; request.img5Url="/"; request.insaleRefund="0"; request.introduction="5aW95ZWG5ZOB"; request.invQty="100"; request.itemCode="商家商品编码"; request.mainPicVideoCode="108627"; request. mobile= { list: [{ num:"1", pic:"http://1.jpg", text:"1", }], summary:"1", }; request. mobileNew= { module: [{ couponId:"1", imgUrl:"http://1.jpg", moduleName:"售后服务", moduleStatus:"1", tuijianId:"1", }], }; request. packingList= [{ packingListName:"装箱清单名称", packingListQty:"1", }]; request. pars= [{ parCode:"G00001", parValue:"1", }]; request.payTemplate="1"; request.price="100"; request.priceType="01"; request.productName="商品名称"; request.saleDate="2013-09-15"; request.saleSet="0"; request.sellChannel="01"; request.sellPoint="商品卖点"; request.sourceCountry="CN"; request.supplierImg10Url="http://1.jpg..."; request.supplierImg1Url="http://1.jpg..."; request.supplierImg2Url="http://1.jpg..."; request.supplierImg3Url="http://1.jpg..."; request.supplierImg4Url="http://1.jpg..."; request.supplierImg5Url="http://1.jpg..."; request.supplierImg6Url="http://1.jpg..."; request.supplierImg7Url="http://1.jpg..."; request.supplierImg8Url="http://1.jpg..."; request.supplierImg9Url="http://1.jpg..."; request.validEndDate="2019-08-13"; request.validStartDate="2019-02-03"; request.verticalPic="xx.jpg"; request.videoCode="108625"; request.writeoffPayment="0"; request.writeoffShop="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)