聚美智数


区块链发票查验V2

<p>[TOC]</p> <h3>接口描述</h3> <ul> <li>查验区块链发票是否真实</li> <li>支持深圳、北京、云南</li> </ul> <h3>请求说明</h3> <h4>请求地址</h4> <p><code>https://api.jumdata.com/invoice/validate/blockchain/v2</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>&lt;div style=&quot;width:400px&quot;&gt;说明&lt;/div&gt;</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>dq</td> <td>String</td> <td>-</td> <td>地区 深圳:4403,北京:1100,云南:5300 默认:4403-深圳</td> </tr> <tr> <td>xfsbh</td> <td>String</td> <td>-</td> <td>销售方识别号 深圳、云南必填</td> </tr> <tr> <td>jym</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 = &amp;quot;xyzxy2121zxyz&amp;quot;; String timestamp = &amp;quot;1555378976238&amp;quot;; String appSecret = &amp;quot;efcefcef1121cefcefc1212121&amp;quot;; String str = appId + appSecret + timestamp; String sign = sha256(str);</code></pre> <h3>返回说明</h3> <h4>成功返回样例</h4> <h5>深圳 - 使用校验码</h5> <pre><code class="language-json">{ &amp;quot;code&amp;quot;: 200, // 返回码,详见code返回码说明 &amp;quot;msg&amp;quot;: &amp;quot;成功&amp;quot;, //code对应的描述 &amp;quot;taskNo&amp;quot;: &amp;quot;12552230716560623515&amp;quot;, // 本次唯一请求号 &amp;quot;charge&amp;quot;: true, // 计费标志 &amp;quot;data&amp;quot;: { &amp;quot;fpdm&amp;quot;: &amp;quot;1440318091**&amp;quot;, // 发票代码 &amp;quot;fphm&amp;quot;: &amp;quot;000000**&amp;quot;, // 发票号码 &amp;quot;kprq&amp;quot;: &amp;quot;2018-08-10 00:10:07&amp;quot;, // 开票日期 &amp;quot;xfsbh&amp;quot;: &amp;quot;9144030073884274**&amp;quot;, // 销售方识别号 &amp;quot;xfmc&amp;quot;: &amp;quot;深圳市XX有限公司&amp;quot;, // 销售方名称 &amp;quot;gfmc&amp;quot;: &amp;quot;深圳XX服务有限公司&amp;quot;, // 购买方名称 &amp;quot;jshj&amp;quot;: 198.00, // 价税合计 &amp;quot;fpzt&amp;quot;: &amp;quot;1&amp;quot;, // 发票状态,1-已开票 2-已打印 3-已收票 4-已报销 5-已冲红 6-已登记异常 7-已标记销毁 8-已回退 &amp;quot;yczt&amp;quot;: &amp;quot;0&amp;quot; // 异常状态,1-异常发票 0-正常发票 } }</code></pre> <h5>北京</h5> <pre><code class="language-json">{ &amp;quot;code&amp;quot;: 200, // 返回码,详见code返回码说明 &amp;quot;msg&amp;quot;: &amp;quot;成功&amp;quot;, //code对应的描述 &amp;quot;taskNo&amp;quot;: &amp;quot;12552230716560623515&amp;quot;, // 本次唯一请求号 &amp;quot;charge&amp;quot;: true, // 计费标志 &amp;quot;data&amp;quot;: { &amp;quot;kprq&amp;quot;: &amp;quot;2020-03-03 00:00:00&amp;quot;, // 开票日期 &amp;quot;fpdm&amp;quot;: &amp;quot;1110020091**&amp;quot;, // 发票代码 &amp;quot;fphm&amp;quot;: &amp;quot;000000**&amp;quot;, // 发票号码 &amp;quot;xfmc&amp;quot;: &amp;quot;北京XX有限公司&amp;quot;, // 销售方名称 &amp;quot;yczt&amp;quot;: &amp;quot;0&amp;quot; // 异常状态,1-异常发票 0-正常发票 } }</code></pre> <h5>云南</h5> <pre><code class="language-json">{ &amp;quot;code&amp;quot;: 200, &amp;quot;msg&amp;quot;: &amp;quot;成功&amp;quot;, &amp;quot;taskNo&amp;quot;: &amp;quot;12552230716560623515&amp;quot;, &amp;quot;charge&amp;quot;: true, &amp;quot;data&amp;quot;: { &amp;quot;xfsbh&amp;quot;:&amp;quot;9153**********8312&amp;quot;, //销方识别号 &amp;quot;gfmc&amp;quot;:&amp;quot;昆明地铁****公司&amp;quot;, //购方名称 &amp;quot;dq&amp;quot;:&amp;quot;云南&amp;quot;, //地区 &amp;quot;kprq&amp;quot;:&amp;quot;2020-03-20 13:47:46&amp;quot;, //开票日期 &amp;quot;kjlx&amp;quot;:&amp;quot;1&amp;quot;, //开具类型 &amp;quot;fpdm&amp;quot;:&amp;quot;1530****0382&amp;quot;, //发票代码 &amp;quot;fplx&amp;quot;:&amp;quot;100&amp;quot;, //发票类型 &amp;quot;fpzt&amp;quot;:&amp;quot;5&amp;quot;, //发票状态 &amp;quot;jshj&amp;quot;:2, //价税合计 &amp;quot;xfmc&amp;quot;:&amp;quot;昆明轨道交通集团有限公司&amp;quot;, //销方名称 &amp;quot;yczt&amp;quot;:&amp;quot;0&amp;quot;, //异常状态 &amp;quot;fphm&amp;quot;:&amp;quot;00****47&amp;quot;, //发票号码 &amp;quot;jym&amp;quot;:&amp;quot;1459d&amp;quot; //校验码 } }</code></pre> <h4>查无此票返回样例</h4> <pre><code class="language-json">{ &amp;quot;code&amp;quot;: 201, &amp;quot;msg&amp;quot;: &amp;quot;查无此票&amp;quot;, &amp;quot;taskNo&amp;quot;: &amp;quot;12552230716560623515&amp;quot;, &amp;quot;charge&amp;quot;: true }</code></pre> <h4>不一致返回样例</h4> <pre><code class="language-json">{ &amp;quot;code&amp;quot;: 202, &amp;quot;msg&amp;quot;: &amp;quot;不一致&amp;quot;, &amp;quot;taskNo&amp;quot;: &amp;quot;12552230716560623515&amp;quot;, &amp;quot;charge&amp;quot;: true } } </code></pre> <h4>失败返回样例</h4> <pre><code class="language-json">{ &amp;quot;code&amp;quot;: 400, &amp;quot;msg&amp;quot;: &amp;quot;发票编号不能为空&amp;quot;, &amp;quot;charge&amp;quot;: false }</code></pre> <h4>code返回码说明</h4> <p><a href="https://www.showdoc.com.cn/p/ec82c9f1cb47cd306fea5b700d3ca953#code返回码说明">code返回码说明</a></p>

页面列表

ITEM_HTML