财政票据查验服务

支持非税收入类票据、结算类票据、其他财政票据、医疗收费票据等票据的真伪查验,对接权威实时数据源,上传票据查验要素信息,即可返回票据相关信息,支持财政票据的批量查验,适用于企事业单位、医疗机构、金融机构等多种需要对财政类票据进行真伪查验的场景

购买API 票据管理系统

产品体验

剩余条数:0

请输入下列信息,或点击 上传发票图片OCR输入

* *

* *

*

开始核验...

API文档

接口地址:
接口说明
https://netocr.com/verapi/v2/verFinancial.do
接口调用方法: post
接口接收参数:
序号 名称 类型 必填 说明
1 key String 用户ocrKey
2 secret String 用户ocrSecrert
3 invoiceCode String 发票代码
4 invoiceNumber String 发票号码
5 billingDate String 开票日期:YYYY-MM-DD
6 amountTax String 票面金额
7 checkCode String 校验码
8 typeId Integer 财政验真:3017
接口返回值参数说明:
序号 名称 类型 说明
1 checkNum String 查验次数
2 administrativeDivisionName String 所属行政区名称
3 invoiceCode String 发票代码
4 invoiceNumber String 发票号码
5 billingDate String 开票日期
6 totalAmount String 不含税金额
7 checkCode String 校验码
8 amountTax String 票面金额
9 purchaserName String 购方名称
10 purchaserTaxNo String 购方税号
11 salesName String 销方名称
11 salesTaxNo String 销方税号
12 totalTax String 合计税额
13 amountTaxCN String 票面金额(大写)
14 receiverName String 收款人
15 recheckName String 复核人
16 remarks String 备注
17 entryTag String 入账标识 0未入账 1已入账
18 printTag String 打印标识 0未打印 1已打印
19 redTag String 冲红标识 0正常,1冲红
20 redDate String 冲红日期
21 redTime String 冲红时间
22 redReason String 冲红原因
23 financeSeal String 财政部门印章
24 financeSealNo String 财政部门印章编码
25 invoiceLists String 明细列表
26 invoiceDetails String 项目明细
27 otherInfos String 其他信息
28 commodityCode String 项目编号
29 commodityName String 项目名称
30 specificationModel String 规格标准
31 unit String 单位
32 quantity String 数量
33 unitPrice String 单价
34 amount String 金额
35 taxRate String 税率
36 tax String 税额
37 notes String 备注
38 serialNo String 项目序号
39 fieldEn String 英文名称
40 fieldCn String 中文名称
41 fieldValue String 字段值
42 invoiceType String 发票类型 财政医疗票据
状态码说明:
status code message
0 查验成功发票一致(扣费)
-30000 该票今日本平台核验失败已超5次(扣费)
-30001 发票信息不一致(扣费)
-30002 所查发票不存在(扣费)
-30003 超过该张票当天查验次数(请于次日再次查验)
-30004 查询发票不规范
-30005 参数不能为空
-30008 参数长度不正确
-30010 查验异常
-30015 类型错误
-30017 传入参数不正确
-30020 查验失败
-30021 超过一年的不能查验
示例代码
  • Java
  • python
  • javascript
  • PHP
  • C#
  • C++
  • GO
  • Node.js
  • ios
  • Android

package com.test;

import okhttp3.*;
import org.json.JSONObject;
import java.io.*;
/**
 * 需要添加依赖
 * 
 * 
 *     com.squareup.okhttp3
 *     okhttp
 *     4.12.0
 * 
 */
class Sample {

	static final OkHttpClient HTTP_CLIENT = new OkHttpClient().newBuilder().build();

	public static void main(String []args) throws IOException{
		MediaType mediaType = MediaType.parse("text/plain");
		RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
		  .addFormDataPart("key","M***********g")
		  .addFormDataPart("secret","3***********6")
		  .addFormDataPart("typeId","3017")
		  .addFormDataPart("invoiceCode","********")
		  .addFormDataPart("invoiceNumber","*******")
		  .addFormDataPart("billingDate","********")
		  .addFormDataPart("checkCode","*******")
		  .addFormDataPart("amountTax","*******")
		  .build();
		Request request = new Request.Builder()
		  .url("https://netocr.com/verapi/v2/verFinancial.do")
		  .method("POST", body)
		  .build();
		Response response = HTTP_CLIENT.newCall(request).execute();
		System.out.println(response.body().string());
	}
}

