# Pricing & Cash Flow Calculator (Precificação e Fluxo de Caixa) (`kman-br/pricing-cash-flow-calculator`) Actor

Builds an XLSX with live formulas: suggested prices by divisor markup, contribution margin, break-even and a 12-month cash flow. Estimate only. No network, nothing stored outside your run.

- **URL**: https://apify.com/kman-br/pricing-cash-flow-calculator.md
- **Developed by:** [Kman](https://apify.com/kman-br) (community)
- **Categories:** E-commerce, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Pricing & Cash Flow Calculator (Calculadora de Precificação e Fluxo de Caixa)

Turn your costs, rates and forecasts into one spreadsheet. The Actor returns an **XLSX with live formulas** (change an assumption and the workbook recalculates), plus dataset rows for use in other tools.

> **This is an ESTIMATE.** It is not accounting, tax or legal advice. **You provide every rate and amount** (effective tax rate, card fee, margin). The Actor has no tax tables, does not look anything up, and does not know your tax situation. Check the numbers with your accountant before you rely on them.

### What you get

- **Suggested price per item** by divisor markup: `price = cost / (1 − (tax + card fee + variable expenses + desired margin))`.
- **Markup multiplier** (`price / cost`) and **contribution margin** in value and in percent.
- **Break-even point** = fixed expenses / contribution margin ratio, in revenue and (when you give volumes) in units.
- **12-month cash flow**: inflows, outflows, monthly balance and cumulative balance, starting from your opening cash.
- An XLSX with four sheets (Inputs, Pricing, Break-even, Cash Flow), saved in the run's key-value store as `report.xlsx` and linked in the `OUTPUT` record (`report_url`).
- Dataset rows typed `price`, `breakeven` and `cashflow`.

#### The contribution margin is the desired margin

The desired margin is a **contribution margin**: what is left of the price after cost, tax, card fee and variable expenses. **Fixed expenses are not spread over the price.** They enter the break-even point. With the divisor method every item's contribution margin ratio equals the desired margin, so break-even revenue is `fixed expenses / desired margin`. The volume-weighted mix only changes the result if you overwrite a price in the workbook (the formulas handle that).

### Input

| Field | Meaning |
|---|---|
| `products` | Items: `name`, `unitCost`, optional `extraVariableCost` and `monthlyVolume`. Up to 200. |
| `fixedExpenses` | Monthly fixed expenses: `name`, `amount`. Up to 100. |
| `taxRegime` | Free text label (for example `Simples Nacional`, `Lucro Presumido`, `MEI`, `Other`). Printed only. |
| `effectiveTaxRatePct` | Effective tax rate on revenue, in percent. Provided by you. |
| `cardFeePct`, `variableExpensesPct`, `desiredMarginPct` | Percentages. The four percentages together may not exceed 95. |
| `openingCashBalance`, `monthlyRevenue`, `monthlyExpenses` | Opening cash and exactly 12 numbers each. `startMonth` (`YYYY-MM`) labels the months. |
| `language` | `en` or `pt-BR`: labels, sheet names and notes. |
| `currency` | Three-letter label and number format (BRL, USD, EUR...). No conversion is done. |

If the input is invalid the run stops with a clear list of what to fix (field paths only, never your values) and no report is generated.

Without volumes the break-even rule is the simple average of the items' contribution margin ratios, and break-even units are not computed. With volumes for only some items, the mix is weighted over those items.

### Pricing

Pay per event:

- **Actor start**: US$0.0005, charged by the platform once per run.
- **Report generated** (`relatorio-gerado`): US$0.03, charged once per report that was generated successfully.
- Dataset rows are not charged.

> **Note on charges:** the start event is charged on every run, including runs that stop because the input is invalid. The report event is charged only after the XLSX has been generated and saved; if the report cannot be generated or saved, or your spending limit (`ACTOR_MAX_TOTAL_CHARGE_USD`) does not fit the report, nothing is charged for it. Nothing is charged per dataset row or per item.

### Your data

Your numbers stay in the storage of your own run. The Actor makes no network calls and uses no proxy. Logs contain only counts and status, never names or values, and error messages never repeat what you typed.

### Limits

Up to 200 items and 100 fixed expenses, names up to 80 characters, money up to 1,000,000,000 per field. Memory is fixed at 256 MB. A run that exceeds its internal 25 second window stops without charging for the report.

### Related Actors

- [PDF to Text & Markdown Converter (PDF para Texto)](https://apify.com/kman-br/pdf-to-text-markdown): text layer of PDFs as plain text and Markdown.
- [CNPJ Lote](https://apify.com/kman-br/cnpj-lote): batch lookup of Brazilian company registrations (`cnpj-lote`).
- [Website Health Checker: Broken Links & SEO (Saúde do Site)](https://apify.com/kman-br/website-health-checker): HTTP-only audit of a site you own.

Browse the full catalog: [kman-br.github.io](https://kman-br.github.io/) ([Português](https://kman-br.github.io/pt/)).

### Em português

Gera uma planilha **XLSX com fórmulas vivas** (premissas, precificação, ponto de equilíbrio e fluxo de caixa de 12 meses) a partir dos seus custos, taxas e previsões. Preço pelo **markup divisor**: `preço = custo / (1 − (imposto + taxa de cartão + despesas variáveis + margem))`; a margem desejada é **margem de contribuição**, e as despesas fixas entram no ponto de equilíbrio, não no preço.

**É uma ESTIMATIVA, não é consultoria contábil, tributária ou jurídica.** Você informa as alíquotas e taxas; o Actor não tem tabela do Simples Nacional nem consulta nada. Confirme os números com seu contador. Os dados ficam só no storage do seu run, sem rede e sem proxy.

Cobrança: US$ 0,0005 por início de run (cobrado mesmo com entrada inválida) e US$ 0,03 por relatório gerado com sucesso. Linhas do dataset não são cobradas.

# Actor input Schema

## `language` (type: `string`):

Language of the workbook labels and sheet names.

## `currency` (type: `string`):

Three-letter code used only as a label and number format (for example BRL or USD). No conversion is done.

## `products` (type: `array`):

Items to price. Each item has a name, a unit cost, optionally extra variable cost per unit and an estimated monthly volume.

## `fixedExpenses` (type: `array`):

Fixed expenses per month (rent, salaries, software). They enter the break-even point, not the price.

## `taxRegime` (type: `string`):

Free text label, for example Simples Nacional, Lucro Presumido, MEI or Other. It is only printed in the workbook.

## `effectiveTaxRatePct` (type: `number`):

Effective tax rate on revenue, in percent, that you provide (0 to 60). The Actor has no tax tables.

## `cardFeePct` (type: `number`):

Fee charged on each sale, in percent (0 to 30).

## `variableExpensesPct` (type: `number`):

Variable expenses as a percent of revenue (0 to 60), for example commissions.

## `desiredMarginPct` (type: `number`):

Margin you want left on the price after costs, taxes, fees and variable expenses (0 to 90). The four percentages together may not exceed 95.

## `openingCashBalance` (type: `number`):

Cash balance before month 1. May be negative.

## `monthlyRevenue` (type: `array`):

Expected cash inflow for each of the next 12 months, exactly 12 numbers.

## `monthlyExpenses` (type: `array`):

Expected cash outflow for each of the next 12 months, exactly 12 numbers.

## `startMonth` (type: `string`):

Optional first forecast month as YYYY-MM. Without it the months are labeled Month 1 to Month 12.

## Actor input object example

```json
{
  "language": "pt-BR",
  "currency": "BRL",
  "products": [
    {
      "name": "Café especial 250 g",
      "unitCost": 18,
      "extraVariableCost": 2.5,
      "monthlyVolume": 300
    },
    {
      "name": "Kit presente",
      "unitCost": 45,
      "extraVariableCost": 6,
      "monthlyVolume": 80
    },
    {
      "name": "Workshop online (vaga)",
      "unitCost": 12,
      "monthlyVolume": 40
    }
  ],
  "fixedExpenses": [
    {
      "name": "Aluguel",
      "amount": 3500
    },
    {
      "name": "Pró-labore",
      "amount": 6000
    },
    {
      "name": "Contabilidade",
      "amount": 600
    },
    {
      "name": "Software",
      "amount": 250
    }
  ],
  "taxRegime": "Simples Nacional",
  "effectiveTaxRatePct": 6,
  "cardFeePct": 3.5,
  "variableExpensesPct": 5,
  "desiredMarginPct": 20,
  "openingCashBalance": 10000,
  "monthlyRevenue": [
    18000,
    17500,
    19000,
    21000,
    26000,
    15000,
    15500,
    16000,
    17000,
    18500,
    19000,
    22000
  ],
  "monthlyExpenses": [
    16500,
    16500,
    17000,
    17500,
    19500,
    15500,
    15500,
    15800,
    16200,
    16800,
    17000,
    18500
  ],
  "startMonth": "2026-11"
}
```

# Actor output Schema

## `report` (type: `string`):

Workbook with live formulas (inputs, pricing, break-even, cash flow).

## `results` (type: `string`):

No description

## `summary` (type: `string`):

OUTPUT: status, reason for stopping, counts and events charged. No user values.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "language": "pt-BR",
    "currency": "BRL",
    "products": [
        {
            "name": "Café especial 250 g",
            "unitCost": 18,
            "extraVariableCost": 2.5,
            "monthlyVolume": 300
        },
        {
            "name": "Kit presente",
            "unitCost": 45,
            "extraVariableCost": 6,
            "monthlyVolume": 80
        },
        {
            "name": "Workshop online (vaga)",
            "unitCost": 12,
            "monthlyVolume": 40
        }
    ],
    "fixedExpenses": [
        {
            "name": "Aluguel",
            "amount": 3500
        },
        {
            "name": "Pró-labore",
            "amount": 6000
        },
        {
            "name": "Contabilidade",
            "amount": 600
        },
        {
            "name": "Software",
            "amount": 250
        }
    ],
    "taxRegime": "Simples Nacional",
    "effectiveTaxRatePct": 6,
    "cardFeePct": 3.5,
    "variableExpensesPct": 5,
    "desiredMarginPct": 20,
    "openingCashBalance": 10000,
    "monthlyRevenue": [
        18000,
        17500,
        19000,
        21000,
        26000,
        15000,
        15500,
        16000,
        17000,
        18500,
        19000,
        22000
    ],
    "monthlyExpenses": [
        16500,
        16500,
        17000,
        17500,
        19500,
        15500,
        15500,
        15800,
        16200,
        16800,
        17000,
        18500
    ],
    "startMonth": "2026-11"
};

// Run the Actor and wait for it to finish
const run = await client.actor("kman-br/pricing-cash-flow-calculator").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "language": "pt-BR",
    "currency": "BRL",
    "products": [
        {
            "name": "Café especial 250 g",
            "unitCost": 18,
            "extraVariableCost": 2.5,
            "monthlyVolume": 300,
        },
        {
            "name": "Kit presente",
            "unitCost": 45,
            "extraVariableCost": 6,
            "monthlyVolume": 80,
        },
        {
            "name": "Workshop online (vaga)",
            "unitCost": 12,
            "monthlyVolume": 40,
        },
    ],
    "fixedExpenses": [
        {
            "name": "Aluguel",
            "amount": 3500,
        },
        {
            "name": "Pró-labore",
            "amount": 6000,
        },
        {
            "name": "Contabilidade",
            "amount": 600,
        },
        {
            "name": "Software",
            "amount": 250,
        },
    ],
    "taxRegime": "Simples Nacional",
    "effectiveTaxRatePct": 6,
    "cardFeePct": 3.5,
    "variableExpensesPct": 5,
    "desiredMarginPct": 20,
    "openingCashBalance": 10000,
    "monthlyRevenue": [
        18000,
        17500,
        19000,
        21000,
        26000,
        15000,
        15500,
        16000,
        17000,
        18500,
        19000,
        22000,
    ],
    "monthlyExpenses": [
        16500,
        16500,
        17000,
        17500,
        19500,
        15500,
        15500,
        15800,
        16200,
        16800,
        17000,
        18500,
    ],
    "startMonth": "2026-11",
}

# Run the Actor and wait for it to finish
run = client.actor("kman-br/pricing-cash-flow-calculator").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "language": "pt-BR",
  "currency": "BRL",
  "products": [
    {
      "name": "Café especial 250 g",
      "unitCost": 18,
      "extraVariableCost": 2.5,
      "monthlyVolume": 300
    },
    {
      "name": "Kit presente",
      "unitCost": 45,
      "extraVariableCost": 6,
      "monthlyVolume": 80
    },
    {
      "name": "Workshop online (vaga)",
      "unitCost": 12,
      "monthlyVolume": 40
    }
  ],
  "fixedExpenses": [
    {
      "name": "Aluguel",
      "amount": 3500
    },
    {
      "name": "Pró-labore",
      "amount": 6000
    },
    {
      "name": "Contabilidade",
      "amount": 600
    },
    {
      "name": "Software",
      "amount": 250
    }
  ],
  "taxRegime": "Simples Nacional",
  "effectiveTaxRatePct": 6,
  "cardFeePct": 3.5,
  "variableExpensesPct": 5,
  "desiredMarginPct": 20,
  "openingCashBalance": 10000,
  "monthlyRevenue": [
    18000,
    17500,
    19000,
    21000,
    26000,
    15000,
    15500,
    16000,
    17000,
    18500,
    19000,
    22000
  ],
  "monthlyExpenses": [
    16500,
    16500,
    17000,
    17500,
    19500,
    15500,
    15500,
    15800,
    16200,
    16800,
    17000,
    18500
  ],
  "startMonth": "2026-11"
}' |
apify call kman-br/pricing-cash-flow-calculator --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,kman-br/pricing-cash-flow-calculator"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/zyt9KGqnPOLJBqHuo/builds/W26pDMvxA0KAb5jCC/openapi.json
