@vitrina/api 17.24.0 → 17.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -72463,12 +72463,13 @@ interface paths {
72463
72463
  };
72464
72464
  /**
72465
72465
  * Plan de cuentas: the account tree
72466
- * @description Every account of the workspace as a flat list in tree order (parents before children, siblings in screen order), each with `depth` and `path`. The first read of a workspace that holds the add-on creates the starter chart for its vertical (clinic, automotora or generic). Archived accounts are left out unless `include_archived=true`. The plan de cuentas is a classification tree, not double-entry. Each account has a `kind` (`ingreso`, `costo`, `gasto` or `no_operacional`) and, on `costo` and `gasto` only, a `behavior` (`fijo` or `variable`). A sub-account has its parent’s kind. Rule breaks answer `422 FINANZAS_ACCOUNT_INVALID` and state conflicts `409 FINANZAS_ACCOUNT_CONFLICT`, both with `details.reason`. Requires the `finanzas` add-on — without it every Finanzas operation answers `402 ENTITLEMENT_NOT_ACTIVE` (`details.required = ["finanzas"]`). Requires `finanzas:read`.
72466
+ * @description Every account of the workspace as a flat list in tree order (parents before children, siblings in screen order), each with `depth` and `path`. The first read of a workspace that holds the add-on creates the starter chart for its vertical (clinic, automotora or generic). Archived accounts are left out unless `include_archived=true`. With `usage_month=YYYY-MM` every account gains `usage` (that month’s net total, document count, last month used and whether it was used in the last 6 months), the same arithmetic as the Resultado; parents roll up their children. `usage_month` must be a month of the workspace (not after the current one) or the answer is `422 FINANZAS_ACCOUNT_INVALID` with `details.reason = "usage_month"`, and it also requires `finanzas_reports:read` (`403` with `details.reason = "usage_requires_reports"` otherwise). The plan de cuentas is a classification tree, not double-entry. Each account has a `kind` (`ingreso`, `costo`, `gasto` or `no_operacional`) and, on `costo` and `gasto` only, a `behavior` (`fijo` or `variable`). A sub-account has its parent’s kind. Rule breaks answer `422 FINANZAS_ACCOUNT_INVALID` and state conflicts `409 FINANZAS_ACCOUNT_CONFLICT`, both with `details.reason`. Requires the `finanzas` add-on — without it every Finanzas operation answers `402 ENTITLEMENT_NOT_ACTIVE` (`details.required = ["finanzas"]`). Requires `finanzas:read`.
72467
72467
  */
