登录
退出
首页
开放版图
苏宁有货
商家后台
文档中心
文档中心
API文档
消息中心
平台公告
工单
我的工单
提交工单
控制台
SDK调用示例
suning.custom.otoinfo.modify/
调用示例(JAVA)
复制全部代码
import com.suning.api.entity.custom.OtoinfoModifyRequest; import com.suning.api.entity.custom.OtoinfoModifyResponse; OtoinfoModifyRequest request = new OtoinfoModifyRequest(); request.setAutoRefund("0"); request.setBookingShop("0"); ChildItem childItem= new ChildItem(); childItem.setDeductiblePriceChild("1.00"); childItem.setPriceChild("1.00"); childItem.setProductCodeChild("1000000000"); List
childItemList =new ArrayList
(); childItemList.add(childItem); request.setChildItem(childItemList); request.setDeductiblePrice("1.00"); request.setEffectiveDay("99"); request.setExtractMode("01,10"); request.setInsaleRefund("0"); request.setPayTemplate("1"); request.setPrice("1.00"); request.setPriceType("01"); request.setProductCode("1"); request.setSaleDate("2013-10-1"); request.setSaleSet("0"); request.setSellChannel("01"); 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 { OtoinfoModifyResponse response = client.excute(request); System.out.println("返回json/xml格式数据 :" + response.getBody()); } catch (SuningApiException e) { e.printStackTrace(); }
调用示例(PHP)
复制全部代码
$req = new OtoinfoModifyRequest(); $req -> setAutoRefund("0"); $req -> setBookingShop("0"); $childItem= new ChildItem(); $childItem-> setDeductiblePriceChild("1.00"); $childItem-> setPriceChild("1.00"); $childItem-> setProductCodeChild("1000000000"); $req -> setChildItem(array($childItem)); $req -> setDeductiblePrice("1.00"); $req -> setEffectiveDay("99"); $req -> setExtractMode("01,10"); $req -> setInsaleRefund("0"); $req -> setPayTemplate("1"); $req -> setPrice("1.00"); $req -> setPriceType("01"); $req -> setProductCode("1"); $req -> setSaleDate("2013-10-1"); $req -> setSaleSet("0"); $req -> setSellChannel("01"); $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; OtoinfoModifyRequest request = new OtoinfoModifyRequest(); request.autoRefund="0"; request.bookingShop="0"; OtoinfoModifyChildItemReq childItem= new OtoinfoModifyChildItemReq(); childItem.deductiblePriceChild="1.00"; childItem.priceChild="1.00"; childItem.productCodeChild="1000000000"; List
childItemList =new ArrayList
(); childItemList.add(childItem); request.childItem=childItemList; request.deductiblePrice="1.00"; request.effectiveDay="99"; request.extractMode="01,10"; request.insaleRefund="0"; request.payTemplate="1"; request.price="1.00"; request.priceType="01"; request.productCode="1"; request.saleDate="2013-10-1"; request.saleSet="0"; request.sellChannel="01"; 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); OtoinfoModifyResponse response = client.Execute(request);
调用示例(PYTHON)
复制全部代码
# -*- coding: utf-8 -*- import suning.api request = suning.api.custom.OtoinfoModifyRequest() request.autoRefund="0"; request.bookingShop="0"; request. childItem= [{ deductiblePriceChild:"1.00", priceChild:"1.00", productCodeChild:"1000000000", }]; request.deductiblePrice="1.00"; request.effectiveDay="99"; request.extractMode="01,10"; request.insaleRefund="0"; request.payTemplate="1"; request.price="1.00"; request.priceType="01"; request.productCode="1"; request.saleDate="2013-10-1"; request.saleSet="0"; request.sellChannel="01"; 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)