登录
退出
首页
开放版图
苏宁有货
商家后台
文档中心
文档中心
API文档
消息中心
平台公告
工单
我的工单
提交工单
控制台
SDK调用示例
suning.retailer.btborder.create/
调用示例(JAVA)
复制全部代码
import com.suning.api.entity.retailer.BtborderCreateRequest; import com.suning.api.entity.retailer.BtborderCreateResponse; BtborderCreateRequest request = new BtborderCreateRequest(); request.setAppId("666666"); request.setChannelCode("19541"); OrderDelivery orderDelivery= new OrderDelivery(); orderDelivery.setBuyerAddress("江苏省南京市玄武区玄武大道1号"); orderDelivery.setCityCode("025"); orderDelivery.setDistrictCode("01"); orderDelivery.setProvinceCode("100"); orderDelivery.setReceiverName("张三"); orderDelivery.setReceiverPhone("18632486868"); orderDelivery.setTownCode("01"); request.setOrderDelivery(orderDelivery); OrderInvoice orderInvoice= new OrderInvoice(); orderInvoice.setInvoiceAddress("江苏省南京市玄武区玄武大道1号"); orderInvoice.setInvoiceReceiverName("张三"); orderInvoice.setInvoiceReceiverPhone("135889088765"); orderInvoice.setInvoiceTitle("个人"); orderInvoice.setInvoiceTitleType("1"); orderInvoice.setInvoiceType("1"); orderInvoice.setTaxPayerNo("122021154545x"); request.setOrderInvoice(orderInvoice); OrderItemList orderItemList= new OrderItemList(); orderItemList.setBookTimeDetail("2018-07-01"); orderItemList.setCmmdtyCode("000000000102556513"); orderItemList.setDistributorCode("0000000000"); orderItemList.setHopeArrivalTime("2018-08-30"); orderItemList.setInstallFlag("0"); orderItemList.setItemTotalFare("24.00"); orderItemList.setOuterOrderItemNo("B20190505180001021"); orderItemList.setPrice("2000.00"); orderItemList.setQuantity("1"); orderItemList.setServiceCmmdtyCode("000000000102556513"); List
orderItemListList =new ArrayList
(); orderItemListList.add(orderItemList); request.setOrderItemList(orderItemListList); request.setOuterOrderNo("B2019050518000801"); request.setPayWay("9"); request.setRemark("备注信息"); request.setStoreCode("59021"); //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 { BtborderCreateResponse response = client.excute(request); System.out.println("返回json/xml格式数据 :" + response.getBody()); } catch (SuningApiException e) { e.printStackTrace(); }
调用示例(PHP)
复制全部代码
$req = new BtborderCreateRequest(); $req -> setAppId("666666"); $req -> setChannelCode("19541"); $orderDelivery= new OrderDelivery(); $orderDelivery-> setBuyerAddress("江苏省南京市玄武区玄武大道1号"); $orderDelivery-> setCityCode("025"); $orderDelivery-> setDistrictCode("01"); $orderDelivery-> setProvinceCode("100"); $orderDelivery-> setReceiverName("张三"); $orderDelivery-> setReceiverPhone("18632486868"); $orderDelivery-> setTownCode("01"); $req -> setOrderDelivery($orderDelivery); $orderInvoice= new OrderInvoice(); $orderInvoice-> setInvoiceAddress("江苏省南京市玄武区玄武大道1号"); $orderInvoice-> setInvoiceReceiverName("张三"); $orderInvoice-> setInvoiceReceiverPhone("135889088765"); $orderInvoice-> setInvoiceTitle("个人"); $orderInvoice-> setInvoiceTitleType("1"); $orderInvoice-> setInvoiceType("1"); $orderInvoice-> setTaxPayerNo("122021154545x"); $req -> setOrderInvoice($orderInvoice); $orderItemList= new OrderItemList(); $orderItemList-> setBookTimeDetail("2018-07-01"); $orderItemList-> setCmmdtyCode("000000000102556513"); $orderItemList-> setDistributorCode("0000000000"); $orderItemList-> setHopeArrivalTime("2018-08-30"); $orderItemList-> setInstallFlag("0"); $orderItemList-> setItemTotalFare("24.00"); $orderItemList-> setOuterOrderItemNo("B20190505180001021"); $orderItemList-> setPrice("2000.00"); $orderItemList-> setQuantity("1"); $orderItemList-> setServiceCmmdtyCode("000000000102556513"); $req -> setOrderItemList(array($orderItemList)); $req -> setOuterOrderNo("B2019050518000801"); $req -> setPayWay("9"); $req -> setRemark("备注信息"); $req -> setStoreCode("59021"); //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; BtborderCreateRequest request = new BtborderCreateRequest(); request.appId="666666"; request.channelCode="19541"; BtborderCreateOrderDeliveryReq orderDelivery= new BtborderCreateOrderDeliveryReq(); orderDelivery.buyerAddress="江苏省南京市玄武区玄武大道1号"; orderDelivery.cityCode="025"; orderDelivery.districtCode="01"; orderDelivery.provinceCode="100"; orderDelivery.receiverName="张三"; orderDelivery.receiverPhone="18632486868"; orderDelivery.townCode="01"; request.orderDelivery=orderDelivery; BtborderCreateOrderInvoiceReq orderInvoice= new BtborderCreateOrderInvoiceReq(); orderInvoice.invoiceAddress="江苏省南京市玄武区玄武大道1号"; orderInvoice.invoiceReceiverName="张三"; orderInvoice.invoiceReceiverPhone="135889088765"; orderInvoice.invoiceTitle="个人"; orderInvoice.invoiceTitleType="1"; orderInvoice.invoiceType="1"; orderInvoice.taxPayerNo="122021154545x"; request.orderInvoice=orderInvoice; BtborderCreateOrderItemListReq orderItemList= new BtborderCreateOrderItemListReq(); orderItemList.bookTimeDetail="2018-07-01"; orderItemList.cmmdtyCode="000000000102556513"; orderItemList.distributorCode="0000000000"; orderItemList.hopeArrivalTime="2018-08-30"; orderItemList.installFlag="0"; orderItemList.itemTotalFare="24.00"; orderItemList.outerOrderItemNo="B20190505180001021"; orderItemList.price="2000.00"; orderItemList.quantity="1"; orderItemList.serviceCmmdtyCode="000000000102556513"; List
orderItemListList =new ArrayList
(); orderItemListList.add(orderItemList); request.orderItemList=orderItemListList; request.outerOrderNo="B2019050518000801"; request.payWay="9"; request.remark="备注信息"; request.storeCode="59021"; //开启日志调试,当测试稳定之后建议设置为 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); BtborderCreateResponse response = client.Execute(request);
调用示例(PYTHON)
复制全部代码
# -*- coding: utf-8 -*- import suning.api request = suning.api.retailer.BtborderCreateRequest() request.appId="666666"; request.channelCode="19541"; request. orderDelivery= { buyerAddress:"江苏省南京市玄武区玄武大道1号", cityCode:"025", districtCode:"01", provinceCode:"100", receiverName:"张三", receiverPhone:"18632486868", townCode:"01", }; request. orderInvoice= { invoiceAddress:"江苏省南京市玄武区玄武大道1号", invoiceReceiverName:"张三", invoiceReceiverPhone:"135889088765", invoiceTitle:"个人", invoiceTitleType:"1", invoiceType:"1", taxPayerNo:"122021154545x", }; request. orderItemList= [{ bookTimeDetail:"2018-07-01", cmmdtyCode:"000000000102556513", distributorCode:"0000000000", hopeArrivalTime:"2018-08-30", installFlag:"0", itemTotalFare:"24.00", outerOrderItemNo:"B20190505180001021", price:"2000.00", quantity:"1", serviceCmmdtyCode:"000000000102556513", }]; request.outerOrderNo="B2019050518000801"; request.payWay="9"; request.remark="备注信息"; request.storeCode="59021"; 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)