Generate forecast

POST /api/v1/budgets/forecast

Generate a financial forecast based on historical data.

Operation ID: generate_forecast_api_v1_budgets_forecast_post · View as markdown · OpenAPI slice

Authentication

Bearer token authentication. Pass your DayZero API token in the Authorization header and the target business UUID in x-business-id.

Request body

method ForecastMethodEnum ForecastMethodEnum

Forecasting method.

lookback_months integer

Historical months to analyze.

forecast_months integer

Months to forecast.

growth_rate_percent integer

Growth rate adjustment.

use_seasonality boolean

Apply seasonal adjustments.

include_cash_flow boolean

Include cash flow projections.

Responses

201 Successful Response

business_id string required

Business UUID.

business_name string required

Business name.

forecast_start string · date required

Forecast period start.

forecast_end string · date required

Forecast period end.

method ForecastMethodEnum requiredForecastMethodEnum

Method used.

generated_at string · date-time required

Generation timestamp.

revenue_items array · ForecastLineItem ForecastLineItem

Revenue account forecasts.

6 fields
ledger_id string required

Ledger UUID.

ledger_name string required

Ledger name.

ledger_type string required

Ledger type.

historical_average integer required

Average historical monthly amount.

historical_trend number required

Monthly trend (slope).

periods array · ForecastPeriod

Forecasted periods.

total_forecasted_revenue integer required

Total forecasted revenue.

expense_items array · ForecastLineItem ForecastLineItem

Expense account forecasts.

6 fields
ledger_id string required

Ledger UUID.

ledger_name string required

Ledger name.

ledger_type string required

Ledger type.

historical_average integer required

Average historical monthly amount.

historical_trend number required

Monthly trend (slope).

periods array · ForecastPeriod

Forecasted periods.

total_forecasted_expenses integer required

Total forecasted expenses.

forecasted_net_income integer required

Forecasted net income.

cash_flow_forecast array · ForecastPeriod ForecastPeriod

Monthly cash flow projections.

5 fields
period_date string · date required

First day of the forecasted month.

forecasted_amount integer required

Forecasted amount in cents.

confidence_low integer

Lower confidence bound.

confidence_high integer

Upper confidence bound.

is_historical boolean

True if this is actual historical data.

projected_ending_cash integer required

Projected cash at forecast end.

400 Bad Request - Invalid input

401 Unauthorized - Authentication required

403 Forbidden - Insufficient permissions

422 Validation Error

detail array · ValidationError ValidationError
5 fields
loc array · string | integer required
msg string required
type string required
input object
ctx object