# WeeKeeper — Agent Integration

## Product
WeeKeeper is an AI-powered accounting platform for Canadian small businesses. Bilingual (English + French). Supports GST/HST by province.

## Capabilities
- Transaction management and categorization (3-tier AI pipeline)
- Financial reporting (P&L, balance sheet, cash position, tax estimates)
- Invoice creation, sending, and payment tracking (Stripe)
- Receipt scanning and matching (OCR)
- Natural language financial queries
- Canadian GST/HST tax calculation (all 13 provinces)
- CRA-compatible tax reporting

## Integration Methods

### MCP Server (for AI agents)
- URL: https://mcp.weekeeper.com
- Transport: SSE (Server-Sent Events)
- Tools: 14
- Auth: API key (pk_live_* or pk_test_*)

### REST API (for custom integrations)
- Base URL: https://api.weekeeper.com
- Auth: Bearer token (JWT for humans, API key for agents)
- Format: JSON
- Pagination: Cursor-based
- Idempotency: Idempotency-Key header on write operations

## Authentication
1. Create API key in WeeKeeper app (Settings → API Keys)
2. Use as Bearer token: Authorization: Bearer pk_live_...
3. Available scopes: read, write, categorize, invoice, report, admin

## Available MCP Tools
| Tool | Description |
|------|-------------|
| get_cash_position | Current cash balance across all accounts |
| list_transactions | Transactions with date/category/status filters |
| categorize_transaction | Set or change a transaction's category |
| batch_categorize | Categorize up to 500 transactions at once |
| get_profit_and_loss | P&L report for any date range |
| get_balance_sheet | Balance sheet as of any date |
| get_tax_estimate | Estimated quarterly tax (GST/HST) |
| create_invoice | Create a new invoice with line items |
| list_invoices | List invoices with status filter |
| send_invoice | Send invoice to client via email |
| scan_receipt | OCR a receipt image and match to transaction |
| ask_question | Natural language query about finances |
| list_uncategorized | Transactions needing human review |
| propose_action | Request human approval for an action |

## Webhooks
Subscribe to events for real-time notifications:
- transaction.imported — new bank transactions synced
- transaction.categorized — AI categorized a transaction
- invoice.sent — invoice emailed to client
- invoice.viewed — client opened the invoice
- invoice.paid — payment received
- invoice.overdue — invoice past due date
- bank.sync_complete — bank sync finished
- proposal.created — agent proposed an action

## Safety & Human-in-the-Loop
- Read operations: always allowed within scope
- Write operations: configurable per-user approval policies
- Sensitive actions (send invoice, batch operations): can require human approval
- Proposals API: agent proposes → user approves/rejects in app
- Full audit trail with actor identity (user vs agent vs system)

## Pricing
- Free: 1 API key, read scope
- Core ($15 CAD/mo): 3 API keys, all scopes, 3 webhooks
- Pro ($29 CAD/mo): 10 API keys, all scopes, 10 webhooks
- Accountant ($49 CAD/mo): 25 API keys, all scopes, 25 webhooks

## Links
- Website: https://weekeeper.com
- Developer docs: https://weekeeper.com/developers
- API reference: https://api.weekeeper.com/health
- Privacy policy: https://weekeeper.com/privacy
