发票库存查询API
API说明:发票库存查询接口,可根据税号,分机号,票种查询库存信息
调用方式:HTTP协议
API编码:ECXML.QY.NEW.FPKCCX
调用方法:POST(XML文件流)
请求报文规范
<REQUEST_FPKCCX class="REQUEST_FPKCCX">
<NSRSBH>纳税人识别号</NSRSBH>
<FJH>分机号</FJH>
<FPZL>发票种类</FPZL>
</REQUEST_FPKCCX>
字段说明
数据项 | 名称 | 类型 | 长度 | 必须 | 说明 |
---|---|---|---|---|---|
NSRSBH | 纳税人识别号 | varchar | 20 | 是 | |
FJH | 分机号 | varchar | 否 | 金税盘:0是主机,非0是分机。 范围0-65535 UKey:传设备编号 |
|
FPZL | 发票种类 | varchar | 40 | 否 | 0:专票 2:普票 51:电子发票 4:电子专票 6:卷票 |
返回报文规范
<RESPONSE_FPKCCX class="RESPONSE_FPKCCX">
<FPKCS class="FPKC;" size="1">
<FPKC>
<NSRSBH>纳税人识别号</NSRSBH>
<FJH>分机号</FJH>
<FPZL>发票种类</FPZL>
<FPSL>发票数量</FPSL>
<TJSJ>统计时间</TJSJ>
</FPKC>
</FPKCS>
</RESPONSE_FPKCCX>
字段说明
数据项 | 名称 | 类型 | 长度 | 必须 | 说明 |
---|---|---|---|---|---|
NSRSBH | 纳税人识别号 | varchar | 20 | 是 | |
FJH | 分机号 | varchar | 是 | ||
FPZL | 发票种类 | varchar | 是 | ||
FPSL | 可用发票数量 | varchar | 是 | ||
TJSJ | 统计时间 | varchar | 是 | 格式:yyyy-MM-dd HH:mi:ss,可用发票数量的统计时间 |
示例报文
请求报文示例
<?xml version="1.0" encoding="UTF-8"?>
<interface
xmlns:schemaLocation="http://www.chinatax.gov.cn/tirip/dataspec/interfaces.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="WLFP1.0">
<globalInfo>
<terminalCode>0</terminalCode>
<appId>DZFP</appId>
<version>1.0</version>
<interfaceCode>ECXML.QY.NEW.FPKCCX</interfaceCode>
<requestCode>P1000001</requestCode>
<requestTime>17-04-07 16:40:30</requestTime>
<responseCode>121</responseCode>
<dataExchangeId>12183218361820170407eXl4EymmJ</dataExchangeId>
<userName>P1000001</userName>
<passWord></passWord>
<taxpayerId>913101010000000090</taxpayerId>
<authorizationCode>NH873FG4KW</authorizationCode>
</globalInfo>
<returnStateInfo>
<returnCode>0000</returnCode>
<returnMessage>5aSE55CG5oiQ5Yqf</returnMessage>
</returnStateInfo>
<Data>
<dataDescription>
<zipCode>0</zipCode>
<encryptCode>1</encryptCode>
<codeType>3DES</codeType>
</dataDescription>
<content>
<REQUEST_FPKCCX class="REQUEST_FPKCCX">
<NSRSBH>913101010000000090</NSRSBH>
<FJH></FJH>
<FPZL></FPZL>
</REQUEST_FPKCCX>
</content>
</Data>
</interface>
返回报文示例(成功)
<?xml version="1.0" encoding="UTF-8"?>
<interface
xmlns:schemaLocation="http://www.chinatax.gov.cn/tirip/dataspec/interfaces.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="WLFP1.0">
<globalInfo>
<terminalCode>0</terminalCode>
<appId>DZFP</appId>
<version>1.0</version>
<interfaceCode>ECXML.QY.NEW.FPKCCX</interfaceCode>
<requestCode>P1000001</requestCode>
<requestTime>2019-04-18 09:40:30</requestTime>
<responseCode>121</responseCode>
<dataExchangeId>adaewredsaf20170407eXl4EymmJ</dataExchangeId>
<userName>P1000001</userName>
<passWord></passWord>
<taxpayerId>913101010000000090</taxpayerId>
<authorizationCode>NH873FG4KW</authorizationCode>
</globalInfo>
<returnStateInfo>
<returnCode>0000</returnCode>
<returnMessage>5aSE55CG5oiQ5Yqf</returnMessage>
</returnStateInfo>
<Data>
<dataDescription>
<zipCode>0</zipCode>
<encryptCode>1</encryptCode>
<codeType>3DES</codeType>
</dataDescription>
<content>
<RESPONSE_FPKCCX class="RESPONSE_FPKCCX">
<FPKCS class="FPKC;" size="1">
<FPKC>
<NSRSBH>913101010000000090</NSRSBH>
<FJH>1</FJH>
<FPZL>51</FPZL>
<FPSL>57872</FPSL>
<TJSJ>2021-07-02 13:46:43</TJSJ>
</FPKC>
</FPKCS>
</RESPONSE_FPKCCX>
</content>
</Data>
</interface>
返回报文示例(失败)
<?xml version="1.0" encoding="UTF-8"?>
<interface
xmlns:schemaLocation="http://www.chinatax.gov.cn/tirip/dataspec/interfaces.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="WLFP1.0">
<globalInfo>
<terminalCode>0</terminalCode>
<appId>DZFP</appId>
<version>1.0</version>
<interfaceCode>ECXML.QY.NEW.FPKCCX</interfaceCode>
<requestCode>P1000001</requestCode>
<requestTime>17-04-07 16:40:30</requestTime>
<responseCode>121</responseCode>
<dataExchangeId>21ewqdsafafx20170407eXl4EymmJ</dataExchangeId>
<userName>P1000001</userName>
<passWord></passWord>
<taxpayerId>913101010000000090</taxpayerId>
<authorizationCode>NH873FG4KW</authorizationCode>
</globalInfo>
<returnStateInfo>
<returnCode>9999(或者是其它错误码)</returnCode>
<returnMessage>Base64(错误信息)</returnMessage>
</returnStateInfo>
<Data>
<dataDescription>
<zipCode>0</zipCode>
<encryptCode>1</encryptCode>
<codeType>3DES</codeType>
</dataDescription>
<content/>
</Data>
</interface>