Skip to content

Forecast

GET
/forecast
curl --request GET \
--url 'https://example.com/forecast?account=example&days=30'

Deterministic daily balance projection with annotated events — ‘checking goes negative on the 19th’ is answerable in this one call. Instances beyond the materialized horizon are expanded from the rules (projected), so days is honoured up to 365; coverage says what the line is made of. Every event names its basis; an estimated one carries a range band (min/max of its schedule’s newest settled amounts and its own), and then each day carries low/high — the balance with every ranged event at its worst / best — and pessimistic_low/optimistic_low their minimums. first_shortfall stays on the point series.

account
required
Account

Account id or path

string

Account id or path

days
Days
integer
default: 30 >= 1 <= 365

Successful Response

Media typeapplication/json
ForecastOut
object
account_id
required
Account Id
string format: uuid
account_path
required
Account Path
string
coverage
required
ForecastCoverage

What the projection is made of (#235) — zero active schedules means a line that is flat by construction, not a calm month.

object
instances
required
Instances
integer
matches_pending
Matches Pending

Instances left out of the line as paid: an open match proposal names a live bank row already in the opening balance (decision 76)

integer
0
matches_pending_net
Any of:
string
projected
required
Projected
integer
schedules_active
required
Schedules Active
integer
suggestions_open
required
Suggestions Open
integer
days
required
Days
Array<object>
ForecastDayOut
object
balance
required
Balance
string
date
required
Date
string format: date
events
required
Events
Array<object>
ForecastEventOut
object
amount
required
Amount
string
basis
Any of:
string
Allowed values: fixed last rolling_avg_3 rolling_avg_12 counterparty_balance override statement
label
required
Label
string
overdue
Overdue

Dated before today and still due

boolean
projected
Projected

Expanded from the rule; no instance row exists yet

boolean
range
Any of:
ForecastRangeOut

An estimated amount’s band (#247, decision 85), in this account’s sign: min/max of the schedule’s newest settled amounts and this one.

object
high
required
High
string
low
required
Low
string
transaction_id
required
Any of:
string format: uuid
high
Any of:
string
low
Any of:
string
first_shortfall
required
Any of:
string format: date
min_balance
required
Any of:
string
optimistic_low
Any of:
ForecastPointOut
object
balance
required
Balance
string
date
required
Date
string format: date
pessimistic_low
Any of:
ForecastPointOut
object
balance
required
Balance
string
date
required
Date
string format: date
start_balance
required
Start Balance
string

Example

{
"coverage": {
"matches_pending": 0
},
"days": [
{
"events": [
{
"basis": "fixed",
"overdue": false,
"projected": false
}
]
}
]
}

Validation Error

Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
ctx
Context
object
input
Input
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string

Example generated

{
"detail": [
{
"ctx": {},
"input": "example",
"loc": [
"example"
],
"msg": "example",
"type": "example"
}
]
}