发票查验服务

翔云发票验真服务接口,实时联网核验发票真伪,查验一致返回全票面信息,支持核验增值税发票管理系统开具发票的真伪,支持发票的批量查验,当日开具发票当日可查,结合发票识别接口支持自动识别发票信息核验,支持手动录入核验,助您摆脱手动录入繁琐,提升工作效率

标准化HTTP、WebService服务接口,适用于财务、电商、税务、审计等需要对发票进行真伪核验的应用场景

购买API 票据管理系统

产品体验

剩余条数:0

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

*

* *

开始核验...

API文档

接口说明
接口地址: https://netocr.com/verapi/v2/verInvoice.do
接口调用方法: post
接口接收参数:
序号 名称 类型 必填 说明
1 key String 用户ocrKey
2 secret String 用户ocrSecrert
3 invoiceCode String 发票代码
4 invoiceNumber String 发票号码
5 billingDate String 开票日期:YYYY-MM-DD (非区块链发票必填)
6 totalAmount String 合计金额(不含税),必须精确到两位小数(专票、货运专票、机动车专票必填)
价税合计(全电票、航空运输电子客票行程单、铁路电子客票)
7 checkCode String 校验码后6位(普票、电子普票、卷式普票,必填),校验码(区块链必填),全电发票号码后6位(全电纸票(普通发票))
8 salesTaxNo String 销方税号(区块链必填)
9 orderNo String 订单号(通用电子发票必填)
9 typeId Integer 发票验真:3007
接口返回值参数说明:
序号 名称 类型 说明
1 invoiceType String

发票类型
增值税专用发票                           01
货运运输业增值税专用发票                      02
机动车销售统一发票                                03
增值税普通发票                                       04
增值税专用发票(电子)                         08
电子发票(增值税专用发票)                      09
增值税普通发票(电子)                         10
增值税普通发票(卷式)                         11
增值税普通发票(通行费)                      14
二手车统一销售发票                                15
区块链发票                                              21
通用电子发票                                           36
电子发票(航空运输电子客票行程单)      61
电子发票(铁路电子客票)                      62
电子发票(普通发票)                                 83
全电纸票(增值税专用发票)                     91
全电纸票(普通发票)                                  92
全电纸票(机动车销售统一发票)                  93
全电纸票(二手车销售统一发票)                  94

