# Cash flow

What comes in and goes out over the next 13 weeks, from your invoices, payroll and taxes, with alerts and scenarios.

The guide, step by step: https://fiscalisto.com/en/docs/api/flujo-de-efectivo.md

## Endpoints

- [Get the cash flow](https://fiscalisto.com/en/docs/api/referencia/flujo-de-efectivo/get-cash-forecast.md): `GET /v1/cash_forecast`
- [Give today's balance](https://fiscalisto.com/en/docs/api/referencia/flujo-de-efectivo/update-cash-forecast.md): `POST /v1/cash_forecast`
- [Add a planned movement](https://fiscalisto.com/en/docs/api/referencia/flujo-de-efectivo/create-cash-forecast-item.md): `POST /v1/cash_forecast/planned_items`
- [Change a planned movement](https://fiscalisto.com/en/docs/api/referencia/flujo-de-efectivo/update-cash-forecast-item.md): `POST /v1/cash_forecast/planned_items/{id}`
- [Delete a planned movement](https://fiscalisto.com/en/docs/api/referencia/flujo-de-efectivo/delete-cash-forecast-item.md): `DELETE /v1/cash_forecast/planned_items/{id}`
- [Change a cash flow line](https://fiscalisto.com/en/docs/api/referencia/flujo-de-efectivo/adjust-cash-forecast.md): `POST /v1/cash_forecast/adjustments`

## The CashForecast object

The cash flow for the next 13 weeks: what you are owed (with how long each customer usually takes), what you owe suppliers, payroll, tax returns, recurring invoices and your planned movements, from the balance you gave. An estimate: it changes nothing.

| Field | Type | Always present | Description |
| --- | --- | --- | --- |
| `object` | `"cash_forecast"` | yes | Always cash_forecast. |
| `livemode` | boolean | yes | true in production (fk_live_ keys), false in test mode (fk_test_). Test objects aren't valid before the SAT. |
| `issuer` | string | yes | The issuer (iss_…). |
| `today` | string | yes | Today in Mexico City (YYYY-MM-DD): the start. |
| `end` | string | yes | The last day of week 13. |
| `currency` | `"MXN"` | yes | Everything in pesos: anything in another currency, at its exchange rate. |
| `starting_balance` | object or null | yes | Today's balance you gave; null if you haven't given it (the forecast starts from 0). |
| `starting_balance.amount` | number | yes | What you had in the bank, in pesos. |
| `starting_balance.date` | string | yes | That balance's day. |
| `minimum_balance` | number | yes | The least you want to have; each week below it carries a warning. 0 if you didn't give it. |
| `suggested_starting_balance` | object or null | yes | The balance of your latest statements in Conciliación (60 days), only as a suggestion; null without them. |
| `suggested_starting_balance.amount` | number | yes | The sum of the balances, in pesos. |
| `suggested_starting_balance.date` | string | yes | The day of the most recent statement. |
| `scenario` | object | yes | The scenario it was calculated with: the one in the query parameters. |
| `scenario.customers_pay_days_later` | integer | yes | Days collections were shifted (0 as usual). (from -9007199254740991 to 9007199254740991) |
| `scenario.pay_suppliers_days_later` | integer | yes | Days supplier payments were shifted. (from -9007199254740991 to 9007199254740991) |
| `scenario.include_doubtful` | boolean | yes | Whether it counts what is more than 90 days late. |
| `scenario.include_recurring` | boolean | yes | Whether it counts recurring invoices not yet issued. |
| `scenario.recurring_sales_change` | integer | yes | Percent recurring invoices changed (−20 to +10…). (from -9007199254740991 to 9007199254740991) |
| `totals` | object | yes | The 13 weeks together. |
| `totals.inflows` | number | yes | What comes in over the 13 weeks. |
| `totals.outflows` | number | yes | What goes out over the 13 weeks. |
| `totals.ending_balance` | number | yes | The balance at the end of week 13. |
| `totals.lowest_balance` | number | yes | The lowest balance at a week's close. |
| `totals.lowest_week` | integer | yes | The week of that balance (1 to 13). (from -9007199254740991 to 9007199254740991) |
| `totals.weeks_below_minimum` | integer | yes | How many weeks close below minimum_balance (or 0). (from -9007199254740991 to 9007199254740991) |
| `totals.doubtful_left_out` | number | yes | What was left out for being more than 90 days late. |
| `weeks` | array of object | yes | The 13 weeks, in order. |
| `weeks[].week` | integer | yes | 1 to 13; week 1 runs from today to Sunday. (from -9007199254740991 to 9007199254740991) |
| `weeks[].start` | string | yes | The first day (YYYY-MM-DD). |
| `weeks[].end` | string | yes | The last day, a Sunday. |
| `weeks[].starting_balance` | number | yes | The balance at the start of the week. |
| `weeks[].inflows` | number | yes | What comes in. |
| `weeks[].outflows` | number | yes | What goes out. |
| `weeks[].ending_balance` | number | yes | The balance at the week's close. |
| `weeks[].by_type` | object | yes | The amount for each line type (lines[].type) that week, in pesos. |
| `lines` | array of object | yes | Each thing that comes in or goes out, from which the weeks are added up. |
| `lines[].line` | string | yes | The line, to change it with POST /v1/cash_forecast/adjustments. |
| `lines[].type` | `receivable`, `recurring_invoice`, `planned_inflow`, `payable`, `payroll`, `taxes`, `planned_outflow` | yes | receivable: what your customers owe you; recurring_invoice: what your recurring invoices will bill; planned_inflow / planned_outflow: a planned movement you added; payable: what you owe suppliers; payroll: payroll; taxes: monthly tax returns. |
| `lines[].direction` | `inflow`, `outflow` | yes | inflow comes in; outflow goes out. |
| `lines[].date` | string | yes | The day it is counted on, with changes and scenario. |
| `lines[].estimated_date` | string | yes | The day that was estimated. |
| `lines[].week` | integer or null | yes | The week it falls in; null if it was left out (left_out). |
| `lines[].amount` | number | yes | What is counted, in pesos. |
| `lines[].estimated_amount` | number | yes | What was estimated, in pesos. |
| `lines[].description` | string | yes | What it is, as in the app. |
| `lines[].tax_id` | string or null | yes | The RFC of the customer or supplier, or null. |
| `lines[].invoices` | integer or null | yes | How many invoices it adds up, or null. |
| `lines[].due_date` | string or null | yes | When it was due, or null. |
| `lines[].days_overdue` | integer or null | yes | Days late if the expected day has passed, or null. |
| `lines[].basis` | string | yes | How it was estimated, in words. |
| `lines[].confidence` | `high`, `medium`, `low` | yes | high: a known amount and day; medium: an average; low: late or without history. |
| `lines[].left_out` | `excluded`, `doubtful`, `scenario`, `after_horizon` or null | yes | Why it doesn't count: excluded you removed it; doubtful more than 90 days late; scenario the scenario removed it; after_horizon falls after week 13. null if it counts. |
| `lines[].adjusted` | boolean | yes | true if you changed its day or amount, or removed it. |
| `lines[].planned_item` | string or null | yes | The planned movement (cfi_…) it comes from, or null. |
| `warnings` | array of object | yes | Warnings with what you can do; you decide. |
| `warnings[].type` | `no_starting_balance`, `stale_starting_balance`, `shortfall`, `overdue_receivables`, `customer_concentration`, `doubtful_left_out` | yes | no_starting_balance: today's balance is missing; stale_starting_balance: it is more than 7 days old; shortfall: a week closes below the minimum; overdue_receivables: a lot of what is to be collected is late; customer_concentration: one customer is 40 % or more of what comes in; doubtful_left_out: what is more than 90 days late was left out. |
| `warnings[].severity` | `critical`, `warning`, `info` | yes | How urgent it is. |
| `warnings[].title` | string | yes | The warning, in words. |
| `warnings[].detail` | string | yes | What you can do; nothing changes on its own. |
| `warnings[].week` | integer or null | yes | The week, or null. |
| `warnings[].shortfall` | number or null | yes | What would be short, in pesos, or null. |
| `planned_items` | array of object | yes | Your planned movements. |
| `planned_items[].id` | string | yes | The planned movement (cfi_…). |
| `planned_items[].object` | `"cash_forecast_item"` | yes | Always cash_forecast_item. |
| `planned_items[].livemode` | boolean | yes | true in production (fk_live_ keys), false in test mode (fk_test_). Test objects aren't valid before the SAT. |
| `planned_items[].issuer` | string | yes | The issuer (iss_…). |
| `planned_items[].description` | string | yes | What it is: «Renta», «Crédito del banco». |
| `planned_items[].direction` | `inflow`, `outflow` | yes | inflow money comes in; outflow goes out. |
| `planned_items[].amount` | number | yes | How much, in pesos. |
| `planned_items[].date` | string | yes | The day (YYYY-MM-DD), or the first time if it repeats. |
| `planned_items[].frequency` | `once`, `weekly`, `biweekly`, `monthly` | yes | once one time; weekly every week; biweekly every two; monthly every month. |
| `planned_items[].until` | string or null | yes | The last day it repeats; null with no end. |
| `notes` | array of string | yes | What couldn't be estimated and why. |

Example:

```json
{
  "object": "cash_forecast",
  "livemode": false,
  "issuer": "iss_OufpKqnrvx9p",
  "today": "2026-11-16",
  "end": "2027-02-14",
  "currency": "MXN",
  "starting_balance": {
    "amount": 185000,
    "date": "2026-11-16"
  },
  "minimum_balance": 50000,
  "suggested_starting_balance": {
    "amount": 183420.5,
    "date": "2026-11-14"
  },
  "scenario": {
    "customers_pay_days_later": 0,
    "pay_suppliers_days_later": 0,
    "include_doubtful": false,
    "include_recurring": true,
    "recurring_sales_change": 0
  },
  "totals": {
    "inflows": 612400,
    "outflows": 655900,
    "ending_balance": 141500,
    "lowest_balance": 38200,
    "lowest_week": 3,
    "weeks_below_minimum": 1,
    "doubtful_left_out": 12760
  },
  "weeks": [
    {
      "week": 1,
      "start": "2026-11-16",
      "end": "2026-11-22",
      "starting_balance": 185000,
      "inflows": 34800,
      "outflows": 0,
      "ending_balance": 219800,
      "by_type": {
        "receivable": 34800
      }
    },
    {
      "week": 2,
      "start": "2026-11-23",
      "end": "2026-11-29",
      "starting_balance": 219800,
      "inflows": 0,
      "outflows": 121400,
      "ending_balance": 98400,
      "by_type": {
        "payable": 46400,
        "payroll": 75000
      }
    }
  ],
  "lines": [
    {
      "line": "cobro:ICV060329BY0:2026-10-15:ppd",
      "type": "receivable",
      "direction": "inflow",
      "date": "2026-11-20",
      "estimated_date": "2026-11-20",
      "week": 1,
      "amount": 34800,
      "estimated_amount": 34800,
      "description": "INMOBILIARIA CVA",
      "tax_id": "ICV060329BY0",
      "invoices": 2,
      "due_date": "2026-11-14",
      "days_overdue": null,
      "basis": "Suele pagar en 36 días; la factura es del 15 de octubre.",
      "confidence": "medium",
      "left_out": null,
      "adjusted": false,
      "planned_item": null
    }
  ],
  "warnings": [
    {
      "type": "shortfall",
      "severity": "warning",
      "title": "La semana 3 cerraría con $38,200, debajo de su mínimo de $50,000",
      "detail": "Le faltarían $11,800. Puede cobrar antes lo atrasado o mover un pago a proveedor.",
      "week": 3,
      "shortfall": 11800
    }
  ],
  "planned_items": [
    {
      "id": "cfi_OufpKqnrvx9p7Hq2",
      "object": "cash_forecast_item",
      "livemode": false,
      "issuer": "iss_OufpKqnrvx9p",
      "description": "Renta de la bodega",
      "direction": "outflow",
      "amount": 28000,
      "date": "2026-12-01",
      "frequency": "monthly",
      "until": null
    }
  ],
  "notes": []
}
```

## The CashForecastItem object

Something you expect to pay or collect that no invoice says (a rent, a loan, a cash sale), which counts in the cash flow.

| Field | Type | Always present | Description |
| --- | --- | --- | --- |
| `id` | string | yes | The planned movement (cfi_…). |
| `object` | `"cash_forecast_item"` | yes | Always cash_forecast_item. |
| `livemode` | boolean | yes | true in production (fk_live_ keys), false in test mode (fk_test_). Test objects aren't valid before the SAT. |
| `issuer` | string | yes | The issuer (iss_…). |
| `description` | string | yes | What it is: «Renta», «Crédito del banco». |
| `direction` | `inflow`, `outflow` | yes | inflow money comes in; outflow goes out. |
| `amount` | number | yes | How much, in pesos. |
| `date` | string | yes | The day (YYYY-MM-DD), or the first time if it repeats. |
| `frequency` | `once`, `weekly`, `biweekly`, `monthly` | yes | once one time; weekly every week; biweekly every two; monthly every month. |
| `until` | string or null | yes | The last day it repeats; null with no end. |

Example:

```json
{
  "id": "cfi_OufpKqnrvx9p7Hq2",
  "object": "cash_forecast_item",
  "livemode": false,
  "issuer": "iss_OufpKqnrvx9p",
  "description": "Renta de la bodega",
  "direction": "outflow",
  "amount": 28000,
  "date": "2026-12-01",
  "frequency": "monthly",
  "until": null
}
```
