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

智能财务管理与会计自动化

QuickBooks · v1.0.6
专业技能 安全 A 级 作者 byungkyu 公开目录收录
6k 下载 5 安装 28.8k 收藏 149 浏览

简介

依托Maton平台和QuickBooks API,提供安全的OAuth托管连接,可直接在对话中管理客户、发票、支付及财报,提升财务效率。

原始描述

QuickBooks API integration with managed OAuth. Install only if you need QuickBooks accounting administration. Connect with a least-privileged QuickBooks acco...

通过你的 Agent 添加

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

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

或者手动安装

Claude Code~/.claude/skills/quickbooks/
Codex CLI~/.codex/skills/quickbooks/
DeepSeek Harness~/.agents/skills/quickbooks/

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

中文使用说明 来自收录源

核心用法

QuickBooks 技能通过 Maton 平台实现了对 QuickBooks Online API 的托管式 OAuth 认证访问,允许用户在 Agent 对话中直接与 QuickBooks 数据进行交互。核心功能包括:

  • 客户与供应商管理:支持查询、创建、更新客户和供应商信息。
  • 发票管理:可创建发票、查询发票列表,并支持删除(作废)发票。
  • 支付管理:支持创建支付记录,并与对应发票关联。
  • 财务报告:可直接生成利润与损失表(Profit and Loss)和资产负债表(Balance Sheet)。
  • 批量操作:支持通过批量接口(batch)在一次请求中执行多个查询。
  • 连接管理:内置了完整的连接生命周期管理,包括创建、列出、获取和删除 QuickBooks OAuth 连接,并支持通过请求头指定特定连接,避免多账户混淆。

该技能严格遵循安全原则,默认建议只读操作,所有写入操作(创建、更新、删除)都需要经过明确的风险提示和用户确认。

显著优点

  1. 简化集成流程:通过 Maton 网关代理,开发者无需自行处理 QuickBooks 复杂的 OAuth 2.0 流程,只需配置 API 密钥和环境变量即可快速调用。
  2. 安全性设计完善:内置了详细的安全指引,包括最小权限原则、写入操作强制确认机制、连接 ID 验证等,有效降低了因自动化操作导致的财务数据错误风险。
  3. 交互友好:技能文档提供了丰富的 Python、Bash 和 JavaScript 代码示例,并给出了清晰的使用场景说明。SQL 式查询语言降低了非程序员的理解门槛。
  4. 财务深度集成:不仅能操作基础客户数据,还能处理发票、支付等核心记账实体,并直接获取专业财务报表,适合深度的财务管理需求。

潜在缺点或局限性

  1. 平台依赖性强:该技能完全依赖 Maton 平台作为中间件,如果 Maton 服务不稳定或发生变更,将直接影响技能的正常使用。
  2. 速率限制:存在明确的 API 频率限制(10 次/秒/账户),对于高并发的自动化场景可能成为瓶颈。
  3. 功能覆盖不全:虽然覆盖了主要的会计实体,但相比完整的 QuickBooks API,仍有一些高级实体(如账单、预算、分类账等)或复杂查询可能暂未开放或未在文档中列出。
  4. 错误处理局限:大部分错误直接透传自 QuickBooks API,用户需要具备一定 QuickBooks 错误码理解能力才能快速定位问题。

适合的目标群体

  • 中小企业主及财务人员:希望在日常办公中通过自然语言或简单脚本快速查询财务数据、创建发票并生成报表。
  • 开发者与系统集成商:需要将 QuickBooks 数据集成到自定义工作流、内部仪表盘或自动化脚本中,而无需关注底层 OAuth 维护。
  • 使用 Agent 自动化工作流的团队:适合需要在 AI Agent 中集成会计写作和审批流程的团队。

使用风险

  • 财务数据一致性风险:虽然技能有写入确认机制,但如果在未经仔细核对客户 ID、金额和账户的情况下批准操作,可能导致记账错误、重复扣款或发票作废不可逆等问题。
  • 环境变量泄露:作为技能前置条件,MATON_API_KEY 是访问财务系统的钥匙。若 Agent 运行环境或日志中存在密钥泄露,未授权者可能获取完整的 QuickBooks 读写权限。
  • 连接混淆风险:如果管理员管理多个公司文件,忘记指定 Maton-Connection 请求头,操作可能会意外发送到默认的错误公司,造成严重的财务数据污染。
  • 供应商锁定:深度嵌入 Maton 生态意味着迁移成本较高,如果未来转用其他 API 网关或直连 QuickBooks,需要重构相关调用代码。

