SmartBill 发票助手:自动化本地 SmartBill API 发票 - Openclaw Skills
作者:互联网
2026-04-13
什么是 SmartBill 发票助手?
SmartBill 发票技能为与 SmartBill.ro API 交互提供了强大的接口,允许用户和 AI 代理精确管理计费文档。通过利用基于 Python 的本地 CLI,这一 Openclaw Skills 扩展可确保在执行任何外部 API 调用之前对发票数据进行验证和规范化。这可以防止常见错误,并为在专业会计工作流中生成草稿和正式发票提供安全环境。
下载入口:https://github.com/openclaw/skills/tree/main/skills/tokyo-s/smartbill
安装与下载
1. ClawHub CLI
从源直接安装技能的最快方式。
npx clawhub@latest install smartbill
2. 手动安装
将技能文件夹复制到以下位置之一
全局模式~/.openclaw/skills/
工作区
/skills/
优先级:工作区 > 本地 > 内置
3. 提示词安装
将此提示词复制到 OpenClaw 即可自动安装。
请帮我使用 Clawhub 安装 smartbill。如果尚未安装 Clawhub,请先安装(npm i -g clawhub)。
SmartBill 发票助手 应用场景
- 根据项目管理或电子商务数据自动创建合法发票。
- 在本地验证复杂的发票负载,以确保在提交前符合架构规范。
- 批量下载发票 PDF 以便存档或自动向客户发送电子邮件。
- 以编程方式管理多个单据系列并查询可用的编号序列。
- 从用户或数据源收集必要的发票详细信息,如客户信息和行项目。
- 使用 CLI 运行本地验证步骤,以确保负载结构符合 SmartBill 要求。
- 执行模拟运行以检查规范化后的负载,而不触及实时 API 端点。
- 执行发票创建命令,并在生成正式(非草稿)单据前获得用户的明确确认。
- 获取生成的系列号和发票号码,以编程方式下载并保存生成的 PDF 文档。
SmartBill 发票助手 配置指南
要在 Openclaw Skills 中开始使用此技能,请使用您的 SmartBill 凭据配置环境变量:
export SMARTBILL_USERNAME="your_email@example.com"
export SMARTBILL_TOKEN="your_api_token"
export SMARTBILL_COMPANY_VAT_CODE="RO12345678"
确保脚本目录中可以访问 smartbill_cli.py 脚本。
SmartBill 发票助手 数据架构与分类体系
该技能使用灵活的 JSON 结构处理数据。关键组件包括:
| 组件 | 描述 | 格式 |
|---|---|---|
| 发票负载 | 包含客户、产品和税务详情的主要对象。 | JSON 对象 |
| 系列数据 | 关于单据编号和系列名称的信息。 | 列表 |
| PDF 输出 | 从 API 获取的二进制文档。 | .pdf 文件 |
CLI 自动处理裸发票对象和封装的发票对象,以实现最大兼容性。
name: smartbill-invoicing description: Issue SmartBill invoices through the SmartBill.ro API with local automation. Use for SmartBill tasks such as validating invoice payloads, creating invoices, listing available document series, and downloading invoice PDFs by series and number.
SmartBill Invoicing
Use scripts/smartbill_cli.py for deterministic SmartBill API calls instead of ad-hoc HTTP snippets.
Workflow
- Collect invoice input from the user.
- Validate payload locally before sending:
python scripts/smartbill_cli.py validate-payload --input references/invoice-example.json --show-payload
- Dry-run to inspect the normalized payload without calling the API:
python scripts/smartbill_cli.py create-invoice --input--dry-run
- Issue final invoice after explicit user confirmation:
python scripts/smartbill_cli.py create-invoice --input--allow-final
- Retrieve PDF once series and number are known:
python scripts/smartbill_cli.py download-invoice-pdf --series-name--number --output
Required Environment
Set these before calling SmartBill:
SMARTBILL_USERNAME- SmartBill login emailSMARTBILL_TOKEN- SmartBill API tokenSMARTBILL_COMPANY_VAT_CODE- default CIF (optional but recommended)
Optional overrides:
SMARTBILL_API_BASE(default:https://ws.smartbill.ro/SBORO/api)SMARTBILL_TIMEOUT_SECONDS(default:30)SMARTBILL_RETRIES(default:2)
Command Guide
validate-payload- Parse and normalize payload shape (bare invoice object or
{ "invoice": {...} }wrapper both accepted). - Validate minimum required structure before API calls.
- Parse and normalize payload shape (bare invoice object or
create-invoice- Create invoice via
POST /invoice. - Requires
--allow-finalto issue a final invoice. - Supports
--dry-run(prints normalized payload, no API call) and--force-draft.
- Create invoice via
get-series- Query available SmartBill series via
GET /series.
- Query available SmartBill series via
download-invoice-pdf- Fetch PDF via
GET /invoice/pdfusing CIF + series + number.
- Fetch PDF via
Payload Format
The invoice payload is a flat JSON object sent directly to the SmartBill API. See references/invoice-example.json for the canonical minimal example and references/smartbill-api.md for field documentation.
Both formats are accepted as input to the CLI:
- Bare invoice object:
{ "companyVatCode": "...", "client": {...}, ... } - Wrapped:
{ "invoice": { "companyVatCode": "...", "client": {...}, ... } }
The CLI unwraps automatically and sends the invoice object directly to the API.
Operational Rules
- Always use
--dry-runfirst to confirm the normalized payload before hitting the API. - Treat final invoice issuance (
isDraft: false) as a high-impact action requiring explicit user confirmation. - Set
client.saveToDb: falseandproducts[].saveToDb: falseto avoid persisting test data. - Preserve SmartBill response data (series, number, message) in run logs.
- Respect SmartBill rate limits: max 30 calls per 10 seconds.
References
- Read
references/smartbill-api.mdfor payload field reference, endpoint mapping, and auth/rate-limit notes. - Use
references/invoice-example.jsonas the canonical starting payload template.
相关推荐
专题
+ 收藏
+ 收藏
+ 收藏
+ 收藏
+ 收藏
+ 收藏
最新数据
相关文章
验证检查点:自动化代码验证 - Openclaw Skills
bird:用于阅读、搜索和发布内容的 X/Twitter 命令行工具 - Openclaw Skills
Bird:X/Twitter 命令行工具,用于阅读、搜索和发布 - Openclaw Skills
bird:用于阅读和发布的 X/Twitter CLI - Openclaw Skills
bird:面向 AI 智能体的 X/Twitter 命令行工具 - Openclaw Skills
自动更新器:自动化 AI 智能体与技能更新 - Openclaw Skills
自动更新程序:Openclaw 技能的自动化维护
自动更新器:自动化智能体与技能维护 - Openclaw Skills
自动更新器:自动执行核心与技能更新 - Openclaw Skills
Agent Browser:AI 智能体网页自动化 CLI - Openclaw Skills
AI精选
