API Overview
Base URL: http://localhost:8000
Interactive docs: http://localhost:8000/docs (Swagger UI)
Authentication
All endpoints (except /auth/register and /auth/login) require a JWT token:
Authorization: Bearer <access_token>
API Endpoints
Auth
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/v1/auth/register | Register user + company |
| POST | /api/v1/auth/login | Login, get tokens |
| POST | /api/v1/auth/refresh | Refresh access token |
| GET | /api/v1/auth/me | Get current user |
Chart of Accounts
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/v1/accounts/ | List accounts |
| GET | /api/v1/accounts/tree | Account hierarchy tree |
| GET | /api/v1/accounts/{id} | Get account |
| POST | /api/v1/accounts/ | Create account |
| PUT | /api/v1/accounts/{id} | Update account |
| DELETE | /api/v1/accounts/{id} | Delete account |
Journal Entries
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/v1/journals/ | List entries |
| GET | /api/v1/journals/{id} | Get entry |
| POST | /api/v1/journals/ | Create entry |
| PUT | /api/v1/journals/{id} | Update draft |
| DELETE | /api/v1/journals/{id} | Delete draft |
| POST | /api/v1/journals/{id}/submit | Submit for approval |
| POST | /api/v1/journals/{id}/approve | Approve entry |
| POST | /api/v1/journals/{id}/post | Post entry |
| POST | /api/v1/journals/{id}/reverse | Reverse entry |
Financial Reports
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/v1/reports/trial-balance | Trial Balance |
| GET | /api/v1/reports/balance-sheet | Balance Sheet |
| GET | /api/v1/reports/income-statement | Income Statement |
| GET | /api/v1/reports/statement-of-equity | Statement of Equity |
| GET | /api/v1/reports/cash-flow | Cash Flow Statement |
| GET | /api/v1/reports/general-ledger | General Ledger |
Documents
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/v1/documents/upload | Upload document |
| GET | /api/v1/documents/ | List documents |
| GET | /api/v1/documents/{id} | Get document |
| GET | /api/v1/documents/{id}/download | Download URL |
| DELETE | /api/v1/documents/{id} | Delete document |
AI Processing
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/v1/ai/process-document/{id} | Process with AI |
| GET | /api/v1/ai/proposals | List proposals |
| POST | /api/v1/ai/proposals/{id}/accept | Accept proposal |
| POST | /api/v1/ai/proposals/{id}/reject | Reject proposal |
Other
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/v1/fiscal-periods/ | Fiscal periods |
| GET | /api/v1/currencies/ | Currencies |
| GET | /api/v1/cost-centers/ | Cost centers |
| GET | /api/v1/projects/ | Projects |
| GET | /api/v1/audit-log/ | Audit trail |