发票OCR识别
请求Header:
名称 | 值 | |
---|---|---|
Content-Type | application/x-www-form-urlencoded |
请求参数说明:
名称 | 必填 | 类型 | 说明 | |
---|---|---|---|---|
key | 是 | string | 在个人中心->我的数据,接口名称上方查看 | |
imageData | 否 | string | 发票图片 Base64 数据,最大不能超过5MB(imageData,imageUrl,imageFile三选一) | |
imageUrl | 否 | string | 发票图片链接(imageData,imageUrl,imageFile三选一) | |
imageFile | 否 | MultipartFile | 上传图片(imageData,imageUrl,imageFile三选一) |
请求代码示例:
curl -k -i -d "key=key&imageData=&imageUrl=&imageFile=" "https://apis.juhe.cn/fp_ocr/verify"
返回参数说明:
名称 | 类型 | 说明 | |
---|---|---|---|
reason | string | 原因 | |
error_code | int | 错误码(0表示成功) | |
result | jsonObject | 结果集 | |
result.orderid | string | 流水号 | |
result.data | jsonObject | 发票信息相关字段,参考发票结构说明发票类型>,发票识别字段说明> | |
JSON返回示例:JSON在线格式化工具 >
//增值税专用发票识别成功返回结果
{
"reason": "成功",
"result":{
"orderid": "JH767202306191439238714",
"data":{
"title":"北京增值税专用发票", --标题
"jdfpdm":"11******30", --机打发票代码
"jdfphm":"51****40", --机打发票号码
"fplc":"抵扣联", --发票联次
"fplcNum":"第二联", --发票是第几联
"province":"北京市", --省份
"city":"", --城市
"qrcode":["********************"], --二维码
"barcode":["********************"], --条码
"xfsbh":"9111*********40XR",
"company_seal":"1",
"gfmc":"****科技(北京)有限公司",
"gmfyhzh":"招商银行1109*******0902",
"xsfdzdh":"北京市**区**门外大街**号*层4016***8898",
"se":1698.11,
"skm":"0390-1010+2/0*7-39-+87079*94,797+<2*8-466+19>3<5/19745207,2*0-+38>8-<5/*0471><4974+127,+/>710670601--8203618281-198",
"kprq":"2016-11-01 00:00:00",
"bz":"",
"imageSize":"1279,786",
"skr":"管理员",
"sbbh":"499922291823",
"gfsbh":"1101*******9631",
"fpdm":"11******30",
"fplx":"01",
"kpr":"管理员",
"fhr":"管理员",
"fpxflx":"服务", --发票消费类型
"gmfdzdh":"北京市**区**园内的**大学学研综合楼*层B903-0****0-82****50",
"xsfyhzh":"建行北京市**支行营业部1100************7384",
"jd":0,
"jshj":30000,
"page":0,
"je":28301.89,
"xfmc":"北京******有限公司",
"hwxx":[
{
"ggxh":"",
"jldw":"",
"dj":"28301.8867924",
"se":1698.11,
"ysse":"1698.11",
"mc":"其他现代服务",
"sl":"1",
"je":28301.89,
"slv":0.06,
"ysslv":"6%"
}
],
"fphm":"51****40",
"jym":""
}
},
"error_code": 0
}
//增值税电子普通发票识别成功返回结果
{
"reason": "成功",
"result":{
"orderid": "JH767202306191439238714",
"imageUrl":"https://image.*****.com/invoice/2022/01/13/60a4b6071dc9f278ea833f44/61df*****************fe00.pdf" --参数imageUrl,传图片链接方式才会返回该字段
"data":{
"xfsbh":"9144***********6084",
"company_seal":"1", -- 是否有公司印章(0:没有;1:有)
"gfmc":"西陇*****公司",
"tspzDm":"06",
"xsfdzdh":"广东省********大马路10号之一首层自编G号020-82373038",
"se":3.84,
"skm":"03<45-2*94-033/575>+61-2->0>,93>5***329-58*****882>0/-3-,+29+*7*+07<1<35>10/>14<>/6<+,0/<748<+0401/5681921-458*<88",
"kprq":"2022-01-06 00:00:00",
"bz":"汇总开具",
"skr":"黄*芬",
"sbbh":"499099656856",
"gfsbh":"9144************168R",
"fpdm":"0440****0112",
"fplx":"14",
"kpr":"徐*丹",
"fhr":"黄*芬",
"fpxflx":"交通", --发票消费类型
"xsfyhzh":"中国银行虎门支行7250****3788",
"jd":0,
"jshj":131.88,
"je":128.04,
"xfmc":"广深珠****有限公司",
"fphm":"07****01",
"jym":"11460***********3162",
"page":0, --页码
"imageSize":"1220,788", --当前页尺寸大小
"hwxx":[
{
"ggxh":"粤STN**9",
"jldw":"客车",
"dj":"20211230",
"se":3.84,
"ysse":"3.84",
"mc":"*经营租赁*通行费",
"sl":"20211202",
"je":128.04,
"slv":0.03,
"ysslv":"3%"
}
]
}
}
},
"error_code": 0
}
//增值税电子专用发票识别成功返回结果
{
"reason": "成功",
"result":{
"orderid": "JH767202306191439238714",
"data":{
"xfsbh":"913*******E80",
"company_seal":"0", -- 是否有公司印章(0:没有;1:有)
"gfmc":"青岛*********股份有限公司",
"gmfyhzh":"中国银行青岛******2364****9478",
"xsfdzdh":"青岛市*******168号13A层13A03室-53053*****578",
"se":29.7,
"skm":"0060-98-6<+++*-/-819930*7358,>4*1724+07688>0-8>-335+*2/8-,5+4496>*3*55*623-+7****451/0,*+0-/98<5+6>>10***571+3983>/",
"kprq":"2021-12-17 00:00:00",
"bz":"",
"skr":"高*红",
"sbbh":"9170*****38248",
"gfsbh":"9137*******8945R",
"fpdm":"0370****0213",
"fplx":"08",
"kpr":"曲*",
"fhr":"吕*霖",
"gmfdzdh":"青岛市城*****10号 0532-8*****238",
"fpxflx":"服务", --发票消费类型
"xsfyhzh":"青岛银行**支行80202******0357",
"jd":0,
"jshj":3000,
"je":2970.3,
"xfmc":"青岛中*******有限公司",
"hwxx":[
{
"ggxh":"",
"jldw":"",
"dj":"2970.29702970297",
"se":29.7,
"ysse":"29.70",
"mc":"*经纪代理服务*知识产权服务费",
"sl":"1",
"je":2970.3,
"slv":0.01,
"ysslv":"1%"
}
],
"fphm":"00****72",
"jym":"0327***********4792"
}, "imageUrl":"https://image.*********.com/invoice/2022/01/14/616e37e5630f2041fe4ba8a1/***********.png" -- 参数imageUrl,传图片链接方式才会返回该字段
}
},
"error_code": 0
}
//定额发票识别成功返回结果
{
"reason": "成功",
"result":{
"orderid": "JH767202306191439238714",
"data":{
"fpdm":"1510****E001", --发票代码
"company_seal":"1", -- 是否有公司印章(0:没有;1:有)
"fpxflx":"餐饮", --发票消费类型
"fplx":"801", --发票类型
"jd":0, --旋转角度
"je":20, --金额
"page":0, --页码
"imageSize":"3024,4032", --当前页尺寸大小
"xfmc":"***市物边***餐饮店", --销方名称
"xfsbh":"9251**********F11R", --销方税号
"fphm":"04****02" --发票号码
},
"success":true,
"imageUrl":"https://image.fenbeitong.com/invoice/2022/01/14/61249dcb6f933a7e7109d8e9/61e0f1f0531b2e1a2fb19be4.jpg" -- 参数imageUrl,传图片链接方式才会返回该字段
}
},
"error_code": 0
}
//机打发票返回示例
{
"reason": "成功",
"result":{
"orderid": "JH767202306191439238714",
"data":{
"xfsbh":"41122********9551501",
"company_seal":"1",
"gfmc":"洛阳市***纪委",
"kprq":"2017-11-30 00:00:00",
"gfsbh":"",
"fpdm":"1410****0043",
"fplx":"903", --发票类型
"fpxflx":"办公", --发票消费类型
"jshj":6200,
"jd":0,
"page":0, --页码
"imageSize":"3264,1708", --当前页尺寸大小
"xfmc":"洛阳市******电脑商行",
"hwxx":[
{
"jldw":"套",
"mc":"戴尔****电脑",
"sl":"1"
},
{
"jldw":"台",
"mc":"惠*打印机",
"dj":"3500.00",
"sl":"1",
"je":3500
},
{
"mc":"",
"dj":"2700.00",
"je":2700
}
],
"fphm":"00****93",
"jym":""
}
},
"error_code": 0
}
//全电发票(普通发票)
{
"reason": "成功",
"result":{
"orderid": "JH767202306191439238714",
"data":{
"xfsbh":"9131*********DL2G", --销售方识别号
"company_seal":"0", --是否有公司印章(0:没有;1:有)
"gfmc":"上海**信息技术有限公司", --购买方名称
"jzdw":"国家税务总局", --监制单位
"jshj":1000, --价税合计
"jshjcn":"壹仟元整", --价税合计(中文大写)
"se":56.6, --税额
"kprq":"2021-12-20 00:00:00", --开票日期
"bz":"", --备注
"imageSize":"1190,1684", --当前页尺寸大小
"skr":"", --收款人
"gfsbh":"9131*********189Q", --购买方识别号
"fpdm":"", --发票代码(全电发票无发票代码)
"fplx":"0910", --发票类型
"kpr":"祝*", --开票人
"fpbt":"电子发票普通发票", --发票标题
"fwlx":"信息技术服务", --服务类型
"fhr":"", --复核人
"xmmc":"*信息技术服务*技术服务费", --项目名称
"fpxflx":"服务", --发票消费类型
"jd":0, --旋转角度
"page":0, --页码
"je":943.4, --金额
"xfmc":"企享云服(上海)信息有限公司", --销售方名称
"xsfyz":"0", --是否有销售方(章)标记(0:没有;1:有)
"hwxx":[
{
"ggxh":"", --规格型号
"jldw":"", --计量单位
"dj":"943.39622642", --单价
"se":56.6, --税额
"ysse":"56.60", --原始税额
"mc":"*信息技术服务*技术服务费", --名称
"sl":"1", --数量
"je":943.4, --金额
"slv":0.06, --税率
"ysslv":"6%" --原始税率
}
],
"fphm":"2131************0064", --发票号码
"jym":"" --校验码
}
},
"error_code": 0
}
//全电发票(增值税专用发票)
{
"reason": "成功",
"result":{
"orderid": "JH767202306191439238714",
"data":{
"xfsbh":"9131*********281C", --销售方识别号
"company_seal":"0", --是否有公司印章(0:没有;1:有)
"gfmc":"***商务有限公司", --购买方名称
"jzdw":"国家税务总局", --监制单位
"jshj":1129.99, --价税合计
"jshjcn":"壹仟壹佰贰拾玖圆玖角玖分", --价税合计(中文大写)
"se":130, --税额
"kprq":"2021-12-01 00:00:00", --开票日期
"bz":"", --备注
"imageSize":"887,595", --当前页尺寸大小
"skr":"", --收款人
"gfsbh":"9131**********632G", --购买方识别号
"fpdm":"", --发票代码
"fplx":"0920", --发票类型
"kpr":"沈**", --开票人
"fpbt":"电子发票(增值税专用发票)", --发票标题
"fwlx":"纸制品", --服务类型
"fhr":"", --复核人
"xmmc":"*纸制品*积点卡", --项目名称
"fpxflx":"日用", --发票消费类型
"jd":0, --旋转角度
"page":0, --页码
"je":999.99, --金额
"xfmc":"上海**商贸有限公司", --销售方名称
"xsfyz":"0", --是否有销售方(章)标记(0:没有;1:有)
"hwxx":[
{
"ggxh":"", --规格型号
"jldw":"张", --计量单位
"dj":"0.3185841000", --单价
"se":130, --税额
"ysse":"130.00", --原始税额
"mc":"*纸制品*积点卡", --名称
"sl":"3138.857212", --数量
"je":999.99, --金额
"slv":1.39, --税率
"ysslv":"139" --原始税率
}
],
"fphm":"2131**************1061", --发票号码
"jym":"" --校验码
}
},
"error_code": 0
}
//全电发票明细为多页时识别成功返回报文
{
"reason": "成功",
"result":{
"orderid": "JH767202306191439238714",
"imageUrl": "http://tu.92086.top/i/2023/04/13/sj9wm6.pdf",
"type": null,
"single": false,
"ylpj": null,
"success": true,
"code": null,
"message": null,
"data": null,
"datas": [
{
"fplx": "0920",
"jd": 0,
"wz": "0,0,595,842",
"fpxflx": "电器",
"fwlx": "家用厨房电器具",
"company_seal": "0",
"imageSize": "595,842",
"page": 0,
"title": "电子发票(增值税专用发票)",
"jzdw": "国家税务总局",
"province": "",
"city": "",
"qrcode": [
"01,31, ,23312000000007781965,21573.75,20230316, ,BCA9"
],
"fpdm": "",
"fphm": "23312000000007781965",
"kprq": "2023-03-16 00:00:00",
"jym": "",
"xfsbh": "91310113MA1GMT8R4G",
"xfmc": "上海斐溢智能科技有限公司",
"gfsbh": "91310000734574775Q",
"gfmc": "西域智慧供应链(上海)股份公司",
"je": 19091.81,
"se": 2481.94,
"jshjcn": "",
"bz": "",
"kpr": "袁程程",
"skr": "",
"fhr": "",
"hwxx": [
{
"mc": "*家用美容保健电器*SKG颈椎按摩仪",
"ggxh": "4098时尚款",
"sl": "1",
"jldw": "个",
"dj": "175.221238938053",
"je": 175.22,
"slv": 0.13,
"ysslv": "13%",
"se": 22.78,
"ysse": "22.78"
},
{
"mc": "*家用美容保健电器*SKG颈椎按摩器",
"ggxh": "4098时尚款",
"sl": "1",
"jldw": "个",
"dj": "181.41592920354",
"je": 181.42,
"slv": 0.13,
"ysslv": "13%",
"se": 23.58,
"ysse": "23.58"
},
{
"mc": "*空调*奥克斯加湿器",
"ggxh": "AJ-H808T",
"sl": "1",
"jldw": "台",
"dj": "173.451327433628",
"je": 173.45,
"slv": 0.13,
"ysslv": "13%",
"se": 22.55,
"ysse": "22.55"
},
{
"mc": "*家用厨房电器具*长虹电热水壶CSH-16D01",
"ggxh": "CSH-16D01",
"sl": "1",
"jldw": "台",
"dj": "64.6017699115044",
"je": 64.6,
"slv": 0.13,
"ysslv": "13%",
"se": 8.4,
"ysse": "8.40"
},
{
"mc": "*家用通风电器具*先锋电风扇",
"ggxh": "DD1605",
"sl": "2",
"jldw": "台",
"dj": "202.654867256637",
"je": 405.31,
"slv": 0.13,
"ysslv": "13%",
"se": 52.69,
"ysse": "52.69"
},
{
"mc": "*家用通风电器具*先锋电风扇",
"ggxh": "DD2102R",
"sl": "1",
"jldw": "台",
"dj": "164.601769911504",
"je": 164.6,
"slv": 0.13,
"ysslv": "13%",
"se": 21.4,
"ysse": "21.40"
},
{
"mc": "*家用电热电力器*先锋取暖器",
"ggxh": "DS1555",
"sl": "20",
"jldw": "台",
"dj": "521.238938053097",
"je": 10424.78,
"slv": 0.13,
"ysslv": "13%",
"se": 1355.22,
"ysse": "1355.22"
},
{
"mc": "*家用美容保健电器*SKG颈椎按摩仪",
"ggxh": "K3-1T",
"sl": "10",
"jldw": "台",
"dj": "141.592920353982",
"je": 1415.93,
"slv": 0.13,
"ysslv": "13%",
"se": 184.07,
"ysse": "184.07"
},
{
"mc": "*家用厨房电器具*龙的电陶炉LD-DTL207C",
"ggxh": "LD-DTL207C",
"sl": "2",
"jldw": "台",
"dj": "132.743362831858",
"je": 265.49,
"slv": 0.13,
"ysslv": "13%",
"se": 34.51,
"ysse": "34.51"
},
{
"mc": "*家用厨房电器具*龙的原汁机",
"ggxh": "LD-GZ25A",
"sl": "1",
"jldw": "台",
"dj": "141.371681415929",
"je": 141.37,
"slv": 0.13,
"ysslv": "13%",
"se": 18.38,
"ysse": "18.38"
},
{
"mc": "*家用厨房电器具*龙的涮烤一体电火锅",
"ggxh": "LD-HG150C",
"sl": "6",
"jldw": "台",
"dj": "116.814159292035",
"je": 700.88,
"slv": 0.13,
"ysslv": "13%",
"se": 91.12,
"ysse": "91.12"
},
{
"mc": "*家用厨房电器具*龙的鸳鸯电火锅",
"ggxh": "LD-HG5030",
"sl": "1",
"jldw": "台",
"dj": "138.053097345133",
"je": 138.05,
"slv": 0.13,
"ysslv": "13%",
"se": 17.95,
"ysse": "17.95"
},
{
"mc": "*家用厨房电器具*龙的烤箱",
"ggxh": "LD-KX201A",
"sl": "1",
"jldw": "台",
"dj": "208.849557522124",
"je": 208.85,
"slv": 0.13,
"ysslv": "13%",
"se": 27.15,
"ysse": "27.15"
},
{
"mc": "*家用厨房电器具*龙的电水壶",
"ggxh": "LD-SH1850",
"sl": "3",
"jldw": "台",
"dj": "64.6017699115044",
"je": 193.81,
"slv": 0.13,
"ysslv": "13%",
"se": 25.19,
"ysse": "25.19"
},
{
"mc": "*家用厨房电器具*龙的煮茶器",
"ggxh": "LD-ZC081A",
"sl": "1",
"jldw": "台",
"dj": "164.601769911504",
"je": 164.6,
"slv": 0.13,
"ysslv": "13%",
"se": 21.4,
"ysse": "21.40"
},
{
"mc": "*家用清洁电器具*莱克吸尘器",
"ggxh": "S1025",
"sl": "2",
"jldw": "台",
"dj": "203.53982300885",
"je": 407.08,
"slv": 0.13,
"ysslv": "13%",
"se": 52.92,
"ysse": "52.92"
},
{
"mc": "*家用厨房电器具*苏泊尔电热水瓶",
"ggxh": "SW-50S56A",
"sl": "6",
"jldw": "台",
"dj": "215.044247787611",
"je": 1290.27,
"slv": 0.13,
"ysslv": "13%",
"se": 167.73,
"ysse": "167.73"
},
{
"mc": "*家用厨房电器具*苏泊尔电热水瓶SW-50S56A5L容量电水壶多段温控电热水壶304不锈刚保温除氯烧水壶",
"ggxh": "SW-50S56A",
"sl": "1",
"jldw": "台",
"dj": "215.044247787611",
"je": 215.04,
"slv": 0.13,
"ysslv": "13%",
"se": 27.96,
"ysse": "27.96"
},
{
"mc": "*家用厨房电器具*苏泊尔电水壶",
"ggxh": "SW-50S56A",
"sl": "1",
"jldw": "台",
"dj": "215.044247787611",
"je": 215.04,
"slv": 0.13,
"ysslv": "13%",
"se": 27.96,
"ysse": "27.96"
},
{
"mc": "*家用厨房电器具*苏泊尔电水壶",
"ggxh": "SWF17S26A",
"sl": "9",
"jldw": "台",
"dj": "94.6902654867257",
"je": 852.21,
"slv": 0.13,
"ysslv": "13%",
"se": 110.79,
"ysse": "110.79"
},
{
"mc": "*家用清洁电器具*莱克除",
"ggxh": "WB73",
"sl": "2",
"jldw": "台",
"dj": "646.902654867257",
"je": 1293.81,
"slv": 0.13,
"ysslv": "13%",
"se": 168.19,
"ysse": "168.19"
}
],
"pageCount": "2",
"pageNumber": "1"
},
{
"fplx": "0920",
"jd": 0,
"wz": "0,0,595,397",
"fpxflx": "其他",
"fwlx": "",
"company_seal": "0",
"imageSize": "595,397",
"page": 1,
"title": "电子发票(增值税专用发票)",
"jzdw": "国家税务总局",
"province": "",
"city": "",
"qrcode": [
"01,31, ,23312000000007781965,21573.75,20230316, ,BCA9"
],
"fpdm": "",
"fphm": "23312000000007781965",
"kprq": "2023-03-16 00:00:00",
"jym": "",
"xfsbh": "91310113MA1GMT8R4G",
"xfmc": "上海斐溢智能科技有限公司",
"gfsbh": "91310000734574775Q",
"gfmc": "西域智慧供应链(上海)股份公司",
"je": 19091.81,
"se": 2481.94,
"jshj": 21573.75,
"jshjcn": "贰万壹仟伍佰柒拾叁圆柒角伍分",
"bz": "PO详见附件",
"kpr": "袁程程",
"skr": "",
"fhr": "",
"pageCount": "2",
"pageNumber": "2"
}
]
}
},
"error_code": 0
}
服务级错误码参照(error_code):
错误码 | 说明 |
---|
系统级错误码参照:
错误码 | 说明 | 旧版本(resultcode) | |
---|---|---|---|
10001 | 错误的请求KEY | 101 | |
10002 | 该KEY无请求权限 | 102 | |
10003 | KEY过期 | 103 | |
10004 | 错误的OPENID | 104 | |
10005 | 应用未审核超时,请提交认证 | 105 | |
10007 | 未知的请求源 | 107 | |
10008 | 被禁止的IP | 108 | |
10009 | 被禁止的KEY | 109 | |
10011 | 当前IP请求超过限制 | 111 | |
10012 | 请求超过次数限制 | 112 | |
10013 | 测试KEY超过请求限制 | 113 | |
10014 | 系统内部异常(调用充值类业务时,请务必联系客服或通过订单查询接口检测订单,避免造成损失) | 114 | |
10020 | 接口维护 | 120 | |
10021 | 接口停用 | 121 |
错误码格式说明(示例:200201):
2 | 002 | 01 | |
---|---|---|---|
服务级错误(1为系统级错误) | 服务模块代码(即数据ID) | 具体错误代码 |