Install
openclaw skills install invoice-cert发票认证技能。税局登录、发票勾选认证、抵扣统计。适用于进项发票勾选、认证、统计等税务操作场景。
openclaw skills install invoice-cert使用此技能进行税局登录、发票勾选认证、查询认证状态、申请抵扣统计等操作。
满足以下需求时使用:
以下用户输入应触发此技能:
执行前准备以下参数:
无额外参数。
无额外参数。
批量处理规则:
前置检查(最高优先级):检查环境变量 ZXT_API_KEY 是否已设置。
注意:当前 shell 会话可能未继承 Windows 用户级环境变量,必须按以下方式检查,不能仅依赖 $ZXT_API_KEY:
powershell -Command "[System.Environment]::GetEnvironmentVariable('ZXT_API_KEY', 'User')" 获取用户级环境变量值,同时检查 $ZXT_API_KEY。$ZXT_API_KEY 即可。如果以上检查结果均为空,禁止执行任何后续操作,立即向用户输出以下提示并停止:
您需要完成以下三步,即可自动配置并执行技能:
注册账号 访问中兴通简税Skill平台:https://skill.quandianfapiao.com/ 完成注册。
申请 apiKey 登录后进入"技能中心",复制您的 apiKey。
提供 apiKey 将复制的 apiKey 发送给我,我将为您完成配置并立即执行技能。
严格限制:前置检查未通过时,禁止执行任何其他动作,包括但不限于:
只允许输出提示信息,然后停止,等待用户提供 apiKey。
用户提供 apiKey 后,写入系统环境变量并使当前会话生效:
setx ZXT_API_KEY <apiKey> 写入用户级环境变量,然后执行 export ZXT_API_KEY=<apiKey> 使当前会话生效。export ZXT_API_KEY=<apiKey> 追加到 ~/.bashrc 或 ~/.zshrc(根据用户使用的 shell),同时执行 export ZXT_API_KEY=<apiKey> 使当前会话生效。环境变量就绪后,继续以下步骤:
python,macOS/Linux 使用 python3),脚本优先使用 --api-key 参数,未传则回退读取环境变量 ZXT_API_KEY。调用登录接口后,根据 returnType 分支处理:
send-sms)→ 输入验证码完成登录(login-sms)。--area-code 参数重新登录。| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| apiKey | string | 是 | apiKey |
| creditCode | string | 是 | 税号(纳税人识别号) |
| account | string | 否 | 税局账号 |
| password | string | 否 | 税局密码 |
| areaCode | string | 否 | 地区码(如 BJ、TJ) |
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| apiKey | string | 是 | apiKey |
| creditCode | string | 是 | 纳税人识别号 |
| account | string | 是 | 税局账号 |
| smsCode | string | 是 | 短信验证码 |
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| apiKey | string | 是 | apiKey |
| creditCode | string | 是 | 纳税人识别号 |
| account | string | 是 | 税局账号 |
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| apiKey | string | 是 | apiKey |
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| apiKey | string | 是 | apiKey |
返回 data 为税款所属期字符串,如 "2026-05"。
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| apiKey | string | 是 | apiKey |
| commitType | string | 是 | 1 申请统计,2 撤销统计 |
| bz | string | 是 | N 忽略未勾选发票直接统计,Y 取消未完成的统计状态 |
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| apiKey | string | 是 | apiKey |
| skssq | string | 否 | 税款所属期,不填默认当前属期 |
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| apiKey | string | 是 | apiKey |
| skssq | string | 否 | 税款所属期,不填默认当前属期 |
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| apiKey | string | 是 | apiKey |
| invoiceNumber | string | 是 | 发票号码 |
| invoiceDate | string | 是 | 开票日期(YYYY-MM-DD) |
| invoiceCode | string | 否 | 发票代码 |
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| apiKey | string | 是 | apiKey |
| commitType | string | 是 | 1 勾选认证,2 取消勾选认证 |
| skssq | string | 否 | 税款所属期,不填默认当前属期 |
| list | array | 是 | 发票列表,每条含 invoiceCode、kprq、invoiceNumber |
| 字段 | 类型 | 说明 |
|---|---|---|
| returnType | string | 4000 直接登录成功,4001 需验证码,4002 需设置地区 |
| loginMobile | string | 带*手机号(returnType=4001 时返回) |
| areaList | array | 地区列表(returnType=4002 时返回),含 areaCode、areaName |
| 字段 | 说明 |
|---|---|
| invoiceCode | 发票代码 |
| invoiceNumber | 发票号码 |
| qdfphm | 全电发票号码 |
| kprq | 开票日期 |
| hjje | 合计金额 |
| hjse | 合计税额 |
| jshj | 价税合计 |
| fplx | 发票类型 |
| fplxName | 发票类型名称 |
| xsfNsrsbh | 销售方税号 |
| xsfMc | 销售方名称 |
| 字段 | 说明 |
|---|---|
| invoiceCode | 发票代码 |
| invoiceNumber | 发票号码 |
| kprq | 开票日期 |
| hjje | 合计金额 |
| hjse | 合计税额 |
| gxzt | 勾选状态:0 未勾选,1 已勾选 |
| skssq | 认证属期 |
| 字段 | 说明 |
|---|---|
| successCount | 成功数量 |
| failCount | 失败数量 |
| successList | 成功集合 |
| failLIst | 失败集合 |
| skssq | 当前税款所属期 |
| 状态码 | 说明 |
|---|---|
| 400 | 请求参数错误 |
| 300 | 参数为空或格式错误 |
| 305 | 无权访问该接口 |
| 307 | 消费失败,授权余次不足 |
| 308 | 超出接口调用次数 |
| 309 | 税局未登录,需先登录税局 |
| 500 | 系统异常 |
税局登录:
python .claude/skills/invoice-cert/invoice_cert.py login --credit-code "911101087582285868" --account "account" --password "password"
发送验证码:
python .claude/skills/invoice-cert/invoice_cert.py send-sms --credit-code "911101087582285868" --account "account"
验证码登录:
python .claude/skills/invoice-cert/invoice_cert.py login-sms --sms-code "123456" --credit-code "911101087582285868" --account "account"
确认签名:
python .claude/skills/invoice-cert/invoice_cert.py sign
查询当前税款所属期:
python .claude/skills/invoice-cert/invoice_cert.py current-period
查询发票认证状态:
python .claude/skills/invoice-cert/invoice_cert.py check-status --invoice-number "26127000000211930033" --invoice-date "2026-05-12"
查询当前属期认证发票:
python .claude/skills/invoice-cert/invoice_cert.py checked-invoices
查询指定属期认证发票(历史记录):
python .claude/skills/invoice-cert/invoice_cert.py checked-invoices --skssq "202604"
提交勾选认证(单张):
python .claude/skills/invoice-cert/invoice_cert.py commit-deduction --commit-type "1" --invoices "011002000311,2026-05-12,26127000000211930033"
提交勾选认证(多张,自动按开票日期排序,每批最多 50 张):
python .claude/skills/invoice-cert/invoice_cert.py commit-deduction --commit-type "1" --invoices "011002000311,2026-05-10,26127000000211930033" "011002000311,2026-05-12,26127000000211930034" "011002000311,2026-05-08,26127000000211930035"
申请统计:
python .claude/skills/invoice-cert/invoice_cert.py statistics --commit-type "1" --bz "N"
查询抵扣统计:
python .claude/skills/invoice-cert/invoice_cert.py deduct-stats