登录
退出
首页
开放版图
苏宁有货
商家后台
文档中心
文档中心
API文档
消息中心
平台公告
工单
我的工单
提交工单
控制台
SDK调用示例
suning.govbus.returnpartorder.add/
调用示例(JAVA)
复制全部代码
import com.suning.api.entity.govbus.ReturnpartorderAddRequest; import com.suning.api.entity.govbus.ReturnpartorderAddResponse; ReturnpartorderAddRequest request = new ReturnpartorderAddRequest(); AftersaleAddress aftersaleAddress= new AftersaleAddress(); aftersaleAddress.setAddress("广顺北大街21号院108楼208室"); aftersaleAddress.setCityId("010"); aftersaleAddress.setCountyId("01001"); aftersaleAddress.setProvinceId("01"); aftersaleAddress.setTownId("0100102"); request.setAftersaleAddress(aftersaleAddress); request.setAftersaleName("李*"); request.setAftersalePhone("13333333333"); request.setBankName("01"); request.setCardNumber("1000406047888888"); request.setCardUsername("张**"); request.setOrderId("100000100025"); Skus skus= new Skus(); skus.setNum("2"); skus.setReason("0101"); skus.setReasonDetails("退货"); skus.setSkuId("121345077"); List
skusList =new ArrayList
(); skusList.add(skus); request.setSkus(skusList); //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 { ReturnpartorderAddResponse response = client.excute(request); System.out.println("返回json/xml格式数据 :" + response.getBody()); } catch (SuningApiException e) { e.printStackTrace(); }
调用示例(PHP)
复制全部代码
$req = new ReturnpartorderAddRequest(); $aftersaleAddress= new AftersaleAddress(); $aftersaleAddress-> setAddress("广顺北大街21号院108楼208室"); $aftersaleAddress-> setCityId("010"); $aftersaleAddress-> setCountyId("01001"); $aftersaleAddress-> setProvinceId("01"); $aftersaleAddress-> setTownId("0100102"); $req -> setAftersaleAddress($aftersaleAddress); $req -> setAftersaleName("李*"); $req -> setAftersalePhone("13333333333"); $req -> setBankName("01"); $req -> setCardNumber("1000406047888888"); $req -> setCardUsername("张**"); $req -> setOrderId("100000100025"); $skus= new Skus(); $skus-> setNum("2"); $skus-> setReason("0101"); $skus-> setReasonDetails("退货"); $skus-> setSkuId("121345077"); $req -> setSkus(array($skus)); //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.CustomGovbusRequest; using suning_api_sdk.BizResponse.CustomGovbusResponse; using suning_api_sdk.Models.CustomGovbusModel; ReturnpartorderAddRequest request = new ReturnpartorderAddRequest(); ReturnpartorderAddAftersaleAddressReq aftersaleAddress= new ReturnpartorderAddAftersaleAddressReq(); aftersaleAddress.address="广顺北大街21号院108楼208室"; aftersaleAddress.cityId="010"; aftersaleAddress.countyId="01001"; aftersaleAddress.provinceId="01"; aftersaleAddress.townId="0100102"; request.aftersaleAddress=aftersaleAddress; request.aftersaleName="李*"; request.aftersalePhone="13333333333"; request.bankName="01"; request.cardNumber="1000406047888888"; request.cardUsername="张**"; request.orderId="100000100025"; ReturnpartorderAddSkusReq skus= new ReturnpartorderAddSkusReq(); skus.num="2"; skus.reason="0101"; skus.reasonDetails="退货"; skus.skuId="121345077"; List
skusList =new ArrayList
(); skusList.add(skus); request.skus=skusList; //开启日志调试,当测试稳定之后建议设置为 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); ReturnpartorderAddResponse response = client.Execute(request);
调用示例(PYTHON)
复制全部代码
# -*- coding: utf-8 -*- import suning.api request = suning.api.govbus.ReturnpartorderAddRequest() request. aftersaleAddress= { address:"广顺北大街21号院108楼208室", cityId:"010", countyId:"01001", provinceId:"01", townId:"0100102", }; request.aftersaleName="李*"; request.aftersalePhone="13333333333"; request.bankName="01"; request.cardNumber="1000406047888888"; request.cardUsername="张**"; request.orderId="100000100025"; request. skus= [{ num:"2", reason:"0101", reasonDetails:"退货", skuId:"121345077", }]; 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)