财政票据查验
<p>[TOC]</p>
<h3>接口描述</h3>
<ul>
<li>查验财政票据是否真实,与财政票据官网保持一致</li>
<li>可查验最近一年内开具的电子票据</li>
<li>每张发票每天最多可查验5次</li>
</ul>
<h3>请求说明</h3>
<h4>请求地址</h4>
<p><code>https://api.jumdata.com/invoice/validate/fiscal</code></p>
<h4>请求方式</h4>
<ul>
<li>GET/POST</li>
</ul>
<h4>请求格式</h4>
<ul>
<li>x-www-form-urlencoded</li>
</ul>
<h4>请求参数</h4>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必须</th>
<th><div style="width:400px">说明</div></th>
</tr>
</thead>
<tbody>
<tr>
<td>appId</td>
<td>String</td>
<td>是</td>
<td>服务商分配的唯一标识</td>
</tr>
<tr>
<td>timestamp</td>
<td>Long</td>
<td>是</td>
<td>当前时间戳</td>
</tr>
<tr>
<td>sign</td>
<td>String</td>
<td>是</td>
<td>签名,详见签名算法说明</td>
</tr>
<tr>
<td>fpdm</td>
<td>String</td>
<td>是</td>
<td>发票代码</td>
</tr>
<tr>
<td>fphm</td>
<td>String</td>
<td>是</td>
<td>发票号码</td>
</tr>
<tr>
<td>jym</td>
<td>String</td>
<td>是</td>
<td>校验码</td>
</tr>
<tr>
<td>kqrq</td>
<td>String</td>
<td>是</td>
<td>开票日期 必填,格式 yyyy-MM-dd / yyyyMMdd</td>
</tr>
<tr>
<td>je</td>
<td>String</td>
<td>是</td>
<td>金额</td>
</tr>
</tbody>
</table>
<h4>签名算法说明</h4>
<p><code>sign = sha256(appId + appSecret + timestamp)</code></p>
<p>用服务商分配的 appId、服务商分配的 appSecret,当前时间时间戳 timestamp,按上述顺序拼接成字符串,再进行 sha256 哈希得到。如下:</p>
<pre><code class="language-java">String appId = &quot;xyzxy2121zxyz&quot;;
String timestamp = &quot;1555378976238&quot;;
String appSecret = &quot;efcefcef1121cefcefc1212121&quot;;
String str = appId + appSecret + timestamp;
String sign = sha256(str);</code></pre>
<h3>返回说明</h3>
<h4>成功返回样例</h4>
<pre><code class="language-json">{
&quot;code&quot;: 200,
&quot;msg&quot;: &quot;成功&quot;,
&quot;taskNo&quot;: &quot;865427293143986503310337&quot;,
&quot;charge&quot;: true,
&quot;data&quot;: {
&quot;fpdm&quot;: &quot;32****22&quot;, //发票代码
&quot;fphm&quot;: &quot;00******63&quot;, //发票号码
&quot;jkrnsrsbh&quot;: &quot;**************0010&quot;, //缴款人纳税识别号
&quot;jym&quot;: &quot;530996&quot;, //校验码
&quot;jkr&quot;: &quot;许**&quot;, //缴款人
&quot;kprq&quot;: &quot;2022-05-26&quot;, //开票日期
&quot;skdw&quot;: &quot;苏州******医院&quot;, //收款单位
&quot;fhr&quot;: &quot;01072&quot;, //复核人
&quot;skr&quot;: &quot;80139&quot;, //收款人
&quot;pjmc&quot;: &quot;江苏省医疗住院收费票据(电子)&quot;, //票据名称
&quot;jehj&quot;: &quot;2235.33&quot;, //金额合计
&quot;jehjcn&quot;: &quot;贰仟贰佰叁拾伍元叁角叁分&quot;, //金额合计中文大写
&quot;ch&quot;: &quot;01&quot;, //冲红 01 正常;02 冲红
&quot;chrq&quot;: &quot;&quot;, //冲红日期
&quot;chsj&quot;: &quot;&quot;, //冲红时间
&quot;chyy&quot;: &quot;&quot;, //冲红原因
&quot;czbmyz&quot;: &quot;&quot;, //财政部门印章
&quot;czbmyzbh&quot;: &quot;&quot;, //财政部门印章编号
&quot;xmqd&quot;: [
{
&quot;xmxh&quot;: 0, //项目序号
&quot;xmbh&quot;: &quot;&quot;, //项目编号
&quot;xmmc&quot;: &quot;床位费&quot;, //项目名称
&quot;dw&quot;: &quot;&quot;, //单位
&quot;sl&quot;: &quot;&quot;, //数量
&quot;ggbz&quot;: &quot;&quot;, //规格标准
&quot;je&quot;: null, //金额
&quot;bz&quot;: &quot;&quot; //备注
}
], //项目清单
&quot;xmmx&quot;: [],
&quot;qtxx&quot;: [ //其他信息
{
&quot;en&quot;: &quot;ywlsh&quot;,
&quot;cn&quot;: &quot;业务流水号&quot;,
&quot;value&quot;: &quot;10****47&quot;
}
],
&quot;detailUrl&quot;: &quot;http://einvoice.jsczt.cn/finance/callback/32****22/00******63/530996/1653494400000/2235.33/013236272acb1f25445fb926e09cae1fe9fd/13/1684207775043/131f7321cd42f3383bbd934c9dbc519d521e3d95175822478e99ee1fd8388c6c&quot; //税局查验截图url
}
}</code></pre>
<h4>查无此票返回样例</h4>
<pre><code class="language-json">{
&quot;code&quot;: 201,
&quot;msg&quot;: &quot;查无此票&quot;,
&quot;taskNo&quot;: &quot;12552230716560623515&quot;,
&quot;charge&quot;: true,
&quot;data&quot;: {
&quot;fplx&quot;: &quot;101&quot;
}
}</code></pre>
<h4>不一致返回样例</h4>
<pre><code class="language-json">{
&quot;code&quot;: 202,
&quot;msg&quot;: &quot;不一致&quot;,
&quot;taskNo&quot;: &quot;12552230716560623515&quot;,
&quot;charge&quot;: true,
&quot;data&quot;: {
&quot;fplx&quot;: &quot;101&quot;
}
}
</code></pre>
<h4>错误返回样例</h4>
<pre><code class="language-json">{
&quot;code&quot;: 400,
&quot;msg&quot;: &quot;发票编号不能为空&quot;,
&quot;charge&quot;: false
}</code></pre>
<h4>code返回码说明</h4>
<p><a href="https://www.showdoc.com.cn/p/ec82c9f1cb47cd306fea5b700d3ca953#code返回码说明">code返回码说明</a></p>