Skip to content

FISCALISTO / API / REFERENCE

Give today's balance · Cash flow

Open in ChatGPTOpen in ClaudeOpen in Cursor
POST
/v1/cash_forecast

Today's balance in your bank accounts (where the cash flow starts from) and the least you want to have. Only what you send changes. Answers with the cash flow with the new balance.

Authorization

bearerAuth
headerAuthorizationBearer <key>

Your secret key: fk_test_… in test mode, fk_live_… in production. Desarrolladores › Llaves.

Headers

Idempotency-Key?string

Optional (the SDKs send it on their own). If the response is lost, repeat the request with the same value within 24 hours: it answers the same, with idempotent-replayed: true, and doesn't do it twice (it doesn't create, send emails or charge).

Length1 <= length <= 255

Request body

application/json
  1. body
issuer?string

Issuer (iss_…). If the key has a single issuer or the account has only one, it can be left out.

starting_balance?|

Today's balance in your bank accounts; null removes it.

minimum_balance?number

The least you want to have: each week below it brings an alert. 0 for none.

Range0 <= value <= 1000000000000

Response body

OK.

application/json
  1. response

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.

object*string

Always cash_forecast.

livemode*boolean

true in production (fk_live_ keys), false in test mode (fk_test_). Test objects aren't valid before the SAT.

issuer*string

The issuer (iss_…).

today*string

Today in Mexico City (YYYY-MM-DD): the start.

end*string

The last day of week 13.

currency*string

Everything in pesos: anything in another currency, at its exchange rate.

starting_balance*|

Today's balance you gave; null if you haven't given it (the forecast starts from 0).

minimum_balance*number

The least you want to have; each week below it carries a warning. 0 if you didn't give it.

suggested_starting_balance*|

The balance of your latest statements in Conciliación (60 days), only as a suggestion; null without them.

scenario*

The scenario it was calculated with: the one in the query parameters.

totals*

The 13 weeks together.

weeks*array<>

The 13 weeks, in order.

lines*array<>

Each thing that comes in or goes out, from which the weeks are added up.

warnings*array<>

Warnings with what you can do; you decide.

planned_items*array<>

Your planned movements.

notes*array<string>

What couldn't be estimated and why.

Errors

  • The issuer is archived and no longer stamps. Its documents can still be read and canceled.

  • The account has several issuers and the request doesn't say which: send issuer (iss_…).

  • The object belongs to the other mode: an fk_test_ key only sees test data and an fk_live_ key only live data.

  • Live, this part of the API (inventario, portal de proveedores, pedidos, comprobación de gastos) follows the empresa's plan, as in the app: it comes with Operaciones (added to any paid plan; included in Corporativo). The books (the /v1/accounting routes except DIOT, cross checks, IVA refunds and fixed assets) come with Contabilidad (added to Independiente, Emprendedor or Negocio; included in Despacho and Corporativo): without it, changing the books answers this error, and reading them works only up to the last month it had it. Add either in Ajustes › Plan y pagos; test mode has everything.

  • That issuer is an empresa of the app connected to your account: through the API it only offers its Portal de proveedores (/v1/portal_suppliers and /v1/supplier_invoices) and, once someone who may pay suppliers and change Configurar pagos turned them on, its supplier payouts (/v1/payouts and /v1/payroll_payouts). It also stops when whoever connected it (or turned its payouts on) no longer has that permission in the empresa: message_es says which. Do everything else in the app.

  • This key can't use that issuer.

  • There is no such issuer in the account (or it belongs to the other mode).

Plus those of any call (key, fields, limits): Errors. They all carry code, message and, when it's about a field, param.

curl -X POST 'https://api.fiscalisto.com/v1/cash_forecast' \  -H 'Authorization: Bearer fk_test_…' \  -H 'Idempotency-Key: pedido-A-1042' \  -H 'Content-Type: application/json' \  -d '{  "starting_balance": {    "amount": 185000,    "date": "2026-11-16"  },  "minimum_balance": 50000}'
{  "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": []}

Was this page helpful?