Zum Inhalt springen
Leadtime
Deutsch
Esc
navigateopen⌘Jpreview

Get turnover insights data in structured JSON format

What are Turnover Insights? Turnover Insights provides detailed revenue analysis across projects, showing income from various revenue streams over time. This helps businesses understand revenue patterns, forecast future income, and analyze which projects or revenue types contribute most to the bottom line.

What data is returned: The response includes two or three “sheets” of data in JSON format (matching the Excel export structure):

  • Summary sheet: Wide format (pivot table style) with periods as rows and breakdown categories as columns. Structure varies by model and breakdown selection.
  • Detailed sheet: Long format (normalized) with one row per period/project/revenue type combination. Perfect for pivot tables and further analysis.
  • Forecast sheet (optional): Only included when includeTrend=true and forecast data exists. Contains 6-month revenue forecast based on subscription billing cycles and project deadlines.

Supported analysis options:

  • Project selection: Analyze single project or compare multiple projects
  • Date range: Auto-calculated from invoice data if not provided, or specify custom range
  • Model selection:
    • COMPARISON: Compare revenue across multiple projects side-by-side
    • TOTAL: Aggregate revenue view showing combined totals
  • Breakdown options (both work with COMPARISON and TOTAL):
    • byProject: In COMPARISON, each period shows one bar per project (project total for that month). In TOTAL, periods show stacked contributions by project toward the combined total.
    • byRevenueType: In COMPARISON, each project’s bar is stacked by revenue type. In TOTAL, stacked layers are revenue types on the workspace aggregate.
  • Forecast option: includeTrend (only available for TOTAL model) — enables 6-month revenue forecast

Revenue types included: The analysis includes all revenue types from invoices:

  • Support (hourly billing)
  • Fixed Subscriptions (recurring fixed amounts)
  • Variable Subscriptions (recurring variable amounts)
  • Express Quotations (quick quotes)
  • Products (one-time product sales)
  • Components (product components)
  • Manual Positions (custom invoice line items)

Important validation rules:

  • includeTrend is only available for TOTAL model (forecast uses the aggregate series)
  • At least one project must be selected

Forecast calculation: When includeTrend=true, the forecast sheet includes:

  • 6-month forward-looking revenue projection
  • Based on active subscription billing cycles
  • Includes upcoming project deadlines and milestones
  • Helps with cash flow planning and revenue forecasting

Use cases:

  • Track revenue trends over time
  • Compare revenue performance across projects
  • Analyze revenue distribution by type (subscriptions vs one-time)
  • Forecast future revenue based on active subscriptions
  • Export to Excel for financial reporting and analysis
