登录
退出
首页
开放版图
苏宁有货
商家后台
文档中心
文档中心
API文档
消息中心
平台公告
工单
我的工单
提交工单
控制台
SDK调用示例
suning.fourps.orderreturn.add/
调用示例(JAVA)
复制全部代码
import com.suning.api.entity.fourps.OrderReturnAddRequest; import com.suning.api.entity.fourps.OrderReturnAddResponse; OrderReturnAddRequest request = new OrderReturnAddRequest(); request.setOutOrderId("333333"); request.setOldOrderId("666666"); request.setOrderSource("201"); request.setExpectStartTime("2014-01-02 12:00:00"); request.setExpectEndTime("2014-01-03 12:00:00"); request.setRemark("*****"); request.setSenderZipCode("938900"); request.setSenderProvince("四川"); request.setSenderCity("成都"); request.setSenderArea("金牛"); request.setSenderTown("1"); request.setSenderAddress("1"); request.setSenderName("李四"); request.setSenderMobile("139880038**"); request.setSenderPhone("028-28200288"); request.setTakeFlag("1"); request.setOrderFlag("9"); request.setWarehouseCode("11"); request.setOrderItemId("5642"); request.setReturnReason("1"); request.setDeliverNo("111111"); request.setItemName("苹果"); request.setItemCode("222222"); request.setOuterItemId("37901"); request.setItemQuantity("12"); //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 { OrderReturnAddResponse response = client.excute(request); System.out.println("返回json/xml格式数据 :" + response.getBody()); } catch (SuningApiException e) { e.printStackTrace(); }
调用示例(PHP)
复制全部代码
$req = new OrderReturnAddRequest(); $req -> setOutOrderId("333333"); $req -> setOldOrderId("666666"); $req -> setOrderSource("201"); $req -> setExpectStartTime("2014-01-02 12:00:00"); $req -> setExpectEndTime("2014-01-03 12:00:00"); $req -> setRemark("*****"); $req -> setSenderZipCode("938900"); $req -> setSenderProvince("四川"); $req -> setSenderCity("成都"); $req -> setSenderArea("金牛"); $req -> setSenderTown("1"); $req -> setSenderAddress("1"); $req -> setSenderName("李四"); $req -> setSenderMobile("139880038**"); $req -> setSenderPhone("028-28200288"); $req -> setTakeFlag("1"); $req -> setOrderFlag("9"); $req -> setWarehouseCode("11"); $req -> setOrderItemId("5642"); $req -> setReturnReason("1"); $req -> setDeliverNo("111111"); $req -> setItemName("苹果"); $req -> setItemCode("222222"); $req -> setOuterItemId("37901"); $req -> setItemQuantity("12"); //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.CustomFourpsRequest; using suning_api_sdk.BizResponse.CustomFourpsResponse; using suning_api_sdk.Models.CustomFourpsModel; OrderReturnAddRequest request = new OrderReturnAddRequest(); request.outOrderId="333333"; request.oldOrderId="666666"; request.orderSource="201"; request.expectStartTime="2014-01-02 12:00:00"; request.expectEndTime="2014-01-03 12:00:00"; request.remark="*****"; request.senderZipCode="938900"; request.senderProvince="四川"; request.senderCity="成都"; request.senderArea="金牛"; request.senderTown="1"; request.senderAddress="1"; request.senderName="李四"; request.senderMobile="139880038**"; request.senderPhone="028-28200288"; request.takeFlag="1"; request.orderFlag="9"; request.warehouseCode="11"; request.orderItemId="5642"; request.returnReason="1"; request.deliverNo="111111"; request.itemName="苹果"; request.itemCode="222222"; request.outerItemId="37901"; request.itemQuantity="12"; //开启日志调试,当测试稳定之后建议设置为 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); OrderReturnAddResponse response = client.Execute(request);
调用示例(PYTHON)
复制全部代码
# -*- coding: utf-8 -*- import suning.api request = suning.api.fourps.OrderReturnAddRequest() request.outOrderId="333333" request.oldOrderId="666666" request.orderSource="201" request.expectStartTime="2014-01-02 12:00:00" request.expectEndTime="2014-01-03 12:00:00" request.remark="*****" request.senderZipCode="938900" request.senderProvince="四川" request.senderCity="成都" request.senderArea="金牛" request.senderTown="1" request.senderAddress="1" request.senderName="李四" request.senderMobile="139880038**" request.senderPhone="028-28200288" request.takeFlag="1" request.orderFlag="9" request.warehouseCode="11" request.orderItemId="5642" request.returnReason="1" request.deliverNo="111111" request.itemName="苹果" request.itemCode="222222" request.outerItemId="37901" request.itemQuantity="12" 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)