登录
退出
首页
开放版图
苏宁有货
商家后台
文档中心
文档中心
API文档
消息中心
平台公告
工单
我的工单
提交工单
控制台
SDK调用示例
suning.retailer.issueinvoicesrcdoms.create/
调用示例(JAVA)
复制全部代码
import com.suning.api.entity.retailer.IssueinvoicesrcdomsCreateRequest; import com.suning.api.entity.retailer.IssueinvoicesrcdomsCreateResponse; IssueinvoicesrcdomsCreateRequest request = new IssueinvoicesrcdomsCreateRequest(); request.setAppId("appId"); InvoiceIssueReqDTO invoiceIssueReqDTO= new InvoiceIssueReqDTO(); invoiceIssueReqDTO.setCityCode("11"); invoiceIssueReqDTO.setCompanyName("11"); invoiceIssueReqDTO.setDistrictCode("11"); invoiceIssueReqDTO.setInvoiceTitle("11"); invoiceIssueReqDTO.setInvoiceType("1"); invoiceIssueReqDTO.setProvCode("11"); invoiceIssueReqDTO.setReceiveAddr("11"); invoiceIssueReqDTO.setReceiveName("11"); invoiceIssueReqDTO.setReceiveTel("11"); invoiceIssueReqDTO.setRegAccount("11"); invoiceIssueReqDTO.setRegAddr("11"); invoiceIssueReqDTO.setRegBank("1111"); invoiceIssueReqDTO.setRegTel("11"); invoiceIssueReqDTO.setSnCustNum("11"); invoiceIssueReqDTO.setTaxNo("11"); invoiceIssueReqDTO.setTownCode("11"); request.setInvoiceIssueReqDTO(invoiceIssueReqDTO); RespList respList= new RespList(); respList.setOmsOrderItemNo("11"); List
respListList =new ArrayList
(); respListList.add(respList); request.setRespList(respListList); //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 { IssueinvoicesrcdomsCreateResponse response = client.excute(request); System.out.println("返回json/xml格式数据 :" + response.getBody()); } catch (SuningApiException e) { e.printStackTrace(); }
调用示例(PHP)
复制全部代码
$req = new IssueinvoicesrcdomsCreateRequest(); $req -> setAppId("appId"); $invoiceIssueReqDTO= new InvoiceIssueReqDTO(); $invoiceIssueReqDTO-> setCityCode("11"); $invoiceIssueReqDTO-> setCompanyName("11"); $invoiceIssueReqDTO-> setDistrictCode("11"); $invoiceIssueReqDTO-> setInvoiceTitle("11"); $invoiceIssueReqDTO-> setInvoiceType("1"); $invoiceIssueReqDTO-> setProvCode("11"); $invoiceIssueReqDTO-> setReceiveAddr("11"); $invoiceIssueReqDTO-> setReceiveName("11"); $invoiceIssueReqDTO-> setReceiveTel("11"); $invoiceIssueReqDTO-> setRegAccount("11"); $invoiceIssueReqDTO-> setRegAddr("11"); $invoiceIssueReqDTO-> setRegBank("1111"); $invoiceIssueReqDTO-> setRegTel("11"); $invoiceIssueReqDTO-> setSnCustNum("11"); $invoiceIssueReqDTO-> setTaxNo("11"); $invoiceIssueReqDTO-> setTownCode("11"); $req -> setInvoiceIssueReqDTO($invoiceIssueReqDTO); $respList= new RespList(); $respList-> setOmsOrderItemNo("11"); $req -> setRespList(array($respList)); //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.CustomRetailerRequest; using suning_api_sdk.BizResponse.CustomRetailerResponse; using suning_api_sdk.Models.CustomRetailerModel; IssueinvoicesrcdomsCreateRequest request = new IssueinvoicesrcdomsCreateRequest(); request.appId="appId"; IssueinvoicesrcdomsCreateInvoiceIssueReqDTOReq invoiceIssueReqDTO= new IssueinvoicesrcdomsCreateInvoiceIssueReqDTOReq(); invoiceIssueReqDTO.cityCode="11"; invoiceIssueReqDTO.companyName="11"; invoiceIssueReqDTO.districtCode="11"; invoiceIssueReqDTO.invoiceTitle="11"; invoiceIssueReqDTO.invoiceType="1"; invoiceIssueReqDTO.provCode="11"; invoiceIssueReqDTO.receiveAddr="11"; invoiceIssueReqDTO.receiveName="11"; invoiceIssueReqDTO.receiveTel="11"; invoiceIssueReqDTO.regAccount="11"; invoiceIssueReqDTO.regAddr="11"; invoiceIssueReqDTO.regBank="1111"; invoiceIssueReqDTO.regTel="11"; invoiceIssueReqDTO.snCustNum="11"; invoiceIssueReqDTO.taxNo="11"; invoiceIssueReqDTO.townCode="11"; request.invoiceIssueReqDTO=invoiceIssueReqDTO; IssueinvoicesrcdomsCreateRespListReq respList= new IssueinvoicesrcdomsCreateRespListReq(); respList.omsOrderItemNo="11"; List
respListList =new ArrayList
(); respListList.add(respList); request.respList=respListList; //开启日志调试,当测试稳定之后建议设置为 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); IssueinvoicesrcdomsCreateResponse response = client.Execute(request);
调用示例(PYTHON)
复制全部代码
# -*- coding: utf-8 -*- import suning.api request = suning.api.retailer.IssueinvoicesrcdomsCreateRequest() request.appId="appId"; request. invoiceIssueReqDTO= { cityCode:"11", companyName:"11", districtCode:"11", invoiceTitle:"11", invoiceType:"1", provCode:"11", receiveAddr:"11", receiveName:"11", receiveTel:"11", regAccount:"11", regAddr:"11", regBank:"1111", regTel:"11", snCustNum:"11", taxNo:"11", townCode:"11", }; request. respList= [{ omsOrderItemNo:"11", }]; 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)