登录
退出
首页
开放版图
苏宁有货
商家后台
文档中心
文档中心
API文档
消息中心
平台公告
工单
我的工单
提交工单
控制台
SDK调用示例
suning.custom.invorder.receive/
调用示例(JAVA)
复制全部代码
import com.suning.api.entity.custom.InvorderReceiveRequest; import com.suning.api.entity.custom.InvorderReceiveResponse; InvorderReceiveRequest request = new InvorderReceiveRequest(); request.setBuySign("1"); request.setClientAddress("xx市xx区"); request.setClientBank("中国银行"); request.setClientBankNum("622848039260099"); request.setClientEmail("xxx@163.com"); request.setClientName("个人"); request.setClientPhone("18551620000"); request.setClientTaxNum("622848039260099"); request.setClientTel("025-8888"); request.setClientType("01"); Cmmdtys cmmdtys= new Cmmdtys(); cmmdtys.setGoodContainTaxSign("1"); cmmdtys.setGoodCountAmount("1000"); cmmdtys.setGoodDeductions("-10"); cmmdtys.setGoodDiscount("5"); cmmdtys.setGoodGovSign("0"); cmmdtys.setGoodId("000101"); cmmdtys.setGoodModel("P"); cmmdtys.setGoodNum("10"); cmmdtys.setGoodPrice("100.00"); cmmdtys.setGoodRate("0.16"); cmmdtys.setGoodsCode("600012346"); cmmdtys.setGoodSerialNum("0001"); cmmdtys.setGoodsName("空调"); cmmdtys.setGoodSpecialSign("不征税"); cmmdtys.setGoodTaxAmount("160"); cmmdtys.setGoodTaxCode("654334"); cmmdtys.setGoodUnit("台"); cmmdtys.setGoodZeroTaxSign("0"); List
cmmdtysList =new ArrayList
(); cmmdtysList.add(cmmdtys); request.setCmmdtys(cmmdtysList); request.setCountMoney("100"); request.setDetialSign("0"); request.setExtendField("xx"); request.setHowtoPrint("0"); request.setOldTicketCode("150003528888"); request.setOldTicketNum("62786934"); request.setOrderNum("32018091901"); request.setOrderNumPwd("1B0A2C64C2A1A7FAB7DEBE25FED8B742"); request.setOrderReturnNum("32018091901"); request.setOrderTime("2018-09-28 14:26:11"); request.setPayeeName("李四"); request.setPlatformCoding("70069114"); request.setReceiveMode("02"); request.setRemark("xx"); request.setReviwerName("李五"); request.setSaleAddress("南京市玄武区苏宁大道1号"); request.setSaleBank("中国银行"); request.setSaleBankNum("622848039260099"); request.setSaleName("南京苏宁软件技术有限公司"); request.setSaleTaxNum("140301193302051282"); request.setSaleTel("025-66996699"); request.setSpecialRedSign("0"); request.setSysSource("例如:ZY:自营"); request.setTicketName("张三"); request.setTicketType("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 { InvorderReceiveResponse response = client.excute(request); System.out.println("返回json/xml格式数据 :" + response.getBody()); } catch (SuningApiException e) { e.printStackTrace(); }
调用示例(PHP)
复制全部代码
$req = new InvorderReceiveRequest(); $req -> setBuySign("1"); $req -> setClientAddress("xx市xx区"); $req -> setClientBank("中国银行"); $req -> setClientBankNum("622848039260099"); $req -> setClientEmail("xxx@163.com"); $req -> setClientName("个人"); $req -> setClientPhone("18551620000"); $req -> setClientTaxNum("622848039260099"); $req -> setClientTel("025-8888"); $req -> setClientType("01"); $cmmdtys= new Cmmdtys(); $cmmdtys-> setGoodContainTaxSign("1"); $cmmdtys-> setGoodCountAmount("1000"); $cmmdtys-> setGoodDeductions("-10"); $cmmdtys-> setGoodDiscount("5"); $cmmdtys-> setGoodGovSign("0"); $cmmdtys-> setGoodId("000101"); $cmmdtys-> setGoodModel("P"); $cmmdtys-> setGoodNum("10"); $cmmdtys-> setGoodPrice("100.00"); $cmmdtys-> setGoodRate("0.16"); $cmmdtys-> setGoodsCode("600012346"); $cmmdtys-> setGoodSerialNum("0001"); $cmmdtys-> setGoodsName("空调"); $cmmdtys-> setGoodSpecialSign("不征税"); $cmmdtys-> setGoodTaxAmount("160"); $cmmdtys-> setGoodTaxCode("654334"); $cmmdtys-> setGoodUnit("台"); $cmmdtys-> setGoodZeroTaxSign("0"); $req -> setCmmdtys(array($cmmdtys)); $req -> setCountMoney("100"); $req -> setDetialSign("0"); $req -> setExtendField("xx"); $req -> setHowtoPrint("0"); $req -> setOldTicketCode("150003528888"); $req -> setOldTicketNum("62786934"); $req -> setOrderNum("32018091901"); $req -> setOrderNumPwd("1B0A2C64C2A1A7FAB7DEBE25FED8B742"); $req -> setOrderReturnNum("32018091901"); $req -> setOrderTime("2018-09-28 14:26:11"); $req -> setPayeeName("李四"); $req -> setPlatformCoding("70069114"); $req -> setReceiveMode("02"); $req -> setRemark("xx"); $req -> setReviwerName("李五"); $req -> setSaleAddress("南京市玄武区苏宁大道1号"); $req -> setSaleBank("中国银行"); $req -> setSaleBankNum("622848039260099"); $req -> setSaleName("南京苏宁软件技术有限公司"); $req -> setSaleTaxNum("140301193302051282"); $req -> setSaleTel("025-66996699"); $req -> setSpecialRedSign("0"); $req -> setSysSource("例如:ZY:自营"); $req -> setTicketName("张三"); $req -> setTicketType("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; InvorderReceiveRequest request = new InvorderReceiveRequest(); request.buySign="1"; request.clientAddress="xx市xx区"; request.clientBank="中国银行"; request.clientBankNum="622848039260099"; request.clientEmail="xxx@163.com"; request.clientName="个人"; request.clientPhone="18551620000"; request.clientTaxNum="622848039260099"; request.clientTel="025-8888"; request.clientType="01"; InvorderReceiveCmmdtysReq cmmdtys= new InvorderReceiveCmmdtysReq(); cmmdtys.goodContainTaxSign="1"; cmmdtys.goodCountAmount="1000"; cmmdtys.goodDeductions="-10"; cmmdtys.goodDiscount="5"; cmmdtys.goodGovSign="0"; cmmdtys.goodId="000101"; cmmdtys.goodModel="P"; cmmdtys.goodNum="10"; cmmdtys.goodPrice="100.00"; cmmdtys.goodRate="0.16"; cmmdtys.goodsCode="600012346"; cmmdtys.goodSerialNum="0001"; cmmdtys.goodsName="空调"; cmmdtys.goodSpecialSign="不征税"; cmmdtys.goodTaxAmount="160"; cmmdtys.goodTaxCode="654334"; cmmdtys.goodUnit="台"; cmmdtys.goodZeroTaxSign="0"; List
cmmdtysList =new ArrayList
(); cmmdtysList.add(cmmdtys); request.cmmdtys=cmmdtysList; request.countMoney="100"; request.detialSign="0"; request.extendField="xx"; request.howtoPrint="0"; request.oldTicketCode="150003528888"; request.oldTicketNum="62786934"; request.orderNum="32018091901"; request.orderNumPwd="1B0A2C64C2A1A7FAB7DEBE25FED8B742"; request.orderReturnNum="32018091901"; request.orderTime="2018-09-28 14:26:11"; request.payeeName="李四"; request.platformCoding="70069114"; request.receiveMode="02"; request.remark="xx"; request.reviwerName="李五"; request.saleAddress="南京市玄武区苏宁大道1号"; request.saleBank="中国银行"; request.saleBankNum="622848039260099"; request.saleName="南京苏宁软件技术有限公司"; request.saleTaxNum="140301193302051282"; request.saleTel="025-66996699"; request.specialRedSign="0"; request.sysSource="例如:ZY:自营"; request.ticketName="张三"; request.ticketType="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); InvorderReceiveResponse response = client.Execute(request);
调用示例(PYTHON)
复制全部代码
# -*- coding: utf-8 -*- import suning.api request = suning.api.custom.InvorderReceiveRequest() request.buySign="1"; request.clientAddress="xx市xx区"; request.clientBank="中国银行"; request.clientBankNum="622848039260099"; request.clientEmail="xxx@163.com"; request.clientName="个人"; request.clientPhone="18551620000"; request.clientTaxNum="622848039260099"; request.clientTel="025-8888"; request.clientType="01"; request. cmmdtys= [{ goodContainTaxSign:"1", goodCountAmount:"1000", goodDeductions:"-10", goodDiscount:"5", goodGovSign:"0", goodId:"000101", goodModel:"P", goodNum:"10", goodPrice:"100.00", goodRate:"0.16", goodsCode:"600012346", goodSerialNum:"0001", goodsName:"空调", goodSpecialSign:"不征税", goodTaxAmount:"160", goodTaxCode:"654334", goodUnit:"台", goodZeroTaxSign:"0", }]; request.countMoney="100"; request.detialSign="0"; request.extendField="xx"; request.howtoPrint="0"; request.oldTicketCode="150003528888"; request.oldTicketNum="62786934"; request.orderNum="32018091901"; request.orderNumPwd="1B0A2C64C2A1A7FAB7DEBE25FED8B742"; request.orderReturnNum="32018091901"; request.orderTime="2018-09-28 14:26:11"; request.payeeName="李四"; request.platformCoding="70069114"; request.receiveMode="02"; request.remark="xx"; request.reviwerName="李五"; request.saleAddress="南京市玄武区苏宁大道1号"; request.saleBank="中国银行"; request.saleBankNum="622848039260099"; request.saleName="南京苏宁软件技术有限公司"; request.saleTaxNum="140301193302051282"; request.saleTel="025-66996699"; request.specialRedSign="0"; request.sysSource="例如:ZY:自营"; request.ticketName="张三"; request.ticketType="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)