import requests
import json

def main():

    url = "https://netocr.com/verapi/v2/verFinancial.do"

    payload = {
    'key': 'M***********g',
    'secret': '3***********6',
    'typeId': '3017',
    'invoiceCode': '*********',
    'invoiceNumber': '*********',
    'billingDate': '********',
    'amountTax': '********',
    'checkCode': '*******',

	}
    files=[

    ]
	headers = {}

    response = requests.request("POST", url, headers=headers, data=payload, files=files)

    print(response.text)

	if __name__ == '__main__':
	    main()

var form = new FormData();
form.append("key", "M***********g");
form.append("secret", "3***********6");
form.append("typeId", "3017");
form.append("invoiceCode", "*********");
form.append("invoiceNumber", "*******");
form.append("billingDate", "******");
form.append("checkCode", "**********");
form.append("amountTax", "**********");




var settings = {
 "url": "https://netocr.com/verapi/v2/verFinancial.do",
 "method": "POST",
 "timeout": 0,
 "processData": false,
 "mimeType": "multipart/form-data",
 "contentType": false,
 "data": form
};

$.ajax(settings).done(function (response) {
 console.log(response);
});

<?php
class Sample {

	public function run() {
		$curl = curl_init();
		curl_setopt_array($curl, array(

			CURLOPT_URL => 'https://netocr.com/verapi/v2/verFinancial.do',
			CURLOPT_RETURNTRANSFER => true,
			CURLOPT_ENCODING => '',
			CURLOPT_MAXREDIRS => 10,
			CURLOPT_TIMEOUT => 0,
			CURLOPT_FOLLOWLOCATION => true,
			CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
			CURLOPT_CUSTOMREQUEST => 'POST',
			CURLOPT_POSTFIELDS => array('key' => 'M***********g','secret' => '3***********6','typeId' => '3017','invoiceCode' => '*******','invoiceNumber' => '**********','billingDate' => '********','amountTax' => '*************','checkCode' => '*********'),

		));
		$response = curl_exec($curl);
        curl_close($curl);
        echo $response;
	}
}
$rtn = (new Sample())->run();
print_r($rtn);

var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://netocr.com/verapi/v2/verFinancial.do");
var content = new MultipartFormDataContent();
content.Add(new StringContent("M***********g"), "key");
content.Add(new StringContent("3***********6"), "secret");
content.Add(new StringContent("3017"), "typeId");
content.Add(new StringContent("*******"), "invoiceCode");
content.Add(new StringContent("*********"), "invoiceNumber");
content.Add(new StringContent("*********"), "billingDate");
content.Add(new StringContent("*********"), "amountTax");
content.Add(new StringContent("*********"), "checkCode");

request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());

#include 
#include 
#include 

int main() {
    // 创建 HTTP 客户端
    web::http::client::http_client client(U("https://netocr.com/verapi/v2/verInvoice.do"));

    // 构建请求内容
    web::http::multipart_content content;
    content.add(web::http::name(U("key")), web::http::value(U("M***********g")));
    content.add(web::http::name(U("secret")), web::http::value(U("3***********6")));
    content.add(web::http::name(U("typeId")), web::http::value(U("3017")));
    content.add(web::http::name(U("invoiceCode")), web::http::value(U("**********")));
    content.add(web::http::name(U("invoiceNumber")), web::http::value(U("************")));
    content.add(web::http::name(U("billingDate")), web::http::value(U("*************")));
    content.add(web::http::name(U("amountTax")), web::http::value(U("*************")));
    content.add(web::http::name(U("checkCode")), web::http::value(U("***********")));


    // 创建 HTTP 请求
    web::http::http_request request(web::http::methods::POST);
    request.headers().set_content_type(U("multipart/form-data; boundary=") + content.boundary());
    request.set_body(content);

    // 发送请求并获取响应
    web::http::http_response response = client.request(request).get();

    // 确保请求成功
    if (response.status_code() == web::http::status_codes::OK) {
        // 读取响应内容
        std::wstring responseString = response.extract_string().get();
        std::wcout << "Response: " << responseString << std::endl;
    } else {
        std::cerr << "Request failed with status code " << response.status_code() << std::endl;
    }
    return 0;
}

