航税云开放平台SDK:多语言开发工具包,快速集成数电发票开票能力。
提供 Java、PHP、Python 等语言的官方 SDK,封装鉴权、报文签名与请求发送,快速接入开放平台能力。
Java SDK 工具包适用于 JDK1.7 及以上环境。
在 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");
NNOpenSDK sdk = NNOpenSDK.getIntance();
String taxnum = "23***789";
String appKey = "Hn***XL";
String appSecret = "F65***65F";
String method = "nuonuo.***";
String token = "2d484e******pdui";
String content = "{\"city\":\"广州市\"}";
String url = "https://sdk.nuonuo.com/open/v1/services";
String senid = UUID.randomUUID().toString()
.replace("-", "");
String json = sdk.sendPostSyncRequest(url, senid,
appKey, appSecret, token, taxnum, method, content);
响应示例:
{"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";//商户税号
$url = "https://sdk.nuonuo.com/open/v1/services";
$method = "nuonuo.***";
$senid = '8cf2c072c3c44666805878efd0a9c5c8';
$body = '{"invoiceSerialNum":["your.voicecode"]}';
$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'
senid = '8cf2c072c3c44666805878efd0a9c5c8'
appKey = 'Ta***p0I'
appsecret = 'WF************79'
accessToken = '44******kgi'
taxNum = '33***42'
api_method = 'nuonuo.electronInvoice.CheckEInvoice'
body = '{"invoiceSerialNum":["19****085"]}'
res = send_request(req_url, senid, appKey,
appsecret, accessToken, taxNum, api_method, body)
print(res)