參數名稱 | 類型 | 必填 | 說明 |
---|---|---|---|
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.jisuapi.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(); } $result = $jsonarr['result']; echo $result['number'].' '.$result['code'].' '.$result['seller'].' '.$result['sellercreditno'].' '. $result['sellerbank'].' '.$result['selleraddress'].' '.$result['buyer'].' '.$result['buyercreditno'].' '. $result['buyerbank'].' '.$result['buyeraddress'].' '.$result['payee'].' '.$result['drawer'].' '. $result['checker'].' '.$result['password'].' '.$result['totalfeecn'].' '.$result['totalfee'].' '. $result['extaxtotalfee'].' '.$result['date'].' '.$result['totaltax'].' '.$result['type'].' '. $result['remark'] .'
'; foreach ($result['itemlist'] as $k=>$v){ echo $v['taxrate'].' '.$v['totalfee'].' '.$v['taxfee'].' '.$v['num'].' '. $v['unit'].' '.$v['price'].' '.$v['name'].' '.$v['type'] .'
'; }
{ "status": 0, "msg": "ok", "result": { "number": "00362801", "seller": "江蘇省常州地方稅務局第一稅務分局", "itemlist": [ { "taxrate": "3%", "totalfee": "19417.48", "taxfee": "582.52", "num": "1", "unit": "", "price": "19417.475728", "name": "商品房", "type": "" } ], "sellerbank": "寧波市海南24號甲5892346", "checker": "41", "extaxtotalfee": "19417.40", "date": "2016年04月26日", "buyer": "北京暢聯電子有限公司", "buyerbank": "江南農商行1234567890123", "remark": "開發區雨虹電子有限)代開企業稅號33020", "password": "80>54209<6<5*>7>7<87/0/--8/78>/01686<+29654/5<7951<>98>>33><米10+39<7<9本>6>7<5+80><284<-65774>56485770/<826", "selleraddress": "寧南24號甲5892346", "buyeraddress": "北京市海淀區澆灌里231號62345123", "code": "", "payee": "", "buyercreditno": "110101251328321", "drawer": "號", "totalfeecn": "貳萬圓整", "totalfee": "20000.00", "totaltax": "582.50", "type": "專用發票", "sellercreditno": "32040700DKD0337" } }
代號 | 說明 |
---|---|
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次 | 85元 | ≈0.085元/次 | |
Level2 | 10000次 | 800元 | ≈0.08元/次 | |
Level3 | 20000次 | 1550元 | ≈0.0775元/次 | |
Level4 | 50000次 | 3600元 | ≈0.072元/次 | |
Level5 | 100000次 | 6500元 | ≈0.065元/次 |