OCR-api报销
<p>[TOC]</p>
<h5>简要描述</h5>
<ul>
<li>OCR报销</li>
</ul>
<h5>请求URL</h5>
<ul>
<li>本地部署: <code>http://api2.taxdata.tax/new_api/invoice_pool/ocr_check</code></li>
</ul>
<h5>请求方式</h5>
<ul>
<li>POST </li>
</ul>
<h5>请求参数</h5>
<pre><code>{
&quot;reimbursement_bill_no&quot;: &quot;报销单号&quot;, // string类型
&quot;image_url&quot;: &quot;图片url&quot;, // string类型 image_url和image_data二选一 优先取image_url 如果两个都传入值, 优先取image_url
&quot;image_data&quot;: &quot;图片base64&quot;, // string类型 image_url和image_data二选一
}</code></pre>
<h5>返回示例</h5>
<pre><code>当住宿费情况时:
{
&quot;code&quot;: 0, // 0=正常 其他=失败
&quot;msg&quot;: &quot;报销单正常; 防重正常; 住宿费检查正常&quot;,
&quot;check_msg&quot;: &quot;防重正常&quot;,
&quot;amount_limit&quot;: 500,
&quot;invoice_amount&quot;: 400
}
非住宿费情况时:
{
&quot;code&quot;: 0, // 0=正常 其他=失败
&quot;msg&quot;: &quot;报销单正常; 防重正常&quot;,
&quot;check_msg&quot;: &quot;防重正常&quot;,
&quot;amount_limit&quot;: 0,
&quot;invoice_amount&quot;: 400
}
{
&quot;code&quot;: 4001, // 0=正常 其他=失败
&quot;msg&quot;: &quot;报销单异常: 请求报文错误, image_data和image_url不能同时为空&quot;,
&quot;check_msg&quot;: &quot;&quot;,
&quot;amount_limit&quot;: 0,
&quot;invoice_amount&quot;: 0
}
{
&quot;code&quot;: 5001, // 0=正常 其他=失败
&quot;msg&quot;: &quot;报销单异常: 请求OCR错误&quot;,
&quot;check_msg&quot;: &quot;&quot;,
&quot;amount_limit&quot;: 0,
&quot;invoice_amount&quot;: 0
}
{
&quot;code&quot;: 5002, // 0=正常 其他=失败
&quot;msg&quot;: &quot;报销单异常: 影像识别到多张发票&quot;,
&quot;check_msg&quot;: &quot;&quot;,
&quot;amount_limit&quot;: 0,
&quot;invoice_amount&quot;: 0
}
{
&quot;code&quot;: 5003, // 0=正常 其他=失败
&quot;msg&quot;: &quot;报销单异常: ocr识别发票信息失败,无法继续防重处理&quot;,
&quot;check_msg&quot;: &quot;&quot;,
&quot;amount_limit&quot;: 0,
&quot;invoice_amount&quot;: 0
}
{
&quot;code&quot;: 5004, // 0=正常 其他=失败
&quot;msg&quot;: &quot;报销单正常; 防重异常: 该发票识别所得金额为负数&quot;,
&quot;check_msg&quot;: &quot;&quot;,
&quot;amount_limit&quot;: 0,
&quot;invoice_amount&quot;: 0
}
{
&quot;code&quot;: 5005, // 0=正常 其他=失败
&quot;msg&quot;: &quot;报销单正常; 防重异常: ocr未能获取到发票关键要素,无法继续防重处理&quot;,
&quot;check_msg&quot;: &quot;&quot;,
&quot;amount_limit&quot;: 0,
&quot;invoice_amount&quot;: 0
}
{
&quot;code&quot;: 5006, // 0=正常 其他=失败
&quot;msg&quot;: &quot;报销单正常; 防重异常: 该发票已作废/已红冲&quot;,
&quot;check_msg&quot;: &quot;防重异常: 该发票已作废/已红冲&quot;,
&quot;amount_limit&quot;: 0,
&quot;invoice_amount&quot;: 0
}
{
&quot;code&quot;: 5007, // 0=正常 其他=失败
&quot;msg&quot;: &quot;报销单正常; 防重异常: 发票查验(jshj={jshj})结果与OCR(total={total_amount})结果比对错误&quot;,
&quot;check_msg&quot;: &quot;防重异常: 发票查验(jshj={jshj})结果与OCR(total={total_amount})结果比对错误&quot;,
&quot;amount_limit&quot;: 0,
&quot;invoice_amount&quot;: 0
}
{
&quot;code&quot;: 5008, // 0=正常 其他=失败
&quot;msg&quot;: &quot;报销单正常; 防重异常: 发票查验(sl={sl})处理错误&quot;,
&quot;check_msg&quot;: &quot;防重异常: 发票查验(sl={sl})处理错误&quot;,
&quot;amount_limit&quot;: 0,
&quot;invoice_amount&quot;: 0
}
{
&quot;code&quot;: 5010, // 0=正常 其他=失败
&quot;msg&quot;: &quot;报销单正常; 防重异常: 查验错误&quot;,
&quot;check_msg&quot;: &quot;防重异常: 查验错误&quot;,
&quot;amount_limit&quot;: 0,
&quot;invoice_amount&quot;: 0
}
{
&quot;code&quot;: 406, // 0=正常 其他=失败
&quot;msg&quot;: &quot;报销单异常: 报销单号{bill_no}已存在, 无法处理报销&quot;,
&quot;check_msg&quot;: &quot;&quot;,
&quot;amount_limit&quot;: 0,
&quot;invoice_amount&quot;: 0
}
{
&quot;code&quot;: 407, // 0=正常 其他=失败
&quot;msg&quot;: &quot;报销单正常; 防重异常: 该发票号({invoice_number})已在审核流程中, 无法报销&quot;,
&quot;check_msg&quot;: &quot;防重异常: 该发票号({invoice_number})已在审核流程中, 无法报销&quot;,
&quot;amount_limit&quot;: 0,
&quot;invoice_amount&quot;: 0
}
{
&quot;code&quot;: 408, // 0=正常 其他=失败
&quot;msg&quot;: &quot;报销单正常; 防重异常: 该发票号({invoice_number})报销已审核, 无法报销&quot;,
&quot;check_msg&quot;: &quot;防重异常: 该发票号({invoice_number})报销已审核, 无法报销&quot;,
&quot;amount_limit&quot;: 0,
&quot;invoice_amount&quot;: 0
}
{
&quot;code&quot;: 409, // 0=正常 其他=失败
&quot;msg&quot;: &quot;报销单正常; 防重异常: 该发票号({invoice_number})已被占用,无法报销&quot;,
&quot;check_msg&quot;: &quot;防重异常: 该发票号({invoice_number})已被占用,无法报销&quot;,
&quot;amount_limit&quot;: 0,
&quot;invoice_amount&quot;: 0
}
{
&quot;code&quot;: 410, // 0=正常 其他=失败
&quot;msg&quot;: &quot;报销单正常; 防重正常; 住宿费检查异常: 住宿费检查不通过 发票金额(金额={jshj}, 天数={lodging_days})超过住宿费标准({city_name}: {city_amount_limit}/天)&quot;,
&quot;check_msg&quot;: &quot;防重正常&quot;,
&quot;amount_limit&quot;: 400, // 城市住宿费限制/天
&quot;invoice_amount&quot;: 0
}
{
&quot;code&quot;: 411, // 0=正常 其他=失败
&quot;msg&quot;: &quot;报销单正常; 防重正常; 住宿费检查异常: 住宿费标准提取校验失败&quot;,
&quot;check_msg&quot;: &quot;防重正常&quot;,
&quot;amount_limit&quot;: 0,
&quot;invoice_amount&quot;: 0
}
{
&quot;code&quot;: 500, // 0=正常 其他=失败
&quot;msg&quot;: &quot;报销单异常: 创建报销单失败, 请检查数据并重试&quot;
&quot;check_msg&quot;: &quot;&quot;,
&quot;amount_limit&quot;: 0,
&quot;invoice_amount&quot;: 0
}
</code></pre>