myob-api-integration
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseMYOB API Integration Skill
MYOB API集成Skill
Provides read-only access to MYOB accounting data through the MYOB API. Extracts historical transactions, chart of accounts, contacts, and financial reports for tax analysis.
通过MYOB API提供对MYOB会计数据的只读访问权限。提取历史交易记录、会计科目表、联系人信息以及财务报告,用于税务分析。
When to Use
适用场景
- Connecting a MYOB client for tax analysis (instead of Xero)
- Extracting historical transaction data from MYOB
- Fetching chart of accounts for GL mapping
- Pulling profit & loss and balance sheet reports
- Multi-year data sync for carry-forward analysis
- 为税务分析连接MYOB客户(替代Xero)
- 从MYOB提取历史交易数据
- 获取会计科目表用于总账映射
- 拉取利润表和资产负债表报告
- 多年度数据同步用于结转分析
Integration Architecture
集成架构
MYOB API → myob-adapter.ts → canonical-schema.ts → analysis enginesAll MYOB data is normalised to the canonical schema () before being consumed by analysis engines. This ensures all 16 engines work identically regardless of whether data comes from Xero, MYOB, or QuickBooks.
lib/integrations/canonical-schema.tsMYOB API → myob-adapter.ts → canonical-schema.ts → analysis engines所有MYOB数据在被分析引擎处理前,都会被标准化为规范模型()。这确保了全部16个引擎无论数据来自Xero、MYOB还是QuickBooks,都能以相同方式运行。
lib/integrations/canonical-schema.tsKey Files
关键文件
- Adapter: — MYOB API client
lib/integrations/adapters/myob-adapter.ts - Historical Fetcher: — Multi-year data sync
lib/integrations/myob-historical-fetcher.ts - Canonical Schema: — Normalised data model
lib/integrations/canonical-schema.ts - Config: — OAuth configuration
lib/integrations/myob-config.ts - Auth Route: — OAuth 2.0 callback
app/api/auth/myob/route.ts
- 适配器:— MYOB API客户端
lib/integrations/adapters/myob-adapter.ts - 历史数据获取器:— 多年度数据同步
lib/integrations/myob-historical-fetcher.ts - 规范模型:— 标准化数据模型
lib/integrations/canonical-schema.ts - 配置文件:— OAuth配置
lib/integrations/myob-config.ts - 认证路由:— OAuth 2.0回调
app/api/auth/myob/route.ts
Access Scopes
访问权限范围
All access is read-only:
- General Ledger transactions
- Chart of accounts
- Contacts
- Bank transactions
- Payroll data (if available)
所有访问均为只读:
- 总账交易记录
- 会计科目表
- 联系人信息
- 银行交易记录
- 薪资数据(若可用)
Data Normalisation
数据标准化
| MYOB Field | Canonical Field | Notes |
|---|---|---|
| UID | externalId | MYOB unique identifier |
| DisplayID | reference | Account/transaction code |
| Date | date | ISO 8601 |
| Total/Amount | amount | Decimal precision preserved |
| Account.DisplayID | accountCode | GL account code |
| Contact.DisplayID | contactId | Contact reference |
| MYOB字段 | 规范字段 | 说明 |
|---|---|---|
| UID | externalId | MYOB唯一标识符 |
| DisplayID | reference | 账户/交易代码 |
| Date | date | ISO 8601格式 |
| Total/Amount | amount | 保留小数精度 |
| Account.DisplayID | accountCode | 总账账户代码 |
| Contact.DisplayID | contactId | 联系人参考编号 |
OAuth Flow
OAuth流程
- User clicks "Connect MYOB"
- Redirect to MYOB OAuth consent screen
- User grants read-only access
- Callback stores encrypted tokens
- Select company file (MYOB-specific)
- Begin historical data sync
- 用户点击"连接MYOB"
- 重定向至MYOB OAuth授权页面
- 用户授予只读访问权限
- 回调存储加密令牌
- 选择公司文件(MYOB特有)
- 开始历史数据同步