2 administrativeDivisionName String 所属行政区名称
3 invoiceCode String 发票代码
4 invoiceNumber String 发票号码
5 billingDate String 开票日期:YYYY-MM-DD
6 purchaserName String 购方名称
7 purchaserTaxNo String 购方税号
8 purchaserBank String 购方开户行账户
9 purchaserAddressPhone String 购方地址电话
10 salesName String 销方名称
11 salesTaxNo String 销方税号
12 salesAddressPhone String 销方地址电话
13 salesBank String 销方开户行账户
14 totalAmount String 合计金额
15 totalTax String 合计税额
16 amountTax String 价税合计
17 amountTaxCN String 价税合计_中文
18 remarks String 备注
19 machineCode String 机器编码
20 checkCode String 校验码
21 state String 发票状态
未作废 1
作废  2
红冲  3
部分红冲  7
全额红冲       8
22 invoiceLists String 发票详细信息列表
23 commodityCode String 税务编码
24 commodityName String 货物或应税劳务名称
25 specificationModel String 规格型号
26 unit String 单位
27 quantity String 数量
28 unitPrice String 单价
29 amount String 金额
30 taxRate String 税率
31 tax String 税额
32 carrierName String 承运人名称
33 carrierTaxNo String 承运人识别号
34 draweeName String 受票方名称
35 draweeTaxNo String 受票方识别号
36 cargoInformation String 运输货物信息
37 transportRoute String 起运地、经由、到达地
38 machineCode String 税控盘号
39 automobileType String 车种车号
40 tonnage String 车船吨位
41 taxAuthorityNo String 主管税务机关
42 taxAuthorityName String 主管税务名称
43 remarks String 备注
44 iDCardNo String 身份证号码/组织机构代码
45 purchaserTaxNo String 购方税号
46 vehicleType String 车辆类型
47 brandModel String 厂牌型号
48 originPlace String 产地
49 certificateNo String 合格证号
50 inspectionListNo String 商检单号
51 engineNo String 发动机号
52 vehicleNo String 车辆识别代号/车架号码
53 importCertificateNo String 进口证明书号
54 salesPhone String 销方地址电话
55 salesTaxNo String 销方税号
56 salesBankNo String 账号
57 salesAddress String 销方地址
58 paymentVoucherNo String 完税凭证号码
59 passengersLimited String 限乘人数
60 commodityName String 项目名称
61 plateNo String 车牌号
62 type String 类型
63 trafficDateStart String 通行日期起
64 trafficDateEnd String 通行日期止
65 receivingClerk String 收款员
66 auctionAddress String 经营,拍卖单位地址
67 auctionName String 经营,拍卖单位
68 auctionPhone String 经营,拍卖单位电话
69 auctionTaxNo String 经营,拍卖单位纳税人识别号
70 auctionbank String 开户银行及账号
71 carNumber String 车牌照号
72 purchaserAddress String 买方单位/个人住址
73 purchaserPhone String 买方电话
74 registrationNumber String 登记证号
75 totalPrice String 车价合计
76 totalPriceCN String 车价合计大写
77 usedCarAddress String 二手车市场地址
78 usedCarName String 二手车市场
79 vehiclePlaceName String 转入地车辆车管所名称
80 usedCarPhone String 二手车市场电话
81 usedCarTaxNo String 二手车市场纳税人识别号
82 usedCarbank String 二手车市场开户银行及账号
83 administrativeDivisionName String 所属行政区名称
84 checkNum String 查验次数
85 collectionUser String 取票用户
86 payInfo String 支付信息
87 merchantNo String 商户号
88 orderNo String 订单号
89 drawerName String 开票人
90 receiverName String 收款人
91 recheckName String 复核
92 name String 乘客姓名
93 userCardNo String 乘客证件号码
94 eticketNumber String 电子客票号码
95 deductSign String 抵扣标记
96 internationalFlag String 国内国际标识
97 gpBillNo String GP单号
98 leg String 航段
99 from String 出发地
100 to String 到达地
101 flightNumber String 航班号
102 date String 日期
103 time String 时间
104 seat String 座位类型
105 carrier String 承运人
106 fareBasis String 客票级别
107 billingTime String 开票时间
108 ticketType String 票种
109 trainNumber String 车次
110 seatNumber String 席位
111 airSign String 空调特征
112 ridingDate String 乘车日期
113 carriageNumber String 车厢
114 businessType String 业务类型
状态码说明:
status code message
0 成功(发票一致)(扣费)
-30000 该票今日本平台核验失败已超5次(扣费)
-30001 不一致,金额或校验码错误(扣费)
-30002 所查发票不存在(扣费)
-30003 超过该张票当天查验次数(请于次日再次查验)
-30009 已超过最大查验量
-30004 查询发票不规范
-30010 查验异常
-30005 参数不能为空
-30008 参数长度不正确
-30006 日期当天的不能查验
-30007 超过五年的不能查验
-30017 参数异常
-30014 接口异常
示例代码
  • 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","3007")
		  .addFormDataPart("invoiceCode","********")
		  .addFormDataPart("invoiceNumber","*******")
		  .addFormDataPart("billingDate","********")
		  .addFormDataPart("totalAmount","*******")
		  .addFormDataPart("salesTaxNo","*********")
		  .addFormDataPart("checkCode","*******")
		  .addFormDataPart("orderNo","**********")
		  .build();
		Request request = new Request.Builder()
		  .url("https://netocr.com/verapi/v2/verInvoice.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/verInvoice.do"

    payload = {
    'key': 'M***********g',
    'secret': '3***********6',
    'typeId': '3007',
    'invoiceCode': '*********',
    'invoiceNumber': '*********',
    'billingDate': '********',
    'totalAmount': '**************',
    'checkCode': '*******',
    'salesTaxNo': '******',
    'orderNo': '******'
	}
    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", "3007");
form.append("invoiceCode", "*********");
form.append("invoiceNumber", "*******");
form.append("billingDate", "******");
form.append("totalAmount", "********");
form.append("checkCode", "**********");
form.append("salesTaxNo", "***********");
form.append("orderNo", "********");



var settings = {
 "url": "https://netocr.com/verapi/v2/verInvoice.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/verInvoice.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' => '3007','invoiceCode' => '*******','invoiceNumber' => '**********','billingDate' => '********','totalAmount' => '*************','checkCode' => '*********','salesTaxNo' => '*********','orderNo' => '*********'),

		));
		$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/verInvoice.do");
var content = new MultipartFormDataContent();
content.Add(new StringContent("M***********g"), "key");
content.Add(new StringContent("3***********6"), "secret");
content.Add(new StringContent("3007"), "typeId");
content.Add(new StringContent("*******"), "invoiceCode");
content.Add(new StringContent("*********"), "invoiceNumber");
content.Add(new StringContent("*********"), "billingDate");
content.Add(new StringContent("*********"), "totalAmount");
content.Add(new StringContent("*********"), "checkCode");
content.Add(new StringContent("*********"), "salesTaxNo");
content.Add(new StringContent("***********"), "orderNo");

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("3007")));
    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("totalAmount")), web::http::value(U("*********")));
    content.add(web::http::name(U("checkCode")), web::http::value(U("***********")));
    content.add(web::http::name(U("salesTaxNo")), web::http::value(U("*************")));
    content.add(web::http::name(U("orderNo")), 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/verInvoice.do"
    method := "POST"

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

    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/verInvoice.do',
   'headers': {
   },
   formData: {
     'key': 'M***********g',
     'secret': '3***********6',
     'typeId': '3007',
     'invoiceCode': '***********',
     'invoiceNumber': '************',
     'billingDate': '**************',
     'totalAmount': '************',
     'checkCode': '***********',
     'salesTaxNo': '***********',
     'orderNo': '***********'

   }
};
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": "3007",
            "invoiceCode": "***********",
            "invoiceNumber": "**************",
            "billingDate": "************",
            "totalAmount": "************",
            "checkCode": "**********",
            "salesTaxNo": "**********",
            "orderNo": "**********"


        ]

        AF.request("https://netocr.com/verapi/v2/verInvoice.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介绍

交易记录

请登录后体验

确定 取消