package main

import (
  "fmt"
  "bytes"
  "mime/multipart"
  "net/http"
  "io/ioutil"
)

func main() {
    url := "https://netocr.com/verapi/v2/verFinancial.do"
    method := "POST"

    payload := &bytes.Buffer{}
    writer := multipart.NewWriter(payload)
    _ = writer.WriteField("key", "M***********g")
    _ = writer.WriteField("secret", "3***********6")
    _ = writer.WriteField("typeId", "3017")
    _ = writer.WriteField("invoiceCode", "9********")
    _ = writer.WriteField("invoiceNumber", "*********")
    _ = writer.WriteField("billingDate", "************")
    _ = writer.WriteField("amountTax", "********")
    _ = writer.WriteField("checkCode", "**********")


    err := writer.Close()
    if err != nil {
     fmt.Println(err)
     return
    }

    client := &http.Client { }
    req, err := http.NewRequest(method, url, payload)

    if err != nil {
     fmt.Println(err)
     return
    }
    req.Header.Set("Content-Type", writer.FormDataContentType())
    res, err := client.Do(req)
    if err != nil {
     fmt.Println(err)
     return
    }
    defer res.Body.Close()

    body, err := ioutil.ReadAll(res.Body)
    if err != nil {
     fmt.Println(err)
     return
    }
    fmt.Println(string(body))
}

var request = require('request');
var options = {
   'method': 'POST',
   'url': 'https://netocr.com/verapi/v2/verFinancial.do',
   'headers': {
   },
   formData: {
     'key': 'M***********g',
     'secret': '3***********6',
     'typeId': '3017',
     'invoiceCode': '***********',
     'invoiceNumber': '************',
     'billingDate': '**************',
     'amountTax': '**************',
     'checkCode': '***********'


   }
};
request(options, function (error, response) {
   if (error) throw new Error(error);
   console.log(response.body);
});

import Alamofire

class Sample {

    func performNetworkRequest() {
        let parameters: [String: Any] = [
            "key": "M***********g",
            "secret": "3***********6",
            "typeId": "3017",
            "invoiceCode": "***********",
            "invoiceNumber": "**************",
            "billingDate": "************",
            "amountTax": "************",
            "checkCode": "**********",


        ]

        AF.request("https://netocr.com/verapi/v2/verFinancial.do", method: .post, parameters: parameters)
            .response { response in
                switch response.result {
                case .success(let responseData):
                    if let data = responseData {
                        let responseString = String(data: data, encoding: .utf8)
                        print("Response: \(responseString ?? "")")
                    }
                case .failure(let error):
                    print("Error: \(error.localizedDescription)")
                }
            }
    }
}
let sample = Sample()
sample.performNetworkRequest()
	

import android.util.Log;
import okhttp3.*;
import java.io.IOException;

public class Sample {

    private static final OkHttpClient HTTP_CLIENT = new OkHttpClient.Builder().build();

    public static void performNetworkRequest() {
        MediaType mediaType = MediaType.parse("text/plain");
        RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
                .addFormDataPart("key", "M***********g")
                .addFormDataPart("secret", "3***********6")
                .addFormDataPart("invoiceCode", "3005")
                .addFormDataPart("invoiceNumber", "**************")
                .addFormDataPart("billingDate", "************")
                .addFormDataPart("totalAmount", "************")
                .addFormDataPart("checkCode", "************")
                .addFormDataPart("salesTaxNo", "*************")
                .addFormDataPart("orderNo", "************")

                .build();
        Request request = new Request.Builder()
                .url("https://netocr.com/verapi/v2/verInvoice.do")
                .method("POST", body)
                .build();

        HTTP_CLIENT.newCall(request).enqueue(new Callback() {
            @Override
            public void onFailure(Call call, IOException e) {
                Log.e("Sample", "Error: " + e.getMessage());
                // 处理请求失败情况
            }

            @Override
            public void onResponse(Call call, Response response) throws IOException {
                if (response.isSuccessful()) {
                    String responseData = response.body().string();
                    // 在这里处理响应结果
                    Log.d("Sample", "Response: " + responseData);
                } else {
                    Log.e("Sample", "Response code: " + response.code());
                    // 处理响应失败情况
                }
            }
        });
    }
}
	
查看详细API介绍

交易记录

请登录后体验

确定 取消