商品管理
<p>[TOC]</p>
<h3>1 接口调用说明</h3>
<h4>1.1 请求方式</h4>
<p>如接口没有单独说明,所有接口均为:<strong>POST</strong></p>
<h4>1.2 请求格式</h4>
<p>如接口没有单独说明,所有接口均为:<strong>application/x-www-form-urlencoded</strong></p>
<h4>1.3 请求参数</h4>
<p>请求参数包括公共参数和业务参数(业务参数见具体接口说明)
调用接口时,需要把<strong>公共参数</strong>和<strong>业务参数</strong>一并放在<strong>请求参数</strong>中提交</p>
<h5>1.3.1 公共请求参数</h5>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必须</th>
<th><div style="width:420px;">说明</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>签名,详见<a href="#签名算法">签名算法说明</a></td>
</tr>
</tbody>
</table>
<p><a name="签名算法"></a></p>
<h5>1.3.2 签名算法说明</h5>
<pre><code>sign = sha256(appId + appSecret + timestamp)</code></pre>
<p>用服务商分配的 <strong>appId</strong>、服务商分配的 <strong>appSecret</strong>,当前时间戳(毫秒) <strong>timestamp</strong>,按上述顺序拼接成字符串,再进行 <strong>sha256</strong> 哈希得到。如下:</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>
<h4>1.4 返回说明</h4>
<h5>1.4.1 公共返回字段说明</h5>
<p>所有接口均返回以下公共字段:</p>
<table>
<thead>
<tr>
<th>字段名</th>
<th><div style="width:420px">说明</div></th>
</tr>
</thead>
<tbody>
<tr>
<td>code</td>
<td>返回码,详见:code返回码说明</td>
</tr>
<tr>
<td>msg</td>
<td>code对应的描述</td>
</tr>
<tr>
<td>charge</td>
<td>计费标志 true为计费,false为不计费</td>
</tr>
<tr>
<td>taskNo</td>
<td>本次请求号</td>
</tr>
<tr>
<td>data</td>
<td>返回具体结果,object类型,详见data返回字段描述</td>
</tr>
</tbody>
</table>
<p><a name="code返回码说明"></a></p>
<h5>1.4.2 code返回码说明</h5>
<table>
<thead>
<tr>
<th>code</th>
<th><div style="width:420px;">说明</div></th>
</tr>
</thead>
<tbody>
<tr>
<td>200</td>
<td>成功</td>
</tr>
<tr>
<td>201</td>
<td>纳税人未登录或缓存失效请重新登录</td>
</tr>
<tr>
<td>202</td>
<td>商品编码不存在</td>
</tr>
<tr>
<td>301</td>
<td>登录相关错误,以实际返回为准</td>
</tr>
<tr>
<td>302</td>
<td>短信验证码发送频繁</td>
</tr>
<tr>
<td>400</td>
<td>参数错误</td>
</tr>
<tr>
<td>404</td>
<td>接口地址不正确</td>
</tr>
<tr>
<td>500</td>
<td>系统维护,请稍候再试</td>
</tr>
<tr>
<td>601</td>
<td>接口未开通</td>
</tr>
<tr>
<td>602</td>
<td>账号停用</td>
</tr>
<tr>
<td>604</td>
<td>接口停用</td>
</tr>
<tr>
<td>606</td>
<td>调用超限,请稍候再试</td>
</tr>
<tr>
<td>607</td>
<td>ip不在白名单</td>
</tr>
<tr>
<td>609</td>
<td>请求过于频繁,请稍候再试</td>
</tr>
<tr>
<td>610</td>
<td>请求超时</td>
</tr>
<tr>
<td>999</td>
<td>其他,以实际返回为准</td>
</tr>
</tbody>
</table>
<hr />
<h3>2 商品分类查询接口</h3>
<h4>2.1 接口描述</h4>
<ul>
<li>在电子税务局查询商品分类</li>
</ul>
<h4>2.2 请求地址</h4>
<p><code>https://api.jumdata.com/invoice-makeout/v3/product-category</code></p>
<h4>2.3 业务参数</h4>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必须</th>
<th><div style="width:420px;">说明</div></th>
</tr>
</thead>
<tbody>
<tr>
<td>nsrsbh</td>
<td>String</td>
<td>是</td>
<td>纳税人识别号</td>
</tr>
<tr>
<td>accountId</td>
<td>String</td>
<td>否</td>
<td>账号唯一标识</td>
</tr>
</tbody>
</table>
<h4>2.4 请求成功返回样例</h4>
<pre><code class="language-json">{
&quot;code&quot;: 200, // 返回码,详见code返回码说明
&quot;msg&quot;: &quot;成功&quot;, //code对应的描述
&quot;taskNo&quot;: &quot;12552230716560623515&quot;, // 本次唯一请求号
&quot;charge&quot;: false, // 计费标志
&quot;data&quot;: {
&quot;list&quot;: [
{
&quot;children&quot;: [],//子分类
&quot;fluuid&quot;: &quot;00&quot;,//分类uuid
&quot;tdysFlsDm&quot;: &quot;00&quot;,//目录树代码
&quot;flmc&quot;: &quot;项目信息分类&quot;//分类名称
}
]
}
}</code></pre>
<h4>2.6 失败返回样例</h4>
<pre><code class="language-json">{
&quot;code&quot;: 400,
&quot;msg&quot;: &quot;税号不能为空&quot;,
&quot;taskNo&quot;: &quot;487974114181909820820522&quot;,
&quot;charge&quot;: false
}</code></pre>
<hr />
<h3>3 商品列表查询接口</h3>
<h4>3.1 接口描述</h4>
<ul>
<li>从电子税务局查询已存在的商品信息列表</li>
</ul>
<h4>3.2 请求地址</h4>
<p><code>https://api.jumdata.com/invoice-makeout/v3/product-list</code></p>
<h4>3.3 业务参数</h4>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必须</th>
<th><div style="width:420px;">说明</div></th>
</tr>
</thead>
<tbody>
<tr>
<td>nsrsbh</td>
<td>String</td>
<td>是</td>
<td>纳税人识别号</td>
</tr>
<tr>
<td>data.pageIndex</td>
<td>Number</td>
<td>是</td>
<td>当前页码</td>
</tr>
<tr>
<td>data.pageSize</td>
<td>Number</td>
<td>是</td>
<td>每页行数</td>
</tr>
<tr>
<td>data.params.xmmc</td>
<td>String</td>
<td>否</td>
<td>指定发票号码查询</td>
</tr>
<tr>
<td>data.params.jm</td>
<td>String</td>
<td>否</td>
<td>简码</td>
</tr>
<tr>
<td>data.params.ggxh</td>
<td>String</td>
<td>否</td>
<td>对方税号</td>
</tr>
<tr>
<td>data.params.slv</td>
<td>String</td>
<td>否</td>
<td>对方纳税人名称</td>
</tr>
<tr>
<td>data.params.dj</td>
<td>String</td>
<td>否</td>
<td>单价</td>
</tr>
<tr>
<td>data.params.spfwbm</td>
<td>String</td>
<td>否</td>
<td>税收分类编码</td>
</tr>
<tr>
<td>data.params.spfwjc</td>
<td>String</td>
<td>否</td>
<td>税收分类名称</td>
</tr>
<tr>
<td>data.params.dwdm</td>
<td>String</td>
<td>否</td>
<td>计量单位代码</td>
</tr>
<tr>
<td>data.params.dwmc</td>
<td>String</td>
<td>否</td>
<td>计量单位名称</td>
</tr>
<tr>
<td>data.params.fluuid</td>
<td>String</td>
<td>否</td>
<td>分类uuid,要查询的商品分类ID, 默认为00</td>
</tr>
</tbody>
</table>
<h4>3.4 成功返回样例</h4>
<pre><code class="language-json">{
&quot;code&quot;: 200, // 返回码,详见code返回码说明
&quot;msg&quot;: &quot;成功&quot;, //code对应的描述
&quot;taskNo&quot;: &quot;12552230716560623515&quot;, // 本次唯一请求号
&quot;charge&quot;: false, // 计费标志
&quot;data&quot;: {
&quot;records&quot;: 1,//总记录数
&quot;list&quot;: [
{
&quot;zzstsgl&quot;: &quot;&quot;,//增值税简易计税类型 01:简易征收,03: 免税,08:按3%简易征收,09:按5%简易征收,10:按5%简易征收减按1.5%计征
&quot;uuid&quot;: &quot;aa3a19d649374e119881c254710fec28&quot;,//商品UUID
&quot;fluuid&quot;: &quot;00&quot;,//商品分类UUID
&quot;yhzsbz&quot;: &quot;N&quot;,//是否享受优惠政策标志 Y是 / N否 枚举值:01 02 03 04
&quot;spfwbm&quot;: &quot;3040101000000000000&quot;,////税收服务编码
&quot;spfwjc&quot;: &quot;研发和技术服务&quot;,//税收服务简称
&quot;hsbz&quot;: &quot;Y&quot;,
&quot;xmmc&quot;: &quot;技术服务费&quot;,//项目名称
&quot;slv&quot;: &quot;0.06&quot;,//税率
&quot;ggxh&quot;: &quot;0.06&quot;,//规格型号
&quot;dwdm&quot;: &quot;0.06&quot;,//计量单位名称
&quot;jm&quot;: &quot;3040101000000000000&quot;,//简码
&quot;dj&quot;: &quot;0.06&quot;,//单价
&quot;hsbz&quot;: &quot;0.06&quot;,//含税标记 Y含税 / N不含税
}
]
}
}
</code></pre>
<h4>3.5 失败返回样例</h4>
<pre><code class="language-json">{
&quot;code&quot;: 400,
&quot;msg&quot;: &quot;参数不能为空&quot;,
&quot;charge&quot;: false
}</code></pre>
<hr />
<h3>4 根据商品名搜索匹配的税收编码接口</h3>
<h4>4.1 接口描述</h4>
<ul>
<li>通过商品名称智能查询相匹配税收编码列表</li>
</ul>
<h4>4.2 请求地址</h4>
<p><code>https://api.jumdata.com/invoice-makeout/v3/product-search/taxcode</code></p>
<h4>4.3 业务参数</h4>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必须</th>
<th><div style="width:420px;">说明</div></th>
</tr>
</thead>
<tbody>
<tr>
<td>nsrsbh</td>
<td>String</td>
<td>是</td>
<td>纳税人识别号</td>
</tr>
<tr>
<td>data.xmmc</td>
<td>String</td>
<td>是</td>
<td>项目名称/商品名称</td>
</tr>
<tr>
<td>accountId</td>
<td>String</td>
<td>否</td>
<td>账号唯一标识</td>
</tr>
</tbody>
</table>
<h4>4.4 成功返回样例</h4>
<pre><code class="language-json">{
&quot;code&quot;: 200, // 返回码,详见code返回码说明
&quot;msg&quot;: &quot;成功&quot;, //code对应的描述
&quot;taskNo&quot;: &quot;12552230716560623515&quot;, // 本次唯一请求号
&quot;charge&quot;: false, // 计费标志
&quot;data&quot;: {
&quot;list&quot;: [
{
&quot;slvList&quot;: [//适用税率
&quot;0.06&quot;
],
&quot;spsjbm&quot;: &quot;3040100000000000000&quot;,//上级编码
&quot;jzjtskbz&quot;: &quot;02&quot;,
&quot;zzscezsbj&quot;: &quot;N&quot;,//增值税差额征收标记 (Y/N)
&quot;zzstsnrdmjh&quot;: &quot;1.06E+08&quot;,//增值税特殊内容代码
&quot;spfwjc&quot;: &quot;研发和技术服务&quot;,//税收简称 (开票时两个**号里面的内容)
&quot;qyrq&quot;: &quot;2019-04-01&quot;,//启用日期
&quot;sphfwssflhbbm&quot;: &quot;3040105000000000000&quot;,//税收编码
&quot;sfhzx&quot;: &quot;N&quot;,
&quot;zzszcyj&quot;: &quot;《财政部 国家税务总局关于印发<资源综合利用产品和劳务增值税优惠目录>的通知》(财税〔2015〕78号)&quot;,
&quot;sfbzsbz&quot;: &quot;N&quot;,
&quot;zslList&quot;: [//适用征收率
&quot;0.03&quot;
],
&quot;sm&quot;: &quot;指气象服务、地震服务、海洋服务、测绘服务、城市规划、环境与生态监测服务等专项技术服务。&quot;,//商品说明
&quot;zt&quot;: &quot;Y&quot;,//状态 (Y:正常)
&quot;zzsslhzzsl&quot;: &quot;6%&quot;,
&quot;zzstsglList&quot;: [//增值税特殊管理列表
&quot;即征即退70%&quot;,
&quot;简易征收&quot;
],
&quot;tdyslxDm&quot;: &quot;&quot;,//应税类型代码
&quot;tdyslxmc&quot;: &quot;&quot;,//应税类型名称
&quot;zsljh&quot;: &quot;3%&quot;,
&quot;hyjh&quot;: &quot;I651、I65362&quot;,
&quot;hwhlwmc&quot;: &quot;专业技术服务&quot;//税收名称
}
]
}
}
</code></pre>
<h4>4.5 失败返回样例</h4>
<pre><code class="language-json">{
&quot;code&quot;: 400,
&quot;msg&quot;: &quot;纳税人识别号不能为空&quot;,
&quot;charge&quot;: false
}</code></pre>
<hr />
<h3>5 根据税收编码查询详情接口</h3>
<h4>5.1 接口描述</h4>
<ul>
<li>通过商品名称智能查询相匹配税收编码列表</li>
</ul>
<h4>5.2 请求地址</h4>
<p><code>https://api.jumdata.com/invoice-makeout/v3/detail/taxcode</code></p>
<h4>5.3 业务参数</h4>
<table>
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必须</th>
<th><div style="width:420px;">说明</div></th>
</tr>
</thead>
<tbody>
<tr>
<td>nsrsbh</td>
<td>String</td>
<td>是</td>
<td>纳税人识别号</td>
</tr>
<tr>
<td>data.spfwbm</td>
<td>String</td>
<td>是</td>
<td>商品编码</td>
</tr>
<tr>
<td>accountId</td>
<td>String</td>
<td>否</td>
<td>账号唯一标识</td>
</tr>
</tbody>
</table>
<h4>5.4 成功返回样例</h4>
<pre><code class="language-json">{
&quot;code&quot;: 200, // 返回码,详见code返回码说明
&quot;msg&quot;: &quot;成功&quot;, //code对应的描述
&quot;taskNo&quot;: &quot;12552230716560623515&quot;, // 本次唯一请求号
&quot;charge&quot;: false, // 计费标志
&quot;data&quot;: {
&quot;list&quot;: [
{
&quot;slvList&quot;: [//适用税率
&quot;0.06&quot;
],
&quot;spsjbm&quot;: &quot;3040100000000000000&quot;,//上级编码
&quot;jzjtskbz&quot;: &quot;02&quot;,
&quot;zzscezsbj&quot;: &quot;N&quot;,//增值税差额征收标记 (Y/N)
&quot;zzstsnrdmjh&quot;: &quot;1.06E+08&quot;,//增值税特殊内容代码
&quot;spfwjc&quot;: &quot;研发和技术服务&quot;,//税收简称 (开票时两个**号里面的内容)
&quot;qyrq&quot;: &quot;2019-04-01&quot;,//启用日期
&quot;sphfwssflhbbm&quot;: &quot;3040105000000000000&quot;,//税收编码
&quot;sfhzx&quot;: &quot;N&quot;,
&quot;zzszcyj&quot;: &quot;《财政部 国家税务总局关于印发<资源综合利用产品和劳务增值税优惠目录>的通知》(财税〔2015〕78号)&quot;,
&quot;sfbzsbz&quot;: &quot;N&quot;,
&quot;zslList&quot;: [//适用征收率
&quot;0.03&quot;
],
&quot;sm&quot;: &quot;指气象服务、地震服务、海洋服务、测绘服务、城市规划、环境与生态监测服务等专项技术服务。&quot;,//商品说明
&quot;zt&quot;: &quot;Y&quot;,//状态 (Y:正常)
&quot;zzsslhzzsl&quot;: &quot;6%&quot;,
&quot;zzstsglList&quot;: [//增值税特殊管理列表
&quot;即征即退70%&quot;,
&quot;简易征收&quot;
],
&quot;tdyslxDm&quot;: &quot;&quot;,//应税类型代码
&quot;tdyslxmc&quot;: &quot;&quot;,//应税类型名称
&quot;zsljh&quot;: &quot;3%&quot;,
&quot;hyjh&quot;: &quot;I651、I65362&quot;,
&quot;hwhlwmc&quot;: &quot;专业技术服务&quot;//税收名称
}
]
}
}
</code></pre>
<h4>5.5 失败返回样例</h4>
<pre><code class="language-json">{
&quot;code&quot;: 400,
&quot;msg&quot;: &quot;纳税人识别号不能为空&quot;,
&quot;charge&quot;: false
}</code></pre>