航税云开放平台SDK:多语言开发工具包,快速集成数电发票开票能力。
提供 Java、PHP、Python 等语言的官方 SDK,封装鉴权、报文签名与请求发送,帮助开发者以最少的代码快速接入开放平台能力。
Java SDK 工具包适用于 JDK1.7 及以上环境。
通过 Maven 获取安装是使用 Java SDK 的推荐方法,Maven 是 Java 的依赖管理工具,支持您项目所需的依赖项,并将其安装到项目中。为您的项目添加 Maven 依赖项,只需在 Maven pom.xml 添加以下依赖项即可:
<dependency>
<groupId>com.nuonuo</groupId>
<artifactId>open-sdk</artifactId>
<version>1.0.5.2</version>
</dependency>
注意:上图仅为示例代码,请 获取 最新依赖项信息。
执行下述方法(具体参数说明可参见「独立企业接入」):
String json = NNOpenSDK.getIntance().getMerchantToken("appKey","appSecret");
执行下述方法(具体参数说明可参见「系统服务商接入」):
String json = NNOpenSDK.getIntance().getISVToken("appKey","appSecret","code","taxnum","redirectUri");
执行下述方法(具体参数说明可参见「系统服务商接入」):
String json = NNOpenSDK.getIntance().refreshISVToken("refreshToken","userId","appSecret");
请求示例:
NNOpenSDK sdk = NNOpenSDK.getIntance();
String taxnum = "23***789";//ISV下授权商户税号,自用型应用置""即可
String appKey = "Hn***XL";
String appSecret = "F65***65F";
String method = "nuonuo.***";//API方法名
String token = "2d484e**************pdui";//访问令牌
String content = "{\"city\":\"广州市\", …,\"maxid\":\"0\"}";//API私有请求参数
String url = "https://sdk.nuonuo.com/open/v1/services"; //SDK请求地址
String senid = UUID.randomUUID().toString().replace("-", ""); // 唯一标识,由企业自己生成32位随机码
String json = sdk.sendPostSyncRequest(url, senid, appKey, appSecret, token, taxnum, method, content); // 请求API
响应示例:
{"code":"200","describe":"调用成功","result":"****"}
PHP SDK 工具包适用于 PHP5.6 及以上版本。
require_once __DIR__ . "/lib/Api.php";
$appKey = "13***877";
$appSecret = "9C************62";
$token = "98***************************tni";//访问令牌
$taxnum = "33***********42";//ISV下授权商户税号,自用型应用置""即可
$url = "https://sdk.nuonuo.com/open/v1/services"; //SDK请求地址
$method = "nuonuo.***"; //API方法名
$senid = '8cf2c072c3c44666805878efd0a9c5c8'; //唯一标识,由企业自己生成32位随机码
$body = '{"invoiceSerialNum":["your.voicecode"]}';//API私有请求参数
$res = Api::sendPostSyncRequest($url, $senid, $appKey, $appSecret, $token, $taxnum, $method, $body);
return $res;
Python SDK 工具包适用于 python3.6 及以上环境。
if __name__ == '__main__':
req_url = 'https://sdk.nuonuo.com/open/v1/services' #SDK请求地址
senid = '8cf2c072c3c44666805878efd0a9c5c8' #唯一标识,由企业自己生成32位随机码
appKey = 'Ta***p0I'
appsecret = 'WF************79'
accessToken = '44***************************kgi' #访问令牌
taxNum = '33***********42' #ISV下授权商户税号,自用型应用置""即可
api_method = 'nuonuo.electronInvoice.CheckEInvoice' #API方法名
body = '{"invoiceSerialNum":["19***************085"]}' #API私有请求参数
res = send_request(req_url, senid, appKey, appsecret, accessToken, taxNum, api_method, body)
print(res)
请留下您的联系方式,我们将在一个工作日内与您联系