登录
退出
首页
开放版图
苏宁有货
商家后台
文档中心
文档中心
API文档
消息中心
平台公告
工单
我的工单
提交工单
控制台
SDK调用示例
suning.onlinestore.ordersubmit.create/
调用示例(JAVA)
复制全部代码
import com.suning.api.entity.onlinestore.OrdersubmitCreateRequest; import com.suning.api.entity.onlinestore.OrdersubmitCreateResponse; OrdersubmitCreateRequest request = new OrdersubmitCreateRequest(); PlatFormTrade platFormTrade= new PlatFormTrade(); platFormTrade.setAccntBank("南京银行"); platFormTrade.setBankAccntNum("6YUIOP3456789009876"); platFormTrade.setBusinessSign("1"); platFormTrade.setCartTwoNo("DLJA2018114812000000"); platFormTrade.setChanId("02"); platFormTrade.setCityName("北京市"); platFormTrade.setDeliveryType("02"); platFormTrade.setInvoiceContent("餐饮"); platFormTrade.setInvoiceTitle("个人消费"); platFormTrade.setInvoiceTitleType("02"); platFormTrade.setInvoiceType("05"); platFormTrade.setMapType("01"); platFormTrade.setMemberNo("23456543"); platFormTrade.setOrderId("123342312"); platFormTrade.setOrderTime("2020-02-14 00:00:00"); platFormTrade.setPayment("100.00"); PlatFormOrder platFormOrder= new PlatFormOrder(); platFormOrder.setActivityId("67678678787"); platFormOrder.setCartTwoItemNo("4324242343"); platFormOrder.setCmmdtyProperty("01"); platFormOrder.setCouponInfo("null"); platFormOrder.setFullReductionInfo("null"); platFormOrder.setHopeArrivalTime("2020-02-14 00:00:00"); platFormOrder.setOrderItemId("242342423"); platFormOrder.setOrderPayment("32.00"); platFormOrder.setPointAmount("3.00"); platFormOrder.setPostage("0.00"); platFormOrder.setPrice("10.00"); platFormOrder.setSaleNum("10"); platFormOrder.setSkuId("4244242"); platFormOrder.setSnSkuId("3244234234"); platFormOrder.setTotalFee("23.00"); List
platFormOrderList =new ArrayList
(); platFormOrderList.add(platFormOrder); platFormTrade.setPlatFormOrder(platFormOrderList); platFormTrade.setPoiId("234243"); platFormTrade.setReceiverAddress("南京市"); platFormTrade.setReceiverMobile("15008987656"); platFormTrade.setReceiverName("张三"); platFormTrade.setRegAddr("南京市白下区淮海路68号苏18F"); platFormTrade.setRegPhone("02584418888"); platFormTrade.setShopCode("001"); platFormTrade.setShopName("小店"); platFormTrade.setTaxMobilePhone("15509876789"); platFormTrade.setTaxPayerAddr("南京市白下区淮宁电器大厦18F"); platFormTrade.setTaxPayerName("张三"); platFormTrade.setTaxPayerNo("SDFDFD458976"); platFormTrade.setTaxPayerPhone("02584418888"); request.setPlatFormTrade(platFormTrade); //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 { OrdersubmitCreateResponse response = client.excute(request); System.out.println("返回json/xml格式数据 :" + response.getBody()); } catch (SuningApiException e) { e.printStackTrace(); }
调用示例(PHP)
复制全部代码
$req = new OrdersubmitCreateRequest(); $platFormTrade= new PlatFormTrade(); $platFormTrade-> setAccntBank("南京银行"); $platFormTrade-> setBankAccntNum("6YUIOP3456789009876"); $platFormTrade-> setBusinessSign("1"); $platFormTrade-> setCartTwoNo("DLJA2018114812000000"); $platFormTrade-> setChanId("02"); $platFormTrade-> setCityName("北京市"); $platFormTrade-> setDeliveryType("02"); $platFormTrade-> setInvoiceContent("餐饮"); $platFormTrade-> setInvoiceTitle("个人消费"); $platFormTrade-> setInvoiceTitleType("02"); $platFormTrade-> setInvoiceType("05"); $platFormTrade-> setMapType("01"); $platFormTrade-> setMemberNo("23456543"); $platFormTrade-> setOrderId("123342312"); $platFormTrade-> setOrderTime("2020-02-14 00:00:00"); $platFormTrade-> setPayment("100.00"); $platFormOrder= new PlatFormOrder(); $platFormOrder-> setActivityId("67678678787"); $platFormOrder-> setCartTwoItemNo("4324242343"); $platFormOrder-> setCmmdtyProperty("01"); $platFormOrder-> setCouponInfo("null"); $platFormOrder-> setFullReductionInfo("null"); $platFormOrder-> setHopeArrivalTime("2020-02-14 00:00:00"); $platFormOrder-> setOrderItemId("242342423"); $platFormOrder-> setOrderPayment("32.00"); $platFormOrder-> setPointAmount("3.00"); $platFormOrder-> setPostage("0.00"); $platFormOrder-> setPrice("10.00"); $platFormOrder-> setSaleNum("10"); $platFormOrder-> setSkuId("4244242"); $platFormOrder-> setSnSkuId("3244234234"); $platFormOrder-> setTotalFee("23.00"); $platFormTrade-> setPlatFormOrder(array($platFormOrder)); $platFormTrade-> setPoiId("234243"); $platFormTrade-> setReceiverAddress("南京市"); $platFormTrade-> setReceiverMobile("15008987656"); $platFormTrade-> setReceiverName("张三"); $platFormTrade-> setRegAddr("南京市白下区淮海路68号苏18F"); $platFormTrade-> setRegPhone("02584418888"); $platFormTrade-> setShopCode("001"); $platFormTrade-> setShopName("小店"); $platFormTrade-> setTaxMobilePhone("15509876789"); $platFormTrade-> setTaxPayerAddr("南京市白下区淮宁电器大厦18F"); $platFormTrade-> setTaxPayerName("张三"); $platFormTrade-> setTaxPayerNo("SDFDFD458976"); $platFormTrade-> setTaxPayerPhone("02584418888"); $req -> setPlatFormTrade($platFormTrade); //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.CustomOnlinestoreRequest; using suning_api_sdk.BizResponse.CustomOnlinestoreResponse; using suning_api_sdk.Models.CustomOnlinestoreModel; OrdersubmitCreateRequest request = new OrdersubmitCreateRequest(); OrdersubmitCreatePlatFormTradeReq platFormTrade= new OrdersubmitCreatePlatFormTradeReq(); platFormTrade.accntBank="南京银行"; platFormTrade.bankAccntNum="6YUIOP3456789009876"; platFormTrade.businessSign="1"; platFormTrade.cartTwoNo="DLJA2018114812000000"; platFormTrade.chanId="02"; platFormTrade.cityName="北京市"; platFormTrade.deliveryType="02"; platFormTrade.invoiceContent="餐饮"; platFormTrade.invoiceTitle="个人消费"; platFormTrade.invoiceTitleType="02"; platFormTrade.invoiceType="05"; platFormTrade.mapType="01"; platFormTrade.memberNo="23456543"; platFormTrade.orderId="123342312"; platFormTrade.orderTime="2020-02-14 00:00:00"; platFormTrade.payment="100.00"; OrdersubmitCreatePlatFormOrderReq platFormOrder= new OrdersubmitCreatePlatFormOrderReq(); platFormOrder.activityId="67678678787"; platFormOrder.cartTwoItemNo="4324242343"; platFormOrder.cmmdtyProperty="01"; platFormOrder.couponInfo="null"; platFormOrder.fullReductionInfo="null"; platFormOrder.hopeArrivalTime="2020-02-14 00:00:00"; platFormOrder.orderItemId="242342423"; platFormOrder.orderPayment="32.00"; platFormOrder.pointAmount="3.00"; platFormOrder.postage="0.00"; platFormOrder.price="10.00"; platFormOrder.saleNum="10"; platFormOrder.skuId="4244242"; platFormOrder.snSkuId="3244234234"; platFormOrder.totalFee="23.00"; List
platFormOrderList =new ArrayList
(); platFormOrderList.add(platFormOrder); platFormTrade.platFormOrder=platFormOrderList; platFormTrade.poiId="234243"; platFormTrade.receiverAddress="南京市"; platFormTrade.receiverMobile="15008987656"; platFormTrade.receiverName="张三"; platFormTrade.regAddr="南京市白下区淮海路68号苏18F"; platFormTrade.regPhone="02584418888"; platFormTrade.shopCode="001"; platFormTrade.shopName="小店"; platFormTrade.taxMobilePhone="15509876789"; platFormTrade.taxPayerAddr="南京市白下区淮宁电器大厦18F"; platFormTrade.taxPayerName="张三"; platFormTrade.taxPayerNo="SDFDFD458976"; platFormTrade.taxPayerPhone="02584418888"; request.platFormTrade=platFormTrade; //开启日志调试,当测试稳定之后建议设置为 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); OrdersubmitCreateResponse response = client.Execute(request);
调用示例(PYTHON)
复制全部代码
# -*- coding: utf-8 -*- import suning.api request = suning.api.onlinestore.OrdersubmitCreateRequest() request. platFormTrade= { accntBank:"南京银行", bankAccntNum:"6YUIOP3456789009876", businessSign:"1", cartTwoNo:"DLJA2018114812000000", chanId:"02", cityName:"北京市", deliveryType:"02", invoiceContent:"餐饮", invoiceTitle:"个人消费", invoiceTitleType:"02", invoiceType:"05", mapType:"01", memberNo:"23456543", orderId:"123342312", orderTime:"2020-02-14 00:00:00", payment:"100.00", platFormOrder: [{ activityId:"67678678787", cartTwoItemNo:"4324242343", cmmdtyProperty:"01", couponInfo:"null", fullReductionInfo:"null", hopeArrivalTime:"2020-02-14 00:00:00", orderItemId:"242342423", orderPayment:"32.00", pointAmount:"3.00", postage:"0.00", price:"10.00", saleNum:"10", skuId:"4244242", snSkuId:"3244234234", totalFee:"23.00", }], poiId:"234243", receiverAddress:"南京市", receiverMobile:"15008987656", receiverName:"张三", regAddr:"南京市白下区淮海路68号苏18F", regPhone:"02584418888", shopCode:"001", shopName:"小店", taxMobilePhone:"15509876789", taxPayerAddr:"南京市白下区淮宁电器大厦18F", taxPayerName:"张三", taxPayerNo:"SDFDFD458976", taxPayerPhone:"02584418888", }; 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)