← 返回 Skills 市场
xiaoyierle

发票查验(invoice-verify) - 慧穗云

作者 小毅尔勒 · GitHub ↗ · v1.0.1 · MIT-0
cross-platform ✓ 安全检测通过
310
总下载
1
收藏
0
当前安装
2
版本数
在 OpenClaw 中安装
/install invoice-verify-hsy
功能描述
使用慧穗云发票查验 API,根据发票代码、号码、日期和金额等信息查询发票详情。
使用说明 (SKILL.md)

发票查验-慧穗云(Invoice Verify)

基于慧穗云官方 API 的发票查验技能,支持通过发票代码、号码、开票日期、金额等信息查验发票真伪。

环境变量配置

# Linux / macOS
export HSY_API_URL="https://huisuiyun.com"
export HSY_AK="your_ak_here"
export HSY_SK="your_sk_here"
export HSY_TYPE="2"  # 1: ISV等级AKSK, 2: 慧穗云等级AKSK

# Windows PowerShell
$env:HSY_API_URL="https://huisuiyun.com"
$env:HSY_AK="your_ak_here"
$env:HSY_SK="your_sk_here"
$env:HSY_TYPE="2"

获取 AK/SK:

  • 慧穗云秘钥管理:https://huisuiyun.com/account/conf/secretkey

注意: 如果未配置环境变量,脚本会返回包含配置链接的错误信息,方便用户快速获取秘钥。

脚本路径

脚本文件:skills/invoice-verify-hsy/invoice-verify-hsy.py

使用方式

1. 查验发票信息

通过 /api/v2/agent/cdk/invoice/check 接口查验增值税发票接口文档

python3 skills/invoice-verify-hsy/invoice-verify-hsy.py verify '{"storeFlag":0,"invoiceList":[{"invoiceCode":"3300201130","invoiceNo":"00517731","amount":7559.41,"drewDate":"2021-06-22","invoiceType":"01"}]}'

请求 JSON 示例:

{
  "storeFlag": 0,
  "invoiceList": [
    {
      "invoiceCode": "3300201130",
      "invoiceNo": "00517731",
      "amount": 7559.41,
      "drewDate": "2021-06-22",
      "invoiceType": "01"
    }
  ]
}

请求参数(verify)

字段名 类型 必填 说明
storeFlag Integer 入库标识:0-入库,1-不入库,默认不入库
invoiceList array 发票信息集合(一次查验不超过20张)

invoiceList 数组中每个对象的字段:

字段名 类型 必填 说明
invoiceNo String 发票号码,如:00517731
drewDate String 开票日期,格式:YYYY-MM-DD,如:2021-06-22
invoiceCode String 发票代码,如:3300201130(全电发票无需传入)
invoiceType String 发票类型:01-增值税专用发票,08-增值税专用发票(电子),04-增值税普通发票,10-增值税普通发票(电子),09-数电发票(增值税专用发票),90-数电发票(普通发票)等
amount BigDecimal 金额:专票(01、08、85)传入不含税金额,数电发票(09、90、51、61)传入价税合计
checkCode String 校验码后六位,普票(04、10、11、14、86)必传
originFileFlag Integer 是否获取版式文件:1-是,0-否
exten1-10 String 扩展字段1-10

返回结果示例(verify)

{
  "code": "200",
  "message": "OK",
  "serialNo": "637680840671330304",
  "data": [
    {
      "checkFlag": true,
      "invoiceCodeNo": "3300201130-00517731",
      "exceptionInfo": null,
      "invoiceVO": {
        "invoiceType": "01",
        "invoiceCode": "3300201130",
        "invoiceNo": "00517731",
        "drewDate": "2021-06-22",
        "checkCode": "56660956691714098653",
        "amount": 7559.41,
        "amountWithTax": 7635,
        "taxAmount": 75.59,
        "sellerName": "杭州江湖有旅人********公司",
        "sellerTaxNo": "91330100MA2H3LL62A",
        "purchaserName": "慧穗数字科技(上海)********司",
        "purchaserTaxNo": "91330108********U",
        "invoiceStatus": 0,
        "detailList": [
          {
            "goodsName": "*设计服务*活动策划",
            "amount": 7559.41,
            "taxRate": 1,
            "taxAmount": 75.59
          }
        ]
      }
    }
  ]
}

返回参数说明

参数名 类型 说明
code String 返回状态码:200-成功
serialNo String 返回流水号
message String 返回信息
data Array 查验返回的信息数组
data[i].checkFlag Boolean 查验是否成功:true-成功,false-失败
data[i].invoiceCodeNo String 查验的发票代码+号码
data[i].exceptionInfo String 查验失败的异常信息
data[i].invoiceVO Object 票面信息(查验成功时返回)
invoiceVO.invoiceStatus Integer 发票状态:0-正常,1-作废,2-红冲,3-失控,4-异常,7-部分红冲,8-全额红冲,80-红冲发票待确认
invoiceVO.amount Decimal 不含税金额
invoiceVO.amountWithTax Decimal 含税金额
invoiceVO.taxAmount Decimal 税额
invoiceVO.sellerName String 销方名称
invoiceVO.sellerTaxNo String 销方税号
invoiceVO.purchaserName String 购方名称
invoiceVO.purchaserTaxNo String 购方税号
invoiceVO.detailList Array 发票明细

