SaaSFlow
DevelopersAPIReferencedata

ForecastBalanceTimeSeries

Use this when the user asks where the bank balance is heading: the actual balance up to the cutover, then a projection built from planned transactions.

Authentication

Checking whether you're signed in…
POST
/companies/{companyId}/data/forecastBalanceTimeSeries

Authorization

headerAuthorization<token>

A SaaSFlow API key (format sf_…) or an OAuth bearer token. Paste only the key — the proxy adds the Bearer prefix. Create an API key in Settings → Company settings → API keys — see API keys.

Path Parameters

companyId*string
Length1 <= length

Request Body

application/json
  1. body
startDate*string

Start of the window (YYYY-MM-DD). Defaults to the batch context start date.

Match^\d{4}-\d{2}-\d{2}
endDate*string

End of the window (YYYY-MM-DD). Typically a future date so the forecast extends past today.

Match^\d{4}-\d{2}-\d{2}
accountIds?array<string>

Restrict to these account ids. Omit to include all accounts.

asOfDate?string

Cutover between the actual and the projected balance (YYYY-MM-DD). Dates on or before asOfDate come from actual balances; the projection starts there and runs to endDate. Defaults to today.

Match^\d{4}-\d{2}-\d{2}

Response Body

forecastBalanceTimeSeries result

application/json
  1. response

Daily account balance, split into actual (dates on or before asOfDate) and projected (asOfDate to endDate). The projection carries the last actual balance forward and applies planned-transaction occurrences as they fall due, so the two series join at asOfDate. It has a point only on days something is planned, plus the join and end anchors; read it as a line, not a dense daily series. Empty when endDate is not in the future or nothing is planned.

actual*array<>
forecast*array<>
Example Request
curl -X POST 'https://api.saasflow.com/companies/string/data/forecastBalanceTimeSeries' \  -H 'Content-Type: application/json' \  -d '{  "startDate": "string",  "endDate": "string"}'
Example Response
{  "actual": [    {      "date": "string",      "value": 0    }  ],  "forecast": [    {      "date": "string",      "value": 0    }  ]}