微算力 · API 导航与自营网关
API 接入 EN
未登录登录
✨

SmartBill Invoicing

SmartBill Invoicing · v1.0.8
入口已确认,内容待校验 文件树里有 SKILL.md,但正文还没采回,frontmatter 未核对。
安全 unknown 级 作者 maverick-ai-tech 公开目录收录
1.1k 下载 2 安装 5.2k 收藏 1 浏览

简介

SmartBill Invoicing

原始描述

Issue SmartBill invoices through the SmartBill.ro API with local automation. Use for SmartBill tasks such as validating invoice payloads, creating invoices,...

通过你的 Agent 添加

安装目录:smartbill-invoicing/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。

点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。

或者手动安装

Claude Code~/.claude/skills/smartbill-invoicing/
Codex CLI~/.codex/skills/smartbill-invoicing/
DeepSeek Harness~/.agents/skills/smartbill-invoicing/

包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可; 目录名不用换,也不要把包直接解压到 skills 根目录。 技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。

技能正文


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. metadata: openclaw: primaryEnv: SMARTBILL_TOKEN requires: env: - SMARTBILL_USERNAME - SMARTBILL_TOKEN - SMARTBILL_COMPANY_VAT_CODE bins: - python3

SmartBill Invoicing

Use scripts/smartbill_cli.py for deterministic SmartBill API calls instead of ad-hoc HTTP snippets.

Workflow

  1. Collect invoice input from the user.
  2. Validate payload locally before sending:
    • python scripts/smartbill_cli.py validate-payload --input references/invoice-example.json --show-payload
  3. Dry-run to inspect the normalized payload without calling the API:
    • python scripts/smartbill_cli.py create-invoice --input <invoice.json> --dry-run
  4. Issue final invoice after explicit user confirmation:
    • python scripts/smartbill_cli.py create-invoice --input <invoice.json> --allow-final
  5. Retrieve PDF once series and number are known:
    • python scripts/smartbill_cli.py download-invoice-pdf --series-name <SERIES> --number <NO> --output <file.pdf>
    • Use the exact number string returned by SmartBill (zero-padded, e.g. "0123"). Do not strip leading zeros or convert to an integer.
    • --output must be a relative path beneath the current working directory and must end in .pdf (e.g. invoices/TST-0123.pdf). Absolute paths and ../ traversals are rejected.

Required Environment

Set these before calling SmartBill:

  • SMARTBILL_USERNAME - SmartBill login email
  • SMARTBILL_TOKEN - SmartBill API token
  • SMARTBILL_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)
  • SMARTBILL_DEBUG (default: unset) — set to 1, true, or yes to enable request/response debug logging to stderr

Command Guide

  • validate-payload
    • Parse and normalize payload shape (bare invoice object or { "invoice": {...} } wrapper both accepted).
    • Validate minimum required structure before API calls.
  • create-invoice
    • Create invoice via POST /invoice.
    • Requires --allow-final to issue a final invoice.
    • Supports --dry-run (prints normalized payload, no API call) and --force-draft.
    • Pass --debug (or set SMARTBILL_DEBUG=1) to print full request/response payloads to stderr.
  • get-series
    • Query available SmartBill series via GET /series.
  • download-invoice-pdf
    • Fetch PDF via GET /invoice/pdf using CIF + series + number.
    • --output must be a relative .pdf path beneath the current working directory (e.g. invoices/TST-0123.pdf). Absolute paths and ../ traversals are rejected. The calling agent should cd to the desired output directory first if needed.

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-run first 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: false and products[].saveToDb: false to avoid persisting test data.
  • Preserve SmartBill response data (series, number, message) in run logs. Store number verbatim as returned — it is zero-padded (e.g. "0123") and must never be stripped of leading zeros or cast to an integer.
  • Respect SmartBill rate limits: max 30 calls per 10 seconds.

References

  • Read references/smartbill-api.md for payload field reference, endpoint mapping, and auth/rate-limit notes.
  • Use references/invoice-example.json as the canonical starting payload template.

正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。

标签

没有标签

同类 Skill