Skip to main content

Overview

The Financials API manages financial records, metrics, and historical data for companies. Base Path: /api/financials

Endpoints

Create Financial Record

POST /api/financials
Request Body:
{
  "company_id": "550e8400-e29b-41d4-a716-446655440000",
  "period": "2024 Q4",
  "period_start": "2024-10-01",
  "period_end": "2024-12-31",
  "revenue": 5000000,
  "cogs": 2000000,
  "gross_profit": 3000000,
  "operating_expenses": 1800000,
  "ebitda": 1200000,
  "net_income": 900000,
  "cash_flow": 1100000
}
Response (201 Created):
{
  "id": "kk0e8400-e29b-41d4-a716-446655445555",
  "company_id": "550e8400-e29b-41d4-a716-446655440000",
  "period": "2024 Q4",
  "revenue": 5000000,
  "ebitda": 1200000,
  "ebitda_margin": 0.24,
  "created_at": "2024-01-22T10:00:00Z"
}

List Financial Records

GET /api/financials?company_id={company_id}
GET /api/financials/{company_id}/trends
Response:
{
  "revenue_trend": {
    "growth_rate": 0.25,
    "cagr": 0.22,
    "quarterly_data": [...]
  },
  "margin_trend": {
    "ebitda_margin": [0.20, 0.22, 0.24],
    "net_margin": [0.15, 0.17, 0.18]
  }
}

Next Steps