常见错误码

错误码 说明
200 查验成功
501 连接超时,请稍后重试
其他 详见接口返回的 message

注意事项

  1. 本接口支持多发票查验,一次查验张数应不大于20张
  2. 同一张票每天最多可以查验5次
  3. Token 有效期为30天,超出有效期后需重新获取
  4. 全电发票查验时发票类型必填
  5. 专票传入不含税金额,数电发票传入价税合计
  6. 普票必须传入校验码后六位

在 OpenClaw 中的推荐用法

  1. 用户提供发票信息(发票代码、号码、开票日期、金额等)
  2. 代理构造 JSON 请求体,根据发票类型填写相应的必填字段
  3. 调用:python3 skills/invoice-verify-hsy/invoice-verify-hsy.py verify '\x3CJSON_BODY>'
  4. 从返回结果中读取查验状态和发票详细信息,并向用户总结发票是否有效及关键信息

如需了解更多欢迎扫码联系

image

安全使用建议
This skill appears to do what it says: it uses your HSY AK/SK to obtain a token and call 慧穗云's invoice-check API. Before installing: (1) confirm you trust huisuiyun.com and are comfortable providing HSY_AK/HSY_SK to this skill; (2) note the script requires the Python 'requests' package although only 'python3' is declared—install or vendor that dependency; (3) be aware HSY_API_URL and HSY_TYPE are used (with defaults) but not listed as required env vars in metadata—set them explicitly if you use a non-default endpoint or type; (4) run the script in an isolated environment (or inspect/modify the code) if you want to limit exposure of credentials. Otherwise the skill is internally consistent and not requesting unexpected privileges.
功能分析
Type: OpenClaw Skill Name: invoice-verify-hsy Version: 1.0.1 The skill is a legitimate integration for the Huisuiyun (慧穗云) invoice verification service. The Python script (invoice-verify-hsy.py) implements a standard authentication flow using MD5-hashed API keys and performs authorized API calls to the official domain (huisuiyun.com). No evidence of data exfiltration, malicious command execution, or prompt injection was found.
能力评估
Purpose & Capability
Name/description match the requested credentials (HSY_AK, HSY_SK) and the code calls 慧穗云 token and invoice-check endpoints. No unrelated credentials, binaries, or config paths are requested.
Instruction Scope
SKILL.md instructs running the included Python script with JSON payloads and documents the expected API behavior. The instructions only reference the service endpoints and the configured HSY env vars; they do not read unrelated files or attempt to transmit data to unexpected endpoints.
Install Mechanism
This is instruction-only (no install spec) which is low-risk, but the Python script depends on the third-party 'requests' package while the skill only declares 'python3' as a required binary. That mismatch may cause runtime failure if 'requests' is not available and should be clarified or the dependency declared.
Credentials
Required secrets HSY_AK and HSY_SK are appropriate for the stated API usage. The script also reads HSY_API_URL and HSY_TYPE (with sensible defaults), but SKILL metadata did not declare HSY_API_URL or HSY_TYPE as required env vars—this mismatch should be documented. No unrelated secrets are requested.
Persistence & Privilege
The skill does not request permanent presence (always:false) and does not modify other skills or system settings. It simply makes outbound HTTPS calls to the configured API.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install invoice-verify-hsy
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /invoice-verify-hsy 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.1
- 文档新增了慧穗云 AK/SK 获取地址说明,便于用户快速获取 API 密钥。 - 明确提示:缺少环境变量时,脚本会返回带有获取链接的错误信息,优化新手指引体验。 - 返回参数“invoiceStatus”补充了更多取值,新增了部分(7)、全额(8)、待确认(80)红冲等状态说明。 - 接口文档链接格式优化,查验接口说明更简洁明了。
v1.0.0
- Initial release of the huisuiyun-invoiceverify-hsy skill. - Allows querying Chinese invoices via the Huisuiyun API using invoice code, number, date, and amount. - Detailed usage instructions, environment variable setup, and command-line invocation provided. - Supports batch verification (up to 20 invoices at once) and returns invoice authenticity and detailed information. - Error codes, parameter requirements, and example inputs/outputs included for reference.
元数据
Slug invoice-verify-hsy
版本 1.0.1
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 2
常见问题

发票查验(invoice-verify) - 慧穗云 是什么?

使用慧穗云发票查验 API,根据发票代码、号码、日期和金额等信息查询发票详情。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 310 次。

如何安装 发票查验(invoice-verify) - 慧穗云?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install invoice-verify-hsy」即可一键安装,无需额外配置。

发票查验(invoice-verify) - 慧穗云 是免费的吗?

是的,发票查验(invoice-verify) - 慧穗云 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

发票查验(invoice-verify) - 慧穗云 支持哪些平台?

发票查验(invoice-verify) - 慧穗云 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 发票查验(invoice-verify) - 慧穗云?

由 小毅尔勒(@xiaoyierle)开发并维护,当前版本 v1.0.1。

💬 留言讨论