GET/insights/turnover-chart
Authorization
AuthorizationOAuth2 access token · headerrequired
Scopes:api:read
or
AuthorizationBearer token (JWT) · headerrequired
Query parameters
projectIdsany[][]required
Array of project UUIDs to analyze for turnover/revenue. Can select single project for detailed analysis or multiple projects for comparison. At least one project is required. Revenue data comes from invoices associated with these projects.
startDatestring
Start date for the analysis period in ISO 8601 format (YYYY-MM-DD). If not provided, automatically calculated from the earliest invoice date in the selected projects. Used to determine the beginning of the revenue analysis period.
endDatestring
End date for the analysis period in ISO 8601 format (YYYY-MM-DD). If not provided, automatically calculated from the latest invoice date in the selected projects. Must be after startDate if both are provided. Used to determine the end of the revenue analysis period.
modelstringrequired
Chart model type for revenue analysis. `comparison` places projects side-by-side per period. `total` aggregates selected projects into one series per period. Use `total` with `includeTrend` for the 6-month forecast.
Allowed:comparisontotal
breakdownstringrequired
Breakdown dimension. `byProject`: comparison mode shows each project’s total per period (grouped bars); total mode stacks project contributions on one bar per period. `byRevenueType`: comparison mode stacks revenue types within each project’s bar; total mode stacks revenue types on the aggregate.
Allowed:byProjectbyRevenueType
includeTrendboolean
Enable 6-month revenue forecast. Only available for TOTAL model. When true, includes a forecast sheet with forward-looking revenue projections based on active subscription billing cycles and upcoming project deadlines. Helps with cash flow planning and revenue forecasting.
Responses
200Turnover insights data in structured JSON format with summary, detailed, and optional forecast sheets
detailedobjectrequired
Detailed sheet data (long/tidy format, normalized). One row per period with project and/or revenue-type columns depending on model and breakdown.
Show properties
headersstring[]required
Column headers for the sheet
rowsobject[]required
Data rows as array of objects, where keys match headers. Each row represents one data point.
titleobjectrequired
Sheet title information with main title and subtitle
forecastobject
Forecast sheet data (only present when includeTrend=true and forecast data exists). Contains 6-month revenue forecast based on subscription billing and project deadlines.
Show properties
headersstring[]required
Column headers for the sheet
rowsobject[]required
Data rows as array of objects, where keys match headers. Each row represents one data point.
titleobjectrequired
Sheet title information with main title and subtitle
metadataobjectrequired
Metadata about the query execution and results
summaryobjectrequired
Summary sheet data (wide/matrix format, like pivot table). Layout depends on `model` and `breakdown` (e.g. comparison+byProject vs comparison+byRevenueType vs total).
Show properties
headersstring[]required
Column headers for the sheet
rowsobject[]required
Data rows as array of objects, where keys match headers. Each row represents one data point.
titleobjectrequired
Sheet title information with main title and subtitle
400Invalid request parameters (invalid dates or enum values)
401Unauthorized - Invalid or missing authentication token
403User does not have permission to view turnover insights (requires Insights.viewTurnoverInsights)
404One or more project IDs not found or user does not have access to them
Request
curl -X GET "https://leadtime.app/api/public/insights/turnover-chart?projectIds=7acff2df-a904-4323-adcc-c2f24a769bde&model=total&breakdown=byRevenueType" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
Response
{
  "detailed": {
    "headers": [
      "Period",
      "Period Label",
      "Value",
      "Cumulative Total"
    ],
    "rows": [
      {
        "Cumulative Total": 120.5,
        "Period": "2024-01",
        "Period Label": "Jan 2024",
        "Value": 120.5
      },
      {
        "Cumulative Total": 255.7,
        "Period": "2024-02",
        "Period Label": "Feb 2024",
        "Value": 135.2
      }
    ],
    "title": {
      "main": "Project Insights: Project Name",
      "subtitle": "Jan 2024 - Dec 2024, Time Series, By User, Months, Trend"
    }
  },
  "forecast": {
    "headers": [
      "Period",
      "Period Label",
      "Value",
      "Cumulative Total"
    ],
    "rows": [
      {
        "Cumulative Total": 120.5,
        "Period": "2024-01",
        "Period Label": "Jan 2024",
        "Value": 120.5
      },
      {
        "Cumulative Total": 255.7,
        "Period": "2024-02",
        "Period Label": "Feb 2024",
        "Value": 135.2
      }
    ],
    "title": {
      "main": "Project Insights: Project Name",
      "subtitle": "Jan 2024 - Dec 2024, Time Series, By User, Months, Trend"
    }
  },
  "metadata": {
    "hasMoreData": false,
    "periodsGenerated": 12,
    "queryExecutionTime": 234,
    "totalInvoicesProcessed": 120
  },
  "summary": {
    "headers": [
      "Period",
      "Period Label",
      "Value",
      "Cumulative Total"
    ],
    "rows": [
      {
        "Cumulative Total": 120.5,
        "Period": "2024-01",
        "Period Label": "Jan 2024",
        "Value": 120.5
      },
      {
        "Cumulative Total": 255.7,
        "Period": "2024-02",
        "Period Label": "Feb 2024",
        "Value": 135.2
      }
    ],
    "title": {
      "main": "Project Insights: Project Name",
      "subtitle": "Jan 2024 - Dec 2024, Time Series, By User, Months, Trend"
    }
  }
}