登录
退出
首页
开放版图
苏宁有货
商家后台
文档中心
文档中心
API文档
消息中心
平台公告
工单
我的工单
提交工单
控制台
SDK调用示例
suning.retailer.memberstoreregistration.create/
调用示例(JAVA)
复制全部代码
import com.suning.api.entity.retailer.MemberstoreregistrationCreateRequest; import com.suning.api.entity.retailer.MemberstoreregistrationCreateResponse; MemberstoreregistrationCreateRequest request = new MemberstoreregistrationCreateRequest(); request.setAppId("666666"); request.setChannelCode("19451"); request.setCityCode("025"); request.setCityName("025"); request.setCompanyAddr("苏宁大道1号"); request.setCompanyName("公司名称"); request.setCompanyType("1"); request.setContactPerson("张三"); request.setContactPhone("02566783636"); request.setDistrictCode("01"); request.setDistrictName("玄武区"); request.setLegalIdcardNo("3402106197812023678"); request.setLegalPerson("张三"); request.setLicenseNo("6652841194"); request.setMerchantType("0"); request.setProvCode("100"); request.setProvName("江苏省"); request.setTownCode("01"); request.setTownName("主城区"); //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 { MemberstoreregistrationCreateResponse response = client.excute(request); System.out.println("返回json/xml格式数据 :" + response.getBody()); } catch (SuningApiException e) { e.printStackTrace(); }
调用示例(PHP)
复制全部代码
$req = new MemberstoreregistrationCreateRequest(); $req -> setAppId("666666"); $req -> setChannelCode("19451"); $req -> setCityCode("025"); $req -> setCityName("025"); $req -> setCompanyAddr("苏宁大道1号"); $req -> setCompanyName("公司名称"); $req -> setCompanyType("1"); $req -> setContactPerson("张三"); $req -> setContactPhone("02566783636"); $req -> setDistrictCode("01"); $req -> setDistrictName("玄武区"); $req -> setLegalIdcardNo("3402106197812023678"); $req -> setLegalPerson("张三"); $req -> setLicenseNo("6652841194"); $req -> setMerchantType("0"); $req -> setProvCode("100"); $req -> setProvName("江苏省"); $req -> setTownCode("01"); $req -> setTownName("主城区"); //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; MemberstoreregistrationCreateRequest request = new MemberstoreregistrationCreateRequest(); request.appId="666666"; request.channelCode="19451"; request.cityCode="025"; request.cityName="025"; request.companyAddr="苏宁大道1号"; request.companyName="公司名称"; request.companyType="1"; request.contactPerson="张三"; request.contactPhone="02566783636"; request.districtCode="01"; request.districtName="玄武区"; request.legalIdcardNo="3402106197812023678"; request.legalPerson="张三"; request.licenseNo="6652841194"; request.merchantType="0"; request.provCode="100"; request.provName="江苏省"; request.townCode="01"; request.townName="主城区"; //开启日志调试,当测试稳定之后建议设置为 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); MemberstoreregistrationCreateResponse response = client.Execute(request);
调用示例(PYTHON)
复制全部代码
# -*- coding: utf-8 -*- import suning.api request = suning.api.retailer.MemberstoreregistrationCreateRequest() request.appId="666666"; request.channelCode="19451"; request.cityCode="025"; request.cityName="025"; request.companyAddr="苏宁大道1号"; request.companyName="公司名称"; request.companyType="1"; request.contactPerson="张三"; request.contactPhone="02566783636"; request.districtCode="01"; request.districtName="玄武区"; request.legalIdcardNo="3402106197812023678"; request.legalPerson="张三"; request.licenseNo="6652841194"; request.merchantType="0"; request.provCode="100"; request.provName="江苏省"; request.townCode="01"; request.townName="主城区"; 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)