登录
退出
首页
开放版图
苏宁有货
商家后台
文档中心
文档中心
API文档
消息中心
平台公告
工单
我的工单
提交工单
控制台
SDK调用示例
suning.govbus.batchcreateorder.create/
调用示例(JAVA)
复制全部代码
import com.suning.api.entity.govbus.BatchcreateorderCreateRequest; import com.suning.api.entity.govbus.BatchcreateorderCreateResponse; BatchcreateorderCreateRequest request = new BatchcreateorderCreateRequest(); request.setBatchId("100000100078"); request.setGoods("1"); request.setInvoiceContent("1"); request.setInvoiceState("1"); request.setInvoiceTo("1"); request.setInvoiceType("1"); request.setOrderType("1"); request.setPayment("08"); ReceiveInfoList receiveInfoList= new ReceiveInfoList(); receiveInfoList.setAddress("江苏省南京市雨花区软件大道舜天集团"); receiveInfoList.setCityId("025"); receiveInfoList.setCountryId("01"); receiveInfoList.setEmail("xxx@xxx.com"); receiveInfoList.setMobile("17856789012"); receiveInfoList.setProvinceId("100"); receiveInfoList.setReceiverName("张飞"); receiveInfoList.setRemark("订单备注"); SkuQuantityList skuQuantityList= new SkuQuantityList(); skuQuantityList.setNum("2"); skuQuantityList.setSku("121347657"); List
skuQuantityListList =new ArrayList
(); skuQuantityListList.add(skuQuantityList); receiveInfoList.setSkuQuantityList(skuQuantityListList); receiveInfoList.setTelephone("010-84728989"); receiveInfoList.setTownId("99"); receiveInfoList.setTradeNo("1000001"); receiveInfoList.setZip("210000"); List
receiveInfoListList =new ArrayList
(); receiveInfoListList.add(receiveInfoList); request.setReceiveInfoList(receiveInfoListList); SkuPriceList skuPriceList= new SkuPriceList(); skuPriceList.setSkuId("121347746"); skuPriceList.setUnitPrice("12.1"); List
skuPriceListList =new ArrayList
(); skuPriceListList.add(skuPriceList); request.setSkuPriceList(skuPriceListList); SpecialVatTicket specialVatTicket= new SpecialVatTicket(); specialVatTicket.setCompanyName("苏宁易购股份有限公司"); specialVatTicket.setConsigneeAddress("江苏省南京市秦淮区法院"); specialVatTicket.setConsigneeMobileNum("15822222200"); specialVatTicket.setConsigneeName("张飞"); specialVatTicket.setRegAccount("23235254664336"); specialVatTicket.setRegAdd("江苏省南京市玄武区苏宁大道113号"); specialVatTicket.setRegBank("苏宁银行"); specialVatTicket.setRegTel("18767890345"); specialVatTicket.setTaxNo("1234567890ABCDE"); request.setSpecialVatTicket(specialVatTicket); request.setSubmitType("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 { BatchcreateorderCreateResponse response = client.excute(request); System.out.println("返回json/xml格式数据 :" + response.getBody()); } catch (SuningApiException e) { e.printStackTrace(); }
调用示例(PHP)
复制全部代码
$req = new BatchcreateorderCreateRequest(); $req -> setBatchId("100000100078"); $req -> setGoods("1"); $req -> setInvoiceContent("1"); $req -> setInvoiceState("1"); $req -> setInvoiceTo("1"); $req -> setInvoiceType("1"); $req -> setOrderType("1"); $req -> setPayment("08"); $receiveInfoList= new ReceiveInfoList(); $receiveInfoList-> setAddress("江苏省南京市雨花区软件大道舜天集团"); $receiveInfoList-> setCityId("025"); $receiveInfoList-> setCountryId("01"); $receiveInfoList-> setEmail("xxx@xxx.com"); $receiveInfoList-> setMobile("17856789012"); $receiveInfoList-> setProvinceId("100"); $receiveInfoList-> setReceiverName("张飞"); $receiveInfoList-> setRemark("订单备注"); $skuQuantityList= new SkuQuantityList(); $skuQuantityList-> setNum("2"); $skuQuantityList-> setSku("121347657"); $receiveInfoList-> setSkuQuantityList(array($skuQuantityList)); $receiveInfoList-> setTelephone("010-84728989"); $receiveInfoList-> setTownId("99"); $receiveInfoList-> setTradeNo("1000001"); $receiveInfoList-> setZip("210000"); $req -> setReceiveInfoList(array($receiveInfoList)); $skuPriceList= new SkuPriceList(); $skuPriceList-> setSkuId("121347746"); $skuPriceList-> setUnitPrice("12.1"); $req -> setSkuPriceList(array($skuPriceList)); $specialVatTicket= new SpecialVatTicket(); $specialVatTicket-> setCompanyName("苏宁易购股份有限公司"); $specialVatTicket-> setConsigneeAddress("江苏省南京市秦淮区法院"); $specialVatTicket-> setConsigneeMobileNum("15822222200"); $specialVatTicket-> setConsigneeName("张飞"); $specialVatTicket-> setRegAccount("23235254664336"); $specialVatTicket-> setRegAdd("江苏省南京市玄武区苏宁大道113号"); $specialVatTicket-> setRegBank("苏宁银行"); $specialVatTicket-> setRegTel("18767890345"); $specialVatTicket-> setTaxNo("1234567890ABCDE"); $req -> setSpecialVatTicket($specialVatTicket); $req -> setSubmitType("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.CustomGovbusRequest; using suning_api_sdk.BizResponse.CustomGovbusResponse; using suning_api_sdk.Models.CustomGovbusModel; BatchcreateorderCreateRequest request = new BatchcreateorderCreateRequest(); request.batchId="100000100078"; request.goods="1"; request.invoiceContent="1"; request.invoiceState="1"; request.invoiceTo="1"; request.invoiceType="1"; request.orderType="1"; request.payment="08"; BatchcreateorderCreateReceiveInfoListReq receiveInfoList= new BatchcreateorderCreateReceiveInfoListReq(); receiveInfoList.address="江苏省南京市雨花区软件大道舜天集团"; receiveInfoList.cityId="025"; receiveInfoList.countryId="01"; receiveInfoList.email="xxx@xxx.com"; receiveInfoList.mobile="17856789012"; receiveInfoList.provinceId="100"; receiveInfoList.receiverName="张飞"; receiveInfoList.remark="订单备注"; BatchcreateorderCreateSkuQuantityListReq skuQuantityList= new BatchcreateorderCreateSkuQuantityListReq(); skuQuantityList.num="2"; skuQuantityList.sku="121347657"; List
skuQuantityListList =new ArrayList
(); skuQuantityListList.add(skuQuantityList); receiveInfoList.skuQuantityList=skuQuantityListList; receiveInfoList.telephone="010-84728989"; receiveInfoList.townId="99"; receiveInfoList.tradeNo="1000001"; receiveInfoList.zip="210000"; List
receiveInfoListList =new ArrayList
(); receiveInfoListList.add(receiveInfoList); request.receiveInfoList=receiveInfoListList; BatchcreateorderCreateSkuPriceListReq skuPriceList= new BatchcreateorderCreateSkuPriceListReq(); skuPriceList.skuId="121347746"; skuPriceList.unitPrice="12.1"; List
skuPriceListList =new ArrayList
(); skuPriceListList.add(skuPriceList); request.skuPriceList=skuPriceListList; BatchcreateorderCreateSpecialVatTicketReq specialVatTicket= new BatchcreateorderCreateSpecialVatTicketReq(); specialVatTicket.companyName="苏宁易购股份有限公司"; specialVatTicket.consigneeAddress="江苏省南京市秦淮区法院"; specialVatTicket.consigneeMobileNum="15822222200"; specialVatTicket.consigneeName="张飞"; specialVatTicket.regAccount="23235254664336"; specialVatTicket.regAdd="江苏省南京市玄武区苏宁大道113号"; specialVatTicket.regBank="苏宁银行"; specialVatTicket.regTel="18767890345"; specialVatTicket.taxNo="1234567890ABCDE"; request.specialVatTicket=specialVatTicket; request.submitType="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); BatchcreateorderCreateResponse response = client.Execute(request);
调用示例(PYTHON)
复制全部代码
# -*- coding: utf-8 -*- import suning.api request = suning.api.govbus.BatchcreateorderCreateRequest() request.batchId="100000100078"; request.goods="1"; request.invoiceContent="1"; request.invoiceState="1"; request.invoiceTo="1"; request.invoiceType="1"; request.orderType="1"; request.payment="08"; request. receiveInfoList= [{ address:"江苏省南京市雨花区软件大道舜天集团", cityId:"025", countryId:"01", email:"xxx@xxx.com", mobile:"17856789012", provinceId:"100", receiverName:"张飞", remark:"订单备注", skuQuantityList: [{ num:"2", sku:"121347657", }], telephone:"010-84728989", townId:"99", tradeNo:"1000001", zip:"210000", }]; request. skuPriceList= [{ skuId:"121347746", unitPrice:"12.1", }]; request. specialVatTicket= { companyName:"苏宁易购股份有限公司", consigneeAddress:"江苏省南京市秦淮区法院", consigneeMobileNum:"15822222200", consigneeName:"张飞", regAccount:"23235254664336", regAdd:"江苏省南京市玄武区苏宁大道113号", regBank:"苏宁银行", regTel:"18767890345", taxNo:"1234567890ABCDE", }; request.submitType="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)