> ## Documentation Index
> Fetch the complete documentation index at: https://docs.finsync.ar/llms.txt
> Use this file to discover all available pages before exploring further.

# Cost centers workflow

> Create and resolve company centros de resultados IDs and budgets before creating budget operations.

# Cost centers workflow

The public field is `cost_center_id`. Table names stay `CostCenter` / `CostCenterBudget`. User-facing copy in the dashboard is **centros de resultados**.

Use `GET /api/cost-centers` (x-api-key, company scoped) to list centers with an embedded `budgets` array so you can resolve IDs.

```bash theme={null}
curl --request GET \
  --url "https://finsync.ar/api/cost-centers" \
  --header "x-api-key: YOUR_API_KEY"
```

Each center includes `client_id` (imputation vehicle), `default_internal_account_id`, `net_balance_by_default`, and `budgets` with `kind` = `expense` | `income` (default `expense`). Amounts are positive. Unique key is `(cost_center_id, currency, year, period, kind)`.

## Create a centro de resultados

If the list is empty, create one with `POST /api/cost-centers`. This is the same domain path as the dashboard: it creates the `CostCenter` and a type=1 client tagged for centros de resultados (legacy `Centro de costos` tags are reused when present; new tags use `Centro de resultados`).

Required: `name`, `default_currency`. Optional: `default_internal_account_id`, `net_balance_by_default`, `owner_name`, `owner_email`, `department`.

```bash theme={null}
curl --request POST \
  --url "https://finsync.ar/api/cost-centers" \
  --header "Content-Type: application/json" \
  --header "x-api-key: YOUR_API_KEY" \
  --data '{
    "name": "Marketing",
    "default_currency": "USD",
    "net_balance_by_default": true
  }'
```

The `201` body is the created center (same fields as a GET item, including `id` and `client_id`, with `budgets: []`). Use that `id` as `cost_center_id` on `POST /api/operations`.

Optional `PATCH /api/cost-centers/{id}` updates those fields. Delete is not supported.

## Seed a budget operation type

Budget operations need a company operation type with `type=budget`. New companies with cost centers enabled get `Centros de resultados` automatically. Existing companies (for example Blueprint) may only have `up` / `down` / `other` / `exchange`.

```bash theme={null}
curl --request POST \
  --url "https://finsync.ar/api/operation-types" \
  --header "Content-Type: application/json" \
  --header "x-api-key: YOUR_API_KEY" \
  --data '{
    "name": "Centros de resultados",
    "type": "budget"
  }'
```

`type` must already exist on `CompanyOperationTypes` (`up`, `down`, `exchange`, `other`, `budget`, `interest`). Then create budget operations with `POST /api/operations`. See [Operations workflow](/docs/workflows/operations).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.