文档中心
API调试

功能描述

区块链发票验真。

请求URL

https://api.textin.com/ai/service/v1/blockchain_validate

HTTP请求方法

HTTP POST

请求头说明(Request Header)

请在HTTP请求中添加以下自定义Header。

header 名
x-ti-app-id 请登录后前往 “工作台-账号设置-开发者信息” 查看 x-ti-app-id
x-ti-secret-code 请登录后前往 “工作台-账号设置-开发者信息” 查看 x-ti-secret-code

请求体说明(Request Body)

Content-Type:application/json

{
    "invoice_code": "",
    "invoice_no": "",
    "invoice_date": "",
    "invoice_sum": "",
    "verify_code": ""
}

提示:Request Body 为 JSON字符串

字段 说明
invoice_code 必填,发票代码
invoice_no 必填,发票号码
invoice_date 必填,开票日期,形如20190203
invoice_sum 必填,不含税金额,如 23.45
verify_code 必填,校验码

响应公共参数

Key Type Description
success Boolean 接口调用成功或失败的标志,true:成功,false:失败
code int 平台的状态码,200为成功,30203为验真失败,失败原因详见errorResponse
requestId String 请求唯一标识
response Object 业务接口调用成功后返回的具体响应信息
errorResponse Object 错误响应信息
+ code String 调用失败后,返回的错误码
+ message String 调用失败后,返回的错误信息
+ subCode String 调用失败后,业务端返回的错误码(业务端返回错误码——详见【业务错误码】部分)
+ subMessage String 调用失败后,业务端返回的错误信息(业务端返回错误信息——详见【业务错误码】部分)

响应业务参数

字段名 中文含义 数据类型 数据长度
invoiceCode 发票代码 String 12
invoiceNo 发票号码 String 8
checkCode 校验码 String 5
billingDate 开票日期 String 10
txHash 交易哈希 String 100
amount 不含税总金额 BigDecimal 19
totalAmount 含税总金额 BigDecimal 19
taxAmount 税额 BigDecimal 19
sellerName 销方名称 String 100
sellerTaxpayerId 销方纳税人识别号 String 200
sellerAddress 销方地址 String 26
sellerPhone 销方电话 String 20
sellerBankInfo 销方开户银行名称 String 100
buyerAddress 购方地址 String 100
buyerPhone 购方电话 String 20
buyerName 购方名称 String 100
sellerBankAccount 销方开户银行账号 String 30
buyerTaxpayerId 购方纳税人识别号 String 20
buyerType 购买方类型 String 10
status 发票状态 String 10
checkedBy 复核人 String 20
reviewedBy 审核人 String 20
remark 开票备注 String 200
drawer 开票人 String 20
time 开票时间 String 20
platformCode 平台编码 String 50
platformName 平台名称 String 100
orderId 订单流水号 String 100
payId 支付流水号 String 100
digitPaymentSign 电子支付标识 String 10
invalidMark 是否作废 String 10
item 发票明细集合 List 2
+ code 货物或应税劳务、服务编码 String 100
+ name 货物或应税劳务、服务名称 String 100
+ subName 商品名称 String 100
+ specModel 规格型号 String 20
+ unit 计量单位 String 20
+ count 数量 Long 19
+ unitPrice 单价 BigDecimal 19
+ amount 金额 BigDecimal 19
+ taxFlag 含税标记 String 10
+ taxRate 税率 BigDecimal 19
+ taxAmount 税额 BigDecimal 19
+ taxPreferMark 是否享受税收优惠标识 Boolean 10
+ taxPreferDescrip 享受税收优惠的具体说明 String 500
+ zeroTaxRateMark 零税率标识 String 10
+ deduction 差额开票时,从总额中扣除的金额 BigDecimal 19

业务错误码

