登录
退出
首页
开放版图
苏宁有货
商家后台
文档中心
文档中心
API文档
消息中心
平台公告
工单
我的工单
提交工单
控制台
SDK调用示例
suning.custexpand.orderbuy.confirm/
调用示例(JAVA)
复制全部代码
import com.suning.api.entity.custexpand.OrderbuyConfirmRequest; import com.suning.api.entity.custexpand.OrderbuyConfirmResponse; OrderbuyConfirmRequest request = new OrderbuyConfirmRequest(); request.setCardType("cardType"); request.setCustNum("custNum"); request.setDeviceId("deviceId"); request.setEcoType("ecoType"); request.setInvokerCode("调用方编码"); request.setOrderId("orderId"); OrderItem orderItem= new OrderItem(); orderItem.setActivityType("activityType"); orderItem.setBranch("branch"); orderItem.setCmdtyBrand("cmdtyBrand"); orderItem.setCmdtyCatalog("cmdtyCatalog"); orderItem.setCmdtyCode("cmdtyCode"); orderItem.setCmdtyCount("cmdtyCount"); orderItem.setCmdtyGroup("cmdtyGroup"); orderItem.setCmdtyName("cmdtyName"); orderItem.setCouponTotalMoney("couponTotalMoney"); DealItem dealItem= new DealItem(); dealItem.setDealType("dealType"); dealItem.setDealTypeFlag("dealTypeFlag"); dealItem.setPromotionNum("promotionNum"); List
dealItemList =new ArrayList
(); dealItemList.add(dealItem); orderItem.setDealItem(dealItemList); orderItem.setDistChannel("distChannel"); orderItem.setGiftCardMoney("giftCardMoney"); orderItem.setInvoiceType("invoiceType"); orderItem.setManagerCardMoney("managerCardMoney"); orderItem.setOrderAmt("orderAmt"); orderItem.setOrderItemId("orderItemId"); orderItem.setOrderItemType("orderItemType"); orderItem.setOrderType("orderType"); orderItem.setOrderTypeDesc("orderTypeDesc"); PayItem payItem= new PayItem(); payItem.setPayMode("payMode"); payItem.setPayMoney("payMoney"); List
payItemList =new ArrayList
(); payItemList.add(payItem); orderItem.setPayItem(payItemList); orderItem.setPayTime("payTime"); orderItem.setPointMoney("pointMoney"); orderItem.setPurchaseFlag("purchaseFlag"); orderItem.setServiceFee("serviceFee"); orderItem.setStaffNum("staffNum"); orderItem.setStockArea("stockArea"); orderItem.setStore("store"); orderItem.setSupplierCode("supplierCode"); orderItem.setSupplierType("supplierType"); orderItem.setTransportFee("transportFee"); List
orderItemList =new ArrayList
(); orderItemList.add(orderItem); request.setOrderItem(orderItemList); request.setOrderSubmitTime("orderSubmitTime"); request.setSceneType("sceneType"); request.setTransId("transId"); //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 { OrderbuyConfirmResponse response = client.excute(request); System.out.println("返回json/xml格式数据 :" + response.getBody()); } catch (SuningApiException e) { e.printStackTrace(); }
调用示例(PHP)
复制全部代码
$req = new OrderbuyConfirmRequest(); $req -> setCardType("cardType"); $req -> setCustNum("custNum"); $req -> setDeviceId("deviceId"); $req -> setEcoType("ecoType"); $req -> setInvokerCode("调用方编码"); $req -> setOrderId("orderId"); $orderItem= new OrderItem(); $orderItem-> setActivityType("activityType"); $orderItem-> setBranch("branch"); $orderItem-> setCmdtyBrand("cmdtyBrand"); $orderItem-> setCmdtyCatalog("cmdtyCatalog"); $orderItem-> setCmdtyCode("cmdtyCode"); $orderItem-> setCmdtyCount("cmdtyCount"); $orderItem-> setCmdtyGroup("cmdtyGroup"); $orderItem-> setCmdtyName("cmdtyName"); $orderItem-> setCouponTotalMoney("couponTotalMoney"); $dealItem= new DealItem(); $dealItem-> setDealType("dealType"); $dealItem-> setDealTypeFlag("dealTypeFlag"); $dealItem-> setPromotionNum("promotionNum"); $orderItem-> setDealItem(array($dealItem)); $orderItem-> setDistChannel("distChannel"); $orderItem-> setGiftCardMoney("giftCardMoney"); $orderItem-> setInvoiceType("invoiceType"); $orderItem-> setManagerCardMoney("managerCardMoney"); $orderItem-> setOrderAmt("orderAmt"); $orderItem-> setOrderItemId("orderItemId"); $orderItem-> setOrderItemType("orderItemType"); $orderItem-> setOrderType("orderType"); $orderItem-> setOrderTypeDesc("orderTypeDesc"); $payItem= new PayItem(); $payItem-> setPayMode("payMode"); $payItem-> setPayMoney("payMoney"); $orderItem-> setPayItem(array($payItem)); $orderItem-> setPayTime("payTime"); $orderItem-> setPointMoney("pointMoney"); $orderItem-> setPurchaseFlag("purchaseFlag"); $orderItem-> setServiceFee("serviceFee"); $orderItem-> setStaffNum("staffNum"); $orderItem-> setStockArea("stockArea"); $orderItem-> setStore("store"); $orderItem-> setSupplierCode("supplierCode"); $orderItem-> setSupplierType("supplierType"); $orderItem-> setTransportFee("transportFee"); $req -> setOrderItem(array($orderItem)); $req -> setOrderSubmitTime("orderSubmitTime"); $req -> setSceneType("sceneType"); $req -> setTransId("transId"); //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.CustomCustexpandRequest; using suning_api_sdk.BizResponse.CustomCustexpandResponse; using suning_api_sdk.Models.CustomCustexpandModel; OrderbuyConfirmRequest request = new OrderbuyConfirmRequest(); request.cardType="cardType"; request.custNum="custNum"; request.deviceId="deviceId"; request.ecoType="ecoType"; request.invokerCode="调用方编码"; request.orderId="orderId"; OrderbuyConfirmOrderItemReq orderItem= new OrderbuyConfirmOrderItemReq(); orderItem.activityType="activityType"; orderItem.branch="branch"; orderItem.cmdtyBrand="cmdtyBrand"; orderItem.cmdtyCatalog="cmdtyCatalog"; orderItem.cmdtyCode="cmdtyCode"; orderItem.cmdtyCount="cmdtyCount"; orderItem.cmdtyGroup="cmdtyGroup"; orderItem.cmdtyName="cmdtyName"; orderItem.couponTotalMoney="couponTotalMoney"; OrderbuyConfirmDealItemReq dealItem= new OrderbuyConfirmDealItemReq(); dealItem.dealType="dealType"; dealItem.dealTypeFlag="dealTypeFlag"; dealItem.promotionNum="promotionNum"; List
dealItemList =new ArrayList
(); dealItemList.add(dealItem); orderItem.dealItem=dealItemList; orderItem.distChannel="distChannel"; orderItem.giftCardMoney="giftCardMoney"; orderItem.invoiceType="invoiceType"; orderItem.managerCardMoney="managerCardMoney"; orderItem.orderAmt="orderAmt"; orderItem.orderItemId="orderItemId"; orderItem.orderItemType="orderItemType"; orderItem.orderType="orderType"; orderItem.orderTypeDesc="orderTypeDesc"; OrderbuyConfirmPayItemReq payItem= new OrderbuyConfirmPayItemReq(); payItem.payMode="payMode"; payItem.payMoney="payMoney"; List
payItemList =new ArrayList
(); payItemList.add(payItem); orderItem.payItem=payItemList; orderItem.payTime="payTime"; orderItem.pointMoney="pointMoney"; orderItem.purchaseFlag="purchaseFlag"; orderItem.serviceFee="serviceFee"; orderItem.staffNum="staffNum"; orderItem.stockArea="stockArea"; orderItem.store="store"; orderItem.supplierCode="supplierCode"; orderItem.supplierType="supplierType"; orderItem.transportFee="transportFee"; List
orderItemList =new ArrayList
(); orderItemList.add(orderItem); request.orderItem=orderItemList; request.orderSubmitTime="orderSubmitTime"; request.sceneType="sceneType"; request.transId="transId"; //开启日志调试,当测试稳定之后建议设置为 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); OrderbuyConfirmResponse response = client.Execute(request);
调用示例(PYTHON)
复制全部代码
# -*- coding: utf-8 -*- import suning.api request = suning.api.custexpand.OrderbuyConfirmRequest() request.cardType="cardType"; request.custNum="custNum"; request.deviceId="deviceId"; request.ecoType="ecoType"; request.invokerCode="调用方编码"; request.orderId="orderId"; request. orderItem= [{ activityType:"activityType", branch:"branch", cmdtyBrand:"cmdtyBrand", cmdtyCatalog:"cmdtyCatalog", cmdtyCode:"cmdtyCode", cmdtyCount:"cmdtyCount", cmdtyGroup:"cmdtyGroup", cmdtyName:"cmdtyName", couponTotalMoney:"couponTotalMoney", dealItem: [{ dealType:"dealType", dealTypeFlag:"dealTypeFlag", promotionNum:"promotionNum", }], distChannel:"distChannel", giftCardMoney:"giftCardMoney", invoiceType:"invoiceType", managerCardMoney:"managerCardMoney", orderAmt:"orderAmt", orderItemId:"orderItemId", orderItemType:"orderItemType", orderType:"orderType", orderTypeDesc:"orderTypeDesc", payItem: [{ payMode:"payMode", payMoney:"payMoney", }], payTime:"payTime", pointMoney:"pointMoney", purchaseFlag:"purchaseFlag", serviceFee:"serviceFee", staffNum:"staffNum", stockArea:"stockArea", store:"store", supplierCode:"supplierCode", supplierType:"supplierType", transportFee:"transportFee", }]; request.orderSubmitTime="orderSubmitTime"; request.sceneType="sceneType"; request.transId="transId"; 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)