登录
退出
首页
开放版图
苏宁有货
商家后台
文档中心
文档中心
API文档
消息中心
平台公告
工单
我的工单
提交工单
控制台
SDK调用示例
suning.custom.freighttemplatenew.update/
调用示例(JAVA)
复制全部代码
import com.suning.api.entity.custom.FreighttemplatenewUpdateRequest; import com.suning.api.entity.custom.FreighttemplatenewUpdateResponse; FreighttemplatenewUpdateRequest request = new FreighttemplatenewUpdateRequest(); CommonMap commonMap= new CommonMap(); commonMap.setContinuedBulkFare("2.01"); commonMap.setContinuedItem("5"); commonMap.setContinuedItemFare("3.01"); commonMap.setContinuedtBulk("2.01"); commonMap.setContinuedWeight("5.01"); commonMap.setContinuedWeightFare("2.01"); commonMap.setFirstBulk("3.01"); commonMap.setFirstBulkFare("10.01"); commonMap.setFirstItem("3"); commonMap.setFirstItemFare("10.01"); commonMap.setFirstWeight("10.01"); commonMap.setFirstWeightFare("3.01"); commonMap.setFreightTemplateId("68a4edbd5cc247eab9bd112ad0776648"); commonMap.setFreightTemplateName("模版名称"); commonMap.setShippingType("0"); commonMap.setSupplierType("H"); commonMap.setTaxType("0"); commonMap.setValuationType("0"); request.setCommonMap(commonMap); SpecialList specialList= new SpecialList(); specialList.setSpeCityEnCode("000001000174,000001000175,000001000176"); specialList.setSpeContinuedItem("10"); specialList.setSpeContinuedItemFare("2.03"); specialList.setSpeContinuedtBulk("5.02"); specialList.setSpeContinuedtBulkFare("5.01"); specialList.setSpeContinuedWeight("3.03"); specialList.setSpeContinuedWeightFare("2.05"); specialList.setSpeFirstBulk("10.08"); specialList.setSpeFirstBulkFare("10.02"); specialList.setSpeFirstItem("5"); specialList.setSpeFirstItemFare("10.02"); specialList.setSpeFirstWeight("5.07"); specialList.setSpeFirstWeightFare("10.01"); specialList.setSpeProvenCode("140,150,160"); specialList.setSpeRenCode("243"); List
specialListList =new ArrayList
(); specialListList.add(specialList); request.setSpecialList(specialListList); request.setVendorCode("0070057239"); //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 { FreighttemplatenewUpdateResponse response = client.excute(request); System.out.println("返回json/xml格式数据 :" + response.getBody()); } catch (SuningApiException e) { e.printStackTrace(); }
调用示例(PHP)
复制全部代码
$req = new FreighttemplatenewUpdateRequest(); $commonMap= new CommonMap(); $commonMap-> setContinuedBulkFare("2.01"); $commonMap-> setContinuedItem("5"); $commonMap-> setContinuedItemFare("3.01"); $commonMap-> setContinuedtBulk("2.01"); $commonMap-> setContinuedWeight("5.01"); $commonMap-> setContinuedWeightFare("2.01"); $commonMap-> setFirstBulk("3.01"); $commonMap-> setFirstBulkFare("10.01"); $commonMap-> setFirstItem("3"); $commonMap-> setFirstItemFare("10.01"); $commonMap-> setFirstWeight("10.01"); $commonMap-> setFirstWeightFare("3.01"); $commonMap-> setFreightTemplateId("68a4edbd5cc247eab9bd112ad0776648"); $commonMap-> setFreightTemplateName("模版名称"); $commonMap-> setShippingType("0"); $commonMap-> setSupplierType("H"); $commonMap-> setTaxType("0"); $commonMap-> setValuationType("0"); $req -> setCommonMap($commonMap); $specialList= new SpecialList(); $specialList-> setSpeCityEnCode("000001000174,000001000175,000001000176"); $specialList-> setSpeContinuedItem("10"); $specialList-> setSpeContinuedItemFare("2.03"); $specialList-> setSpeContinuedtBulk("5.02"); $specialList-> setSpeContinuedtBulkFare("5.01"); $specialList-> setSpeContinuedWeight("3.03"); $specialList-> setSpeContinuedWeightFare("2.05"); $specialList-> setSpeFirstBulk("10.08"); $specialList-> setSpeFirstBulkFare("10.02"); $specialList-> setSpeFirstItem("5"); $specialList-> setSpeFirstItemFare("10.02"); $specialList-> setSpeFirstWeight("5.07"); $specialList-> setSpeFirstWeightFare("10.01"); $specialList-> setSpeProvenCode("140,150,160"); $specialList-> setSpeRenCode("243"); $req -> setSpecialList(array($specialList)); $req -> setVendorCode("0070057239"); //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; FreighttemplatenewUpdateRequest request = new FreighttemplatenewUpdateRequest(); FreighttemplatenewUpdateCommonMapReq commonMap= new FreighttemplatenewUpdateCommonMapReq(); commonMap.continuedBulkFare="2.01"; commonMap.continuedItem="5"; commonMap.continuedItemFare="3.01"; commonMap.continuedtBulk="2.01"; commonMap.continuedWeight="5.01"; commonMap.continuedWeightFare="2.01"; commonMap.firstBulk="3.01"; commonMap.firstBulkFare="10.01"; commonMap.firstItem="3"; commonMap.firstItemFare="10.01"; commonMap.firstWeight="10.01"; commonMap.firstWeightFare="3.01"; commonMap.freightTemplateId="68a4edbd5cc247eab9bd112ad0776648"; commonMap.freightTemplateName="模版名称"; commonMap.shippingType="0"; commonMap.supplierType="H"; commonMap.taxType="0"; commonMap.valuationType="0"; request.commonMap=commonMap; FreighttemplatenewUpdateSpecialListReq specialList= new FreighttemplatenewUpdateSpecialListReq(); specialList.speCityEnCode="000001000174,000001000175,000001000176"; specialList.speContinuedItem="10"; specialList.speContinuedItemFare="2.03"; specialList.speContinuedtBulk="5.02"; specialList.speContinuedtBulkFare="5.01"; specialList.speContinuedWeight="3.03"; specialList.speContinuedWeightFare="2.05"; specialList.speFirstBulk="10.08"; specialList.speFirstBulkFare="10.02"; specialList.speFirstItem="5"; specialList.speFirstItemFare="10.02"; specialList.speFirstWeight="5.07"; specialList.speFirstWeightFare="10.01"; specialList.speProvenCode="140,150,160"; specialList.speRenCode="243"; List
specialListList =new ArrayList
(); specialListList.add(specialList); request.specialList=specialListList; request.vendorCode="0070057239"; //开启日志调试,当测试稳定之后建议设置为 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); FreighttemplatenewUpdateResponse response = client.Execute(request);
调用示例(PYTHON)
复制全部代码
# -*- coding: utf-8 -*- import suning.api request = suning.api.custom.FreighttemplatenewUpdateRequest() request. commonMap= { continuedBulkFare:"2.01", continuedItem:"5", continuedItemFare:"3.01", continuedtBulk:"2.01", continuedWeight:"5.01", continuedWeightFare:"2.01", firstBulk:"3.01", firstBulkFare:"10.01", firstItem:"3", firstItemFare:"10.01", firstWeight:"10.01", firstWeightFare:"3.01", freightTemplateId:"68a4edbd5cc247eab9bd112ad0776648", freightTemplateName:"模版名称", shippingType:"0", supplierType:"H", taxType:"0", valuationType:"0", }; request. specialList= [{ speCityEnCode:"000001000174,000001000175,000001000176", speContinuedItem:"10", speContinuedItemFare:"2.03", speContinuedtBulk:"5.02", speContinuedtBulkFare:"5.01", speContinuedWeight:"3.03", speContinuedWeightFare:"2.05", speFirstBulk:"10.08", speFirstBulkFare:"10.02", speFirstItem:"5", speFirstItemFare:"10.02", speFirstWeight:"5.07", speFirstWeightFare:"10.01", speProvenCode:"140,150,160", speRenCode:"243", }]; request.vendorCode="0070057239"; 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)