技能正文


name: quickbooks description: | QuickBooks API integration with managed OAuth. Install only if you need QuickBooks accounting administration. Connect with a least-privileged QuickBooks account, verify the intended connection ID before each request, and revoke unused connections promptly. This integration can mutate accounting records — approve only specific write actions after checking the exact endpoint, account, resource ID, amounts, and consequence. For other third party apps, use the api-gateway skill (https://clawhub.ai/byungkyu/api-gateway). compatibility: Requires network access and valid Maton API key metadata: author: maton version: "1.0" clawdbot: emoji: 🧠 requires: env: - MATON_API_KEY

QuickBooks

Access the QuickBooks Online API with managed OAuth authentication. Manage customers, vendors, invoices, payments, and run financial reports.

Quick Start

# Query customers
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://api.maton.ai/quickbooks/v3/company/:realmId/query?query=SELECT%20*%20FROM%20Customer%20MAXRESULTS%20100')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

Base URL

https://api.maton.ai/quickbooks/{endpoint-path}

The gateway proxies requests to quickbooks.api.intuit.com and the :realmId placeholder is automatically replaced with your company's realm ID from connection config. Only the endpoints documented in the API Reference section below are supported — always use specific endpoint paths from that section rather than constructing arbitrary paths.

Authentication

All requests require the Maton API key in the Authorization header:

Authorization: Bearer $MATON_API_KEY

Environment Variable: Set your API key as MATON_API_KEY:

export MATON_API_KEY="YOUR_API_KEY"

Getting Your API Key

  1. Sign in or create an account at maton.ai
  2. Go to maton.ai/settings
  3. Copy your API key

Connection Management

Manage your QuickBooks OAuth connections at https://api.maton.ai.

List Connections

python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://api.maton.ai/connections?app=quickbooks&status=ACTIVE')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

Create Connection

python <<'EOF'
import urllib.request, os, json
data = json.dumps({'app': 'quickbooks'}).encode()
req = urllib.request.Request('https://api.maton.ai/connections', data=data, method='POST')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
req.add_header('Content-Type', 'application/json')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

Get Connection

python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://api.maton.ai/connections/{connection_id}')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

Response:

{
  "connection": {
    "connection_id": "{connection_id}",
    "status": "ACTIVE",
    "creation_time": "2025-12-08T07:20:53.488460Z",
    "last_updated_time": "2026-01-31T20:03:32.593153Z",
    "url": "https://connect.maton.ai/?session_token=...",
    "app": "quickbooks",
    "metadata": {}
  }
}

Open the returned url in a browser to complete OAuth authorization.

Delete Connection

python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://api.maton.ai/connections/{connection_id}', method='DELETE')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

Specifying Connection

If you have multiple QuickBooks connections, specify which one to use with the Maton-Connection header:

python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://api.maton.ai/quickbooks/v3/company/:realmId/companyinfo/:realmId')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
req.add_header('Maton-Connection', '{connection_id}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

Always include the Maton-Connection header to ensure requests go to the intended QuickBooks company, especially before any write operation. If you have multiple connections and omit this header, the gateway uses a default connection, which may not be the intended account.

Security & Permissions

  • Access is scoped to the QuickBooks resources permitted by the connected account's OAuth scopes. Only install if you need QuickBooks accounting administration. Use least-privilege access and revoke unused connections promptly.
  • Default to read-only operations. Always start by listing or retrieving resources to confirm identifiers, amounts, and account context before proposing any changes.
  • All write operations require explicit user approval with specific details. Before executing any POST or delete call:
    1. Retrieve and display the target resource (customer name/ID, invoice number, payment amount) so the user can verify.
    2. Clearly describe the intended effect (e.g., "This will void invoice #1042 ($500.00) for customer 'Acme Corp' — this cannot be undone").
    3. Wait for explicit user confirmation before proceeding.
  • Accounting operations are high-impact. Any action that creates, modifies, or deletes invoices, payments, bills, or customer records affects financial books. These actions must include a summary of financial consequences and require confirmation.

API Reference

Company Info

GET /quickbooks/v3/company/:realmId/companyinfo/:realmId

Customers

Query Customers
GET /quickbooks/v3/company/:realmId/query?query=SELECT%20*%20FROM%20Customer%20MAXRESULTS%20100
Get Customer
GET /quickbooks/v3/company/:realmId/customer/{customerId}
Create Customer
POST /quickbooks/v3/company/:realmId/customer
Content-Type: application/json

{
  "DisplayName": "John Doe",
  "PrimaryEmailAddr": {"Address": "john@example.com"},
  "PrimaryPhone": {"FreeFormNumber": "555-1234"}
}
Update Customer

Requires Id and SyncToken from previous GET:

POST /quickbooks/v3/company/:realmId/customer
Content-Type: application/json

{
  "Id": "123",
  "SyncToken": "0",
  "DisplayName": "John Doe Updated"
}

Invoices

Query Invoices
GET /quickbooks/v3/company/:realmId/query?query=SELECT%20*%20FROM%20Invoice%20MAXRESULTS%20100
Create Invoice
POST /quickbooks/v3/company/:realmId/invoice
Content-Type: application/json

{
  "CustomerRef": {"value": "123"},
  "Line": [
    {
      "Amount": 100.00,
      "DetailType": "SalesItemLineDetail",
      "SalesItemLineDetail": {
        "ItemRef": {"value": "1"},
        "Qty": 1
      }
    }
  ]
}
Delete Invoice
POST /quickbooks/v3/company/:realmId/invoice?operation=delete
Content-Type: application/json

{
  "Id": "123",
  "SyncToken": "0"
}

Payments

Create Payment
POST /quickbooks/v3/company/:realmId/payment
Content-Type: application/json

{
  "CustomerRef": {"value": "123"},
  "TotalAmt": 100.00,
  "Line": [
    {
      "Amount": 100.00,
      "LinkedTxn": [{"TxnId": "456", "TxnType": "Invoice"}]
    }
  ]
}

Reports

Profit and Loss
GET /quickbooks/v3/company/:realmId/reports/ProfitAndLoss?start_date=2024-01-01&end_date=2024-12-31
Balance Sheet
GET /quickbooks/v3/company/:realmId/reports/BalanceSheet?date=2024-12-31

Batch Operations

POST /quickbooks/v3/company/:realmId/batch
Content-Type: application/json

{
  "BatchItemRequest": [
    {"bId": "1", "Query": "SELECT * FROM Customer MAXRESULTS 2"},
    {"bId": "2", "Query": "SELECT * FROM Vendor MAXRESULTS 2"}
  ]
}

Query Language

QuickBooks uses SQL-like queries:

SELECT * FROM Customer WHERE DisplayName LIKE 'John%' MAXRESULTS 100

Operators: =, LIKE, <, >, <=, >=, IN

SyncToken

All updates require the current SyncToken:

  1. GET the entity to get current SyncToken
  2. Include Id and SyncToken in POST body
  3. If SyncToken doesn't match, update fails

Code Examples

JavaScript

const response = await fetch(
  'https://api.maton.ai/quickbooks/v3/company/:realmId/query?query=SELECT%20*%20FROM%20Customer',
  {
    headers: {
      'Authorization': `Bearer ${process.env.MATON_API_KEY}`
    }
  }
);

Python

import os
import requests

response = requests.get(
    'https://api.maton.ai/quickbooks/v3/company/:realmId/query',
    headers={'Authorization': f'Bearer {os.environ["MATON_API_KEY"]}'},
    params={'query': 'SELECT * FROM Customer MAXRESULTS 10'}
)

Notes

  • :realmId is automatically replaced by the router
  • All queries must be URL-encoded
  • Use MAXRESULTS to limit query results
  • Dates are in YYYY-MM-DD format
  • Soft delete entities by setting Active: false
  • IMPORTANT: When using curl commands, use curl -g when URLs contain brackets (fields[], sort[], records[]) to disable glob parsing
  • IMPORTANT: When piping curl output to jq or other commands, environment variables like $MATON_API_KEY may not expand correctly in some shell environments. You may get "Invalid API key" errors when piping.

Error Handling

Status Meaning
400 Missing QuickBooks connection
401 Invalid or missing Maton API key
429 Rate limited (10 req/sec per account)
4xx/5xx Passthrough error from QuickBooks API

Troubleshooting: API Key Issues

  1. Check that the MATON_API_KEY environment variable is set:
echo $MATON_API_KEY
  1. Verify the API key is valid by listing connections:
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://api.maton.ai/connections')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

Troubleshooting: Invalid App Name

  1. Ensure your URL path starts with quickbooks. For example:
  • Correct: https://api.maton.ai/quickbooks/v3/company/:realmId/query
  • Incorrect: https://api.maton.ai/v3/company/:realmId/query

Resources

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

标签

finance-accountingapiautomationproductivity

同类 Skill