@vitrina/api 17.20.0 → 17.22.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.
Files changed (3) hide show
  1. package/dist/index.d.cts +1062 -160
  2. package/dist/index.d.ts +1062 -160
  3. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -75892,6 +75892,8 @@ interface paths {
75892
75892
  * "payer": null,
75893
75893
  * "comment_count": 0,
75894
75894
  * "ads_document_id": null,
75895
+ * "card_processor": null,
75896
+ * "generic_label": null,
75895
75897
  * "created_at": "2026-10-28T09:00:00.000Z"
75896
75898
  * }
75897
75899
  * },
@@ -76743,6 +76745,8 @@ interface paths {
76743
76745
  * "payer": null,
76744
76746
  * "comment_count": 1,
76745
76747
  * "ads_document_id": null,
76748
+ * "card_processor": null,
76749
+ * "generic_label": null,
76746
76750
  * "created_at": "2026-10-30T08:00:00.000Z"
76747
76751
  * }
76748
76752
  * ],
@@ -76906,6 +76910,8 @@ interface paths {
76906
76910
  * "payer": null,
76907
76911
  * "comment_count": 1,
76908
76912
  * "ads_document_id": null,
76913
+ * "card_processor": null,
76914
+ * "generic_label": null,
76909
76915
  * "created_at": "2026-10-30T08:00:00.000Z",
76910
76916
  * "comments": [
76911
76917
  * {
@@ -82622,6 +82628,8 @@ interface paths {
82622
82628
  * "payer": null,
82623
82629
  * "comment_count": 0,
82624
82630
  * "ads_document_id": null,
82631
+ * "card_processor": null,
82632
+ * "generic_label": null,
82625
82633
  * "created_at": "2026-10-30T08:00:00.000Z"
82626
82634
  * },
82627
82635
  * "money_mirrored": false,
@@ -82653,6 +82661,7 @@ interface paths {
82653
82661
  * "paired_movement": null,
82654
82662
  * "cash_day": null,
82655
82663
  * "contraparte": null,
82664
+ * "payout": null,
82656
82665
  * "undoable": true
82657
82666
  * }
82658
82667
  * ],
@@ -82936,6 +82945,7 @@ interface paths {
82936
82945
  * "paired_movement": null,
82937
82946
  * "cash_day": null,
82938
82947
  * "contraparte": null,
82948
+ * "payout": null,
82939
82949
  * "undoable": true
82940
82950
  * }
82941
82951
  * ],
@@ -83158,6 +83168,8 @@ interface paths {
83158
83168
  * "payer": null,
83159
83169
  * "comment_count": 0,
83160
83170
  * "ads_document_id": null,
83171
+ * "card_processor": null,
83172
+ * "generic_label": null,
83161
83173
  * "created_at": "2026-10-30T08:00:00.000Z"
83162
83174
  * },
83163
83175
  * "money_mirrored": false,
@@ -83189,6 +83201,7 @@ interface paths {
83189
83201
  * "paired_movement": null,
83190
83202
  * "cash_day": null,
83191
83203
  * "contraparte": null,
83204
+ * "payout": null,
83192
83205
  * "undoable": true
83193
83206
  * }
83194
83207
  * ],
@@ -86572,7 +86585,7 @@ interface paths {
86572
86585
  };
86573
86586
  /**
86574
86587
  * Mes en paralelo: the diff against Chipax for a month
86575
- * @description Balances (per bank account, at month end), payables (per Contraparte, open at month end) and costs (per costo / gasto account, NET as the Resultado counts) must match to the peso. Income is a bridge: Chipax counts it when cashed, Vitrina the documents issued in the month, so the gap is explained line by line. Vitrina's side is computed live; Chipax's side is the newest finished read. `clean` = all three match and the bridge is explained (the exit criterion). Each row's `key` drills down to its items. Before a finished read: `status` not_read / reading / failed and null dimensions. A caller without the patient register (the Contador) sees a patient as «Paciente A. P.» with no RUT and no glosa, on both sides; Chipax boletas carry neither RUT nor name. 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` (the Contador seat, owners and admins).
86588
+ * @description Balances (per bank account, at month end), payables (per Contraparte, open at month end) and costs (per costo / gasto account, NET as the Resultado counts) must match to the peso. Income is a bridge: Chipax counts it when cashed, Vitrina the documents issued in the month, so the gap is explained line by line. Vitrina's side is computed live; Chipax's side is the newest finished read. `clean` = all three match and the bridge is explained (the exit criterion). Each row's `key` drills down to its items. Rows list the differences first; `difference_count` of each section counts its rows that are not «Cuadra», and the headline `difference_count` is the sum of the sections with `in_headline` (the two reviews, `inherited_overdue` and `possible_duplicates`, are listed beside them and never counted in it). Before a finished read: `status` not_read / reading / failed and null dimensions. A caller without the patient register (the Contador) sees a patient as «Paciente A. P.» with no RUT and no glosa, on both sides; Chipax boletas carry neither RUT nor name. 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` (the Contador seat, owners and admins).
86576
86589
  */
