| 参数名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
| pic | file/string | 是 | 发票图片文件 POST上传,支持传base64格式的图片内容 JPG识别率略高 最大300K |
| 参数名称 | 类型 | 说明 |
|---|---|---|
| number | string | 发票号码 |
| seller | string | 销售方名称 |
| itemlist | string | 货物、服务列表 |
| taxrate | string | 税率 |
| taxfee | string | 税额 |
| num | string | 数量 |
| unit | string | 单位 |
| price | string | 单价 |
| name | string | 名称 |
| sellerbank | string | 销售方开户行 |
| checker | string | 复核人 |
| extaxtotalfee | string | 金额合计 |
| date | string | 开票日期 |
| buyer | string | 购买方名称 |
| buyerbank | string | 购买方开户行 |
| remark | string | 备注 |
| password | string | 密码 |
| selleraddress | string | 销售方地址 |
| buyeraddress | string | 购买方地址 |
| code | string | 发票代码 |
| payee | string | 收款人 |
| buyercreditno | string | 购买方识别号 |
| drawer | string | 开票人 |
| totalfeecn | string | 价税合计大写 |
| totalfee | string | 价税合计 |
| totaltax | string | 税额合计 |
| type | string | 发票类型 |
| sellercreditno | string | 销售方识别号 |
| checkcode | string | 校验码 |
<?php
require_once 'curl.func.php';
$appkey = 'your_appkey_here';//你的appkey
$url = "https://api.jisuepc.com/invoicerecognition/recognize?appkey=$appkey";
$post = array(
'pic'=>base64_encode(file_get_contents('timg.jpg')),
);
$result = curlOpen($url, array('post'=>$post, 'isupfile'=>true));
$jsonarr = json_decode($result, true);
if($jsonarr['status'] != 0)
{
echo $jsonarr['msg'];
exit();
}
$data = $jsonarr['result'];
print_r($data);
{
"status": 0,
"msg": "ok",
"result": {
"buyeraddress": "xxxx",
"buyerbank": "建设银行深圳爱华支行3427xxxxx5",
"password": "10><97>>-<4-9-2/>8496+xx/>+30206<3>-*+56*7-81-xx/-3<83-+161-95/58-><0<0-xx+2*<07560557/xxx",
"sellercreditno": "92442300Mxxx235K",
"sellerbank": "兴业银行37311010xxxx4962",
"itemlist": [
{
"totalfee": "7920.79",
"price": "7921.783029",
"taxrate": "1%",
"taxfee": "79.21",
"name": "*信息技术服务*服务费"
}
],
"type": "电子普通发票",
"totalfeecn": "捌仟圆整",
"totaltax": "79.21",
"checker": "车主",
"code": "04403xxx11",
"selleraddress": "xxx",
"drawer": "吉xx",
"number": "xxxx",
"date": "2013年08月10日",
"buyercreditno": "9334xxx1058P",
"extaxtotalfee": "7920.79",
"buyer": "深圳市麦道专科技有限公司",
"seller": "深县市艺尔科技有限公司",
"checkcode": "13415xx5",
"remark": "",
"payee": "曹xx",
"totalfee": "8000.00"
}
}
| 代号 | 说明 |
|---|---|
| 201 | 图片为空 |
| 202 | 图片格式错误 |
| 204 | 图片大小超过300K |
| 208 | 识别失败 |
| 210 | 没有信息 |
| 代号 | 说明 |
|---|---|
| 101 | APPKEY为空或不存在 |
| 102 | APPKEY已过期 |
| 103 | APPKEY无请求此数据权限 |
| 104 | 请求超过次数限制 |
| 105 | IP被禁止 |
| 106 | IP请求超过限制 |
| 107 | 接口维护中 |
| 108 | 接口已停用 |
| 计次套餐 | 套餐规格 | 价格 | ||
|---|---|---|---|---|
| 免费套餐 | 5次 | 0.00元 | ≈0元/次 | |
| Level1 | 1000次 | 40.00元 | ≈0.04元/次 | |
| Level2 | 10000次 | 350.00元 | ≈0.035元/次 | |
| Level3 | 20000次 | 680.00元 | ≈0.034元/次 | |
| Level4 | 50000次 | 1500.00元 | ≈0.03元/次 | |
| Level5 | 100000次 | 2700.00元 | ≈0.027元/次 | |