ReportsGenerate cash flow forecast

Generate cash flow forecast

POST/partners/reports/cash-flow-forecast

Forecasts the workspace's cash for the next 13 weeks, with optional what-if scenarios.

Starting cash is the bank and cash balance the dashboard shows. Each week carries `openingBalance`, `inflows` and `outflows` (totals by source), `closingBalance`, and `forecastLines` — the individual items, each with `isEstimate`. The report also returns `lowestBalance`, `atRisk`, `beyondHorizon`, and `assumptions`, which say what is left out. Send an empty body for the base forecast. With a `scenario`, `scenarioForecast` holds the forecast with the scenario applied; re-run with a different scenario rather than adjusting figures yourself. No query parameters are accepted, and the body is strict: an unknown key is a 400.

HMAC signature + Bearer access token
Try this request

Request body

scenarioobject

What-if changes to apply on top of the base forecast. Send any of the three lists.

customerPaymentDelaysarray

Move a customer's expected payments later (or earlier). At most 100.

customerUuiduuidrequired

Customer UUID.

delayDaysintegerrequired

Days to move the customer's payments, -365 to 365.

billPaymentDelaysarray

Pay a bill on a different date. At most 100.

billUuiduuidrequired

Bill UUID.

newPaymentDatedaterequired

YYYY-MM-DD payment date.

adjustmentsarray

Extra cash in or out that the books do not hold yet, e.g. a loan or a new hire. At most 50.

descriptionstringrequired

Label, 1–200 characters.

amountstringrequired

Positive decimal string with at most two places, e.g. `"6000.00"`.

directionenumrequired

Cash in or cash out.

One of: inflow, outflow

startDatedaterequired

YYYY-MM-DD date of the first occurrence.

cadenceenumrequired

How often it repeats.

One of: once, weekly, monthly

Responses

200The forecast. Amounts are decimal strings in `currency`. `scenarioForecast` has the same shape as `forecast`, and is null when no scenario was sent. `weeks` holds 13 entries; one is shown here.
400The body has an unknown key, or a scenario value is invalid.
401Missing or invalid HMAC signature, expired timestamp, or invalid Bearer token. Troubleshoot
403The credential does not have access to this workspace or resource. Troubleshoot
429Rate limit exceeded (100 requests per minute per user of each app, or 10,000 per minute per app). Retry after the Retry-After header. Troubleshoot
POSThttps://api.getcount.com/partners/reports/cash-flow-forecast
Request
import crypto from 'node:crypto';

const BASE_URL = 'https://api.getcount.com';
const CLIENT_ID = process.env.COUNT_CLIENT_ID;
const CLIENT_SECRET = process.env.COUNT_CLIENT_SECRET;
const ACCESS_TOKEN = process.env.COUNT_ACCESS_TOKEN;

const method = 'POST';
const signingPath = '/reports/cash-flow-forecast';
const timestamp = Math.floor(Date.now() / 1000).toString();
const body = {
  "scenario": {
    "customerPaymentDelays": [
      {
        "customerUuid": "dfa3219e-6af8-4c53-997a-037534f63a35",
        "delayDays": 30
      }
    ],
    "adjustments": [
      {
        "description": "New hire salary",
        "amount": "6000.00",
        "direction": "outflow",
        "startDate": "2026-04-01",
        "cadence": "monthly"
      }
    ]
  }
};
const bodyString = JSON.stringify(body);

const bodyHash = crypto.createHash('sha256').update(bodyString).digest('hex');
const baseString = `${method}:${signingPath}:${timestamp}:${bodyHash}`;
const signature = crypto.createHmac('sha256', CLIENT_SECRET).update(baseString).digest('hex');

const response = await fetch(`${BASE_URL}/partners/reports/cash-flow-forecast`, {
  method,
  headers: {
    'x-client-id': CLIENT_ID,
    'x-timestamp': timestamp,
    'x-signature': signature,
    'Content-Type': 'application/json',
    Authorization: `Bearer ${ACCESS_TOKEN}`,
  },
  body: bodyString,
});

console.log(await response.json());
Response · 200
{
  "status": "success",
  "message": "Success on generating cash flow forecast",
  "data": {
    "currency": "USD",
    "asOf": "2026-03-02",
    "exchangeRateDate": "2026-03-02",
    "startingCash": {
      "amount": "48250.00"
    },
    "forecast": {
      "weeks": [
        {
          "weekStart": "2026-03-02",
          "weekEnd": "2026-03-08",
          "openingBalance": "48250.00",
          "inflows": {
            "invoices": "1250.00",
            "recurringInvoices": "0.00",
            "gst": "0.00",
            "adjustments": "0.00",
            "total": "1250.00"
          },
          "outflows": {
            "bills": "2500.00",
            "recurringSpend": "180.00",
            "payroll": "0.00",
            "gst": "0.00",
            "adjustments": "0.00",
            "total": "2680.00"
          },
          "closingBalance": "46820.00",
          "forecastLines": [
            {
              "type": "invoice",
              "direction": "inflow",
              "date": "2026-03-05",
              "amount": "1250.00",
              "description": "Acme Corporation — INV-1042",
              "reference": "f6a7b8c9-d0e1-2345-fabc-456789012345",
              "isEstimate": false
            }
          ]
        }
      ],
      "lowestBalance": {
        "weekStart": "2026-03-02",
        "amount": "46820.00"
      },
      "atRisk": {
        "amount": "0.00",
        "invoices": []
      },
      "beyondHorizon": {
        "inflows": "0.00",
        "outflows": "0.00"
      }
    },
    "scenarioForecast": null,
    "assumptions": [
      {
        "code": "credit_cards_excluded",
        "message": "Starting cash counts bank and cash accounts only; credit card balances are not included."
      }
    ]
  }
}