名称 错误描述
MGBC_S000 执行成功
MGBC_S001 系统异常
MGBC_P002 税号长度不正确
MGBC_P003 发票代码不能为空
MGBC_P004 发票代码格式不正确
MGBC_P005 发票号码不能为空
MGBC_P006 发票号码格式不正确
MGBC_P007 开票日期不能为空
MGBC_P008 开票日期格式不正确
MGBC_P009 校验码不能为空
MGBC_P010 校验码格式不正确
MGBC_P011 不含税金额不能为空
MGBC_P012 不含税金额格式不正确
MGBC_P013 appKey不能为空
MGBC_P014 租户ID不能为空
MGBC_P016 请求来源不正确
MGBC_B050 %s地区已被熔断,请稍后重试
MGBC_B051 %s租户已被熔断,请稍后重试
MGBC_B052 %s税号已被熔断,请稍后重试
MGBC_B053 该发票当天已经查验超过%s次,请明天再试
MGBC_B054 该发票查验处理中,请勿重复请求
MGBC_B055 查验失败,发票不存在
MGBC_B056 当前地区%s查验繁忙,请稍后重试
MGBC_B057 当前地区%s暂不支持查验
MGBC_B058 %s局端服务异常,请稍后重试

响应示例

成功的返回示例

{
    "code":200,
    "requestId":"61ee2876-34ac-40a7-b0dc-2c8c04daba0e",
    "response":{
        "orderId":"6678122204544286668",
        "payId":"",
        "item":[
            {
                "count":1,
                "unitPrice":33.98,
                "deduction":0,
                "taxAmount":1.02,
                "name":"运输服务",
                "subName":"车票",
                "amount":33.98,
                "code":"3010101020102000000",
                "specModel":"车票",
                "taxPreferMark":false,
                "taxFlag":"0",
                "unit":"张",
                "taxPreferDescrip":"",
                "zeroTaxRateMark":"0",
                "taxRate":0.03
            }
        ],
        "txHash":"00440******5398f",
        "invalidMark":"0",
        "sellerName":"深圳市***有限公司",
        "sellerTaxpayerId":"91440300708454972X",
        "sellerAddress":"深圳市宝安区***物流园区二期B楼",
        "sellerPhone":"23456534",
        "invoiceCode":"144032009110",
        "sellerBankInfo":"中国银行***支行",
        "sellerBankAccount":"756261198186",
        "buyerTaxpayerId":"91440300MA5F2W1X41",
        "billingDate":"2020-06-15",
        "buyerName":"上海***信息科技有限公司",
        "buyerAddress":"",
        "buyerPhone":"",
        "totalAmount":35,
        "buyerType":"2",
        "taxAmount":1.02,
        "checkedBy":"张**",
        "checkCode":"5398f",
        "amount":33.98,
        "reviewedBy":"韩**",
        "remark":"",
        "drawer":"杨**",
        "time":"2020-06-15 10:33:27",
        "platformCode":"",
        "status":"1",
        "platformName":"",
        "invoiceNo":"09173193"
    },
    "success":true
}

失败的返回示例

{
    "errorResponse":{
        "message":"远程服务错误",
        "subMessage":"该发票当天已经查验超过10次,请明天再试",
        "subCode":"MGBC_B053",
        "code":100006
    },
    "requestId":"d1e99527-d5a5-4a49-b236-b4fbfe3d200a",
    "success":false,
    "code":30203
}

错误码说明

错误码 描述
40101 x-ti-app-id 或 x-ti-secret-code 为空
40102 x-ti-app-id 或 x-ti-secret-code 无效,验证失败
40103 客户端IP不在白名单
40003 余额不足,请充值后再使用
40004 参数错误,请查看技术文档,检查传参
40007 机器人不存在或未发布
40008 机器人未开通,请至市场开通后重试
40301 图片类型不支持
40302 上传文件大小不符,文件大小不超过 10M
40303 文件类型不支持
40304 图片尺寸不符,图像宽高须介于 20 和 10000(像素)之间
40305 识别文件未上传
30203 基础服务故障,请稍后重试
500 服务器内部错误
官方社群
体验中心

联系我们