72468
72468
  get: {
72469
72469
  parameters: {
72470
72470
  query?: {
72471
72471
  include_archived?: "true" | "false";
72472
+ usage_month?: string;
72472
72473
  };
72473
72474
  header?: never;
72474
72475
  path?: never;
@@ -72707,6 +72708,267 @@ interface paths {
72707
72708
  patch?: never;
72708
72709
  trace?: never;
72709
72710
  };
72711
+ "/finanzas/accounts/review": {
72712
+ parameters: {
72713
+ query?: never;
72714
+ header?: never;
72715
+ path?: never;
72716
+ cookie?: never;
72717
+ };
72718
+ /**
72719
+ * Plan de cuentas: the monthly review
72720
+ * @description Is the plan in order? How much of the month’s outflow has an account (`classified_pct`), the documents nobody classified (the Resultado’s «Egresos sin clasificar»), and up to three findings in priority order: `unclassified`, `duplicate_import` (accounts an import brought that repeat a template account) and `unused` (leaf accounts with no money in 6 months). Default `month`: the latest closed month, else the previous month, else the current one (`in_progress`). A `month` outside the workspace answers `422 FINANZAS_ACCOUNT_INVALID` (`details.reason = "month"`). Requires the `finanzas` add-on — without it every Finanzas operation answers `402 ENTITLEMENT_NOT_ACTIVE` (`details.required = ["finanzas"]`). Requires `finanzas:read` and `finanzas_reports:read`.
72721
+ */
72722
+ get: {
72723
+ parameters: {
72724
+ query?: {
72725
+ month?: string;
72726
+ };
72727
+ header?: never;
72728
+ path?: never;
72729
+ cookie?: never;
72730
+ };
72731
+ requestBody?: never;
72732
+ responses: {
72733
+ /** @description The review */
72734
+ 200: {
72735
+ headers: {
72736
+ [name: string]: unknown;
72737
+ };
72738
+ content: {
72739
+ /**
72740
+ * @example {
72741
+ * "data": {
72742
+ * "month": "2026-10",
72743
+ * "in_progress": false,
72744
+ * "classified_pct": 95.7,
72745
+ * "outflow_total_clp": 37000000,
72746
+ * "unclassified": {
72747
+ * "count": 7,
72748
+ * "total_clp": 1590984,
72749
+ * "by_kind": [
72750
+ * {
72751
+ * "kind": "purchase",
72752
+ * "count": 7,
72753
+ * "total_clp": 1590984
72754
+ * }
72755
+ * ],
72756
+ * "with_proposal": 4
72757
+ * },
72758
+ * "unclassified_income": {
72759
+ * "count": 0,
72760
+ * "total_clp": 0
72761
+ * },
72762
+ * "findings": [
72763
+ * {
72764
+ * "key": "unclassified",
72765
+ * "count": 7,
72766
+ * "total_clp": 1590984
72767
+ * },
72768
+ * {
72769
+ * "key": "duplicate_import",
72770
+ * "count": 1,
72771
+ * "pairs": [
72772
+ * {
72773
+ * "account_id": "0190a3c2-5d1e-7b6a-9f20-4c1d2e3f4d03",
72774
+ * "name": "Ret. Boletas de Honorarios (auto)",
72775
+ * "duplicates_id": "0190a3c2-5d1e-7b6a-9f20-4c1d2e3f4d04",
72776
+ * "duplicates_name": "Retención de boletas de honorarios",
72777
+ * "used_6m": true
72778
+ * }
72779
+ * ]
72780
+ * }
72781
+ * ]
72782
+ * }
72783
+ * }
72784
+ */
72785
+ "application/json": {
72786
+ data: components["schemas"]["FinanzasAccountReview"];
72787
+ };
72788
+ };
72789
+ };
72790
+ /** @description Validation error */
72791
+ 400: {
72792
+ headers: {
72793
+ [name: string]: unknown;
72794
+ };
72795
+ content: {
72796
+ "application/json": components["schemas"]["Error"];
72797
+ };
72798
+ };
72799
+ /** @description Unauthorized */
72800
+ 401: {
72801
+ headers: {
72802
+ [name: string]: unknown;
72803
+ };
72804
+ content: {
72805
+ "application/json": components["schemas"]["Error"];
72806
+ };
72807
+ };
72808
+ /** @description Forbidden */
72809
+ 403: {
72810
+ headers: {
72811
+ [name: string]: unknown;
72812
+ };
72813
+ content: {
72814
+ "application/json": components["schemas"]["Error"];
72815
+ };
72816
+ };
72817
+ /** @description Not found */
72818
+ 404: {
72819
+ headers: {
72820
+ [name: string]: unknown;
72821
+ };
72822
+ content: {
72823
+ "application/json": components["schemas"]["Error"];
72824
+ };
72825
+ };
72826
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
72827
+ 409: {
72828
+ headers: {
72829
+ [name: string]: unknown;
72830
+ };
72831
+ content: {
72832
+ "application/json": components["schemas"]["Error"];
72833
+ };
72834
+ };
72835
+ /** @description Rate limited */
72836
+ 429: {
72837
+ headers: {
72838
+ [name: string]: unknown;
72839
+ };
72840
+ content: {
72841
+ "application/json": components["schemas"]["Error"];
72842
+ };
72843
+ };
72844
+ };
72845
+ };
72846
+ put?: never;
72847
+ post?: never;
72848
+ delete?: never;
72849
+ options?: never;
72850
+ head?: never;
72851
+ patch?: never;
72852
+ trace?: never;
72853
+ };
72854
+ "/finanzas/accounts/review/dismiss": {
72855
+ parameters: {
72856
+ query?: never;
72857
+ header?: never;
72858
+ path?: never;
72859
+ cookie?: never;
72860
+ };
72861
+ get?: never;
72862
+ put?: never;
72863
+ /**
72864
+ * Plan de cuentas: «No son la misma»
72865
+ * @description Stops a `duplicate_import` pair from appearing in the review again. Idempotent. Requires the `finanzas` add-on — without it every Finanzas operation answers `402 ENTITLEMENT_NOT_ACTIVE` (`details.required = ["finanzas"]`). Requires `finanzas_admin:write`.
72866
+ */
72867
+ post: {
72868
+ parameters: {
72869
+ query?: never;
72870
+ header?: {
72871
+ /** @description Replay-safe retries: resending the SAME key with the SAME body returns the original response (`X-Idempotent-Replay: 1`) instead of creating a second copy — safe to send whenever a response might not have arrived. The same key with a DIFFERENT body answers `409 IDEMPOTENCY_KEY_CONFLICT`; use a fresh key per operation. */
72872
+ "Idempotency-Key"?: string;
72873
+ };
72874
+ path?: never;
72875
+ cookie?: never;
72876
+ };
72877
+ requestBody?: {
72878
+ content: {
72879
+ /**
72880
+ * @example {
72881
+ * "key": "duplicate_import",
72882
+ * "account_id": "0190a3c2-5d1e-7b6a-9f20-4c1d2e3f4d03"
72883
+ * }
72884
+ */
72885
+ "application/json": components["schemas"]["FinanzasAccountReviewDismissBody"];
72886
+ };
72887
+ };
72888
+ responses: {
72889
+ /** @description Dismissed */
72890
+ 200: {
72891
+ headers: {
72892
+ [name: string]: unknown;
72893
+ };
72894
+ content: {
72895
+ /**
72896
+ * @example {
72897
+ * "data": {
72898
+ * "dismissed": true
72899
+ * }
72900
+ * }
72901
+ */
72902
+ "application/json": {
72903
+ data: {
72904
+ /** @enum {boolean} */
72905
+ dismissed: true;
72906
+ };
72907
+ };
72908
+ };
72909
+ };
72910
+ /** @description Validation error */
72911
+ 400: {
72912
+ headers: {
72913
+ [name: string]: unknown;
72914
+ };
72915
+ content: {
72916
+ "application/json": components["schemas"]["Error"];
72917
+ };
72918
+ };
72919
+ /** @description Unauthorized */
72920
+ 401: {
72921
+ headers: {
72922
+ [name: string]: unknown;
72923
+ };
72924
+ content: {
72925
+ "application/json": components["schemas"]["Error"];
72926
+ };
72927
+ };
72928
+ /** @description Forbidden */
72929
+ 403: {
72930
+ headers: {
72931
+ [name: string]: unknown;
72932
+ };
72933
+ content: {
72934
+ "application/json": components["schemas"]["Error"];
72935
+ };
72936
+ };
72937
+ /** @description Not found */
72938
+ 404: {
72939
+ headers: {
72940
+ [name: string]: unknown;
72941
+ };
72942
+ content: {
72943
+ "application/json": components["schemas"]["Error"];
72944
+ };
72945
+ };
72946
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
72947
+ 409: {
72948
+ headers: {
72949
+ [name: string]: unknown;
72950
+ };
72951
+ content: {
72952
+ "application/json": components["schemas"]["Error"];
72953
+ };
72954
+ };
72955
+ /** @description Rate limited */
72956
+ 429: {
72957
+ headers: {
72958
+ [name: string]: unknown;
72959
+ };
72960
+ content: {
72961
+ "application/json": components["schemas"]["Error"];
72962
+ };
72963
+ };
72964
+ };
72965
+ };
72966
+ delete?: never;
72967
+ options?: never;
72968
+ head?: never;
72969
+ patch?: never;
72970
+ trace?: never;
72971
+ };
72710
72972
  "/finanzas/accounts/{id}": {
72711
72973
  parameters: {
72712
72974
  query?: never;
@@ -73305,6 +73567,8 @@ interface paths {
73305
73567
  /**
73306
73568
  * Start a bank link (Fintoc widget token)
73307
73569
  * @description Opens one bank-link attempt: creates a Fintoc link intent (business holder, movements) and returns its `widget_token`, which opens Fintoc's widget (`Fintoc.create({ publicKey, widgetToken })`). Fintoc returns the token only once, so request a fresh one each time the widget opens. On success the widget hands back an `exchange_token`: send it to `POST /finanzas/connections/fintoc` (or `…/{id}/reconnect`). Reads no bank and costs nothing. Requires the `bank_feed_fintoc` add-on (`402 ENTITLEMENT_NOT_ACTIVE` otherwise). Requires the `finanzas` add-on — without it every Finanzas operation answers `402 ENTITLEMENT_NOT_ACTIVE` (`details.required = ["finanzas"]`). Requires `finanzas_admin:write`.
73570
+ *
73571
+ * **Connected apps:** refused with `403 CONNECTED_APP_EXCLUDED_OPERATION` and absent from the MCP catalogue, whatever write pack was granted — the «Agentes de IA» pack promises not to include this act. An API key or a personal token of the workspace holding the scope reaches it as usual.
73308
73572
  */
73309
73573
  post: {
73310
73574
  parameters: {
@@ -73411,6 +73675,8 @@ interface paths {
73411
73675
  /**
73412
73676
  * Connect a bank account
73413
73677
  * @description Send the `exchange_token` Fintoc's widget returns (or a `link_token`). The link token is stored encrypted and the first sync is queued. Each bank is billed at Fintoc's cost through the `bank_feed_fintoc` add-on; without it the answer is `402 ENTITLEMENT_NOT_ACTIVE` (`required: ["bank_feed_fintoc"]`). Requires the `finanzas` add-on — without it every Finanzas operation answers `402 ENTITLEMENT_NOT_ACTIVE` (`details.required = ["finanzas"]`). Requires `finanzas_admin:write`.
73678
+ *
73679
+ * **Connected apps:** refused with `403 CONNECTED_APP_EXCLUDED_OPERATION` and absent from the MCP catalogue, whatever write pack was granted — the «Agentes de IA» pack promises not to include this act. An API key or a personal token of the workspace holding the scope reaches it as usual.
73414
73680
  */
73415
73681
  post: {
73416
73682
  parameters: {
@@ -73657,6 +73923,8 @@ interface paths {
73657
73923
  /**
73658
73924
  * Reconnect a bank account
73659
73925
  * @description For a bank link whose login must be redone (`login_required`). Send the `exchange_token` from Fintoc's widget opened again for that bank. The link returns to `active`; if Fintoc answers with a different link, it replaces this one, which is disconnected. Requires the `finanzas` add-on — without it every Finanzas operation answers `402 ENTITLEMENT_NOT_ACTIVE` (`details.required = ["finanzas"]`). Requires `finanzas_admin:write`.
73926
+ *
73927
+ * **Connected apps:** refused with `403 CONNECTED_APP_EXCLUDED_OPERATION` and absent from the MCP catalogue, whatever write pack was granted — the «Agentes de IA» pack promises not to include this act. An API key or a personal token of the workspace holding the scope reaches it as usual.
73660
73928
  */
73661
73929
  post: {
73662
73930
  parameters: {
@@ -73797,6 +74065,8 @@ interface paths {
73797
74065
  /**
73798
74066
  * Disconnect a bank account
73799
74067
  * @description Reversible: the link stays (disabled), its movements stay in the ledger, it stops syncing and stops counting as a billed bank. Bank links only. Requires the `finanzas` add-on — without it every Finanzas operation answers `402 ENTITLEMENT_NOT_ACTIVE` (`details.required = ["finanzas"]`). Requires `finanzas_admin:write`.
74068
+ *
74069
+ * **Connected apps:** refused with `403 CONNECTED_APP_EXCLUDED_OPERATION` and absent from the MCP catalogue, whatever write pack was granted — the «Agentes de IA» pack promises not to include this act. An API key or a personal token of the workspace holding the scope reaches it as usual.
73800
74070
  */
73801
74071
  post: {
73802
74072
  parameters: {
@@ -77618,6 +77888,8 @@ interface paths {
77618
77888
  /**
77619
77889
  * Share a bank account with the AI agent (or stop)
77620
77890
  * @description One bank-account registry (Finanzas 33): the Finanzas bank accounts are the workspace's accounts, and «el agente comparte esta cuenta» is a flag on one of them. `shared: true` makes the AI agent dictate this account for transfers and matches abonos into it (the same registry `GET /tenant-bank-accounts` lists); `false` stops it, keeping the row. The first share needs `holder_name` (400 `VALIDATION_ERROR`, `details.reason = agent_sharing_holder_required`); `holder_rut` defaults to the workspace's SII RUT. 409 `CONFLICT` with `details.reason = agent_sharing_not_supported` for a card, a credit line, a USD account or a number known only by its last digits. Audited. Requires the `finanzas` add-on — without it every Finanzas operation answers `402 ENTITLEMENT_NOT_ACTIVE` (`details.required = ["finanzas"]`). Requires `finanzas_admin:write`.
77891
+ *
77892
+ * **Connected apps:** refused with `403 CONNECTED_APP_EXCLUDED_OPERATION` and absent from the MCP catalogue, whatever write pack was granted — the «Agentes de IA» pack promises not to include this act. An API key or a personal token of the workspace holding the scope reaches it as usual.
77621
77893
  */
77622
77894
  put: {
77623
77895
  parameters: {
@@ -79680,6 +79952,8 @@ interface paths {
79680
79952
  /**
79681
79953
  * Replace the forwarding address
79682
79954
  * @description A new address; the old one stops working at once (mail to it is dropped). Requires the `finanzas` add-on — without it every Finanzas operation answers `402 ENTITLEMENT_NOT_ACTIVE` (`details.required = ["finanzas"]`). Requires `finanzas_admin:write`.
79955
+ *
79956
+ * **Connected apps:** refused with `403 CONNECTED_APP_EXCLUDED_OPERATION` and absent from the MCP catalogue, whatever write pack was granted — the «Agentes de IA» pack promises not to include this act. An API key or a personal token of the workspace holding the scope reaches it as usual.
79683
79957
  */
79684
79958
  post: {
79685
79959
  parameters: {
@@ -85963,6 +86237,8 @@ interface paths {
85963
86237
  /**
85964
86238
  * Close a month (Cerrar mes)
85965
86239
  * @description Closes an ended month with nothing open in «Por resolver». Send the `checklist.unreviewed_count` the person confirmed. Records who, when, the checklist and a snapshot of the figures. Soft: nothing is locked; from now on a change that touches the month needs `?adjustment_reason=` and is listed as an «ajuste posterior al cierre». 409 `FINANZAS_MONTH_NOT_CLOSABLE` with `details.reason` `open_cases` (+ `open_cases`, the count), `not_ended`, `already_closed` or `unreviewed_changed` (+ `unreviewed_count`, the count now). Requires the `finanzas` add-on — without it every Finanzas operation answers `402 ENTITLEMENT_NOT_ACTIVE` (`details.required = ["finanzas"]`). Requires `finanzas:write`.
86240
+ *
86241
+ * **Connected apps:** refused with `403 CONNECTED_APP_EXCLUDED_OPERATION` and absent from the MCP catalogue, whatever write pack was granted — the «Agentes de IA» pack promises not to include this act. An API key or a personal token of the workspace holding the scope reaches it as usual.
85966
86242
  */
85967
86243
  post: {
85968
86244
  parameters: {
@@ -92516,6 +92792,8 @@ interface paths {
92516
92792
  /**
92517
92793
  * Connect a razón social to the SII (step 1)
92518
92794
  * @description Records the razón social when the workspace has none (`legal_entity`, the Datos legales body) or takes an existing one (`legal_entity_id`), then creates its SII connection. Idempotent per sociedad: an already connected one answers its connection. `resolucion` keeps an existing electronic-emission authorisation. Boleta emission stays OFF. Requires the `finanzas` add-on (402 `ENTITLEMENT_NOT_ACTIVE` otherwise). Requires `finanzas_admin:write`.
92795
+ *
92796
+ * **Connected apps:** refused with `403 CONNECTED_APP_EXCLUDED_OPERATION` and absent from the MCP catalogue, whatever write pack was granted — the «Agentes de IA» pack promises not to include this act. An API key or a personal token of the workspace holding the scope reaches it as usual.
92519
92797
  */
92520
92798
  post: {
92521
92799
  parameters: {
@@ -92663,6 +92941,8 @@ interface paths {
92663
92941
  /**
92664
92942
  * Vitrina's mandato for the representante legal to sign (step 3)
92665
92943
  * @description Renders Vitrina's mandato (`GET /legal/documents/{key}` with key `sii_mandato`, version + SHA-256) for this razón social and opens it in Vitrina's signing service. Returns the representante legal's `signing_url` (also mailed to them unless `send_email: false`). A new request replaces an unsigned one; a signed mandato cannot be replaced. Once signed it is registered at the SII automatically (`sii.mandato.phase`: `connecting` → `connected`). Requires the `finanzas` add-on (402 `ENTITLEMENT_NOT_ACTIVE` otherwise). Requires `finanzas_admin:write`.
92944
+ *
92945
+ * **Connected apps:** refused with `403 CONNECTED_APP_EXCLUDED_OPERATION` and absent from the MCP catalogue, whatever write pack was granted — the «Agentes de IA» pack promises not to include this act. An API key or a personal token of the workspace holding the scope reaches it as usual.
92666
92946
  */
92667
92947
  post: {
92668
92948
  parameters: {
@@ -92916,6 +93196,8 @@ interface paths {
92916
93196
  /**
92917
93197
  * Revoke the mandato (cláusula 7.1)
92918
93198
  * @description Revokes the signed mandato at the SII and here, with immediate effect: the SII connection stops acting for the empresa until a new mandato is signed. Requires the `finanzas` add-on (402 `ENTITLEMENT_NOT_ACTIVE` otherwise). Requires `finanzas_admin:write`.
93199
+ *
93200
+ * **Connected apps:** refused with `403 CONNECTED_APP_EXCLUDED_OPERATION` and absent from the MCP catalogue, whatever write pack was granted — the «Agentes de IA» pack promises not to include this act. An API key or a personal token of the workspace holding the scope reaches it as usual.
92919
93201
  */
92920
93202
  post: {
92921
93203
  parameters: {
@@ -93164,6 +93446,8 @@ interface paths {
93164
93446
  /**
93165
93447
  * Onboarding state: start, defer, or «no recibe boletas de honorarios»
93166
93448
  * @description Per workspace. `start` keeps the guided start while things get connected; `defer` («Lo hago después») collapses it to the checklist on Resumen; `no_honorarios` marks the honorarios step skipped (409 while honorarios documents are on record); `has_honorarios` undoes it; `dismiss_mercado_pago` hides the optional Mercado Pago card for good (per workspace, every device). Answers the setup. Requires the `finanzas` add-on (402 `ENTITLEMENT_NOT_ACTIVE` otherwise). Requires `finanzas_admin:write`.
93449
+ *
93450
+ * **Connected apps:** refused with `403 CONNECTED_APP_EXCLUDED_OPERATION` and absent from the MCP catalogue, whatever write pack was granted — the «Agentes de IA» pack promises not to include this act. An API key or a personal token of the workspace holding the scope reaches it as usual.
93167
93451
  */
93168
93452
  post: {
93169
93453
  parameters: {
@@ -281037,6 +281321,19 @@ interface components {
281037
281321
  FinanzasAccountKind: "ingreso" | "costo" | "gasto" | "no_operacional";
281038
281322
  /** @enum {string|null} */
281039
281323
  FinanzasAccountBehavior: "fijo" | "variable" | null;
281324
+ /** @description Present only when the list was asked with `usage_month`. */
281325
+ FinanzasAccountUsage: {
281326
+ /** @example 2026-10 */
281327
+ month: string;
281328
+ /** @description Whole CLP, NET, signed as the Resultado counts the account in that month (parents roll up their children). A costo / gasto line with no legal document sits in the Resultado’s «Egresos sin documento», not here. */
281329
+ total_clp: number;
281330
+ /** @description Distinct documents and movements behind `total_clp` (the Resultado drill-down of this account). */
281331
+ count: number;
281332
+ /** @description Latest `YYYY-MM` with any line on this account or a descendant, up to `month`. */
281333
+ last_used_month: string | null;
281334
+ /** @description Any line in the 6 months ending at `month`, inclusive. */
281335
+ used_6m: boolean;
281336
+ };
281040
281337
  FinanzasAccount: {
281041
281338
  /** Format: uuid */
281042
281339
  id: string;
@@ -281056,10 +281353,66 @@ interface components {
281056
281353
  archived_at: string | null;
281057
281354
  created_at: string;
281058
281355
  updated_at: string;
281356
+ usage?: components["schemas"]["FinanzasAccountUsage"];
281059
281357
  };
281060
281358
  FinanzasAccounts: {
281061
281359
  accounts: components["schemas"]["FinanzasAccount"][];
281062
281360
  };
281361
+ FinanzasAccountReview: {
281362
+ month: string;
281363
+ /** @description The month is the current (proforma) one. */
281364
+ in_progress: boolean;
281365
+ /** @description Share of the month’s costo + gasto outflow that has an account, floored to one decimal (99.96 reads 99.9). 100 only when nothing is unclassified. Null when nothing went out. */
281366
+ classified_pct: number | null;
281367
+ outflow_total_clp: number;
281368
+ unclassified: {
281369
+ count: number;
281370
+ /** @description Equals the Resultado’s «Egresos sin clasificar» for the month. */
281371
+ total_clp: number;
281372
+ by_kind: {
281373
+ /** @enum {string} */
281374
+ kind: "purchase" | "honorario" | "manual_expense" | "movement";
281375
+ count: number;
281376
+ total_clp: number;
281377
+ }[];
281378
+ /** @description How many of them sit in an open, ready `classify` case: Vitrina already proposes an account. */
281379
+ with_proposal: number;
281380
+ };
281381
+ unclassified_income: {
281382
+ count: number;
281383
+ total_clp: number;
281384
+ };
281385
+ findings: ({
281386
+ /** @enum {string} */
281387
+ key: "unclassified";
281388
+ count: number;
281389
+ total_clp: number;
281390
+ } | {
281391
+ /** @enum {string} */
281392
+ key: "duplicate_import";
281393
+ count: number;
281394
+ pairs: {
281395
+ /** Format: uuid */
281396
+ account_id: string;
281397
+ name: string;
281398
+ /** Format: uuid */
281399
+ duplicates_id: string;
281400
+ duplicates_name: string;
281401
+ used_6m: boolean;
281402
+ }[];
281403
+ } | {
281404
+ /** @enum {string} */
281405
+ key: "unused";
281406
+ count: number;
281407
+ account_ids: string[];
281408
+ })[];
281409
+ };
281410
+ FinanzasAccountReviewDismissBody: {
281411
+ /** @enum {string} */
281412
+ key: "duplicate_import";
281413
+ /** Format: uuid */
281414
+ account_id: string;
281415
+ };
281063
281416
  FinanzasAccountCreateBody: {
281064
281417
  name: string;
281065
281418
  /** Format: uuid */
package/dist/index.d.ts CHANGED
@@ -72463,12 +72463,13 @@ interface paths {
72463
72463
  };
72464
72464
  /**
72465
72465
  * Plan de cuentas: the account tree
72466
- * @description Every account of the workspace as a flat list in tree order (parents before children, siblings in screen order), each with `depth` and `path`. The first read of a workspace that holds the add-on creates the starter chart for its vertical (clinic, automotora or generic). Archived accounts are left out unless `include_archived=true`. The plan de cuentas is a classification tree, not double-entry. Each account has a `kind` (`ingreso`, `costo`, `gasto` or `no_operacional`) and, on `costo` and `gasto` only, a `behavior` (`fijo` or `variable`). A sub-account has its parent’s kind. Rule breaks answer `422 FINANZAS_ACCOUNT_INVALID` and state conflicts `409 FINANZAS_ACCOUNT_CONFLICT`, both with `details.reason`. Requires the `finanzas` add-on — without it every Finanzas operation answers `402 ENTITLEMENT_NOT_ACTIVE` (`details.required = ["finanzas"]`). Requires `finanzas:read`.
72466
+ * @description Every account of the workspace as a flat list in tree order (parents before children, siblings in screen order), each with `depth` and `path`. The first read of a workspace that holds the add-on creates the starter chart for its vertical (clinic, automotora or generic). Archived accounts are left out unless `include_archived=true`. With `usage_month=YYYY-MM` every account gains `usage` (that month’s net total, document count, last month used and whether it was used in the last 6 months), the same arithmetic as the Resultado; parents roll up their children. `usage_month` must be a month of the workspace (not after the current one) or the answer is `422 FINANZAS_ACCOUNT_INVALID` with `details.reason = "usage_month"`, and it also requires `finanzas_reports:read` (`403` with `details.reason = "usage_requires_reports"` otherwise). The plan de cuentas is a classification tree, not double-entry. Each account has a `kind` (`ingreso`, `costo`, `gasto` or `no_operacional`) and, on `costo` and `gasto` only, a `behavior` (`fijo` or `variable`). A sub-account has its parent’s kind. Rule breaks answer `422 FINANZAS_ACCOUNT_INVALID` and state conflicts `409 FINANZAS_ACCOUNT_CONFLICT`, both with `details.reason`. Requires the `finanzas` add-on — without it every Finanzas operation answers `402 ENTITLEMENT_NOT_ACTIVE` (`details.required = ["finanzas"]`). Requires `finanzas:read`.
72467
72467
  */
72468
72468
  get: {
72469
72469
  parameters: {
72470
72470
  query?: {
72471
72471
  include_archived?: "true" | "false";
72472
+ usage_month?: string;
72472
72473
  };
72473
72474
  header?: never;
72474
72475
  path?: never;
@@ -72707,6 +72708,267 @@ interface paths {
72707
72708
  patch?: never;
72708
72709
  trace?: never;
72709
72710
  };
72711
+ "/finanzas/accounts/review": {
72712
+ parameters: {
72713
+ query?: never;
72714
+ header?: never;
72715
+ path?: never;
72716
+ cookie?: never;
72717
+ };
72718
+ /**
72719
+ * Plan de cuentas: the monthly review
72720
+ * @description Is the plan in order? How much of the month’s outflow has an account (`classified_pct`), the documents nobody classified (the Resultado’s «Egresos sin clasificar»), and up to three findings in priority order: `unclassified`, `duplicate_import` (accounts an import brought that repeat a template account) and `unused` (leaf accounts with no money in 6 months). Default `month`: the latest closed month, else the previous month, else the current one (`in_progress`). A `month` outside the workspace answers `422 FINANZAS_ACCOUNT_INVALID` (`details.reason = "month"`). Requires the `finanzas` add-on — without it every Finanzas operation answers `402 ENTITLEMENT_NOT_ACTIVE` (`details.required = ["finanzas"]`). Requires `finanzas:read` and `finanzas_reports:read`.
72721
+ */
72722
+ get: {
72723
+ parameters: {
72724
+ query?: {
72725
+ month?: string;
72726
+ };
72727
+ header?: never;
72728
+ path?: never;
72729
+ cookie?: never;
72730
+ };
72731
+ requestBody?: never;
72732
+ responses: {
72733
+ /** @description The review */
72734
+ 200: {
72735
+ headers: {
72736
+ [name: string]: unknown;
72737
+ };
72738
+ content: {
72739
+ /**
72740
+ * @example {
72741
+ * "data": {
72742
+ * "month": "2026-10",
72743
+ * "in_progress": false,
72744
+ * "classified_pct": 95.7,
72745
+ * "outflow_total_clp": 37000000,
72746
+ * "unclassified": {
72747
+ * "count": 7,
72748
+ * "total_clp": 1590984,
72749
+ * "by_kind": [
72750
+ * {
72751
+ * "kind": "purchase",
72752
+ * "count": 7,
72753
+ * "total_clp": 1590984
72754
+ * }
72755
+ * ],
72756
+ * "with_proposal": 4
72757
+ * },
72758
+ * "unclassified_income": {
72759
+ * "count": 0,
72760
+ * "total_clp": 0
72761
+ * },
72762
+ * "findings": [
72763
+ * {
72764
+ * "key": "unclassified",
72765
+ * "count": 7,
72766
+ * "total_clp": 1590984
72767
+ * },
72768
+ * {
72769
+ * "key": "duplicate_import",
72770
+ * "count": 1,
72771
+ * "pairs": [
72772
+ * {
72773
+ * "account_id": "0190a3c2-5d1e-7b6a-9f20-4c1d2e3f4d03",
72774
+ * "name": "Ret. Boletas de Honorarios (auto)",
72775
+ * "duplicates_id": "0190a3c2-5d1e-7b6a-9f20-4c1d2e3f4d04",
72776
+ * "duplicates_name": "Retención de boletas de honorarios",
72777
+ * "used_6m": true
72778
+ * }
72779
+ * ]
72780
+ * }
72781
+ * ]
72782
+ * }
72783
+ * }
72784
+ */
72785
+ "application/json": {
72786
+ data: components["schemas"]["FinanzasAccountReview"];
72787
+ };
72788
+ };
72789
+ };
72790
+ /** @description Validation error */
72791
+ 400: {
72792
+ headers: {
72793
+ [name: string]: unknown;
72794
+ };
72795
+ content: {
72796
+ "application/json": components["schemas"]["Error"];
72797
+ };
72798
+ };
72799
+ /** @description Unauthorized */
72800
+ 401: {
72801
+ headers: {
72802
+ [name: string]: unknown;
72803
+ };
72804
+ content: {
72805
+ "application/json": components["schemas"]["Error"];
72806
+ };
72807
+ };
72808
+ /** @description Forbidden */
72809
+ 403: {
72810
+ headers: {
72811
+ [name: string]: unknown;
72812
+ };
72813
+ content: {
72814
+ "application/json": components["schemas"]["Error"];
72815
+ };
72816
+ };
72817
+ /** @description Not found */
72818
+ 404: {
72819
+ headers: {
72820
+ [name: string]: unknown;
72821
+ };
72822
+ content: {
72823
+ "application/json": components["schemas"]["Error"];
72824
+ };
72825
+ };
72826
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
72827
+ 409: {
72828
+ headers: {
72829
+ [name: string]: unknown;
72830
+ };
72831
+ content: {
72832
+ "application/json": components["schemas"]["Error"];
72833
+ };
72834
+ };
72835
+ /** @description Rate limited */
72836
+ 429: {
72837
+ headers: {
72838
+ [name: string]: unknown;
72839
+ };
72840
+ content: {
72841
+ "application/json": components["schemas"]["Error"];
72842
+ };
72843
+ };
72844
+ };
72845
+ };
72846
+ put?: never;
72847
+ post?: never;
72848
+ delete?: never;
72849
+ options?: never;
72850
+ head?: never;
72851
+ patch?: never;
72852
+ trace?: never;
72853
+ };
72854
+ "/finanzas/accounts/review/dismiss": {
72855
+ parameters: {
72856
+ query?: never;
72857
+ header?: never;
72858
+ path?: never;
72859
+ cookie?: never;
72860
+ };
72861
+ get?: never;
72862
+ put?: never;
72863
+ /**
72864
+ * Plan de cuentas: «No son la misma»
72865
+ * @description Stops a `duplicate_import` pair from appearing in the review again. Idempotent. Requires the `finanzas` add-on — without it every Finanzas operation answers `402 ENTITLEMENT_NOT_ACTIVE` (`details.required = ["finanzas"]`). Requires `finanzas_admin:write`.
72866
+ */
72867
+ post: {
72868
+ parameters: {
72869
+ query?: never;
72870
+ header?: {
72871
+ /** @description Replay-safe retries: resending the SAME key with the SAME body returns the original response (`X-Idempotent-Replay: 1`) instead of creating a second copy — safe to send whenever a response might not have arrived. The same key with a DIFFERENT body answers `409 IDEMPOTENCY_KEY_CONFLICT`; use a fresh key per operation. */
72872
+ "Idempotency-Key"?: string;
72873
+ };
72874
+ path?: never;
72875
+ cookie?: never;
72876
+ };
72877
+ requestBody?: {
72878
+ content: {
72879
+ /**
72880
+ * @example {
72881
+ * "key": "duplicate_import",
72882
+ * "account_id": "0190a3c2-5d1e-7b6a-9f20-4c1d2e3f4d03"
72883
+ * }
72884
+ */
72885
+ "application/json": components["schemas"]["FinanzasAccountReviewDismissBody"];
72886
+ };
72887
+ };
72888
+ responses: {
72889
+ /** @description Dismissed */
72890
+ 200: {
72891
+ headers: {
72892
+ [name: string]: unknown;
72893
+ };
72894
+ content: {
72895
+ /**
72896
+ * @example {
72897
+ * "data": {
72898
+ * "dismissed": true
72899
+ * }
72900
+ * }
72901
+ */
72902
+ "application/json": {
72903
+ data: {
72904
+ /** @enum {boolean} */
72905
+ dismissed: true;
72906
+ };
72907
+ };
72908
+ };
72909
+ };
72910
+ /** @description Validation error */
72911
+ 400: {
72912
+ headers: {
72913
+ [name: string]: unknown;
72914
+ };
72915
+ content: {
72916
+ "application/json": components["schemas"]["Error"];
72917
+ };
72918
+ };
72919
+ /** @description Unauthorized */
72920
+ 401: {
72921
+ headers: {
72922
+ [name: string]: unknown;
72923
+ };
72924
+ content: {
72925
+ "application/json": components["schemas"]["Error"];
72926
+ };
72927
+ };
72928
+ /** @description Forbidden */
72929
+ 403: {
72930
+ headers: {
72931
+ [name: string]: unknown;
72932
+ };
72933
+ content: {
72934
+ "application/json": components["schemas"]["Error"];
72935
+ };
72936
+ };
72937
+ /** @description Not found */
72938
+ 404: {
72939
+ headers: {
72940
+ [name: string]: unknown;
72941
+ };
72942
+ content: {
72943
+ "application/json": components["schemas"]["Error"];
72944
+ };
72945
+ };
72946
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
72947
+ 409: {
72948
+ headers: {
72949
+ [name: string]: unknown;
72950
+ };
72951
+ content: {
72952
+ "application/json": components["schemas"]["Error"];
72953
+ };
72954
+ };
72955
+ /** @description Rate limited */
72956
+ 429: {
72957
+ headers: {
72958
+ [name: string]: unknown;
72959
+ };
72960
+ content: {
72961
+ "application/json": components["schemas"]["Error"];
72962
+ };
72963
+ };
72964
+ };
72965
+ };
72966
+ delete?: never;
72967
+ options?: never;
72968
+ head?: never;
72969
+ patch?: never;
72970
+ trace?: never;
72971
+ };
72710
72972
  "/finanzas/accounts/{id}": {
72711
72973
  parameters: {
72712
72974
  query?: never;
@@ -73305,6 +73567,8 @@ interface paths {
73305
73567
  /**
73306
73568
  * Start a bank link (Fintoc widget token)
73307
73569
  * @description Opens one bank-link attempt: creates a Fintoc link intent (business holder, movements) and returns its `widget_token`, which opens Fintoc's widget (`Fintoc.create({ publicKey, widgetToken })`). Fintoc returns the token only once, so request a fresh one each time the widget opens. On success the widget hands back an `exchange_token`: send it to `POST /finanzas/connections/fintoc` (or `…/{id}/reconnect`). Reads no bank and costs nothing. Requires the `bank_feed_fintoc` add-on (`402 ENTITLEMENT_NOT_ACTIVE` otherwise). Requires the `finanzas` add-on — without it every Finanzas operation answers `402 ENTITLEMENT_NOT_ACTIVE` (`details.required = ["finanzas"]`). Requires `finanzas_admin:write`.
73570
+ *
73571
+ * **Connected apps:** refused with `403 CONNECTED_APP_EXCLUDED_OPERATION` and absent from the MCP catalogue, whatever write pack was granted — the «Agentes de IA» pack promises not to include this act. An API key or a personal token of the workspace holding the scope reaches it as usual.
73308
73572
  */
73309
73573
  post: {
73310
73574
  parameters: {
@@ -73411,6 +73675,8 @@ interface paths {
73411
73675
  /**
73412
73676
  * Connect a bank account
73413
73677
  * @description Send the `exchange_token` Fintoc's widget returns (or a `link_token`). The link token is stored encrypted and the first sync is queued. Each bank is billed at Fintoc's cost through the `bank_feed_fintoc` add-on; without it the answer is `402 ENTITLEMENT_NOT_ACTIVE` (`required: ["bank_feed_fintoc"]`). Requires the `finanzas` add-on — without it every Finanzas operation answers `402 ENTITLEMENT_NOT_ACTIVE` (`details.required = ["finanzas"]`). Requires `finanzas_admin:write`.
73678
+ *
73679
+ * **Connected apps:** refused with `403 CONNECTED_APP_EXCLUDED_OPERATION` and absent from the MCP catalogue, whatever write pack was granted — the «Agentes de IA» pack promises not to include this act. An API key or a personal token of the workspace holding the scope reaches it as usual.
73414
73680
  */
73415
73681
  post: {
73416
73682
  parameters: {
@@ -73657,6 +73923,8 @@ interface paths {
73657
73923
  /**
73658
73924
  * Reconnect a bank account
73659
73925
  * @description For a bank link whose login must be redone (`login_required`). Send the `exchange_token` from Fintoc's widget opened again for that bank. The link returns to `active`; if Fintoc answers with a different link, it replaces this one, which is disconnected. Requires the `finanzas` add-on — without it every Finanzas operation answers `402 ENTITLEMENT_NOT_ACTIVE` (`details.required = ["finanzas"]`). Requires `finanzas_admin:write`.
73926
+ *
73927
+ * **Connected apps:** refused with `403 CONNECTED_APP_EXCLUDED_OPERATION` and absent from the MCP catalogue, whatever write pack was granted — the «Agentes de IA» pack promises not to include this act. An API key or a personal token of the workspace holding the scope reaches it as usual.
73660
73928
  */
73661
73929
  post: {
73662
73930
  parameters: {
@@ -73797,6 +74065,8 @@ interface paths {
73797
74065
  /**
73798
74066
  * Disconnect a bank account
73799
74067
  * @description Reversible: the link stays (disabled), its movements stay in the ledger, it stops syncing and stops counting as a billed bank. Bank links only. Requires the `finanzas` add-on — without it every Finanzas operation answers `402 ENTITLEMENT_NOT_ACTIVE` (`details.required = ["finanzas"]`). Requires `finanzas_admin:write`.
74068
+ *
74069
+ * **Connected apps:** refused with `403 CONNECTED_APP_EXCLUDED_OPERATION` and absent from the MCP catalogue, whatever write pack was granted — the «Agentes de IA» pack promises not to include this act. An API key or a personal token of the workspace holding the scope reaches it as usual.
73800
74070
  */
73801
74071
  post: {
73802
74072
  parameters: {
@@ -77618,6 +77888,8 @@ interface paths {
77618
77888
  /**
77619
77889
  * Share a bank account with the AI agent (or stop)
77620
77890
  * @description One bank-account registry (Finanzas 33): the Finanzas bank accounts are the workspace's accounts, and «el agente comparte esta cuenta» is a flag on one of them. `shared: true` makes the AI agent dictate this account for transfers and matches abonos into it (the same registry `GET /tenant-bank-accounts` lists); `false` stops it, keeping the row. The first share needs `holder_name` (400 `VALIDATION_ERROR`, `details.reason = agent_sharing_holder_required`); `holder_rut` defaults to the workspace's SII RUT. 409 `CONFLICT` with `details.reason = agent_sharing_not_supported` for a card, a credit line, a USD account or a number known only by its last digits. Audited. Requires the `finanzas` add-on — without it every Finanzas operation answers `402 ENTITLEMENT_NOT_ACTIVE` (`details.required = ["finanzas"]`). Requires `finanzas_admin:write`.
77891
+ *
77892
+ * **Connected apps:** refused with `403 CONNECTED_APP_EXCLUDED_OPERATION` and absent from the MCP catalogue, whatever write pack was granted — the «Agentes de IA» pack promises not to include this act. An API key or a personal token of the workspace holding the scope reaches it as usual.
77621
77893
  */
77622
77894
  put: {
77623
77895
  parameters: {
@@ -79680,6 +79952,8 @@ interface paths {
79680
79952
  /**
79681
79953
  * Replace the forwarding address
79682
79954
  * @description A new address; the old one stops working at once (mail to it is dropped). Requires the `finanzas` add-on — without it every Finanzas operation answers `402 ENTITLEMENT_NOT_ACTIVE` (`details.required = ["finanzas"]`). Requires `finanzas_admin:write`.
79955
+ *
79956
+ * **Connected apps:** refused with `403 CONNECTED_APP_EXCLUDED_OPERATION` and absent from the MCP catalogue, whatever write pack was granted — the «Agentes de IA» pack promises not to include this act. An API key or a personal token of the workspace holding the scope reaches it as usual.
79683
79957
  */
79684
79958
  post: {
79685
79959
  parameters: {
@@ -85963,6 +86237,8 @@ interface paths {
85963
86237
  /**
85964
86238
  * Close a month (Cerrar mes)
85965
86239
  * @description Closes an ended month with nothing open in «Por resolver». Send the `checklist.unreviewed_count` the person confirmed. Records who, when, the checklist and a snapshot of the figures. Soft: nothing is locked; from now on a change that touches the month needs `?adjustment_reason=` and is listed as an «ajuste posterior al cierre». 409 `FINANZAS_MONTH_NOT_CLOSABLE` with `details.reason` `open_cases` (+ `open_cases`, the count), `not_ended`, `already_closed` or `unreviewed_changed` (+ `unreviewed_count`, the count now). Requires the `finanzas` add-on — without it every Finanzas operation answers `402 ENTITLEMENT_NOT_ACTIVE` (`details.required = ["finanzas"]`). Requires `finanzas:write`.
86240
+ *
86241
+ * **Connected apps:** refused with `403 CONNECTED_APP_EXCLUDED_OPERATION` and absent from the MCP catalogue, whatever write pack was granted — the «Agentes de IA» pack promises not to include this act. An API key or a personal token of the workspace holding the scope reaches it as usual.
85966
86242
  */
85967
86243
  post: {
85968
86244
  parameters: {
@@ -92516,6 +92792,8 @@ interface paths {
92516
92792
  /**
92517
92793
  * Connect a razón social to the SII (step 1)
92518
92794
  * @description Records the razón social when the workspace has none (`legal_entity`, the Datos legales body) or takes an existing one (`legal_entity_id`), then creates its SII connection. Idempotent per sociedad: an already connected one answers its connection. `resolucion` keeps an existing electronic-emission authorisation. Boleta emission stays OFF. Requires the `finanzas` add-on (402 `ENTITLEMENT_NOT_ACTIVE` otherwise). Requires `finanzas_admin:write`.
92795
+ *
92796
+ * **Connected apps:** refused with `403 CONNECTED_APP_EXCLUDED_OPERATION` and absent from the MCP catalogue, whatever write pack was granted — the «Agentes de IA» pack promises not to include this act. An API key or a personal token of the workspace holding the scope reaches it as usual.
92519
92797
  */
92520
92798
  post: {
92521
92799
  parameters: {
@@ -92663,6 +92941,8 @@ interface paths {
92663
92941
  /**
92664
92942
  * Vitrina's mandato for the representante legal to sign (step 3)
92665
92943
  * @description Renders Vitrina's mandato (`GET /legal/documents/{key}` with key `sii_mandato`, version + SHA-256) for this razón social and opens it in Vitrina's signing service. Returns the representante legal's `signing_url` (also mailed to them unless `send_email: false`). A new request replaces an unsigned one; a signed mandato cannot be replaced. Once signed it is registered at the SII automatically (`sii.mandato.phase`: `connecting` → `connected`). Requires the `finanzas` add-on (402 `ENTITLEMENT_NOT_ACTIVE` otherwise). Requires `finanzas_admin:write`.
92944
+ *
92945
+ * **Connected apps:** refused with `403 CONNECTED_APP_EXCLUDED_OPERATION` and absent from the MCP catalogue, whatever write pack was granted — the «Agentes de IA» pack promises not to include this act. An API key or a personal token of the workspace holding the scope reaches it as usual.
92666
92946
  */
92667
92947
  post: {
92668
92948
  parameters: {
@@ -92916,6 +93196,8 @@ interface paths {
92916
93196
  /**
92917
93197
  * Revoke the mandato (cláusula 7.1)
92918
93198
  * @description Revokes the signed mandato at the SII and here, with immediate effect: the SII connection stops acting for the empresa until a new mandato is signed. Requires the `finanzas` add-on (402 `ENTITLEMENT_NOT_ACTIVE` otherwise). Requires `finanzas_admin:write`.
93199
+ *
93200
+ * **Connected apps:** refused with `403 CONNECTED_APP_EXCLUDED_OPERATION` and absent from the MCP catalogue, whatever write pack was granted — the «Agentes de IA» pack promises not to include this act. An API key or a personal token of the workspace holding the scope reaches it as usual.
92919
93201
  */
92920
93202
  post: {
92921
93203
  parameters: {
@@ -93164,6 +93446,8 @@ interface paths {
93164
93446
  /**
93165
93447
  * Onboarding state: start, defer, or «no recibe boletas de honorarios»
93166
93448
  * @description Per workspace. `start` keeps the guided start while things get connected; `defer` («Lo hago después») collapses it to the checklist on Resumen; `no_honorarios` marks the honorarios step skipped (409 while honorarios documents are on record); `has_honorarios` undoes it; `dismiss_mercado_pago` hides the optional Mercado Pago card for good (per workspace, every device). Answers the setup. Requires the `finanzas` add-on (402 `ENTITLEMENT_NOT_ACTIVE` otherwise). Requires `finanzas_admin:write`.
93449
+ *
93450
+ * **Connected apps:** refused with `403 CONNECTED_APP_EXCLUDED_OPERATION` and absent from the MCP catalogue, whatever write pack was granted — the «Agentes de IA» pack promises not to include this act. An API key or a personal token of the workspace holding the scope reaches it as usual.
93167
93451
  */
93168
93452
  post: {
93169
93453
  parameters: {
@@ -281037,6 +281321,19 @@ interface components {
281037
281321
  FinanzasAccountKind: "ingreso" | "costo" | "gasto" | "no_operacional";
281038
281322
  /** @enum {string|null} */
281039
281323
  FinanzasAccountBehavior: "fijo" | "variable" | null;
281324
+ /** @description Present only when the list was asked with `usage_month`. */
281325
+ FinanzasAccountUsage: {
281326
+ /** @example 2026-10 */
281327
+ month: string;
281328
+ /** @description Whole CLP, NET, signed as the Resultado counts the account in that month (parents roll up their children). A costo / gasto line with no legal document sits in the Resultado’s «Egresos sin documento», not here. */
281329
+ total_clp: number;
281330
+ /** @description Distinct documents and movements behind `total_clp` (the Resultado drill-down of this account). */
281331
+ count: number;
281332
+ /** @description Latest `YYYY-MM` with any line on this account or a descendant, up to `month`. */
281333
+ last_used_month: string | null;
281334
+ /** @description Any line in the 6 months ending at `month`, inclusive. */
281335
+ used_6m: boolean;
281336
+ };
281040
281337
  FinanzasAccount: {
281041
281338
  /** Format: uuid */
281042
281339
  id: string;
@@ -281056,10 +281353,66 @@ interface components {
281056
281353
  archived_at: string | null;
281057
281354
  created_at: string;
281058
281355
  updated_at: string;
281356
+ usage?: components["schemas"]["FinanzasAccountUsage"];
281059
281357
  };
281060
281358
  FinanzasAccounts: {
281061
281359
  accounts: components["schemas"]["FinanzasAccount"][];
281062
281360
  };
281361
+ FinanzasAccountReview: {
281362
+ month: string;
281363
+ /** @description The month is the current (proforma) one. */
281364
+ in_progress: boolean;
281365
+ /** @description Share of the month’s costo + gasto outflow that has an account, floored to one decimal (99.96 reads 99.9). 100 only when nothing is unclassified. Null when nothing went out. */
281366
+ classified_pct: number | null;
281367
+ outflow_total_clp: number;
281368
+ unclassified: {
281369
+ count: number;
281370
+ /** @description Equals the Resultado’s «Egresos sin clasificar» for the month. */
281371
+ total_clp: number;
281372
+ by_kind: {
281373
+ /** @enum {string} */
281374
+ kind: "purchase" | "honorario" | "manual_expense" | "movement";
281375
+ count: number;
281376
+ total_clp: number;
281377
+ }[];
281378
+ /** @description How many of them sit in an open, ready `classify` case: Vitrina already proposes an account. */
281379
+ with_proposal: number;
281380
+ };
281381
+ unclassified_income: {
281382
+ count: number;
281383
+ total_clp: number;
281384
+ };
281385
+ findings: ({
281386
+ /** @enum {string} */
281387
+ key: "unclassified";
281388
+ count: number;
281389
+ total_clp: number;
281390
+ } | {
281391
+ /** @enum {string} */
281392
+ key: "duplicate_import";
281393
+ count: number;
281394
+ pairs: {
281395
+ /** Format: uuid */
281396
+ account_id: string;
281397
+ name: string;
281398
+ /** Format: uuid */
281399
+ duplicates_id: string;
281400
+ duplicates_name: string;
281401
+ used_6m: boolean;
281402
+ }[];
281403
+ } | {
281404
+ /** @enum {string} */
281405
+ key: "unused";
281406
+ count: number;
281407
+ account_ids: string[];
281408
+ })[];
281409
+ };
281410
+ FinanzasAccountReviewDismissBody: {
281411
+ /** @enum {string} */
281412
+ key: "duplicate_import";
281413
+ /** Format: uuid */
281414
+ account_id: string;
281415
+ };
281063
281416
  FinanzasAccountCreateBody: {
281064
281417
  name: string;
281065
281418
  /** Format: uuid */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitrina/api",
3
- "version": "17.24.0",
3
+ "version": "17.25.0",
4
4
  "description": "Typed TypeScript SDK for the Vitrina API pública — generated from the committed openapi.public.json (ADR 0106).",
5
5
  "type": "module",
6
6
  "license": "MIT",