QBO Automation Skill
Automates QuickBooks Online operations: chart of accounts, bank rules, recurring transactions,
reconciliation, and journal entries. Backed by accounting domain knowledge.
Prerequisites
- - QBO account with admin or accountant access
- QBO API credentials (Client ID, Client Secret, Refresh Token) stored in environment:
-
QBO_CLIENT_ID
-
QBO_CLIENT_SECRET
-
QBO_REFRESH_TOKEN
-
QBO_REALM_ID (Company ID)
- - Node.js or Python environment for API calls (or use QBO's web UI with guided steps below)
1. Chart of Accounts Setup
Standard Account Hierarchy (US Small Business)
CODEBLOCK0
QBO API — Create Account (Python/requests)
CODEBLOCK1
Bulk Account Import (CSV → QBO)
QBO supports bulk import via Accountant Toolbox > Chart of Accounts > Import.
CSV format:
Account Name,Type,Detail Type,Account Number,Description,Balance
Checking Account,Bank,Checking,1000,Main operating account,0
Accounts Receivable,Accounts receivable,Accounts Receivable (A/R),1100,,0
Software Subscriptions,Expense,Other Miscellaneous Service Cost,6025,SaaS tools,,
2. Bank Rules Configuration
Bank rules auto-categorize imported bank/credit card transactions.
Rule Types
- - Category Rules — assign account + class/location
- Split Rules — divide transaction across multiple accounts
- Vendor Rules — auto-assign payee name
QBO UI Steps (no API — bank rules not in QBO API v3)
- 1. Go to Banking > Rules > New rule
- Set:
- Rule name: descriptive (e.g., "AWS Monthly Charges")
- Apply to: Money out / Money in
- Bank account: select account
- Conditions:
-
Description contains AMAZON WEB SERVICES
- Then:
- Category:
Software Subscriptions (6025)
- Payee:
Amazon Web Services
- Class (if tracking):
Operations
- 3. Save and run rule against unreviewed transactions
Common Bank Rule Templates
| Rule Name | Condition | Category | Notes |
|---|
| AWS Charges | Description contains "AMAZON WEB SERVICES" | Software Subscriptions | |
| Stripe Payouts |
Description contains "STRIPE" + Money In | Services Revenue | |
| Payroll - Gusto | Description contains "GUSTO" | Payroll Expenses | |
| Rent | Description contains "ACH RENT" | Rent or Lease | |
| Google Ads | Description contains "GOOGLE ADS" | Advertising & Marketing | |
| Bank Fee | Description contains "SERVICE FEE" | Bank Charges & Fees | |
| Owner Draw | Description contains "OWNER DRAW" | Owner's Draw | Equity |
Split Rule Example (Mixed Expense)
- - Rule: "Office & Meals Split"
- Condition: Payee is INLINECODE9
- Split:
- 60% → Office Supplies (6050)
- 40% → Meals & Entertainment (6040)
3. Recurring Transaction Templates
Recurring Bill Template (API)
CODEBLOCK3
Common Recurring Templates
| Template | Type | Frequency | Amount | Account |
|---|
| Office Rent | Bill | Monthly | Fixed | Rent or Lease |
| AWS |
Bill | Monthly | Variable | Software Subscriptions |
| Liability Insurance | Bill | Monthly | Fixed | Insurance |
| Owner's Draw | Check | Bi-weekly | Fixed | Owner's Draw |
| Depreciation Entry | Journal Entry | Monthly | Calculated | Depreciation |
Depreciation Journal Entry (Straight-Line)
Monthly entry template:
DEBIT Depreciation Expense (6300) $[amount]
CREDIT Accumulated Depreciation (1510) $[amount]
Memo: Monthly depreciation - [asset name]
4. Reconciliation Workflows
Monthly Reconciliation Checklist
- 1. Gather statements — Download bank/CC statements for the period
- Review unreviewed transactions — Banking > For Review; categorize all
- Run reconciliation — Accounting > Reconcile > select account
- Match ending balance to bank statement
- Investigate discrepancies:
- Duplicate transactions
- Missing transactions (manually add)
- Wrong amounts (edit/split)
- Timing differences (outstanding checks/deposits)
- 6. Finish reconciliation — generate reconciliation report
- Document — save PDF of reconciliation report
Reconciliation Discrepancy Quick-Fix Guide
| Discrepancy | Likely Cause | Fix |
|---|
| $X off exactly | Transposition error | Search for transposed digits |
| Amount doubled |
Duplicate import | Delete duplicate |
| Amount missing | Manual transaction needed | Add from source doc |
| Off by fraction | Rounding | Check bank rounding rules |
| Persistent gap | Beginning balance wrong | Correct prior period |
API: Fetch Unreconciled Transactions
CODEBLOCK5
5. Journal Entry Generation
Standard Journal Entry Template
CODEBLOCK6
Common Journal Entry Templates
Accrued Revenue
CODEBLOCK7
Prepaid Expense Recognition
CODEBLOCK8
Owner Investment
CODEBLOCK9
Crypto Asset Purchase (On-Chain)
DEBIT Crypto Assets (1201) $X [at cost basis in USD]
CREDIT Checking Account (1000) $X
Memo: Purchased [X ETH] at $[price] on [date] - TxHash: [0x...]
6. Reporting & Queries
Useful QBO Queries (SQL-like)
CODEBLOCK11
Negative Boundaries — When NOT to Use This Skill
- - Tax filing — use
qbo-to-tax-bridge for IRS schedule mapping and tax workpaper generation - Payroll processing — QBO Payroll and Gusto have dedicated APIs; this skill doesn't cover payroll runs or W-2/1099 filing
- OAuth setup — Getting QBO Client ID/Secret and initial token exchange requires a separate auth flow; this skill assumes credentials already exist
- Multi-entity consolidations — Each QBO realm is separate; consolidation across entities requires a dedicated reporting layer
- Audit-level assurance — This produces bookkeeping outputs; CPA review and sign-off are required for audit-level work
- Non-QBO accounting software — Xero, FreshBooks, Wave, Sage have different APIs; this skill is QBO-specific
- Real-time inventory management — QBO inventory has limitations; dedicated WMS systems (Fishbowl, etc.) are better for complex inventory
Environment Variables Reference
CODEBLOCK12
Quick Reference — QBO Account Types & Sub-Types
| Account Type | Common Sub-Types |
|---|
| Bank | Checking, Savings, MoneyMarket |
| Accounts Receivable |
AccountsReceivable |
| Other Current Asset | Prepaid Expenses, UndepositedFunds |
| Fixed Asset | Machinery, FurnitureAndFixtures, Vehicles |
| Accounts Payable | AccountsPayable |
| Credit Card | CreditCard |
| Other Current Liability | DirectDepositPayable, SalesTaxPayable |
| Long Term Liability | NotesPayable, OtherLongTermLiabilities |
| Equity | OpeningBalanceEquity, OwnersEquity, RetainedEarnings |
| Income | SalesOfProductIncome, ServiceFeeIncome |
| Cost of Goods Sold | SuppliesMaterialsCogs |
| Expense | AdvertisingPromotional, Insurance, RentOrLeaseOfBuildings |
| Other Income | OtherMiscellaneousIncome |
| Other Expense | Depreciation, OtherMiscellaneousExpense |
QBO 自动化技能
自动化QuickBooks Online操作:科目表、银行规则、定期交易、对账和日记账分录。以会计领域知识为支撑。
前提条件
- - 具有管理员或会计师权限的QBO账户
- 存储在环境变量中的QBO API凭证(客户端ID、客户端密钥、刷新令牌):
- QBO
CLIENTID
- QBO
CLIENTSECRET
- QBO
REFRESHTOKEN
- QBO
REALMID(公司ID)
- - 用于API调用的Node.js或Python环境(或按照以下引导步骤使用QBO的Web界面)
1. 科目表设置
标准科目层级(美国小型企业)
资产
1000 支票账户 (银行)
1010 储蓄账户 (银行)
1100 应收账款 (应收账款)
1200 库存资产 (其他流动资产)
1500 计算机设备 (固定资产)
1510 累计折旧 (固定资产)
负债
2000 应付账款 (应付账款)
2100 信用卡 (信用卡)
2200 工资负债 (其他流动负债)
2300 应交销售税 (其他流动负债)
2700 应付票据 (长期负债)
所有者权益
3000 所有者权益 (权益)
3100 所有者提款 (权益)
3200 留存收益 (权益)
收入
4000 服务收入 (收入)
4100 产品销售 (收入)
4200 其他收入 (其他收入)
销售成本
5000 销售成本 (销售成本)
费用
6000 广告与营销 (费用)
6010 银行手续费 (费用)
6020 会费与订阅 (费用)
6030 保险 (费用)
6040 餐饮与招待 (费用)
6050 办公用品 (费用)
6060 专业服务费 (费用)
6070 租金 (费用)
6080 公用事业费 (费用)
6090 车辆费用 (费用)
6100 差旅费 (费用)
6200 工资费用 (费用)
6300 折旧 (费用)
QBO API — 创建科目(Python/requests)
python
import requests, json, base64, os
def getaccesstoken():
用刷新令牌换取访问令牌。
credentials = base64.b64encode(
f{os.environ[QBOCLIENTID]}:{os.environ[QBOCLIENTSECRET]}.encode()
).decode()
resp = requests.post(
https://oauth.platform.intuit.com/oauth2/v1/tokens/bearer,
headers={
Authorization: fBasic {credentials},
Content-Type: application/x-www-form-urlencoded
},
data={
granttype: refreshtoken,
refreshtoken: os.environ[QBOREFRESH_TOKEN]
}
)
return resp.json()[access_token]
def createaccount(accesstoken, realmid, name, accounttype, accountsubtype, acct_num=None):
创建一个QBO科目。
payload = {
Name: name,
AccountType: account_type,
AccountSubType: accountsubtype
}
if acct_num:
payload[AcctNum] = acct_num
resp = requests.post(
fhttps://quickbooks.api.intuit.com/v3/company/{realm_id}/account,
headers={
Authorization: fBearer {access_token},
Content-Type: application/json,
Accept: application/json
},
json=payload
)
return resp.json()
示例:创建一个新的费用科目
token = get
accesstoken()
realm = os.environ[QBO
REALMID]
result = create_account(token, realm,
name=软件订阅,
account_type=Expense,
account
subtype=OtherMiscellaneousExpense,
acct_num=6025
)
print(result)
批量科目导入(CSV → QBO)
QBO支持通过会计师工具箱 > 科目表 > 导入进行批量导入。
CSV格式:
csv
科目名称,类型,明细类型,科目编号,描述,余额
支票账户,银行,支票,1000,主运营账户,0
应收账款,应收账款,应收账款(A/R),1100,,0
软件订阅,费用,其他杂项服务成本,6025,SaaS工具,,
2. 银行规则配置
银行规则自动分类导入的银行/信用卡交易。
规则类型
- - 类别规则 — 分配科目 + 类别/地点
- 拆分规则 — 将交易分配到多个科目
- 供应商规则 — 自动分配收款方名称
QBO界面步骤(无API — 银行规则不在QBO API v3中)
- 1. 前往银行 > 规则 > 新建规则
- 设置:
- 规则名称:描述性(例如,AWS月度费用)
- 应用于:支出 / 收入
- 银行账户:选择账户
- 条件:
- 描述
包含 AMAZON WEB SERVICES
- 然后:
- 类别:软件订阅 (6025)
- 收款方:Amazon Web Services
- 类别(如跟踪):运营
- 3. 保存并对未审核交易运行规则
常见银行规则模板
| 规则名称 | 条件 | 类别 | 备注 |
|---|
| AWS费用 | 描述包含AMAZON WEB SERVICES | 软件订阅 | |
| Stripe付款 |
描述包含STRIPE + 收入 | 服务收入 | |
| 工资 - Gusto | 描述包含GUSTO | 工资费用 | |
| 租金 | 描述包含ACH RENT | 租金 | |
| Google广告 | 描述包含GOOGLE ADS | 广告与营销 | |
| 银行费用 | 描述包含SERVICE FEE | 银行手续费 | |
| 所有者提款 | 描述包含OWNER DRAW | 所有者提款 | 权益 |
拆分规则示例(混合费用)
- - 规则:办公与餐饮拆分
- 条件:收款方为 Costco
- 拆分:
- 60% → 办公用品 (6050)
- 40% → 餐饮与招待 (6040)
3. 定期交易模板
定期账单模板(API)
python
def createrecurringtransaction(accesstoken, realmid):
创建一个月度定期账单模板。
payload = {
RecurDataRef: {
type: Bill,
},
RecurType: Scheduled,
ScheduleInfo: {
StartDate: 2026-01-01,
NextDate: 2026-04-01,
EndDate: None,
NumRemaining: None,
RecurFrequency: Monthly,
IntervalType: Monthly,
MaxOccurrences: None
},
Name: 月度租金 - 123 Main St,
Active: True,
VendorRef: {value: VENDORIDHERE},
Line: [
{
DetailType: AccountBasedExpenseLineDetail,
Amount: 3500.00,
AccountBasedExpenseLineDetail: {
AccountRef: {value: ACCOUNTIDFOR_RENT}
}
}
]
}
resp = requests.post(
fhttps://quickbooks.api.intuit.com/v3/company/{realm_id}/recurringtransaction,
headers={
Authorization: fBearer {access_token},
Content-Type: application/json,
Accept: application/json
},
json=payload
)
return resp.json()
常见定期模板
| 模板 | 类型 | 频率 | 金额 | 科目 |
|---|
| 办公室租金 | 账单 | 月度 | 固定 | 租金 |
| AWS |
账单 | 月度 | 可变 | 软件订阅 |
| 责任保险 | 账单 | 月度 | 固定 | 保险 |
| 所有者提款 | 支票 | 双周 | 固定 | 所有者提款 |
| 折旧分录 | 日记账分录 | 月度 | 计算 | 折旧 |
折旧日记账分录(直线法)
月度分录模板:
借 折旧费用 (6300) $[金额]
贷 累计折旧 (1510) $[金额]
备注:月度折旧 - [资产名称]
4. 对账工作流程
月度对账清单
- 1. 收集对账单 — 下载期间内的银行/信用卡对账单
- 审核未审核