登录
退出
首页
开放版图
苏宁有货
商家后台
文档中心
文档中心
API文档
消息中心
平台公告
工单
我的工单
提交工单
控制台
SDK调用示例
suning.cmall.pointgive.add/
调用示例(JAVA)
复制全部代码
import com.suning.api.entity.cmall.PointgiveAddRequest; import com.suning.api.entity.cmall.PointgiveAddResponse; PointgiveAddRequest request = new PointgiveAddRequest(); request.setCustNum("6143457056"); request.setDeviceId("aafadfadf"); request.setEcoType("140000000010"); request.setInvokerCode("pptv"); Order order= new Order(); order.setAccountType("8012"); order.setAddAmt("11"); order.setBranch("5006"); order.setCmdtyBrand("adad"); order.setCmdtyCatalog("aad"); order.setCmdtyCode("adadd"); order.setCmdtyGroup("adaa"); order.setCmdtyName("aada"); order.setOrderAmt("10"); order.setOrderItemId("A101602061818477844"); order.setOrderType("DXHDT"); order.setOrderTypeDesc("aaa"); order.setStore("8371"); order.setSupplierCode("如果积分发放主体类型为209000000020时,此字段必填"); order.setSupplierType("209000000020"); request.setOrder(order); request.setOrderId("aaaaaa"); request.setSceneCode("场景编码"); request.setSceneType("PE1110"); request.setTransId("d7bb1090e11c4ab398b38ab75efa6e02"); request.setTransTimestamp("2016-05-06 18:18:47:691"); //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 { PointgiveAddResponse response = client.excute(request); System.out.println("返回json/xml格式数据 :" + response.getBody()); } catch (SuningApiException e) { e.printStackTrace(); }
调用示例(PHP)
复制全部代码
$req = new PointgiveAddRequest(); $req -> setCustNum("6143457056"); $req -> setDeviceId("aafadfadf"); $req -> setEcoType("140000000010"); $req -> setInvokerCode("pptv"); $order= new Order(); $order-> setAccountType("8012"); $order-> setAddAmt("11"); $order-> setBranch("5006"); $order-> setCmdtyBrand("adad"); $order-> setCmdtyCatalog("aad"); $order-> setCmdtyCode("adadd"); $order-> setCmdtyGroup("adaa"); $order-> setCmdtyName("aada"); $order-> setOrderAmt("10"); $order-> setOrderItemId("A101602061818477844"); $order-> setOrderType("DXHDT"); $order-> setOrderTypeDesc("aaa"); $order-> setStore("8371"); $order-> setSupplierCode("如果积分发放主体类型为209000000020时,此字段必填"); $order-> setSupplierType("209000000020"); $req -> setOrder($order); $req -> setOrderId("aaaaaa"); $req -> setSceneCode("场景编码"); $req -> setSceneType("PE1110"); $req -> setTransId("d7bb1090e11c4ab398b38ab75efa6e02"); $req -> setTransTimestamp("2016-05-06 18:18:47:691"); //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.CustomCmallRequest; using suning_api_sdk.BizResponse.CustomCmallResponse; using suning_api_sdk.Models.CustomCmallModel; PointgiveAddRequest request = new PointgiveAddRequest(); request.custNum="6143457056"; request.deviceId="aafadfadf"; request.ecoType="140000000010"; request.invokerCode="pptv"; PointgiveAddOrderReq order= new PointgiveAddOrderReq(); order.accountType="8012"; order.addAmt="11"; order.branch="5006"; order.cmdtyBrand="adad"; order.cmdtyCatalog="aad"; order.cmdtyCode="adadd"; order.cmdtyGroup="adaa"; order.cmdtyName="aada"; order.orderAmt="10"; order.orderItemId="A101602061818477844"; order.orderType="DXHDT"; order.orderTypeDesc="aaa"; order.store="8371"; order.supplierCode="如果积分发放主体类型为209000000020时,此字段必填"; order.supplierType="209000000020"; request.order=order; request.orderId="aaaaaa"; request.sceneCode="场景编码"; request.sceneType="PE1110"; request.transId="d7bb1090e11c4ab398b38ab75efa6e02"; request.transTimestamp="2016-05-06 18:18:47:691"; //开启日志调试,当测试稳定之后建议设置为 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); PointgiveAddResponse response = client.Execute(request);
调用示例(PYTHON)
复制全部代码
# -*- coding: utf-8 -*- import suning.api request = suning.api.cmall.PointgiveAddRequest() request.custNum="6143457056"; request.deviceId="aafadfadf"; request.ecoType="140000000010"; request.invokerCode="pptv"; request. order= { accountType:"8012", addAmt:"11", branch:"5006", cmdtyBrand:"adad", cmdtyCatalog:"aad", cmdtyCode:"adadd", cmdtyGroup:"adaa", cmdtyName:"aada", orderAmt:"10", orderItemId:"A101602061818477844", orderType:"DXHDT", orderTypeDesc:"aaa", store:"8371", supplierCode:"如果积分发放主体类型为209000000020时,此字段必填", supplierType:"209000000020", }; request.orderId="aaaaaa"; request.sceneCode="场景编码"; request.sceneType="PE1110"; request.transId="d7bb1090e11c4ab398b38ab75efa6e02"; request.transTimestamp="2016-05-06 18:18:47:691"; 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)