发票剩余数量查询API
API说明:企业可用发票数获取(目前非实时,获取的值为每日凌晨的剩余值,需要实时数据时,需要配合平台管理端使用)
调用方式:HTTP协议
API编码:ECXML.QY.KYFPSL
调用方法:POST(XML文件流)
请求报文规范
<REQUEST_KYFPSL class="REQUEST_KYFPSL">
<NSRSBH>纳税人识别号</NSRSBH>
</REQUEST_KYFPSL>
字段说明
数据项 |
名称 |
类型 |
长度 |
必须 |
说明 |
NSRSBH |
纳税人识别号 |
varchar |
20 |
是 |
|
返回报文规范
<RESPONSE_KYFPSL class="RESPONSE_KYFPSL">
<NSRSBH>纳税人识别号</NSRSBH>
<KYFPSL>可用发票数量</KYFPSL>
<TJSJ>统计时间</TJSJ>
</RESPONSE_KYFPSL>
字段说明
数据项 |
名称 |
类型 |
长度 |
必须 |
说明 |
NSRSBH |
纳税人识别号 |
varchar |
20 |
是 |
|
KYFPSL |
可用发票数量 |
number |
|
是 |
|
TJSJ |
统计时间 |
datetime |
|
是 |
格式: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>ZZS_PT_DZFP</appId>
<version>2.0</version>
<interfaceCode>ECXML.QY.KYFPSL</interfaceCode>
<requestCode>P1000001</requestCode>
<requestTime>2019-04-18 10:30:42</requestTime>
<responseCode>121</responseCode>
<dataExchangeId>P100000120160801000000001</dataExchangeId>
<userName>P1000001</userName>
<passWord />
<taxpayerId>913101010000000090</taxpayerId>
<authorizationCode>NH873FG4KW</authorizationCode>
</globalInfo>
<returnStateInfo>
<returnCode/>
<returnMessage/>
</returnStateInfo>
<Data>
<dataDescription>
<zipCode>0</zipCode>
<encryptCode>1</encryptCode>
<codeType>3DES</codeType>
</dataDescription>
<content>
<REQUEST_KYFPSL class="REQUEST_KYFPSL">
<NSRSBH>913101010000000090</NSRSBH>
</REQUEST_KYFPSL>
</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>ZZS_PT_DZFP</appId>
<version>2.0</version>
<interfaceCode>ECXML.QY.KYFPSL</interfaceCode>
<requestCode>P1000001</requestCode>
<requestTime>2019-04-18 10:30:42</requestTime>
<responseCode>121</responseCode>
<dataExchangeId>P100000120160801000000001</dataExchangeId>
<userName>P1000001</userName>
<passWord />
<taxpayerId>913101010000000090</taxpayerId>
<authorizationCode>NH873FG4KW</authorizationCode>
</globalInfo>
<returnStateInfo>
<returnCode>0000</returnCode>
<returnMessage>5p+l6K+i5oiQ5Yqf</returnMessage>
</returnStateInfo>
<Data>
<dataDescription>
<zipCode>0</zipCode>
<encryptCode>1</encryptCode>
<codeType>3DES</codeType>
</dataDescription>
<content>
<RESPONSE_KYFPSL class="RESPONSE_KYFPSL">
<NSRSBH>913101010000000090</NSRSBH>
<KYFPSL>10940</KYFPSL>
<TJSJ>2019-02-19 17:03:55</TJSJ>
</RESPONSE_KYFPSL>
</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>ZZS_PT_DZFP</appId>
<version>2.0</version>
<interfaceCode>ECXML.QY.KYFPSL</interfaceCode>
<requestCode>P1000001</requestCode>
<requestTime>2019-04-18 10:30:42</requestTime>
<responseCode>121</responseCode>
<dataExchangeId>P100000120160801000000001</dataExchangeId>
<userName>P1000001</userName>
<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>