86577
86590
  get: {
86578
86591
  parameters: {
@@ -86613,9 +86626,46 @@ interface paths {
86613
86626
  * "history_from": "2025-01-01",
86614
86627
  * "clean": false,
86615
86628
  * "warnings": [],
86629
+ * "difference_count": 1,
86630
+ * "sections": [
86631
+ * {
86632
+ * "key": "balances",
86633
+ * "difference_count": 0,
86634
+ * "in_headline": true
86635
+ * },
86636
+ * {
86637
+ * "key": "payables",
86638
+ * "difference_count": 1,
86639
+ * "in_headline": true
86640
+ * },
86641
+ * {
86642
+ * "key": "costs",
86643
+ * "difference_count": 0,
86644
+ * "in_headline": true
86645
+ * },
86646
+ * {
86647
+ * "key": "income",
86648
+ * "difference_count": 2,
86649
+ * "in_headline": true
86650
+ * },
86651
+ * {
86652
+ * "key": "inherited_overdue",
86653
+ * "difference_count": 1135,
86654
+ * "in_headline": false
86655
+ * },
86656
+ * {
86657
+ * "key": "possible_duplicates",
86658
+ * "difference_count": 2,
86659
+ * "in_headline": false
86660
+ * }
86661
+ * ],
86616
86662
  * "balances": {
86617
86663
  * "matches": true,
86618
86664
  * "difference_count": 0,
86665
+ * "row_count": 1,
86666
+ * "matching_count": 1,
86667
+ * "item_difference_count": 0,
86668
+ * "without_balance_count": 0,
86619
86669
  * "rows": [
86620
86670
  * {
86621
86671
  * "key": "bank:01930000-0000-7000-8000-0000000000b1",
@@ -86654,6 +86704,9 @@ interface paths {
86654
86704
  * "vitrina_clp": 3800000,
86655
86705
  * "difference_clp": 410000,
86656
86706
  * "difference_count": 1,
86707
+ * "row_count": 1,
86708
+ * "matching_count": 0,
86709
+ * "item_difference_count": 1,
86657
86710
  * "rows": [
86658
86711
  * {
86659
86712
  * "key": "p_0000000000000001",
@@ -86675,9 +86728,15 @@ interface paths {
86675
86728
  * "vitrina_clp": 9340000,
86676
86729
  * "difference_clp": 0,
86677
86730
  * "difference_count": 0,
86731
+ * "row_count": 0,
86732
+ * "matching_count": 0,
86733
+ * "item_difference_count": 0,
86678
86734
  * "rows": []
86679
86735
  * },
86680
86736
  * "income": {
86737
+ * "difference_count": 2,
86738
+ * "row_count": 6,
86739
+ * "matching_count": 4,
86681
86740
  * "bridge": {
86682
86741
  * "vitrina_clp": 31500000,
86683
86742
  * "chipax_clp": 30100000,
@@ -86749,9 +86808,27 @@ interface paths {
86749
86808
  /** @description Balances, payables and costs match and the income bridge is fully explained: the exit criterion of the shadow month. */
86750
86809
  clean: boolean | null;
86751
86810
  warnings: string[];
86811
+ /** @description The headline «{n} diferencias en {month}»: the sum of `difference_count` of the `sections` with `in_headline`. 0 until Chipax has been read. */
86812
+ difference_count: number;
86813
+ /** @description Every section in screen order. The two reviews are present even before Chipax is read. */
86814
+ sections: {
86815
+ /** @enum {string} */
86816
+ key: "balances" | "payables" | "costs" | "income" | "inherited_overdue" | "possible_duplicates";
86817
+ difference_count: number;
86818
+ /** @description true for the four comparisons of Chipax against Vitrina; false for the two reviews (`inherited_overdue`: payables to resolve, see GET /finanzas/inherited-overdue; `possible_duplicates`: groups of repeated bank lines, see GET /finanzas/possible-duplicates), which are a to-do list. */
86819
+ in_headline: boolean;
86820
+ }[];
86752
86821
  balances: {
86753
86822
  matches: boolean;
86823
+ /** @description The section's «N diferencias»: its rows that are not «Cuadra» (Finanzas 40). Income counts its bridge lines that hold items. */
86754
86824
  difference_count: number;
86825
+ /** @description Rows the section lists (income: bridge lines). */
86826
+ row_count: number;
86827
+ /** @description Rows that match, for «{n} cuentas cuadran · Ver». `rows` lists the differences first. */
86828
+ matching_count: number;
86829
+ item_difference_count: number;
86830
+ /** @description Rows with no balance on one side (compared on the month movements): the «un lado no tiene saldo» footnote, once per section. */
86831
+ without_balance_count: number;
86755
86832
  rows: {
86756
86833
  /** @description Pass as `key` to the items endpoint. */
86757
86834
  key: string;
@@ -86809,7 +86886,14 @@ interface paths {
86809
86886
  vitrina_clp: number;
86810
86887
  /** @description Whole CLP. */
86811
86888
  difference_clp: number;
86889
+ /** @description The section's «N diferencias»: its rows that are not «Cuadra» (Finanzas 40). Income counts its bridge lines that hold items. */
86812
86890
  difference_count: number;
86891
+ /** @description Rows the section lists (income: bridge lines). */
86892
+ row_count: number;
86893
+ /** @description Rows that match, for «{n} cuentas cuadran · Ver». `rows` lists the differences first. */
86894
+ matching_count: number;
86895
+ /** @description Items (lines, documents) behind the rows that do not pair. */
86896
+ item_difference_count: number;
86813
86897
  rows: {
86814
86898
  /** @description Pass as `key` to the items endpoint. */
86815
86899
  key: string;
@@ -86836,7 +86920,14 @@ interface paths {
86836
86920
  vitrina_clp: number;
86837
86921
  /** @description Whole CLP. */
86838
86922
  difference_clp: number;
86923
+ /** @description The section's «N diferencias»: its rows that are not «Cuadra» (Finanzas 40). Income counts its bridge lines that hold items. */
86839
86924
  difference_count: number;
86925
+ /** @description Rows the section lists (income: bridge lines). */
86926
+ row_count: number;
86927
+ /** @description Rows that match, for «{n} cuentas cuadran · Ver». `rows` lists the differences first. */
86928
+ matching_count: number;
86929
+ /** @description Items (lines, documents) behind the rows that do not pair. */
86930
+ item_difference_count: number;
86840
86931
  rows: {
86841
86932
  /** @description Pass as `key` to the items endpoint. */
86842
86933
  key: string;
@@ -86865,6 +86956,12 @@ interface paths {
86865
86956
  }[];
86866
86957
  } | null;
86867
86958
  income: {
86959
+ /** @description The section's «N diferencias»: its rows that are not «Cuadra» (Finanzas 40). Income counts its bridge lines that hold items. */
86960
+ difference_count: number;
86961
+ /** @description Rows the section lists (income: bridge lines). */
86962
+ row_count: number;
86963
+ /** @description Rows that match, for «{n} cuentas cuadran · Ver». `rows` lists the differences first. */
86964
+ matching_count: number;
86868
86965
  bridge: {
86869
86966
  /** @description Whole CLP. */
86870
86967
  vitrina_clp: number;
@@ -87287,7 +87384,7 @@ interface paths {
87287
87384
  patch?: never;
87288
87385
  trace?: never;
87289
87386
  };
87290
- "/finanzas/chipax": {
87387
+ "/finanzas/inherited-overdue": {
87291
87388
  parameters: {
87292
87389
  query?: never;
87293
87390
  header?: never;
@@ -87295,19 +87392,24 @@ interface paths {
87295
87392
  cookie?: never;
87296
87393
  };
87297
87394
  /**
87298
- * Importar desde Chipax: connection and runs
87299
- * @description Whether the workspace stored its Chipax API credentials (only a masked App ID hint, never the secret), the run in progress and the last finished one. Vitrina only READS Chipax: it logs in and sends GET requests; it never creates, edits or deletes anything in the Chipax account. Requires the `finanzas` add-on — without it every Finanzas operation answers `402 ENTITLEMENT_NOT_ACTIVE` (`details.required = ["finanzas"]`). Requires `finanzas:read`.
87395
+ * Vencido heredado: the payables to review
87396
+ * @description The payables that arrived already more than 90 days overdue (`payment_state = vencido_heredado`): they are out of the cash-flow projection and the balances until someone marks them pagado or anulado. Each carries the open bank payment that most likely settled it (`suggested_match`: exact amount, a payment is suggested to one document only; `signal` says why). `summary` counts the whole filter, `items` is one page. Filter by Contraparte with `contraparte`. A caller without the patient register (the Contador) sees a patient as «Paciente A. P.» and no glosa on money in. Requires the `finanzas` add-on — without it every Finanzas operation answers `402 ENTITLEMENT_NOT_ACTIVE` (`details.required = ["finanzas"]`). Requires `finanzas:read`.
87300
87397
  */
87301
87398
  get: {
87302
87399
  parameters: {
87303
- query?: never;
87400
+ query?: {
87401
+ contraparte?: string;
87402
+ sort?: "due_date" | "amount";
87403
+ limit?: number;
87404
+ offset?: number | null;
87405
+ };
87304
87406
  header?: never;
87305
87407
  path?: never;
87306
87408
  cookie?: never;
87307
87409
  };
87308
87410
  requestBody?: never;
87309
87411
  responses: {
87310
- /** @description Connection and runs */
87412
+ /** @description The page */
87311
87413
  200: {
87312
87414
  headers: {
87313
87415
  [name: string]: unknown;
@@ -87316,29 +87418,110 @@ interface paths {
87316
87418
  /**
87317
87419
  * @example {
87318
87420
  * "data": {
87319
- * "connected": true,
87320
- * "app_id_preview": "a1b…9f2",
87321
- * "verified_at": "2026-10-30T21:58:40.000Z",
87322
- * "active_import": null,
87323
- * "last_import": {
87324
- * "id": "0190a3c2-5d1e-7b6a-9f20-4c1d2e3f5a16",
87325
- * "mode": "dry_run",
87326
- * "status": "done",
87327
- * "from": "2025-01-01",
87328
- * "to": "2026-10-30",
87329
- * "account_map": [],
87330
- * "requested_by": "0190a3c2-5d1e-7b6a-9f20-4c1d2e3f4f01",
87331
- * "error": null,
87332
- * "started_at": "2026-10-30T22:01:04.000Z",
87333
- * "finished_at": "2026-10-30T22:14:51.000Z",
87334
- * "created_at": "2026-10-30T22:01:02.000Z",
87335
- * "report": null
87336
- * }
87421
+ * "summary": {
87422
+ * "count": 1135,
87423
+ * "amount_clp": 437600000
87424
+ * },
87425
+ * "filter": {
87426
+ * "contraparte_id": null
87427
+ * },
87428
+ * "items": [
87429
+ * {
87430
+ * "id": "01930000-0000-7000-8000-0000000000d1",
87431
+ * "kind": "purchase",
87432
+ * "dte_type": 33,
87433
+ * "label": "Factura electrónica N° 451",
87434
+ * "folio": "451",
87435
+ * "contraparte": {
87436
+ * "id": "01930000-0000-7000-8000-0000000000c1",
87437
+ * "name": "Laboratorio Dental Andes Ltda"
87438
+ * },
87439
+ * "counterparty_name": "Laboratorio Dental Andes Ltda",
87440
+ * "issue_date": "2025-06-10",
87441
+ * "due_date": "2025-07-10",
87442
+ * "arrived_on": "2025-11-02",
87443
+ * "days_overdue": 120,
87444
+ * "total_clp": 302852,
87445
+ * "outstanding_clp": 302852,
87446
+ * "suggested_match": {
87447
+ * "movement_id": "01930000-0000-7000-8000-0000000000a1",
87448
+ * "day": "2025-09-12",
87449
+ * "amount_clp": 302852,
87450
+ * "description": "Transferencia a Laboratorio Dental Andes",
87451
+ * "counterparty_name": "Laboratorio Dental Andes Ltda",
87452
+ * "bank_account_id": "01930000-0000-7000-8000-0000000000b1",
87453
+ * "bank_account_name": "Cuenta corriente",
87454
+ * "institution_name": "BCI",
87455
+ * "number_masked": "•••• 9819",
87456
+ * "signal": "contraparte"
87457
+ * }
87458
+ * }
87459
+ * ],
87460
+ * "total": 1135,
87461
+ * "limit": 50,
87462
+ * "offset": 0
87337
87463
  * }
87338
87464
  * }
87339
87465
  */
87340
87466
  "application/json": {
87341
- data: components["schemas"]["FinanzasChipaxStatus"];
87467
+ data: {
87468
+ /** @description The whole filter, not only this page. */
87469
+ summary: {
87470
+ count: number;
87471
+ /** @description What is still open on them (total − retención − links). */
87472
+ amount_clp: number;
87473
+ };
87474
+ filter: {
87475
+ contraparte_id: string | null;
87476
+ };
87477
+ items: {
87478
+ /** Format: uuid */
87479
+ id: string;
87480
+ /** @enum {string} */
87481
+ kind: "purchase" | "honorario" | "manual_expense" | "sale" | "tax";
87482
+ dte_type: number | null;
87483
+ /** @description «Factura electrónica N° 451». */
87484
+ label: string;
87485
+ folio: string | null;
87486
+ contraparte: {
87487
+ id: string;
87488
+ name: string;
87489
+ } | null;
87490
+ counterparty_name: string | null;
87491
+ issue_date: string;
87492
+ due_date: string | null;
87493
+ /** @description The day Vitrina first recorded it. */
87494
+ arrived_on: string;
87495
+ days_overdue: number | null;
87496
+ /** @description Whole CLP. */
87497
+ total_clp: number;
87498
+ /** @description Whole CLP. */
87499
+ outstanding_clp: number;
87500
+ /** @description The open outbound bank line that most likely paid it (exact amount; one payment is suggested to one document). `null` when none fits. */
87501
+ suggested_match: {
87502
+ /** Format: uuid */
87503
+ movement_id: string;
87504
+ day: string;
87505
+ /** @description Whole CLP. */
87506
+ amount_clp: number;
87507
+ description: string;
87508
+ counterparty_name: string | null;
87509
+ bank_account_id: string | null;
87510
+ bank_account_name: string | null;
87511
+ /** @description The bank, for its logo («BCI»). */
87512
+ institution_name: string | null;
87513
+ number_masked: string | null;
87514
+ /**
87515
+ * @description What ties the payment to the document: its folio in the glosa, the same Contraparte, or only the exact amount.
87516
+ * @enum {string}
87517
+ */
87518
+ signal: "folio" | "contraparte" | "amount";
87519
+ } | null;
87520
+ }[];
87521
+ total: number;
87522
+ limit: number;
87523
+ offset: number;
87524
+ };
87342
87525
  };
87343
87526
  };
87344
87527
  };
@@ -87406,7 +87589,7 @@ interface paths {
87406
87589
  patch?: never;
87407
87590
  trace?: never;
87408
87591
  };
87409
- "/finanzas/chipax/credentials": {
87592
+ "/finanzas/inherited-overdue/resolve": {
87410
87593
  parameters: {
87411
87594
  query?: never;
87412
87595
  header?: never;
@@ -87415,137 +87598,44 @@ interface paths {
87415
87598
  };
87416
87599
  get?: never;
87417
87600
  put?: never;
87418
- post?: never;
87419
87601
  /**
87420
- * Importar desde Chipax: «Eliminar credenciales»
87421
- * @description Deletes the stored Chipax credentials. What was already imported stays. Idempotent. Requires the `finanzas` add-on — without it every Finanzas operation answers `402 ENTITLEMENT_NOT_ACTIVE` (`details.required = ["finanzas"]`). Requires `finanzas_admin:write`.
87602
+ * Vencido heredado: mark pagado or anulado in bulk
87603
+ * @description Resolves up to 500 inherited payables at once. `pagado`: it was settled; the document leaves the review as paid (no bank link is invented). `anulado`: it never has to be paid; the document is voided, so no report counts it. A document that is no longer inherited is skipped (`not_inherited`), never overwritten. One batch, one `batch_id`: it lands in the audit log (`finanzas.inherited_overdue.pagado` / `.anulado`) and `POST /finanzas/inherited-overdue/batches/{batchId}/undo` puts it back. «anulado» in a closed month needs `?adjustment_reason=` (409 `FINANZAS_PERIOD_CLOSED` otherwise). Requires the `finanzas` add-on — without it every Finanzas operation answers `402 ENTITLEMENT_NOT_ACTIVE` (`details.required = ["finanzas"]`). Requires `finanzas:write`.
87422
87604
  */
87423
- delete: {
87605
+ post: {
87424
87606
  parameters: {
87425
87607
  query?: never;
87426
- header?: never;
87608
+ header?: {
87609
+ /** @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. */
87610
+ "Idempotency-Key"?: string;
87611
+ };
87427
87612
  path?: never;
87428
87613
  cookie?: never;
87429
87614
  };
87430
- requestBody?: never;
87431
- responses: {
87432
- /** @description Deleted */
87433
- 200: {
87434
- headers: {
87435
- [name: string]: unknown;
87436
- };
87437
- content: {
87615
+ requestBody?: {
87616
+ content: {
87617
+ /**
87618
+ * @example {
87619
+ * "document_ids": [
87620
+ * "01930000-0000-7000-8000-0000000000d1"
87621
+ * ],
87622
+ * "resolution": "pagado"
87623
+ * }
87624
+ */
87625
+ "application/json": {
87626
+ /** @description The inherited payables to resolve (1 to 500). */
87627
+ document_ids: string[];
87438
87628
  /**
87439
- * @example {
87440
- * "data": {
87441
- * "connected": false,
87442
- * "app_id_preview": null,
87443
- * "verified_at": null,
87444
- * "active_import": null,
87445
- * "last_import": {
87446
- * "id": "0190a3c2-5d1e-7b6a-9f20-4c1d2e3f5a16",
87447
- * "mode": "dry_run",
87448
- * "status": "done",
87449
- * "from": "2025-01-01",
87450
- * "to": "2026-10-30",
87451
- * "account_map": [],
87452
- * "requested_by": "0190a3c2-5d1e-7b6a-9f20-4c1d2e3f4f01",
87453
- * "error": null,
87454
- * "started_at": "2026-10-30T22:01:04.000Z",
87455
- * "finished_at": "2026-10-30T22:14:51.000Z",
87456
- * "created_at": "2026-10-30T22:01:02.000Z",
87457
- * "report": null
87458
- * }
87459
- * }
87460
- * }
87629
+ * @description pagado: it was settled (no bank link is invented; the document leaves the review as paid). anulado: it never has to be paid (it is voided, so no report counts it).
87630
+ * @enum {string}
87461
87631
  */
87462
- "application/json": {
87463
- data: components["schemas"]["FinanzasChipaxStatus"];
87464
- };
87465
- };
87466
- };
87467
- /** @description Validation error */
87468
- 400: {
87469
- headers: {
87470
- [name: string]: unknown;
87471
- };
87472
- content: {
87473
- "application/json": components["schemas"]["Error"];
87474
- };
87475
- };
87476
- /** @description Unauthorized */
87477
- 401: {
87478
- headers: {
87479
- [name: string]: unknown;
87480
- };
87481
- content: {
87482
- "application/json": components["schemas"]["Error"];
87483
- };
87484
- };
87485
- /** @description Forbidden */
87486
- 403: {
87487
- headers: {
87488
- [name: string]: unknown;
87489
- };
87490
- content: {
87491
- "application/json": components["schemas"]["Error"];
87492
- };
87493
- };
87494
- /** @description Not found */
87495
- 404: {
87496
- headers: {
87497
- [name: string]: unknown;
87498
- };
87499
- content: {
87500
- "application/json": components["schemas"]["Error"];
87501
- };
87502
- };
87503
- /** @description Conflict (incl. Idempotency-Key reuse with different body) */
87504
- 409: {
87505
- headers: {
87506
- [name: string]: unknown;
87507
- };
87508
- content: {
87509
- "application/json": components["schemas"]["Error"];
87510
- };
87511
- };
87512
- /** @description Rate limited */
87513
- 429: {
87514
- headers: {
87515
- [name: string]: unknown;
87516
- };
87517
- content: {
87518
- "application/json": components["schemas"]["Error"];
87632
+ resolution: "pagado" | "anulado";
87633
+ note?: string;
87519
87634
  };
87520
87635
  };
87521
87636
  };
87522
- };
87523
- options?: never;
87524
- head?: never;
87525
- patch?: never;
87526
- trace?: never;
87527
- };
87528
- "/finanzas/chipax/imports": {
87529
- parameters: {
87530
- query?: never;
87531
- header?: never;
87532
- path?: never;
87533
- cookie?: never;
87534
- };
87535
- /**
87536
- * Importar desde Chipax: the runs
87537
- * @description The last 20 runs, newest first (no report; GET one for it). Requires the `finanzas` add-on — without it every Finanzas operation answers `402 ENTITLEMENT_NOT_ACTIVE` (`details.required = ["finanzas"]`). Requires `finanzas:read`.
87538
- */
87539
- get: {
87540
- parameters: {
87541
- query?: never;
87542
- header?: never;
87543
- path?: never;
87544
- cookie?: never;
87545
- };
87546
- requestBody?: never;
87547
87637
  responses: {
87548
- /** @description Runs */
87638
+ /** @description The batch */
87549
87639
  200: {
87550
87640
  headers: {
87551
87641
  [name: string]: unknown;
@@ -87553,26 +87643,819 @@ interface paths {
87553
87643
  content: {
87554
87644
  /**
87555
87645
  * @example {
87556
- * "data": [
87557
- * {
87558
- * "id": "0190a3c2-5d1e-7b6a-9f20-4c1d2e3f5a16",
87559
- * "mode": "dry_run",
87560
- * "status": "done",
87561
- * "from": "2025-01-01",
87562
- * "to": "2026-10-30",
87563
- * "account_map": [],
87564
- * "requested_by": "0190a3c2-5d1e-7b6a-9f20-4c1d2e3f4f01",
87565
- * "error": null,
87566
- * "started_at": "2026-10-30T22:01:04.000Z",
87567
- * "finished_at": "2026-10-30T22:14:51.000Z",
87568
- * "created_at": "2026-10-30T22:01:02.000Z",
87569
- * "report": null
87646
+ * "data": {
87647
+ * "batch_id": "01930000-0000-7000-8000-0000000000b9",
87648
+ * "resolution": "pagado",
87649
+ * "resolved": [
87650
+ * "01930000-0000-7000-8000-0000000000d1"
87651
+ * ],
87652
+ * "skipped": [],
87653
+ * "amount_clp": 302852,
87654
+ * "remaining": {
87655
+ * "count": 1134,
87656
+ * "amount_clp": 437297148
87570
87657
  * }
87571
- * ]
87658
+ * }
87572
87659
  * }
87573
87660
  */
87574
87661
  "application/json": {
87575
- data: (components["schemas"]["FinanzasChipaxImport"] & Record<string, never>)[];
87662
+ data: {
87663
+ /**
87664
+ * Format: uuid
87665
+ * @description Pass it to the undo route («Deshacer»).
87666
+ */
87667
+ batch_id: string;
87668
+ /** @enum {string} */
87669
+ resolution: "pagado" | "anulado";
87670
+ resolved: string[];
87671
+ skipped: {
87672
+ id: string;
87673
+ /**
87674
+ * @description not_inherited: someone already resolved it, or a payment was linked to it.
87675
+ * @enum {string}
87676
+ */
87677
+ reason: "not_found" | "not_inherited";
87678
+ }[];
87679
+ /** @description What was open on the documents resolved. */
87680
+ amount_clp: number;
87681
+ remaining: {
87682
+ count: number;
87683
+ /** @description What is still open on them (total − retención − links). */
87684
+ amount_clp: number;
87685
+ };
87686
+ };
87687
+ };
87688
+ };
87689
+ };
87690
+ /** @description Validation error */
87691
+ 400: {
87692
+ headers: {
87693
+ [name: string]: unknown;
87694
+ };
87695
+ content: {
87696
+ "application/json": components["schemas"]["Error"];
87697
+ };
87698
+ };
87699
+ /** @description Unauthorized */
87700
+ 401: {
87701
+ headers: {
87702
+ [name: string]: unknown;
87703
+ };
87704
+ content: {
87705
+ "application/json": components["schemas"]["Error"];
87706
+ };
87707
+ };
87708
+ /** @description Forbidden */
87709
+ 403: {
87710
+ headers: {
87711
+ [name: string]: unknown;
87712
+ };
87713
+ content: {
87714
+ "application/json": components["schemas"]["Error"];
87715
+ };
87716
+ };
87717
+ /** @description Not found */
87718
+ 404: {
87719
+ headers: {
87720
+ [name: string]: unknown;
87721
+ };
87722
+ content: {
87723
+ "application/json": components["schemas"]["Error"];
87724
+ };
87725
+ };
87726
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
87727
+ 409: {
87728
+ headers: {
87729
+ [name: string]: unknown;
87730
+ };
87731
+ content: {
87732
+ "application/json": components["schemas"]["Error"];
87733
+ };
87734
+ };
87735
+ /** @description Rate limited */
87736
+ 429: {
87737
+ headers: {
87738
+ [name: string]: unknown;
87739
+ };
87740
+ content: {
87741
+ "application/json": components["schemas"]["Error"];
87742
+ };
87743
+ };
87744
+ };
87745
+ };
87746
+ delete?: never;
87747
+ options?: never;
87748
+ head?: never;
87749
+ patch?: never;
87750
+ trace?: never;
87751
+ };
87752
+ "/finanzas/inherited-overdue/batches/{batchId}/undo": {
87753
+ parameters: {
87754
+ query?: never;
87755
+ header?: never;
87756
+ path?: never;
87757
+ cookie?: never;
87758
+ };
87759
+ get?: never;
87760
+ put?: never;
87761
+ /**
87762
+ * Vencido heredado: undo a batch («Deshacer»)
87763
+ * @description Puts the documents of a batch back to «vencido heredado» (a payment linked in the meantime wins and the state follows it). Pass `document_ids` to undo only some. Idempotent: what was already undone comes back in `skipped`. Audited as `finanzas.inherited_overdue.undo`. Requires the `finanzas` add-on — without it every Finanzas operation answers `402 ENTITLEMENT_NOT_ACTIVE` (`details.required = ["finanzas"]`). Requires `finanzas:write`.
87764
+ */
87765
+ post: {
87766
+ parameters: {
87767
+ query?: never;
87768
+ header?: {
87769
+ /** @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. */
87770
+ "Idempotency-Key"?: string;
87771
+ };
87772
+ path: {
87773
+ batchId: string;
87774
+ };
87775
+ cookie?: never;
87776
+ };
87777
+ requestBody?: {
87778
+ content: {
87779
+ /** @example {} */
87780
+ "application/json": {
87781
+ /** @description Undo only these documents of the batch (default: the whole batch). */
87782
+ document_ids?: string[];
87783
+ };
87784
+ };
87785
+ };
87786
+ responses: {
87787
+ /** @description The undo */
87788
+ 200: {
87789
+ headers: {
87790
+ [name: string]: unknown;
87791
+ };
87792
+ content: {
87793
+ /**
87794
+ * @example {
87795
+ * "data": {
87796
+ * "batch_id": "01930000-0000-7000-8000-0000000000b9",
87797
+ * "resolution": "pagado",
87798
+ * "undone": [
87799
+ * "01930000-0000-7000-8000-0000000000d1"
87800
+ * ],
87801
+ * "skipped": [],
87802
+ * "remaining": {
87803
+ * "count": 1135,
87804
+ * "amount_clp": 437600000
87805
+ * }
87806
+ * }
87807
+ * }
87808
+ */
87809
+ "application/json": {
87810
+ data: {
87811
+ /** Format: uuid */
87812
+ batch_id: string;
87813
+ /** @enum {string|null} */
87814
+ resolution: "pagado" | "anulado" | null;
87815
+ undone: string[];
87816
+ skipped: string[];
87817
+ remaining: {
87818
+ count: number;
87819
+ /** @description What is still open on them (total − retención − links). */
87820
+ amount_clp: number;
87821
+ };
87822
+ };
87823
+ };
87824
+ };
87825
+ };
87826
+ /** @description Validation error */
87827
+ 400: {
87828
+ headers: {
87829
+ [name: string]: unknown;
87830
+ };
87831
+ content: {
87832
+ "application/json": components["schemas"]["Error"];
87833
+ };
87834
+ };
87835
+ /** @description Unauthorized */
87836
+ 401: {
87837
+ headers: {
87838
+ [name: string]: unknown;
87839
+ };
87840
+ content: {
87841
+ "application/json": components["schemas"]["Error"];
87842
+ };
87843
+ };
87844
+ /** @description Forbidden */
87845
+ 403: {
87846
+ headers: {
87847
+ [name: string]: unknown;
87848
+ };
87849
+ content: {
87850
+ "application/json": components["schemas"]["Error"];
87851
+ };
87852
+ };
87853
+ /** @description Not found */
87854
+ 404: {
87855
+ headers: {
87856
+ [name: string]: unknown;
87857
+ };
87858
+ content: {
87859
+ "application/json": components["schemas"]["Error"];
87860
+ };
87861
+ };
87862
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
87863
+ 409: {
87864
+ headers: {
87865
+ [name: string]: unknown;
87866
+ };
87867
+ content: {
87868
+ "application/json": components["schemas"]["Error"];
87869
+ };
87870
+ };
87871
+ /** @description Rate limited */
87872
+ 429: {
87873
+ headers: {
87874
+ [name: string]: unknown;
87875
+ };
87876
+ content: {
87877
+ "application/json": components["schemas"]["Error"];
87878
+ };
87879
+ };
87880
+ };
87881
+ };
87882
+ delete?: never;
87883
+ options?: never;
87884
+ head?: never;
87885
+ patch?: never;
87886
+ trace?: never;
87887
+ };
87888
+ "/finanzas/inherited-overdue/batches": {
87889
+ parameters: {
87890
+ query?: never;
87891
+ header?: never;
87892
+ path?: never;
87893
+ cookie?: never;
87894
+ };
87895
+ /**
87896
+ * Vencido heredado: the batches already resolved
87897
+ * @description Each bulk action, newest first, with how many of its documents are still resolved (`live_count`). Requires the `finanzas` add-on — without it every Finanzas operation answers `402 ENTITLEMENT_NOT_ACTIVE` (`details.required = ["finanzas"]`). Requires `finanzas:read`.
87898
+ */
87899
+ get: {
87900
+ parameters: {
87901
+ query?: {
87902
+ limit?: number;
87903
+ };
87904
+ header?: never;
87905
+ path?: never;
87906
+ cookie?: never;
87907
+ };
87908
+ requestBody?: never;
87909
+ responses: {
87910
+ /** @description Batches */
87911
+ 200: {
87912
+ headers: {
87913
+ [name: string]: unknown;
87914
+ };
87915
+ content: {
87916
+ /**
87917
+ * @example {
87918
+ * "data": [
87919
+ * {
87920
+ * "batch_id": "01930000-0000-7000-8000-0000000000b9",
87921
+ * "resolution": "pagado",
87922
+ * "resolved_at": "2026-11-08T14:00:00.000Z",
87923
+ * "resolved_by": "00000000-0000-4000-8000-000000000001",
87924
+ * "document_count": 3,
87925
+ * "live_count": 3,
87926
+ * "amount_clp": 908556
87927
+ * }
87928
+ * ]
87929
+ * }
87930
+ */
87931
+ "application/json": {
87932
+ data: {
87933
+ /** Format: uuid */
87934
+ batch_id: string;
87935
+ /** @enum {string} */
87936
+ resolution: "pagado" | "anulado";
87937
+ /** @description ISO 8601 timestamp. */
87938
+ resolved_at: string;
87939
+ resolved_by: string | null;
87940
+ document_count: number;
87941
+ /** @description Documents of the batch not undone. */
87942
+ live_count: number;
87943
+ /** @description Whole CLP. */
87944
+ amount_clp: number;
87945
+ }[];
87946
+ };
87947
+ };
87948
+ };
87949
+ /** @description Validation error */
87950
+ 400: {
87951
+ headers: {
87952
+ [name: string]: unknown;
87953
+ };
87954
+ content: {
87955
+ "application/json": components["schemas"]["Error"];
87956
+ };
87957
+ };
87958
+ /** @description Unauthorized */
87959
+ 401: {
87960
+ headers: {
87961
+ [name: string]: unknown;
87962
+ };
87963
+ content: {
87964
+ "application/json": components["schemas"]["Error"];
87965
+ };
87966
+ };
87967
+ /** @description Forbidden */
87968
+ 403: {
87969
+ headers: {
87970
+ [name: string]: unknown;
87971
+ };
87972
+ content: {
87973
+ "application/json": components["schemas"]["Error"];
87974
+ };
87975
+ };
87976
+ /** @description Not found */
87977
+ 404: {
87978
+ headers: {
87979
+ [name: string]: unknown;
87980
+ };
87981
+ content: {
87982
+ "application/json": components["schemas"]["Error"];
87983
+ };
87984
+ };
87985
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
87986
+ 409: {
87987
+ headers: {
87988
+ [name: string]: unknown;
87989
+ };
87990
+ content: {
87991
+ "application/json": components["schemas"]["Error"];
87992
+ };
87993
+ };
87994
+ /** @description Rate limited */
87995
+ 429: {
87996
+ headers: {
87997
+ [name: string]: unknown;
87998
+ };
87999
+ content: {
88000
+ "application/json": components["schemas"]["Error"];
88001
+ };
88002
+ };
88003
+ };
88004
+ };
88005
+ put?: never;
88006
+ post?: never;
88007
+ delete?: never;
88008
+ options?: never;
88009
+ head?: never;
88010
+ patch?: never;
88011
+ trace?: never;
88012
+ };
88013
+ "/finanzas/possible-duplicates": {
88014
+ parameters: {
88015
+ query?: never;
88016
+ header?: never;
88017
+ path?: never;
88018
+ cookie?: never;
88019
+ };
88020
+ /**
88021
+ * Posibles duplicados: bank lines that repeat
88022
+ * @description Bank lines that repeat under one bank-issued operation id on the same account, day, direction and amount, at least `min_repeats` times (default 3). An id derived from the date (ending in six zeros) is not a bank reference and never counts. READ-ONLY: Vitrina deletes nothing here; someone reviews the list before any change. The Chipax import skips a repeated line of this kind on its next run. A caller without the patient register (the Contador) sees a patient as «Paciente A. P.» and no glosa on money in. Requires the `finanzas` add-on — without it every Finanzas operation answers `402 ENTITLEMENT_NOT_ACTIVE` (`details.required = ["finanzas"]`). Requires `finanzas:read`.
88023
+ */
88024
+ get: {
88025
+ parameters: {
88026
+ query?: {
88027
+ min_repeats?: number;
88028
+ };
88029
+ header?: never;
88030
+ path?: never;
88031
+ cookie?: never;
88032
+ };
88033
+ requestBody?: never;
88034
+ responses: {
88035
+ /** @description The groups */
88036
+ 200: {
88037
+ headers: {
88038
+ [name: string]: unknown;
88039
+ };
88040
+ content: {
88041
+ /**
88042
+ * @example {
88043
+ * "data": {
88044
+ * "min_repeats": 3,
88045
+ * "group_count": 1,
88046
+ * "line_count": 3,
88047
+ * "groups": [
88048
+ * {
88049
+ * "key": "acct|2025121010599320|2527239|outbound|2025-12-10",
88050
+ * "day": "2025-12-10",
88051
+ * "amount_clp": 2527239,
88052
+ * "direction": "outbound",
88053
+ * "bank_operation": "2025121010599320",
88054
+ * "description": "Pk smart4d tasa int. 2,09%",
88055
+ * "repeats": 3,
88056
+ * "total_clp": 7581717,
88057
+ * "bank_account": {
88058
+ * "id": "01930000-0000-7000-8000-0000000000b2",
88059
+ * "name": "Itaú tarjeta de crédito",
88060
+ * "institution_name": "Itaú",
88061
+ * "number_masked": "•••• 5402"
88062
+ * },
88063
+ * "lines": [
88064
+ * {
88065
+ * "id": "01930000-0000-7000-8000-0000000000a1",
88066
+ * "source": "chipax",
88067
+ * "description": "Pk smart4d tasa int. 2,09%"
88068
+ * }
88069
+ * ]
88070
+ * }
88071
+ * ]
88072
+ * }
88073
+ * }
88074
+ */
88075
+ "application/json": {
88076
+ data: {
88077
+ min_repeats: number;
88078
+ group_count: number;
88079
+ line_count: number;
88080
+ groups: {
88081
+ key: string;
88082
+ day: string;
88083
+ /** @description Whole CLP. */
88084
+ amount_clp: number;
88085
+ /** @enum {string} */
88086
+ direction: "inbound" | "outbound";
88087
+ /** @description The bank's own reference for the operation. */
88088
+ bank_operation: string;
88089
+ description: string | null;
88090
+ repeats: number;
88091
+ /** @description amount × repeats. */
88092
+ total_clp: number;
88093
+ bank_account: {
88094
+ id: string | null;
88095
+ name: string | null;
88096
+ institution_name: string | null;
88097
+ number_masked: string | null;
88098
+ };
88099
+ lines: {
88100
+ id: string;
88101
+ source: string;
88102
+ description: string | null;
88103
+ }[];
88104
+ }[];
88105
+ };
88106
+ };
88107
+ };
88108
+ };
88109
+ /** @description Validation error */
88110
+ 400: {
88111
+ headers: {
88112
+ [name: string]: unknown;
88113
+ };
88114
+ content: {
88115
+ "application/json": components["schemas"]["Error"];
88116
+ };
88117
+ };
88118
+ /** @description Unauthorized */
88119
+ 401: {
88120
+ headers: {
88121
+ [name: string]: unknown;
88122
+ };
88123
+ content: {
88124
+ "application/json": components["schemas"]["Error"];
88125
+ };
88126
+ };
88127
+ /** @description Forbidden */
88128
+ 403: {
88129
+ headers: {
88130
+ [name: string]: unknown;
88131
+ };
88132
+ content: {
88133
+ "application/json": components["schemas"]["Error"];
88134
+ };
88135
+ };
88136
+ /** @description Not found */
88137
+ 404: {
88138
+ headers: {
88139
+ [name: string]: unknown;
88140
+ };
88141
+ content: {
88142
+ "application/json": components["schemas"]["Error"];
88143
+ };
88144
+ };
88145
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
88146
+ 409: {
88147
+ headers: {
88148
+ [name: string]: unknown;
88149
+ };
88150
+ content: {
88151
+ "application/json": components["schemas"]["Error"];
88152
+ };
88153
+ };
88154
+ /** @description Rate limited */
88155
+ 429: {
88156
+ headers: {
88157
+ [name: string]: unknown;
88158
+ };
88159
+ content: {
88160
+ "application/json": components["schemas"]["Error"];
88161
+ };
88162
+ };
88163
+ };
88164
+ };
88165
+ put?: never;
88166
+ post?: never;
88167
+ delete?: never;
88168
+ options?: never;
88169
+ head?: never;
88170
+ patch?: never;
88171
+ trace?: never;
88172
+ };
88173
+ "/finanzas/chipax": {
88174
+ parameters: {
88175
+ query?: never;
88176
+ header?: never;
88177
+ path?: never;
88178
+ cookie?: never;
88179
+ };
88180
+ /**
88181
+ * Importar desde Chipax: connection and runs
88182
+ * @description Whether the workspace stored its Chipax API credentials (only a masked App ID hint, never the secret), the run in progress and the last finished one. Vitrina only READS Chipax: it logs in and sends GET requests; it never creates, edits or deletes anything in the Chipax account. Requires the `finanzas` add-on — without it every Finanzas operation answers `402 ENTITLEMENT_NOT_ACTIVE` (`details.required = ["finanzas"]`). Requires `finanzas:read`.
88183
+ */
88184
+ get: {
88185
+ parameters: {
88186
+ query?: never;
88187
+ header?: never;
88188
+ path?: never;
88189
+ cookie?: never;
88190
+ };
88191
+ requestBody?: never;
88192
+ responses: {
88193
+ /** @description Connection and runs */
88194
+ 200: {
88195
+ headers: {
88196
+ [name: string]: unknown;
88197
+ };
88198
+ content: {
88199
+ /**
88200
+ * @example {
88201
+ * "data": {
88202
+ * "connected": true,
88203
+ * "app_id_preview": "a1b…9f2",
88204
+ * "verified_at": "2026-10-30T21:58:40.000Z",
88205
+ * "active_import": null,
88206
+ * "last_import": {
88207
+ * "id": "0190a3c2-5d1e-7b6a-9f20-4c1d2e3f5a16",
88208
+ * "mode": "dry_run",
88209
+ * "status": "done",
88210
+ * "from": "2025-01-01",
88211
+ * "to": "2026-10-30",
88212
+ * "account_map": [],
88213
+ * "requested_by": "0190a3c2-5d1e-7b6a-9f20-4c1d2e3f4f01",
88214
+ * "error": null,
88215
+ * "started_at": "2026-10-30T22:01:04.000Z",
88216
+ * "finished_at": "2026-10-30T22:14:51.000Z",
88217
+ * "created_at": "2026-10-30T22:01:02.000Z",
88218
+ * "report": null
88219
+ * }
88220
+ * }
88221
+ * }
88222
+ */
88223
+ "application/json": {
88224
+ data: components["schemas"]["FinanzasChipaxStatus"];
88225
+ };
88226
+ };
88227
+ };
88228
+ /** @description Validation error */
88229
+ 400: {
88230
+ headers: {
88231
+ [name: string]: unknown;
88232
+ };
88233
+ content: {
88234
+ "application/json": components["schemas"]["Error"];
88235
+ };
88236
+ };
88237
+ /** @description Unauthorized */
88238
+ 401: {
88239
+ headers: {
88240
+ [name: string]: unknown;
88241
+ };
88242
+ content: {
88243
+ "application/json": components["schemas"]["Error"];
88244
+ };
88245
+ };
88246
+ /** @description Forbidden */
88247
+ 403: {
88248
+ headers: {
88249
+ [name: string]: unknown;
88250
+ };
88251
+ content: {
88252
+ "application/json": components["schemas"]["Error"];
88253
+ };
88254
+ };
88255
+ /** @description Not found */
88256
+ 404: {
88257
+ headers: {
88258
+ [name: string]: unknown;
88259
+ };
88260
+ content: {
88261
+ "application/json": components["schemas"]["Error"];
88262
+ };
88263
+ };
88264
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
88265
+ 409: {
88266
+ headers: {
88267
+ [name: string]: unknown;
88268
+ };
88269
+ content: {
88270
+ "application/json": components["schemas"]["Error"];
88271
+ };
88272
+ };
88273
+ /** @description Rate limited */
88274
+ 429: {
88275
+ headers: {
88276
+ [name: string]: unknown;
88277
+ };
88278
+ content: {
88279
+ "application/json": components["schemas"]["Error"];
88280
+ };
88281
+ };
88282
+ };
88283
+ };
88284
+ put?: never;
88285
+ post?: never;
88286
+ delete?: never;
88287
+ options?: never;
88288
+ head?: never;
88289
+ patch?: never;
88290
+ trace?: never;
88291
+ };
88292
+ "/finanzas/chipax/credentials": {
88293
+ parameters: {
88294
+ query?: never;
88295
+ header?: never;
88296
+ path?: never;
88297
+ cookie?: never;
88298
+ };
88299
+ get?: never;
88300
+ put?: never;
88301
+ post?: never;
88302
+ /**
88303
+ * Importar desde Chipax: «Eliminar credenciales»
88304
+ * @description Deletes the stored Chipax credentials. What was already imported stays. Idempotent. Requires the `finanzas` add-on — without it every Finanzas operation answers `402 ENTITLEMENT_NOT_ACTIVE` (`details.required = ["finanzas"]`). Requires `finanzas_admin:write`.
88305
+ */
88306
+ delete: {
88307
+ parameters: {
88308
+ query?: never;
88309
+ header?: never;
88310
+ path?: never;
88311
+ cookie?: never;
88312
+ };
88313
+ requestBody?: never;
88314
+ responses: {
88315
+ /** @description Deleted */
88316
+ 200: {
88317
+ headers: {
88318
+ [name: string]: unknown;
88319
+ };
88320
+ content: {
88321
+ /**
88322
+ * @example {
88323
+ * "data": {
88324
+ * "connected": false,
88325
+ * "app_id_preview": null,
88326
+ * "verified_at": null,
88327
+ * "active_import": null,
88328
+ * "last_import": {
88329
+ * "id": "0190a3c2-5d1e-7b6a-9f20-4c1d2e3f5a16",
88330
+ * "mode": "dry_run",
88331
+ * "status": "done",
88332
+ * "from": "2025-01-01",
88333
+ * "to": "2026-10-30",
88334
+ * "account_map": [],
88335
+ * "requested_by": "0190a3c2-5d1e-7b6a-9f20-4c1d2e3f4f01",
88336
+ * "error": null,
88337
+ * "started_at": "2026-10-30T22:01:04.000Z",
88338
+ * "finished_at": "2026-10-30T22:14:51.000Z",
88339
+ * "created_at": "2026-10-30T22:01:02.000Z",
88340
+ * "report": null
88341
+ * }
88342
+ * }
88343
+ * }
88344
+ */
88345
+ "application/json": {
88346
+ data: components["schemas"]["FinanzasChipaxStatus"];
88347
+ };
88348
+ };
88349
+ };
88350
+ /** @description Validation error */
88351
+ 400: {
88352
+ headers: {
88353
+ [name: string]: unknown;
88354
+ };
88355
+ content: {
88356
+ "application/json": components["schemas"]["Error"];
88357
+ };
88358
+ };
88359
+ /** @description Unauthorized */
88360
+ 401: {
88361
+ headers: {
88362
+ [name: string]: unknown;
88363
+ };
88364
+ content: {
88365
+ "application/json": components["schemas"]["Error"];
88366
+ };
88367
+ };
88368
+ /** @description Forbidden */
88369
+ 403: {
88370
+ headers: {
88371
+ [name: string]: unknown;
88372
+ };
88373
+ content: {
88374
+ "application/json": components["schemas"]["Error"];
88375
+ };
88376
+ };
88377
+ /** @description Not found */
88378
+ 404: {
88379
+ headers: {
88380
+ [name: string]: unknown;
88381
+ };
88382
+ content: {
88383
+ "application/json": components["schemas"]["Error"];
88384
+ };
88385
+ };
88386
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
88387
+ 409: {
88388
+ headers: {
88389
+ [name: string]: unknown;
88390
+ };
88391
+ content: {
88392
+ "application/json": components["schemas"]["Error"];
88393
+ };
88394
+ };
88395
+ /** @description Rate limited */
88396
+ 429: {
88397
+ headers: {
88398
+ [name: string]: unknown;
88399
+ };
88400
+ content: {
88401
+ "application/json": components["schemas"]["Error"];
88402
+ };
88403
+ };
88404
+ };
88405
+ };
88406
+ options?: never;
88407
+ head?: never;
88408
+ patch?: never;
88409
+ trace?: never;
88410
+ };
88411
+ "/finanzas/chipax/imports": {
88412
+ parameters: {
88413
+ query?: never;
88414
+ header?: never;
88415
+ path?: never;
88416
+ cookie?: never;
88417
+ };
88418
+ /**
88419
+ * Importar desde Chipax: the runs
88420
+ * @description The last 20 runs, newest first (no report; GET one for it). Requires the `finanzas` add-on — without it every Finanzas operation answers `402 ENTITLEMENT_NOT_ACTIVE` (`details.required = ["finanzas"]`). Requires `finanzas:read`.
88421
+ */
88422
+ get: {
88423
+ parameters: {
88424
+ query?: never;
88425
+ header?: never;
88426
+ path?: never;
88427
+ cookie?: never;
88428
+ };
88429
+ requestBody?: never;
88430
+ responses: {
88431
+ /** @description Runs */
88432
+ 200: {
88433
+ headers: {
88434
+ [name: string]: unknown;
88435
+ };
88436
+ content: {
88437
+ /**
88438
+ * @example {
88439
+ * "data": [
88440
+ * {
88441
+ * "id": "0190a3c2-5d1e-7b6a-9f20-4c1d2e3f5a16",
88442
+ * "mode": "dry_run",
88443
+ * "status": "done",
88444
+ * "from": "2025-01-01",
88445
+ * "to": "2026-10-30",
88446
+ * "account_map": [],
88447
+ * "requested_by": "0190a3c2-5d1e-7b6a-9f20-4c1d2e3f4f01",
88448
+ * "error": null,
88449
+ * "started_at": "2026-10-30T22:01:04.000Z",
88450
+ * "finished_at": "2026-10-30T22:14:51.000Z",
88451
+ * "created_at": "2026-10-30T22:01:02.000Z",
88452
+ * "report": null
88453
+ * }
88454
+ * ]
88455
+ * }
88456
+ */
88457
+ "application/json": {
88458
+ data: (components["schemas"]["FinanzasChipaxImport"] & Record<string, never>)[];
87576
88459
  };
87577
88460
  };
87578
88461
  };
@@ -280619,6 +281502,18 @@ interface components {
280619
281502
  * @description Finanzas 30: the ad document (`GET /finanzas/documents/{id}`, `origin = ads`) of this movement when it is an ad charge or refund; null otherwise.
280620
281503
  */
280621
281504
  ads_document_id: string | null;
281505
+ /** @description Finanzas 36: set when this is a known card processor's payout («Cobro con tarjeta»: PNOL / PAGOS Y SERVICIOS, Transbank, Getnet, Mercado Pago). It settles the month's boleta summary and never adds income. Null for any other movement and for money out. */
281506
+ card_processor: {
281507
+ /** @enum {string} */
281508
+ key: "pagos_y_servicios" | "transbank" | "getnet" | "mercado_pago";
281509
+ name: string;
281510
+ rut_formatted: string | null;
281511
+ } | null;
281512
+ /**
281513
+ * @description Finanzas 36: set when the bank text names nobody and the movement has no Contraparte: show it as the title with the sub-line «Sin contraparte».
281514
+ * @enum {string|null}
281515
+ */
281516
+ generic_label: "Depósito en efectivo" | "Pago recibido" | "Depósito con cheque" | null;
280622
281517
  created_at: string;
280623
281518
  };
280624
281519
  FinanzasDocument: {
@@ -281566,6 +282461,13 @@ interface components {
281566
282461
  id: string;
281567
282462
  name: string;
281568
282463
  } | null;
282464
+ /** @description Finanzas 36: set on a link with reason `payout_deduction`: the commission factura (`document`) was paid by deduction from this card payout (the processor kept it). Show «Pagada con descuento» and «Descontada del abono de {processor_name} del {day}», linking to `movement_id`. Such a link takes nothing from the payout's cash. Null otherwise. */
282465
+ payout: {
282466
+ movement_id: string;
282467
+ day: string;
282468
+ amount_clp: number;
282469
+ processor_name: string | null;
282470
+ } | null;
281569
282471
  own_transfer: components["schemas"]["FinanzasOwnTransfer"];
281570
282472
  undoable: boolean;
281571
282473
  };