商品信息同步API
API说明:商品信息同步
调用方式:HTTP协议
API编码:ECXML.SPXX.JS
调用方法:POST(XML文件流)
请求报文规范
<REQUEST_SPXX class="REQUEST_SPXX">
<PRODUCT_NR>商品编码</PRODUCT_NR>
<PRODUCT_NAME>商品名称</PRODUCT_NAME>
<UNIT>计量单位</UNIT>
<SPEC>规格型号</SPEC>
<PRICE>单价</PRICE>
<SWBM>税务编码</SWBM>
<SWBM_VER>税务编码版本号</SWBM_VER>
<YHZCBS>优惠政策标识</YHZCBS>
<LSLBS>零税率标识</LSLBS>
<ZZSTSGL>增值税特殊管理</ZZSTSGL>
<TAX_RATE>税率</TAX_RATE>
<BYZD1>备用字段</BYZD1>
<BYZD2>备用字段</BYZD2>
<BYZD3>备用字段</BYZD3>
<BYZD4>备用字段</BYZD4>
<BYZD5>备用字段</BYZD5>
</REQUEST_SPXX>
字段说明
数据项 | 名称 | 类型 | 长度 | 必须 | 说明 |
---|---|---|---|---|---|
PRODUCT_NR | 商品编码 | varchar | 20 | 是 | 企业内部唯一,用一企业传相同编码,则更新对应编码的商品信息 |
PRODUCT_NAME | 商品名称 | varchar | 90 | 是 | 90 是‘商品简码+商品名称’的长度 |
UNIT | 计量单位 | varchar | 20 | 否 | |
SPEC | 规格型号 | varchar | 90 | 否 | |
PRICE | 单价 | double | 否 | ||
SWBM | 税务编码 | varchar | 19 | 是 | 技术人员需向企业财务核实,不能是汇总的大类编码; 不足 19 位后面补‘0’ |
SWBM_VER | 税务编码版本号 | varchar | 是 | 如:33.0 | |
YHZCBS | 优惠政策标识 | varchar | 1 | 是 | 0:不使用 1:使用 |
LSLBS | 零税率标识 | varchar | 1 | 是 | 空:非零税率 1:免税 2:不征税 3:普通零税率 |
ZZSTSGL | 增值税特殊管理 | varchar | 50 | 否 | 当YHZCBS是1时必填, LSLBS 为 0 填写出口零税, LSLBS 为 1 填写免税, LSLBS为 2 填写不征税 |
TAX_RATE | 税率 | double | 是 | 如果税率为0,表示免税(正常税率以小数形式给出,如0.13) | |
BYZD1 | 备用字段1 | varchar | 100 | 否 | |
BYZD2 | 备用字段2 | varchar | 100 | 否 | |
BYZD3 | 备用字段3 | varchar | 100 | 否 | |
BYZD4 | 备用字段4 | varchar | 100 | 否 | |
BYZD5 | 备用字段5 | varchar | 100 | 否 |
示例报文
请求报文示例
<?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.1</version>
<interfaceCode>ECXML.SPXX.JS</interfaceCode>
<requestCode>P1000001</requestCode>
<requestTime>2019-11-13 17:12:43</requestTime>
<responseCode />
<dataExchangeId>P100000120191113911130309</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_SPXX class="REQUEST_SPXX">
<PRODUCT_NR>spxx_test_001</PRODUCT_NR>
<PRODUCT_NAME>测试商品</PRODUCT_NAME>
<UNIT>个</UNIT>
<SPEC></SPEC>
<PRICE>100.00</PRICE>
<SWBM>1010101030000000000</SWBM>
<SWBM_VER>33.0</SWBM_VER>
<YHZCBS>0</YHZCBS>
<LSLBS></LSLBS>
<ZZSTSGL></ZZSTSGL>
<TAX_RATE>0.06</TAX_RATE>
<BYZD1></BYZD1>
<BYZD2></BYZD2>
<BYZD3></BYZD3>
<BYZD4></BYZD4>
<BYZD5></BYZD5>
</REQUEST_SPXX>
</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.SPXX.JS</interfaceCode>
<requestCode>P1000001</requestCode>
<requestTime>2019-04-18 09:40:30</requestTime>
<responseCode>121</responseCode>
<dataExchangeId>P1000001ECXML.FPKJ.BC.E_INV20170407eXl4EymmJ</dataExchangeId>
<userName>P1000001</userName>
<passWord></passWord>
<taxpayerId>913101010000000090</taxpayerId>
<authorizationCode>NH873FG4KW</authorizationCode>
</globalInfo>
<returnStateInfo>
<returnCode>0000</returnCode>
<returnMessage>5ZWG5ZOB5L+h5oGv5ZCM5q2l5oiQ5Yqf77yB</returnMessage>
</returnStateInfo>
<Data>
<dataDescription>
<zipCode>0</zipCode>
<encryptCode>1</encryptCode>
<codeType>3DES</codeType>
</dataDescription>
<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.SPXX.JS</interfaceCode>
<requestCode>P1000001</requestCode>
<requestTime>17-04-07 16:40:30</requestTime>
<responseCode>121</responseCode>
<dataExchangeId>P1000001ECXML.FPKJ.BC.E_INV20170407eXl4EymmJ</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>