@vitrina/api 11.102.0 → 11.103.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 +1336 -287
  2. package/dist/index.d.ts +1336 -287
  3. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -34767,6 +34767,115 @@ interface paths {
34767
34767
  patch?: never;
34768
34768
  trace?: never;
34769
34769
  };
34770
+ "/billing/invoices/{id}/transfer-claim": {
34771
+ parameters: {
34772
+ query?: never;
34773
+ header?: never;
34774
+ path?: never;
34775
+ cookie?: never;
34776
+ };
34777
+ get?: never;
34778
+ put?: never;
34779
+ /**
34780
+ * «Ya pagué por transferencia»: pause automatic charging of a cobro
34781
+ * @description The owner says this cobro was already paid by bank transfer (for example without its reference, which the reconciliation cannot match). While the claim is pending nothing charges the cobro automatically — not the scheduled charge, not a retry — and it does not advance in collections; the Vitrina team verifies the transfer and either records the payment or resumes the charge with a fresh heads-up. Idempotent (`created: false` when already pending). 409 when the cobro is no longer open (paid, voided, or a charge is in flight). Requires `billing:write`.
34782
+ */
34783
+ post: {
34784
+ parameters: {
34785
+ query?: never;
34786
+ header?: {
34787
+ /** @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. */
34788
+ "Idempotency-Key"?: string;
34789
+ };
34790
+ path: {
34791
+ id: string;
34792
+ };
34793
+ cookie?: never;
34794
+ };
34795
+ requestBody?: never;
34796
+ responses: {
34797
+ /** @description The claim */
34798
+ 200: {
34799
+ headers: {
34800
+ [name: string]: unknown;
34801
+ };
34802
+ content: {
34803
+ /**
34804
+ * @example {
34805
+ * "data": {
34806
+ * "created": true,
34807
+ * "claimedAt": "2026-10-14T13:20:00.000Z",
34808
+ * "number": "VT-2026-0002"
34809
+ * }
34810
+ * }
34811
+ */
34812
+ "application/json": {
34813
+ data: components["schemas"]["TransferClaimResult"];
34814
+ };
34815
+ };
34816
+ };
34817
+ /** @description Validation error */
34818
+ 400: {
34819
+ headers: {
34820
+ [name: string]: unknown;
34821
+ };
34822
+ content: {
34823
+ "application/json": components["schemas"]["Error"];
34824
+ };
34825
+ };
34826
+ /** @description Unauthorized */
34827
+ 401: {
34828
+ headers: {
34829
+ [name: string]: unknown;
34830
+ };
34831
+ content: {
34832
+ "application/json": components["schemas"]["Error"];
34833
+ };
34834
+ };
34835
+ /** @description Forbidden */
34836
+ 403: {
34837
+ headers: {
34838
+ [name: string]: unknown;
34839
+ };
34840
+ content: {
34841
+ "application/json": components["schemas"]["Error"];
34842
+ };
34843
+ };
34844
+ /** @description Not found */
34845
+ 404: {
34846
+ headers: {
34847
+ [name: string]: unknown;
34848
+ };
34849
+ content: {
34850
+ "application/json": components["schemas"]["Error"];
34851
+ };
34852
+ };
34853
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
34854
+ 409: {
34855
+ headers: {
34856
+ [name: string]: unknown;
34857
+ };
34858
+ content: {
34859
+ "application/json": components["schemas"]["Error"];
34860
+ };
34861
+ };
34862
+ /** @description Rate limited */
34863
+ 429: {
34864
+ headers: {
34865
+ [name: string]: unknown;
34866
+ };
34867
+ content: {
34868
+ "application/json": components["schemas"]["Error"];
34869
+ };
34870
+ };
34871
+ };
34872
+ };
34873
+ delete?: never;
34874
+ options?: never;
34875
+ head?: never;
34876
+ patch?: never;
34877
+ trace?: never;
34878
+ };
34770
34879
  "/billing/payment-method/setup": {
34771
34880
  parameters: {
34772
34881
  query?: never;
@@ -52165,7 +52274,7 @@ interface paths {
52165
52274
  patch?: never;
52166
52275
  trace?: never;
52167
52276
  };
52168
- "/payment-settings": {
52277
+ "/clinic/payment-registrations": {
52169
52278
  parameters: {
52170
52279
  query?: never;
52171
52280
  header?: never;
@@ -52173,8 +52282,167 @@ interface paths {
52173
52282
  cookie?: never;
52174
52283
  };
52175
52284
  /**
52176
- * How this business charges, and its Mercado Pago connection
52177
- * @description `charging.reservation` (refundable reservations: booking deposits, vehicle reservation deposits) and `charging.final` (balances, budgets, packs, services), each with the effective `mode`, whether it is the workspace's choice or the vertical default (`source`), and the `default_mode`. Defaults: healthcare `mp_first` for both; automotive `transfer_first` for reservations (a Mercado Pago refund does not return the commission) and `mp_first` for final payments; any other vertical `mp_first`. `mercadopago` is the connection status plus `configured` (the environment can connect at all). `installments.min_clp`: from which amount a final-charge link offers cuotas (`null` = off). `budgets.accept_charge`: what a presupuesto's «aceptar y pagar» charges (`full` | `first_installment`). Requires `tenant_bank_accounts:read` (or `clinic_money:read`).
52285
+ * Mercado Pago payments to register in the practice system
52286
+ * @description The reception tasks: each Mercado Pago payment of a clinic whose Dentalink / Medilink / Reservo authors its money, pre-filled (patient and RUT, amount, medio, MP number, date, what it paid) and, once the mirror brings the pago in, its match. `status=pending` (default) = `open` + `ambiguous` (an ambiguous task lists its `candidates`). `payments:read`.
52287
+ */
52288
+ get: {
52289
+ parameters: {
52290
+ query?: {
52291
+ /** @description `pending` = open + ambiguous (default); `closed` = matched, dismissed or cancelled. */
52292
+ status?: "pending" | "matched" | "closed" | "all";
52293
+ contact_id?: string;
52294
+ limit?: number;
52295
+ offset?: number | null;
52296
+ };
52297
+ header?: never;
52298
+ path?: never;
52299
+ cookie?: never;
52300
+ };
52301
+ requestBody?: never;
52302
+ responses: {
52303
+ /** @description The tasks, newest payment first */
52304
+ 200: {
52305
+ headers: {
52306
+ [name: string]: unknown;
52307
+ };
52308
+ content: {
52309
+ /**
52310
+ * @example {
52311
+ * "data": [
52312
+ * {
52313
+ * "id": "0199c3a0-1111-7000-8000-000000000001",
52314
+ * "status": "matched",
52315
+ * "vendor": "dentalink",
52316
+ * "vendor_label": "Dentalink",
52317
+ * "provider": "mercadopago",
52318
+ * "provider_reference": "182050716739",
52319
+ * "provider_payment_url": "https://www.mercadopago.cl/activities?q=182050716739",
52320
+ * "customer_payment_id": "0199c3a0-2222-7000-8000-000000000002",
52321
+ * "contact_id": "0199c3a0-3333-7000-8000-000000000003",
52322
+ * "amount_clp": 30000,
52323
+ * "paid_on": "2026-10-05",
52324
+ * "patient": {
52325
+ * "id": "0199c3a0-4444-7000-8000-000000000004",
52326
+ * "name": "Ana Pérez",
52327
+ * "rut": "11.111.111-1"
52328
+ * },
52329
+ * "concept": {
52330
+ * "kind": "appointment_deposit",
52331
+ * "label": "Abono cita",
52332
+ * "appointment_starts_at": "2026-10-09T13:00:00.000Z"
52333
+ * },
52334
+ * "medio": {
52335
+ * "code": "30",
52336
+ * "label": "Mercado Pago"
52337
+ * },
52338
+ * "matched": {
52339
+ * "mirror_payment_id": "0199c3a0-5555-7000-8000-000000000005",
52340
+ * "vendor_reference": "88123",
52341
+ * "received_on": "2026-10-05",
52342
+ * "amount_clp": 30000,
52343
+ * "medio": "Mercado Pago",
52344
+ * "voided": false,
52345
+ * "by": "auto_unique",
52346
+ * "at": "2026-10-05T18:20:00.000Z"
52347
+ * },
52348
+ * "candidates": [],
52349
+ * "dismissed_reason": null,
52350
+ * "overdue": false,
52351
+ * "reminded_at": null,
52352
+ * "created_at": "2026-10-05T14:02:11.000Z"
52353
+ * }
52354
+ * ],
52355
+ * "meta": {
52356
+ * "total": 1,
52357
+ * "limit": 50,
52358
+ * "offset": 0
52359
+ * }
52360
+ * }
52361
+ */
52362
+ "application/json": {
52363
+ data: components["schemas"]["PaymentRegistration"][];
52364
+ meta: {
52365
+ total: number;
52366
+ limit: number;
52367
+ offset: number;
52368
+ };
52369
+ };
52370
+ };
52371
+ };
52372
+ /** @description Validation error */
52373
+ 400: {
52374
+ headers: {
52375
+ [name: string]: unknown;
52376
+ };
52377
+ content: {
52378
+ "application/json": components["schemas"]["Error"];
52379
+ };
52380
+ };
52381
+ /** @description Unauthorized */
52382
+ 401: {
52383
+ headers: {
52384
+ [name: string]: unknown;
52385
+ };
52386
+ content: {
52387
+ "application/json": components["schemas"]["Error"];
52388
+ };
52389
+ };
52390
+ /** @description Forbidden */
52391
+ 403: {
52392
+ headers: {
52393
+ [name: string]: unknown;
52394
+ };
52395
+ content: {
52396
+ "application/json": components["schemas"]["Error"];
52397
+ };
52398
+ };
52399
+ /** @description Not found */
52400
+ 404: {
52401
+ headers: {
52402
+ [name: string]: unknown;
52403
+ };
52404
+ content: {
52405
+ "application/json": components["schemas"]["Error"];
52406
+ };
52407
+ };
52408
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
52409
+ 409: {
52410
+ headers: {
52411
+ [name: string]: unknown;
52412
+ };
52413
+ content: {
52414
+ "application/json": components["schemas"]["Error"];
52415
+ };
52416
+ };
52417
+ /** @description Rate limited */
52418
+ 429: {
52419
+ headers: {
52420
+ [name: string]: unknown;
52421
+ };
52422
+ content: {
52423
+ "application/json": components["schemas"]["Error"];
52424
+ };
52425
+ };
52426
+ };
52427
+ };
52428
+ put?: never;
52429
+ post?: never;
52430
+ delete?: never;
52431
+ options?: never;
52432
+ head?: never;
52433
+ patch?: never;
52434
+ trace?: never;
52435
+ };
52436
+ "/clinic/payment-registrations/settings": {
52437
+ parameters: {
52438
+ query?: never;
52439
+ header?: never;
52440
+ path?: never;
52441
+ cookie?: never;
52442
+ };
52443
+ /**
52444
+ * Which vendor medio stands for Mercado Pago
52445
+ * @description The practice system, its medios (the synced `medio_pago` catalog for Dentalink / Medilink, the fixed list for Reservo), the one chosen as Mercado Pago, a name-based suggestion, and after how many business days an unregistered payment reminds reception (default 2). `payments:read`.
52178
52446
  */
52179
52447
  get: {
52180
52448
  parameters: {
@@ -52185,7 +52453,7 @@ interface paths {
52185
52453
  };
52186
52454
  requestBody?: never;
52187
52455
  responses: {
52188
- /** @description Charging preference and connection */
52456
+ /** @description The settings */
52189
52457
  200: {
52190
52458
  headers: {
52191
52459
  [name: string]: unknown;
@@ -52194,43 +52462,28 @@ interface paths {
52194
52462
  /**
52195
52463
  * @example {
52196
52464
  * "data": {
52197
- * "charging": {
52198
- * "reservation": {
52199
- * "mode": "transfer_first",
52200
- * "source": "default",
52201
- * "default_mode": "transfer_first"
52465
+ * "vendor": "dentalink",
52466
+ * "vendor_label": "Dentalink",
52467
+ * "mercadopago_medio": null,
52468
+ * "suggested_medio": "30",
52469
+ * "medios": [
52470
+ * {
52471
+ * "code": "2",
52472
+ * "label": "Tarjeta de débito",
52473
+ * "active": true
52202
52474
  * },
52203
- * "final": {
52204
- * "mode": "mp_first",
52205
- * "source": "tenant",
52206
- * "default_mode": "mp_first"
52475
+ * {
52476
+ * "code": "30",
52477
+ * "label": "Mercado Pago",
52478
+ * "active": true
52207
52479
  * }
52208
- * },
52209
- * "installments": {
52210
- * "min_clp": null
52211
- * },
52212
- * "budgets": {
52213
- * "accept_charge": "full"
52214
- * },
52215
- * "mercadopago": {
52216
- * "connected": true,
52217
- * "mp_user_id": "1234567890",
52218
- * "mp_nickname": "AUTOMOTORAEJEMPLO",
52219
- * "environment": "production",
52220
- * "connected_at": "2026-10-08T14:00:00.000Z",
52221
- * "last_sync_at": "2026-10-08T15:00:00.000Z",
52222
- * "last_sync_status": "ok",
52223
- * "last_sync_error": null,
52224
- * "configured": true
52225
- * }
52480
+ * ],
52481
+ * "reminder_business_days": 2
52226
52482
  * }
52227
52483
  * }
52228
52484
  */
52229
52485
  "application/json": {
52230
- data?: unknown;
52231
- meta?: {
52232
- [key: string]: unknown;
52233
- };
52486
+ data: components["schemas"]["PaymentRegistrationSettings"];
52234
52487
  };
52235
52488
  };
52236
52489
  };
@@ -52290,25 +52543,9 @@ interface paths {
52290
52543
  };
52291
52544
  };
52292
52545
  };
52293
- put?: never;
52294
- post?: never;
52295
- delete?: never;
52296
- options?: never;
52297
- head?: never;
52298
- patch?: never;
52299
- trace?: never;
52300
- };
52301
- "/payment-settings/charging": {
52302
- parameters: {
52303
- query?: never;
52304
- header?: never;
52305
- path?: never;
52306
- cookie?: never;
52307
- };
52308
- get?: never;
52309
52546
  /**
52310
- * Set how this business charges, per charge type
52311
- * @description Pass `reservation` and/or `final`; `null` resets that type to the vertical default, an omitted type is left as it is. Every payment block (the agent booking tools, the hosted booking page) follows it. Returns the resolved preference. Requires `tenant_bank_accounts:write` (or `clinic_money:write`).
52547
+ * Choose the Mercado Pago medio / the reminder delay
52548
+ * @description Sets the vendor medio that stands for Mercado Pago (it must be one of the clinic's medios; 400 `unknown_medio`) and/or the reminder delay in business days (1–15). Re-runs the matcher: a chosen medio can settle an ambiguous task. `clinic_admin:write`.
52312
52549
  */
52313
52550
  put: {
52314
52551
  parameters: {
@@ -52321,26 +52558,19 @@ interface paths {
52321
52558
  content: {
52322
52559
  /**
52323
52560
  * @example {
52324
- * "reservation": "transfer_first",
52325
- * "final": null
52561
+ * "mercadopago_medio": "30",
52562
+ * "reminder_business_days": 2
52326
52563
  * }
52327
52564
  */
52328
52565
  "application/json": {
52329
- /**
52330
- * @description `mp_first` = Mercado Pago link first, transfer as the alternative; `transfer_first` = transfer first, link only if the customer asks; `mp_only` / `transfer_only` = only that method. A mode that needs Mercado Pago without a connection falls back to the transfer; an `*_only` mode with nothing to offer tells the customer the team will send the details.
52331
- * @enum {string|null}
52332
- */
52333
- reservation?: "mp_first" | "transfer_first" | "mp_only" | "transfer_only" | null;
52334
- /**
52335
- * @description `mp_first` = Mercado Pago link first, transfer as the alternative; `transfer_first` = transfer first, link only if the customer asks; `mp_only` / `transfer_only` = only that method. A mode that needs Mercado Pago without a connection falls back to the transfer; an `*_only` mode with nothing to offer tells the customer the team will send the details.
52336
- * @enum {string|null}
52337
- */
52338
- final?: "mp_first" | "transfer_first" | "mp_only" | "transfer_only" | null;
52566
+ /** @description The vendor medio that stands for Mercado Pago; null clears it. */
52567
+ mercadopago_medio?: string | null;
52568
+ reminder_business_days?: number;
52339
52569
  };
52340
52570
  };
52341
52571
  };
52342
52572
  responses: {
52343
- /** @description The resolved charging preference */
52573
+ /** @description The settings */
52344
52574
  200: {
52345
52575
  headers: {
52346
52576
  [name: string]: unknown;
@@ -52349,24 +52579,28 @@ interface paths {
52349
52579
  /**
52350
52580
  * @example {
52351
52581
  * "data": {
52352
- * "reservation": {
52353
- * "mode": "transfer_first",
52354
- * "source": "default",
52355
- * "default_mode": "transfer_first"
52356
- * },
52357
- * "final": {
52358
- * "mode": "mp_first",
52359
- * "source": "tenant",
52360
- * "default_mode": "mp_first"
52361
- * }
52582
+ * "vendor": "dentalink",
52583
+ * "vendor_label": "Dentalink",
52584
+ * "mercadopago_medio": null,
52585
+ * "suggested_medio": "30",
52586
+ * "medios": [
52587
+ * {
52588
+ * "code": "2",
52589
+ * "label": "Tarjeta de débito",
52590
+ * "active": true
52591
+ * },
52592
+ * {
52593
+ * "code": "30",
52594
+ * "label": "Mercado Pago",
52595
+ * "active": true
52596
+ * }
52597
+ * ],
52598
+ * "reminder_business_days": 2
52362
52599
  * }
52363
52600
  * }
52364
52601
  */
52365
52602
  "application/json": {
52366
- data?: unknown;
52367
- meta?: {
52368
- [key: string]: unknown;
52369
- };
52603
+ data: components["schemas"]["PaymentRegistrationSettings"];
52370
52604
  };
52371
52605
  };
52372
52606
  };
@@ -52433,43 +52667,29 @@ interface paths {
52433
52667
  patch?: never;
52434
52668
  trace?: never;
52435
52669
  };
52436
- "/payment-settings/installments": {
52670
+ "/clinic/payment-registrations/{id}": {
52437
52671
  parameters: {
52438
52672
  query?: never;
52439
52673
  header?: never;
52440
52674
  path?: never;
52441
52675
  cookie?: never;
52442
52676
  };
52443
- get?: never;
52444
52677
  /**
52445
- * Set from which amount a payment link offers installments
52446
- * @description From `min_clp` CLP up, a Mercado Pago link for a FINAL charge (balance, budget, pack) offers installments («cuotas»); `null` turns them off (the default). Reservations and deposits are always one payment. Returns the saved threshold. Requires `tenant_bank_accounts:write` (or `clinic_money:write`).
52678
+ * One Mercado Pago payment registration task
52679
+ * @description One task, as the list returns it. `payments:read`.
52447
52680
  */
52448
- put: {
52681
+ get: {
52449
52682
  parameters: {
52450
52683
  query?: never;
52451
52684
  header?: never;
52452
- path?: never;
52453
- cookie?: never;
52454
- };
52455
- requestBody?: {
52456
- content: {
52457
- /**
52458
- * @example {
52459
- * "min_clp": 200000
52460
- * }
52461
- */
52462
- "application/json": {
52463
- /**
52464
- * @description Whole CLP from which a final charge (balance, budget, pack) may be paid in installments. `null` turns installments off. Reservations and deposits are always one payment.
52465
- * @example 200000
52466
- */
52467
- min_clp: number | null;
52468
- };
52685
+ path: {
52686
+ id: string;
52469
52687
  };
52688
+ cookie?: never;
52470
52689
  };
52690
+ requestBody?: never;
52471
52691
  responses: {
52472
- /** @description The saved threshold */
52692
+ /** @description The task */
52473
52693
  200: {
52474
52694
  headers: {
52475
52695
  [name: string]: unknown;
@@ -52478,15 +52698,51 @@ interface paths {
52478
52698
  /**
52479
52699
  * @example {
52480
52700
  * "data": {
52481
- * "min_clp": 200000
52701
+ * "id": "0199c3a0-1111-7000-8000-000000000001",
52702
+ * "status": "matched",
52703
+ * "vendor": "dentalink",
52704
+ * "vendor_label": "Dentalink",
52705
+ * "provider": "mercadopago",
52706
+ * "provider_reference": "182050716739",
52707
+ * "provider_payment_url": "https://www.mercadopago.cl/activities?q=182050716739",
52708
+ * "customer_payment_id": "0199c3a0-2222-7000-8000-000000000002",
52709
+ * "contact_id": "0199c3a0-3333-7000-8000-000000000003",
52710
+ * "amount_clp": 30000,
52711
+ * "paid_on": "2026-10-05",
52712
+ * "patient": {
52713
+ * "id": "0199c3a0-4444-7000-8000-000000000004",
52714
+ * "name": "Ana Pérez",
52715
+ * "rut": "11.111.111-1"
52716
+ * },
52717
+ * "concept": {
52718
+ * "kind": "appointment_deposit",
52719
+ * "label": "Abono cita",
52720
+ * "appointment_starts_at": "2026-10-09T13:00:00.000Z"
52721
+ * },
52722
+ * "medio": {
52723
+ * "code": "30",
52724
+ * "label": "Mercado Pago"
52725
+ * },
52726
+ * "matched": {
52727
+ * "mirror_payment_id": "0199c3a0-5555-7000-8000-000000000005",
52728
+ * "vendor_reference": "88123",
52729
+ * "received_on": "2026-10-05",
52730
+ * "amount_clp": 30000,
52731
+ * "medio": "Mercado Pago",
52732
+ * "voided": false,
52733
+ * "by": "auto_unique",
52734
+ * "at": "2026-10-05T18:20:00.000Z"
52735
+ * },
52736
+ * "candidates": [],
52737
+ * "dismissed_reason": null,
52738
+ * "overdue": false,
52739
+ * "reminded_at": null,
52740
+ * "created_at": "2026-10-05T14:02:11.000Z"
52482
52741
  * }
52483
52742
  * }
52484
52743
  */
52485
52744
  "application/json": {
52486
- data?: unknown;
52487
- meta?: {
52488
- [key: string]: unknown;
52489
- };
52745
+ data: components["schemas"]["PaymentRegistration"];
52490
52746
  };
52491
52747
  };
52492
52748
  };
@@ -52546,6 +52802,7 @@ interface paths {
52546
52802
  };
52547
52803
  };
52548
52804
  };
52805
+ put?: never;
52549
52806
  post?: never;
52550
52807
  delete?: never;
52551
52808
  options?: never;
@@ -52553,7 +52810,7 @@ interface paths {
52553
52810
  patch?: never;
52554
52811
  trace?: never;
52555
52812
  };
52556
- "/payment-settings/budgets": {
52813
+ "/clinic/payment-registrations/{id}/confirm": {
52557
52814
  parameters: {
52558
52815
  query?: never;
52559
52816
  header?: never;
@@ -52561,36 +52818,41 @@ interface paths {
52561
52818
  cookie?: never;
52562
52819
  };
52563
52820
  get?: never;
52821
+ put?: never;
52564
52822
  /**
52565
- * Set what «aceptar y pagar» charges for a presupuesto
52566
- * @description When the charging preference offers a Mercado Pago link for final charges, the public presupuesto page offers «aceptar y pagar». `accept_charge` decides its amount: `full` (default) or `first_installment` (the accepted amount divided by the presupuesto's `installments`). Returns the saved choice. Requires `tenant_bank_accounts:write` (or `clinic_money:write`).
52823
+ * Confirm which vendor pago records this payment
52824
+ * @description Staff match: the pago must be the same patient's, the same amount and inside the window (400 `not_a_candidate`), and not already record another payment (409 `candidate_taken`). 409 `registration_not_pending` once the task is closed. Closes the task and its notification. `payments:write`.
52567
52825
  */
52568
- put: {
52826
+ post: {
52569
52827
  parameters: {
52570
52828
  query?: never;
52571
- header?: never;
52572
- path?: never;
52829
+ header?: {
52830
+ /** @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. */
52831
+ "Idempotency-Key"?: string;
52832
+ };
52833
+ path: {
52834
+ id: string;
52835
+ };
52573
52836
  cookie?: never;
52574
52837
  };
52575
52838
  requestBody?: {
52576
52839
  content: {
52577
52840
  /**
52578
52841
  * @example {
52579
- * "accept_charge": "first_installment"
52842
+ * "mirror_payment_id": "0199c3a0-5555-7000-8000-000000000005"
52580
52843
  * }
52581
52844
  */
52582
52845
  "application/json": {
52583
52846
  /**
52584
- * @description What the patient pays when they accept a presupuesto from its link: `full` (the whole amount being accepted, the default) or `first_installment` (that amount divided by the presupuesto's `installments`; the whole amount when it has none).
52585
- * @example first_installment
52586
- * @enum {string}
52847
+ * Format: uuid
52848
+ * @description The vendor pago (a `clinic_mirror_payment` id) that records this payment.
52587
52849
  */
52588
- accept_charge: "full" | "first_installment";
52850
+ mirror_payment_id: string;
52589
52851
  };
52590
52852
  };
52591
52853
  };
52592
52854
  responses: {
52593
- /** @description The saved choice */
52855
+ /** @description The matched task */
52594
52856
  200: {
52595
52857
  headers: {
52596
52858
  [name: string]: unknown;
@@ -52599,15 +52861,51 @@ interface paths {
52599
52861
  /**
52600
52862
  * @example {
52601
52863
  * "data": {
52602
- * "accept_charge": "first_installment"
52864
+ * "id": "0199c3a0-1111-7000-8000-000000000001",
52865
+ * "status": "matched",
52866
+ * "vendor": "dentalink",
52867
+ * "vendor_label": "Dentalink",
52868
+ * "provider": "mercadopago",
52869
+ * "provider_reference": "182050716739",
52870
+ * "provider_payment_url": "https://www.mercadopago.cl/activities?q=182050716739",
52871
+ * "customer_payment_id": "0199c3a0-2222-7000-8000-000000000002",
52872
+ * "contact_id": "0199c3a0-3333-7000-8000-000000000003",
52873
+ * "amount_clp": 30000,
52874
+ * "paid_on": "2026-10-05",
52875
+ * "patient": {
52876
+ * "id": "0199c3a0-4444-7000-8000-000000000004",
52877
+ * "name": "Ana Pérez",
52878
+ * "rut": "11.111.111-1"
52879
+ * },
52880
+ * "concept": {
52881
+ * "kind": "appointment_deposit",
52882
+ * "label": "Abono cita",
52883
+ * "appointment_starts_at": "2026-10-09T13:00:00.000Z"
52884
+ * },
52885
+ * "medio": {
52886
+ * "code": "30",
52887
+ * "label": "Mercado Pago"
52888
+ * },
52889
+ * "matched": {
52890
+ * "mirror_payment_id": "0199c3a0-5555-7000-8000-000000000005",
52891
+ * "vendor_reference": "88123",
52892
+ * "received_on": "2026-10-05",
52893
+ * "amount_clp": 30000,
52894
+ * "medio": "Mercado Pago",
52895
+ * "voided": false,
52896
+ * "by": "auto_unique",
52897
+ * "at": "2026-10-05T18:20:00.000Z"
52898
+ * },
52899
+ * "candidates": [],
52900
+ * "dismissed_reason": null,
52901
+ * "overdue": false,
52902
+ * "reminded_at": null,
52903
+ * "created_at": "2026-10-05T14:02:11.000Z"
52603
52904
  * }
52604
52905
  * }
52605
52906
  */
52606
52907
  "application/json": {
52607
- data?: unknown;
52608
- meta?: {
52609
- [key: string]: unknown;
52610
- };
52908
+ data: components["schemas"]["PaymentRegistration"];
52611
52909
  };
52612
52910
  };
52613
52911
  };
@@ -52667,34 +52965,55 @@ interface paths {
52667
52965
  };
52668
52966
  };
52669
52967
  };
52670
- post?: never;
52671
52968
  delete?: never;
52672
52969
  options?: never;
52673
52970
  head?: never;
52674
52971
  patch?: never;
52675
52972
  trace?: never;
52676
52973
  };
52677
- "/payment-settings/mercadopago/status": {
52974
+ "/clinic/payment-registrations/{id}/dismiss": {
52678
52975
  parameters: {
52679
52976
  query?: never;
52680
52977
  header?: never;
52681
52978
  path?: never;
52682
52979
  cookie?: never;
52683
52980
  };
52981
+ get?: never;
52982
+ put?: never;
52684
52983
  /**
52685
- * Mercado Pago connection status
52686
- * @description Connected as … / last sync / last sync error, or `connected: false`. Requires `tenant_bank_accounts:read` (or `clinic_money:read`).
52984
+ * Close a registration task without a match
52985
+ * @description `registered_elsewhere` (reception registered it in a way Vitrina cannot match) or `not_needed`. 409 `registration_not_pending` once the task is closed. `payments:write`.
52687
52986
  */
52688
- get: {
52987
+ post: {
52689
52988
  parameters: {
52690
52989
  query?: never;
52691
- header?: never;
52692
- path?: never;
52990
+ header?: {
52991
+ /** @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. */
52992
+ "Idempotency-Key"?: string;
52993
+ };
52994
+ path: {
52995
+ id: string;
52996
+ };
52693
52997
  cookie?: never;
52694
52998
  };
52695
- requestBody?: never;
52999
+ requestBody?: {
53000
+ content: {
53001
+ /**
53002
+ * @example {
53003
+ * "reason": "registered_elsewhere"
53004
+ * }
53005
+ */
53006
+ "application/json": {
53007
+ /**
53008
+ * @description `registered_elsewhere` = reception registered it in a way Vitrina cannot match (another amount, a split); `not_needed` = it does not belong in the practice system.
53009
+ * @enum {string}
53010
+ */
53011
+ reason: "registered_elsewhere" | "not_needed";
53012
+ };
53013
+ };
53014
+ };
52696
53015
  responses: {
52697
- /** @description The connection status */
53016
+ /** @description The closed task */
52698
53017
  200: {
52699
53018
  headers: {
52700
53019
  [name: string]: unknown;
@@ -52703,22 +53022,51 @@ interface paths {
52703
53022
  /**
52704
53023
  * @example {
52705
53024
  * "data": {
52706
- * "connected": true,
52707
- * "mp_user_id": "1234567890",
52708
- * "mp_nickname": "AUTOMOTORAEJEMPLO",
52709
- * "environment": "production",
52710
- * "connected_at": "2026-10-08T14:00:00.000Z",
52711
- * "last_sync_at": "2026-10-08T15:00:00.000Z",
52712
- * "last_sync_status": "ok",
52713
- * "last_sync_error": null
53025
+ * "id": "0199c3a0-1111-7000-8000-000000000001",
53026
+ * "status": "matched",
53027
+ * "vendor": "dentalink",
53028
+ * "vendor_label": "Dentalink",
53029
+ * "provider": "mercadopago",
53030
+ * "provider_reference": "182050716739",
53031
+ * "provider_payment_url": "https://www.mercadopago.cl/activities?q=182050716739",
53032
+ * "customer_payment_id": "0199c3a0-2222-7000-8000-000000000002",
53033
+ * "contact_id": "0199c3a0-3333-7000-8000-000000000003",
53034
+ * "amount_clp": 30000,
53035
+ * "paid_on": "2026-10-05",
53036
+ * "patient": {
53037
+ * "id": "0199c3a0-4444-7000-8000-000000000004",
53038
+ * "name": "Ana Pérez",
53039
+ * "rut": "11.111.111-1"
53040
+ * },
53041
+ * "concept": {
53042
+ * "kind": "appointment_deposit",
53043
+ * "label": "Abono cita",
53044
+ * "appointment_starts_at": "2026-10-09T13:00:00.000Z"
53045
+ * },
53046
+ * "medio": {
53047
+ * "code": "30",
53048
+ * "label": "Mercado Pago"
53049
+ * },
53050
+ * "matched": {
53051
+ * "mirror_payment_id": "0199c3a0-5555-7000-8000-000000000005",
53052
+ * "vendor_reference": "88123",
53053
+ * "received_on": "2026-10-05",
53054
+ * "amount_clp": 30000,
53055
+ * "medio": "Mercado Pago",
53056
+ * "voided": false,
53057
+ * "by": "auto_unique",
53058
+ * "at": "2026-10-05T18:20:00.000Z"
53059
+ * },
53060
+ * "candidates": [],
53061
+ * "dismissed_reason": null,
53062
+ * "overdue": false,
53063
+ * "reminded_at": null,
53064
+ * "created_at": "2026-10-05T14:02:11.000Z"
52714
53065
  * }
52715
53066
  * }
52716
53067
  */
52717
53068
  "application/json": {
52718
- data?: unknown;
52719
- meta?: {
52720
- [key: string]: unknown;
52721
- };
53069
+ data: components["schemas"]["PaymentRegistration"];
52722
53070
  };
52723
53071
  };
52724
53072
  };
@@ -52778,42 +53126,33 @@ interface paths {
52778
53126
  };
52779
53127
  };
52780
53128
  };
52781
- put?: never;
52782
- post?: never;
52783
53129
  delete?: never;
52784
53130
  options?: never;
52785
53131
  head?: never;
52786
53132
  patch?: never;
52787
53133
  trace?: never;
52788
53134
  };
52789
- "/payment-settings/mercadopago/connect": {
53135
+ "/payment-settings": {
52790
53136
  parameters: {
52791
53137
  query?: never;
52792
53138
  header?: never;
52793
53139
  path?: never;
52794
53140
  cookie?: never;
52795
53141
  };
52796
- get?: never;
52797
- put?: never;
52798
53142
  /**
52799
- * Start the Mercado Pago OAuth consent flow
52800
- * @description Returns the consent URL for a person to open. Connects the business's OWN Mercado Pago account, never Vitrina's. `return_to` is where the browser lands after the callback. Requires `tenant_bank_accounts:write` (or `clinic_money:write`).
53143
+ * How this business charges, and its Mercado Pago connection
53144
+ * @description `charging.reservation` (refundable reservations: booking deposits, vehicle reservation deposits) and `charging.final` (balances, budgets, packs, services), each with the effective `mode`, whether it is the workspace's choice or the vertical default (`source`), and the `default_mode`. Defaults: healthcare `mp_first` for both; automotive `transfer_first` for reservations (a Mercado Pago refund does not return the commission) and `mp_first` for final payments; any other vertical `mp_first`. `mercadopago` is the connection status plus `configured` (the environment can connect at all). `installments.min_clp`: from which amount a final-charge link offers cuotas (`null` = off). `budgets.accept_charge`: what a presupuesto's «aceptar y pagar» charges (`full` | `first_installment`). Requires `tenant_bank_accounts:read` (or `clinic_money:read`).
52801
53145
  */
52802
- post: {
53146
+ get: {
52803
53147
  parameters: {
52804
- query?: {
52805
- return_to?: string;
52806
- };
52807
- header?: {
52808
- /** @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. */
52809
- "Idempotency-Key"?: string;
52810
- };
53148
+ query?: never;
53149
+ header?: never;
52811
53150
  path?: never;
52812
53151
  cookie?: never;
52813
53152
  };
52814
53153
  requestBody?: never;
52815
53154
  responses: {
52816
- /** @description The consent URL */
53155
+ /** @description Charging preference and connection */
52817
53156
  200: {
52818
53157
  headers: {
52819
53158
  [name: string]: unknown;
@@ -52822,7 +53161,35 @@ interface paths {
52822
53161
  /**
52823
53162
  * @example {
52824
53163
  * "data": {
52825
- * "url": "https://auth.mercadopago.cl/authorization?client_id=4688094843266502&response_type=code&platform_id=mp&state=…"
53164
+ * "charging": {
53165
+ * "reservation": {
53166
+ * "mode": "transfer_first",
53167
+ * "source": "default",
53168
+ * "default_mode": "transfer_first"
53169
+ * },
53170
+ * "final": {
53171
+ * "mode": "mp_first",
53172
+ * "source": "tenant",
53173
+ * "default_mode": "mp_first"
53174
+ * }
53175
+ * },
53176
+ * "installments": {
53177
+ * "min_clp": null
53178
+ * },
53179
+ * "budgets": {
53180
+ * "accept_charge": "full"
53181
+ * },
53182
+ * "mercadopago": {
53183
+ * "connected": true,
53184
+ * "mp_user_id": "1234567890",
53185
+ * "mp_nickname": "AUTOMOTORAEJEMPLO",
53186
+ * "environment": "production",
53187
+ * "connected_at": "2026-10-08T14:00:00.000Z",
53188
+ * "last_sync_at": "2026-10-08T15:00:00.000Z",
53189
+ * "last_sync_status": "ok",
53190
+ * "last_sync_error": null,
53191
+ * "configured": true
53192
+ * }
52826
53193
  * }
52827
53194
  * }
52828
53195
  */
@@ -52890,13 +53257,15 @@ interface paths {
52890
53257
  };
52891
53258
  };
52892
53259
  };
53260
+ put?: never;
53261
+ post?: never;
52893
53262
  delete?: never;
52894
53263
  options?: never;
52895
53264
  head?: never;
52896
53265
  patch?: never;
52897
53266
  trace?: never;
52898
53267
  };
52899
- "/payment-settings/mercadopago/disconnect": {
53268
+ "/payment-settings/charging": {
52900
53269
  parameters: {
52901
53270
  query?: never;
52902
53271
  header?: never;
@@ -52904,29 +53273,69 @@ interface paths {
52904
53273
  cookie?: never;
52905
53274
  };
52906
53275
  get?: never;
52907
- put?: never;
52908
53276
  /**
52909
- * Disconnect the Mercado Pago account
52910
- * @description Reversible: the connection survives disabled and a later reconnect re-enables it. Payment blocks fall back to the transfer. Requires `tenant_bank_accounts:write` (or `clinic_money:write`).
53277
+ * Set how this business charges, per charge type
53278
+ * @description Pass `reservation` and/or `final`; `null` resets that type to the vertical default, an omitted type is left as it is. Every payment block (the agent booking tools, the hosted booking page) follows it. Returns the resolved preference. Requires `tenant_bank_accounts:write` (or `clinic_money:write`).
52911
53279
  */
52912
- post: {
53280
+ put: {
52913
53281
  parameters: {
52914
53282
  query?: never;
52915
- header?: {
52916
- /** @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. */
52917
- "Idempotency-Key"?: string;
52918
- };
53283
+ header?: never;
52919
53284
  path?: never;
52920
53285
  cookie?: never;
52921
53286
  };
52922
- requestBody?: never;
53287
+ requestBody?: {
53288
+ content: {
53289
+ /**
53290
+ * @example {
53291
+ * "reservation": "transfer_first",
53292
+ * "final": null
53293
+ * }
53294
+ */
53295
+ "application/json": {
53296
+ /**
53297
+ * @description `mp_first` = Mercado Pago link first, transfer as the alternative; `transfer_first` = transfer first, link only if the customer asks; `mp_only` / `transfer_only` = only that method. A mode that needs Mercado Pago without a connection falls back to the transfer; an `*_only` mode with nothing to offer tells the customer the team will send the details.
53298
+ * @enum {string|null}
53299
+ */
53300
+ reservation?: "mp_first" | "transfer_first" | "mp_only" | "transfer_only" | null;
53301
+ /**
53302
+ * @description `mp_first` = Mercado Pago link first, transfer as the alternative; `transfer_first` = transfer first, link only if the customer asks; `mp_only` / `transfer_only` = only that method. A mode that needs Mercado Pago without a connection falls back to the transfer; an `*_only` mode with nothing to offer tells the customer the team will send the details.
53303
+ * @enum {string|null}
53304
+ */
53305
+ final?: "mp_first" | "transfer_first" | "mp_only" | "transfer_only" | null;
53306
+ };
53307
+ };
53308
+ };
52923
53309
  responses: {
52924
- /** @description Disconnected */
52925
- 204: {
53310
+ /** @description The resolved charging preference */
53311
+ 200: {
52926
53312
  headers: {
52927
53313
  [name: string]: unknown;
52928
53314
  };
52929
- content?: never;
53315
+ content: {
53316
+ /**
53317
+ * @example {
53318
+ * "data": {
53319
+ * "reservation": {
53320
+ * "mode": "transfer_first",
53321
+ * "source": "default",
53322
+ * "default_mode": "transfer_first"
53323
+ * },
53324
+ * "final": {
53325
+ * "mode": "mp_first",
53326
+ * "source": "tenant",
53327
+ * "default_mode": "mp_first"
53328
+ * }
53329
+ * }
53330
+ * }
53331
+ */
53332
+ "application/json": {
53333
+ data?: unknown;
53334
+ meta?: {
53335
+ [key: string]: unknown;
53336
+ };
53337
+ };
53338
+ };
52930
53339
  };
52931
53340
  /** @description Validation error */
52932
53341
  400: {
@@ -52984,13 +53393,14 @@ interface paths {
52984
53393
  };
52985
53394
  };
52986
53395
  };
53396
+ post?: never;
52987
53397
  delete?: never;
52988
53398
  options?: never;
52989
53399
  head?: never;
52990
53400
  patch?: never;
52991
53401
  trace?: never;
52992
53402
  };
52993
- "/payment-settings/mercadopago/sync": {
53403
+ "/payment-settings/installments": {
52994
53404
  parameters: {
52995
53405
  query?: never;
52996
53406
  header?: never;
@@ -52998,25 +53408,36 @@ interface paths {
52998
53408
  cookie?: never;
52999
53409
  };
53000
53410
  get?: never;
53001
- put?: never;
53002
53411
  /**
53003
- * Sincronizar ahora — enqueue an incremental pull
53004
- * @description Enqueues the same job the daily tick uses; dedups with an in-flight sync. 400 when nothing is connected. Requires `tenant_bank_accounts:write` (or `clinic_money:write`).
53412
+ * Set from which amount a payment link offers installments
53413
+ * @description From `min_clp` CLP up, a Mercado Pago link for a FINAL charge (balance, budget, pack) offers installments («cuotas»); `null` turns them off (the default). Reservations and deposits are always one payment. Returns the saved threshold. Requires `tenant_bank_accounts:write` (or `clinic_money:write`).
53005
53414
  */
53006
- post: {
53415
+ put: {
53007
53416
  parameters: {
53008
53417
  query?: never;
53009
- header?: {
53010
- /** @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. */
53011
- "Idempotency-Key"?: string;
53012
- };
53418
+ header?: never;
53013
53419
  path?: never;
53014
53420
  cookie?: never;
53015
53421
  };
53016
- requestBody?: never;
53422
+ requestBody?: {
53423
+ content: {
53424
+ /**
53425
+ * @example {
53426
+ * "min_clp": 200000
53427
+ * }
53428
+ */
53429
+ "application/json": {
53430
+ /**
53431
+ * @description Whole CLP from which a final charge (balance, budget, pack) may be paid in installments. `null` turns installments off. Reservations and deposits are always one payment.
53432
+ * @example 200000
53433
+ */
53434
+ min_clp: number | null;
53435
+ };
53436
+ };
53437
+ };
53017
53438
  responses: {
53018
- /** @description Enqueued */
53019
- 202: {
53439
+ /** @description The saved threshold */
53440
+ 200: {
53020
53441
  headers: {
53021
53442
  [name: string]: unknown;
53022
53443
  };
@@ -53024,7 +53445,7 @@ interface paths {
53024
53445
  /**
53025
53446
  * @example {
53026
53447
  * "data": {
53027
- * "enqueued": true
53448
+ * "min_clp": 200000
53028
53449
  * }
53029
53450
  * }
53030
53451
  */
@@ -53092,35 +53513,51 @@ interface paths {
53092
53513
  };
53093
53514
  };
53094
53515
  };
53516
+ post?: never;
53095
53517
  delete?: never;
53096
53518
  options?: never;
53097
53519
  head?: never;
53098
53520
  patch?: never;
53099
53521
  trace?: never;
53100
53522
  };
53101
- "/clinic/bank-feed/sources": {
53523
+ "/payment-settings/budgets": {
53102
53524
  parameters: {
53103
53525
  query?: never;
53104
53526
  header?: never;
53105
53527
  path?: never;
53106
53528
  cookie?: never;
53107
53529
  };
53530
+ get?: never;
53108
53531
  /**
53109
- * Bank feed sources available to this clinic
53110
- * @description The e-mail rail (free, always on), Fintoc (optional add-on `bank_feed_fintoc`, billed per connected bank per month at the provider's list price — `price_clp_per_bank_month` is null until it is set) and BCI API Market (not configured until the partner approval lands). Requires `clinic_money:read`.
53111
- *
53112
- * **Connected apps:** every patient and contact in the response is a Seudónimo de paciente — initials plus a stable number, `"M.F. · #1001"` — unless the clinic allowed patient names, with RUT, phone and email masked in free text and `meta.patient_privacy` saying so. Clinical alerts (`flags`) are withheld in both modes, and a non-JSON body (an export, a file) is refused with `403 CONNECTED_APP_SENSITIVE_DATA`.
53532
+ * Set what «aceptar y pagar» charges for a presupuesto
53533
+ * @description When the charging preference offers a Mercado Pago link for final charges, the public presupuesto page offers «aceptar y pagar». `accept_charge` decides its amount: `full` (default) or `first_installment` (the accepted amount divided by the presupuesto's `installments`). Returns the saved choice. Requires `tenant_bank_accounts:write` (or `clinic_money:write`).
53113
53534
  */
53114
- get: {
53535
+ put: {
53115
53536
  parameters: {
53116
53537
  query?: never;
53117
53538
  header?: never;
53118
53539
  path?: never;
53119
53540
  cookie?: never;
53120
53541
  };
53121
- requestBody?: never;
53542
+ requestBody?: {
53543
+ content: {
53544
+ /**
53545
+ * @example {
53546
+ * "accept_charge": "first_installment"
53547
+ * }
53548
+ */
53549
+ "application/json": {
53550
+ /**
53551
+ * @description What the patient pays when they accept a presupuesto from its link: `full` (the whole amount being accepted, the default) or `first_installment` (that amount divided by the presupuesto's `installments`; the whole amount when it has none).
53552
+ * @example first_installment
53553
+ * @enum {string}
53554
+ */
53555
+ accept_charge: "full" | "first_installment";
53556
+ };
53557
+ };
53558
+ };
53122
53559
  responses: {
53123
- /** @description The sources */
53560
+ /** @description The saved choice */
53124
53561
  200: {
53125
53562
  headers: {
53126
53563
  [name: string]: unknown;
@@ -53129,26 +53566,15 @@ interface paths {
53129
53566
  /**
53130
53567
  * @example {
53131
53568
  * "data": {
53132
- * "email": {
53133
- * "available": true,
53134
- * "billed": false
53135
- * },
53136
- * "fintoc": {
53137
- * "configured": true,
53138
- * "entitled": true,
53139
- * "feature": "bank_feed_fintoc",
53140
- * "price_clp_per_bank_month": null,
53141
- * "connected_banks": 1
53142
- * },
53143
- * "bci_api_market": {
53144
- * "configured": false,
53145
- * "reason": "BCI API Market production access is pending partner approval."
53146
- * }
53569
+ * "accept_charge": "first_installment"
53147
53570
  * }
53148
53571
  * }
53149
53572
  */
53150
53573
  "application/json": {
53151
- data: components["schemas"]["BankFeedSources"];
53574
+ data?: unknown;
53575
+ meta?: {
53576
+ [key: string]: unknown;
53577
+ };
53152
53578
  };
53153
53579
  };
53154
53580
  };
@@ -53208,7 +53634,6 @@ interface paths {
53208
53634
  };
53209
53635
  };
53210
53636
  };
53211
- put?: never;
53212
53637
  post?: never;
53213
53638
  delete?: never;
53214
53639
  options?: never;
@@ -53216,7 +53641,7 @@ interface paths {
53216
53641
  patch?: never;
53217
53642
  trace?: never;
53218
53643
  };
53219
- "/clinic/bank-feed/connections": {
53644
+ "/payment-settings/mercadopago/status": {
53220
53645
  parameters: {
53221
53646
  query?: never;
53222
53647
  header?: never;
@@ -53224,10 +53649,8 @@ interface paths {
53224
53649
  cookie?: never;
53225
53650
  };
53226
53651
  /**
53227
- * Connected bank links
53228
- * @description Every bank link this clinic connected through an API source, enabled or not, with masked account numbers and the last sync result. Requires `clinic_money:read`.
53229
- *
53230
- * **Connected apps:** every patient and contact in the response is a Seudónimo de paciente — initials plus a stable number, `"M.F. · #1001"` — unless the clinic allowed patient names, with RUT, phone and email masked in free text and `meta.patient_privacy` saying so. Clinical alerts (`flags`) are withheld in both modes, and a non-JSON body (an export, a file) is refused with `403 CONNECTED_APP_SENSITIVE_DATA`.
53652
+ * Mercado Pago connection status
53653
+ * @description Connected as … / last sync / last sync error, or `connected: false`. Requires `tenant_bank_accounts:read` (or `clinic_money:read`).
53231
53654
  */
53232
53655
  get: {
53233
53656
  parameters: {
@@ -53238,7 +53661,7 @@ interface paths {
53238
53661
  };
53239
53662
  requestBody?: never;
53240
53663
  responses: {
53241
- /** @description The connections */
53664
+ /** @description The connection status */
53242
53665
  200: {
53243
53666
  headers: {
53244
53667
  [name: string]: unknown;
@@ -53246,31 +53669,23 @@ interface paths {
53246
53669
  content: {
53247
53670
  /**
53248
53671
  * @example {
53249
- * "data": [
53250
- * {
53251
- * "id": "bf0bf0bf-0000-4000-8000-000000000001",
53252
- * "provider": "fintoc",
53253
- * "institution_name": "Banco de Chile",
53254
- * "holder_name": "Clínica Ejemplo SpA",
53255
- * "accounts": [
53256
- * {
53257
- * "id": "acc_9Xz2Lm",
53258
- * "number_masked": "••••4821"
53259
- * }
53260
- * ],
53261
- * "enabled": true,
53262
- * "connected_at": "2026-09-20T14:02:11.000Z",
53263
- * "disconnected_at": null,
53264
- * "last_sync_at": "2026-09-22T09:00:04.000Z",
53265
- * "last_sync_status": "ok",
53266
- * "last_sync_error": null,
53267
- * "sync_cursor": "2026-09-22"
53268
- * }
53269
- * ]
53672
+ * "data": {
53673
+ * "connected": true,
53674
+ * "mp_user_id": "1234567890",
53675
+ * "mp_nickname": "AUTOMOTORAEJEMPLO",
53676
+ * "environment": "production",
53677
+ * "connected_at": "2026-10-08T14:00:00.000Z",
53678
+ * "last_sync_at": "2026-10-08T15:00:00.000Z",
53679
+ * "last_sync_status": "ok",
53680
+ * "last_sync_error": null
53681
+ * }
53270
53682
  * }
53271
53683
  */
53272
53684
  "application/json": {
53273
- data: components["schemas"]["BankFeedConnection"][];
53685
+ data?: unknown;
53686
+ meta?: {
53687
+ [key: string]: unknown;
53688
+ };
53274
53689
  };
53275
53690
  };
53276
53691
  };
@@ -53338,7 +53753,7 @@ interface paths {
53338
53753
  patch?: never;
53339
53754
  trace?: never;
53340
53755
  };
53341
- "/clinic/bank-feed/fintoc/connect": {
53756
+ "/payment-settings/mercadopago/connect": {
53342
53757
  parameters: {
53343
53758
  query?: never;
53344
53759
  header?: never;
@@ -53348,14 +53763,14 @@ interface paths {
53348
53763
  get?: never;
53349
53764
  put?: never;
53350
53765
  /**
53351
- * Connect a bank through Fintoc
53352
- * @description Send the `exchange_token` Fintoc's widget returns (or a `link_token`). The server swaps it for the long-lived link token, stores it encrypted, and queues the first pull. Requires the `bank_feed_fintoc` add-on — without it the answer is `402 ENTITLEMENT_NOT_ACTIVE` (the upsell). Reconnecting the same bank updates its connection. Requires `clinic_money:write`.
53353
- *
53354
- * **Connected apps:** every patient and contact in the response is a Seudónimo de paciente — initials plus a stable number, `"M.F. · #1001"` — unless the clinic allowed patient names, with RUT, phone and email masked in free text and `meta.patient_privacy` saying so. Clinical alerts (`flags`) are withheld in both modes, and a non-JSON body (an export, a file) is refused with `403 CONNECTED_APP_SENSITIVE_DATA`.
53766
+ * Start the Mercado Pago OAuth consent flow
53767
+ * @description Returns the consent URL for a person to open. Connects the business's OWN Mercado Pago account, never Vitrina's. `return_to` is where the browser lands after the callback. Requires `tenant_bank_accounts:write` (or `clinic_money:write`).
53355
53768
  */
53356
53769
  post: {
53357
53770
  parameters: {
53358
- query?: never;
53771
+ query?: {
53772
+ return_to?: string;
53773
+ };
53359
53774
  header?: {
53360
53775
  /** @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. */
53361
53776
  "Idempotency-Key"?: string;
@@ -53363,19 +53778,10 @@ interface paths {
53363
53778
  path?: never;
53364
53779
  cookie?: never;
53365
53780
  };
53366
- requestBody?: {
53367
- content: {
53368
- /**
53369
- * @example {
53370
- * "exchange_token": "exch_7f3a9b2c1d"
53371
- * }
53372
- */
53373
- "application/json": components["schemas"]["BankFeedFintocConnectBody"];
53374
- };
53375
- };
53781
+ requestBody?: never;
53376
53782
  responses: {
53377
- /** @description The connection */
53378
- 201: {
53783
+ /** @description The consent URL */
53784
+ 200: {
53379
53785
  headers: {
53380
53786
  [name: string]: unknown;
53381
53787
  };
@@ -53383,28 +53789,15 @@ interface paths {
53383
53789
  /**
53384
53790
  * @example {
53385
53791
  * "data": {
53386
- * "id": "bf0bf0bf-0000-4000-8000-000000000001",
53387
- * "provider": "fintoc",
53388
- * "institution_name": "Banco de Chile",
53389
- * "holder_name": "Clínica Ejemplo SpA",
53390
- * "accounts": [
53391
- * {
53392
- * "id": "acc_9Xz2Lm",
53393
- * "number_masked": "••••4821"
53394
- * }
53395
- * ],
53396
- * "enabled": true,
53397
- * "connected_at": "2026-09-20T14:02:11.000Z",
53398
- * "disconnected_at": null,
53399
- * "last_sync_at": "2026-09-22T09:00:04.000Z",
53400
- * "last_sync_status": "ok",
53401
- * "last_sync_error": null,
53402
- * "sync_cursor": "2026-09-22"
53792
+ * "url": "https://auth.mercadopago.cl/authorization?client_id=4688094843266502&response_type=code&platform_id=mp&state=…"
53403
53793
  * }
53404
53794
  * }
53405
53795
  */
53406
53796
  "application/json": {
53407
- data: components["schemas"]["BankFeedConnection"];
53797
+ data?: unknown;
53798
+ meta?: {
53799
+ [key: string]: unknown;
53800
+ };
53408
53801
  };
53409
53802
  };
53410
53803
  };
@@ -53470,7 +53863,7 @@ interface paths {
53470
53863
  patch?: never;
53471
53864
  trace?: never;
53472
53865
  };
53473
- "/clinic/bank-feed/connections/{id}/sync": {
53866
+ "/payment-settings/mercadopago/disconnect": {
53474
53867
  parameters: {
53475
53868
  query?: never;
53476
53869
  header?: never;
@@ -53480,10 +53873,8 @@ interface paths {
53480
53873
  get?: never;
53481
53874
  put?: never;
53482
53875
  /**
53483
- * Sincronizar ahora — enqueue a pull of one bank link
53484
- * @description Enqueues the SAME job the daily tick uses; the stable per-connection jobId dedups with an in-flight sync. Requires `clinic_money:write`.
53485
- *
53486
- * **Connected apps:** every patient and contact in the response is a Seudónimo de paciente — initials plus a stable number, `"M.F. · #1001"` — unless the clinic allowed patient names, with RUT, phone and email masked in free text and `meta.patient_privacy` saying so. Clinical alerts (`flags`) are withheld in both modes, and a non-JSON body (an export, a file) is refused with `403 CONNECTED_APP_SENSITIVE_DATA`.
53876
+ * Disconnect the Mercado Pago account
53877
+ * @description Reversible: the connection survives disabled and a later reconnect re-enables it. Payment blocks fall back to the transfer. Requires `tenant_bank_accounts:write` (or `clinic_money:write`).
53487
53878
  */
53488
53879
  post: {
53489
53880
  parameters: {
@@ -53492,9 +53883,101 @@ interface paths {
53492
53883
  /** @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. */
53493
53884
  "Idempotency-Key"?: string;
53494
53885
  };
53495
- path: {
53496
- id: string;
53886
+ path?: never;
53887
+ cookie?: never;
53888
+ };
53889
+ requestBody?: never;
53890
+ responses: {
53891
+ /** @description Disconnected */
53892
+ 204: {
53893
+ headers: {
53894
+ [name: string]: unknown;
53895
+ };
53896
+ content?: never;
53897
+ };
53898
+ /** @description Validation error */
53899
+ 400: {
53900
+ headers: {
53901
+ [name: string]: unknown;
53902
+ };
53903
+ content: {
53904
+ "application/json": components["schemas"]["Error"];
53905
+ };
53906
+ };
53907
+ /** @description Unauthorized */
53908
+ 401: {
53909
+ headers: {
53910
+ [name: string]: unknown;
53911
+ };
53912
+ content: {
53913
+ "application/json": components["schemas"]["Error"];
53914
+ };
53915
+ };
53916
+ /** @description Forbidden */
53917
+ 403: {
53918
+ headers: {
53919
+ [name: string]: unknown;
53920
+ };
53921
+ content: {
53922
+ "application/json": components["schemas"]["Error"];
53923
+ };
53924
+ };
53925
+ /** @description Not found */
53926
+ 404: {
53927
+ headers: {
53928
+ [name: string]: unknown;
53929
+ };
53930
+ content: {
53931
+ "application/json": components["schemas"]["Error"];
53932
+ };
53933
+ };
53934
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
53935
+ 409: {
53936
+ headers: {
53937
+ [name: string]: unknown;
53938
+ };
53939
+ content: {
53940
+ "application/json": components["schemas"]["Error"];
53941
+ };
53942
+ };
53943
+ /** @description Rate limited */
53944
+ 429: {
53945
+ headers: {
53946
+ [name: string]: unknown;
53947
+ };
53948
+ content: {
53949
+ "application/json": components["schemas"]["Error"];
53950
+ };
53497
53951
  };
53952
+ };
53953
+ };
53954
+ delete?: never;
53955
+ options?: never;
53956
+ head?: never;
53957
+ patch?: never;
53958
+ trace?: never;
53959
+ };
53960
+ "/payment-settings/mercadopago/sync": {
53961
+ parameters: {
53962
+ query?: never;
53963
+ header?: never;
53964
+ path?: never;
53965
+ cookie?: never;
53966
+ };
53967
+ get?: never;
53968
+ put?: never;
53969
+ /**
53970
+ * Sincronizar ahora — enqueue an incremental pull
53971
+ * @description Enqueues the same job the daily tick uses; dedups with an in-flight sync. 400 when nothing is connected. Requires `tenant_bank_accounts:write` (or `clinic_money:write`).
53972
+ */
53973
+ post: {
53974
+ parameters: {
53975
+ query?: never;
53976
+ header?: {
53977
+ /** @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. */
53978
+ "Idempotency-Key"?: string;
53979
+ };
53980
+ path?: never;
53498
53981
  cookie?: never;
53499
53982
  };
53500
53983
  requestBody?: never;
@@ -53513,8 +53996,492 @@ interface paths {
53513
53996
  * }
53514
53997
  */
53515
53998
  "application/json": {
53516
- data: {
53517
- enqueued: boolean;
53999
+ data?: unknown;
54000
+ meta?: {
54001
+ [key: string]: unknown;
54002
+ };
54003
+ };
54004
+ };
54005
+ };
54006
+ /** @description Validation error */
54007
+ 400: {
54008
+ headers: {
54009
+ [name: string]: unknown;
54010
+ };
54011
+ content: {
54012
+ "application/json": components["schemas"]["Error"];
54013
+ };
54014
+ };
54015
+ /** @description Unauthorized */
54016
+ 401: {
54017
+ headers: {
54018
+ [name: string]: unknown;
54019
+ };
54020
+ content: {
54021
+ "application/json": components["schemas"]["Error"];
54022
+ };
54023
+ };
54024
+ /** @description Forbidden */
54025
+ 403: {
54026
+ headers: {
54027
+ [name: string]: unknown;
54028
+ };
54029
+ content: {
54030
+ "application/json": components["schemas"]["Error"];
54031
+ };
54032
+ };
54033
+ /** @description Not found */
54034
+ 404: {
54035
+ headers: {
54036
+ [name: string]: unknown;
54037
+ };
54038
+ content: {
54039
+ "application/json": components["schemas"]["Error"];
54040
+ };
54041
+ };
54042
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
54043
+ 409: {
54044
+ headers: {
54045
+ [name: string]: unknown;
54046
+ };
54047
+ content: {
54048
+ "application/json": components["schemas"]["Error"];
54049
+ };
54050
+ };
54051
+ /** @description Rate limited */
54052
+ 429: {
54053
+ headers: {
54054
+ [name: string]: unknown;
54055
+ };
54056
+ content: {
54057
+ "application/json": components["schemas"]["Error"];
54058
+ };
54059
+ };
54060
+ };
54061
+ };
54062
+ delete?: never;
54063
+ options?: never;
54064
+ head?: never;
54065
+ patch?: never;
54066
+ trace?: never;
54067
+ };
54068
+ "/clinic/bank-feed/sources": {
54069
+ parameters: {
54070
+ query?: never;
54071
+ header?: never;
54072
+ path?: never;
54073
+ cookie?: never;
54074
+ };
54075
+ /**
54076
+ * Bank feed sources available to this clinic
54077
+ * @description The e-mail rail (free, always on), Fintoc (optional add-on `bank_feed_fintoc`, billed per connected bank per month at the provider's list price — `price_clp_per_bank_month` is null until it is set) and BCI API Market (not configured until the partner approval lands). Requires `clinic_money:read`.
54078
+ *
54079
+ * **Connected apps:** every patient and contact in the response is a Seudónimo de paciente — initials plus a stable number, `"M.F. · #1001"` — unless the clinic allowed patient names, with RUT, phone and email masked in free text and `meta.patient_privacy` saying so. Clinical alerts (`flags`) are withheld in both modes, and a non-JSON body (an export, a file) is refused with `403 CONNECTED_APP_SENSITIVE_DATA`.
54080
+ */
54081
+ get: {
54082
+ parameters: {
54083
+ query?: never;
54084
+ header?: never;
54085
+ path?: never;
54086
+ cookie?: never;
54087
+ };
54088
+ requestBody?: never;
54089
+ responses: {
54090
+ /** @description The sources */
54091
+ 200: {
54092
+ headers: {
54093
+ [name: string]: unknown;
54094
+ };
54095
+ content: {
54096
+ /**
54097
+ * @example {
54098
+ * "data": {
54099
+ * "email": {
54100
+ * "available": true,
54101
+ * "billed": false
54102
+ * },
54103
+ * "fintoc": {
54104
+ * "configured": true,
54105
+ * "entitled": true,
54106
+ * "feature": "bank_feed_fintoc",
54107
+ * "price_clp_per_bank_month": null,
54108
+ * "connected_banks": 1
54109
+ * },
54110
+ * "bci_api_market": {
54111
+ * "configured": false,
54112
+ * "reason": "BCI API Market production access is pending partner approval."
54113
+ * }
54114
+ * }
54115
+ * }
54116
+ */
54117
+ "application/json": {
54118
+ data: components["schemas"]["BankFeedSources"];
54119
+ };
54120
+ };
54121
+ };
54122
+ /** @description Validation error */
54123
+ 400: {
54124
+ headers: {
54125
+ [name: string]: unknown;
54126
+ };
54127
+ content: {
54128
+ "application/json": components["schemas"]["Error"];
54129
+ };
54130
+ };
54131
+ /** @description Unauthorized */
54132
+ 401: {
54133
+ headers: {
54134
+ [name: string]: unknown;
54135
+ };
54136
+ content: {
54137
+ "application/json": components["schemas"]["Error"];
54138
+ };
54139
+ };
54140
+ /** @description Forbidden */
54141
+ 403: {
54142
+ headers: {
54143
+ [name: string]: unknown;
54144
+ };
54145
+ content: {
54146
+ "application/json": components["schemas"]["Error"];
54147
+ };
54148
+ };
54149
+ /** @description Not found */
54150
+ 404: {
54151
+ headers: {
54152
+ [name: string]: unknown;
54153
+ };
54154
+ content: {
54155
+ "application/json": components["schemas"]["Error"];
54156
+ };
54157
+ };
54158
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
54159
+ 409: {
54160
+ headers: {
54161
+ [name: string]: unknown;
54162
+ };
54163
+ content: {
54164
+ "application/json": components["schemas"]["Error"];
54165
+ };
54166
+ };
54167
+ /** @description Rate limited */
54168
+ 429: {
54169
+ headers: {
54170
+ [name: string]: unknown;
54171
+ };
54172
+ content: {
54173
+ "application/json": components["schemas"]["Error"];
54174
+ };
54175
+ };
54176
+ };
54177
+ };
54178
+ put?: never;
54179
+ post?: never;
54180
+ delete?: never;
54181
+ options?: never;
54182
+ head?: never;
54183
+ patch?: never;
54184
+ trace?: never;
54185
+ };
54186
+ "/clinic/bank-feed/connections": {
54187
+ parameters: {
54188
+ query?: never;
54189
+ header?: never;
54190
+ path?: never;
54191
+ cookie?: never;
54192
+ };
54193
+ /**
54194
+ * Connected bank links
54195
+ * @description Every bank link this clinic connected through an API source, enabled or not, with masked account numbers and the last sync result. Requires `clinic_money:read`.
54196
+ *
54197
+ * **Connected apps:** every patient and contact in the response is a Seudónimo de paciente — initials plus a stable number, `"M.F. · #1001"` — unless the clinic allowed patient names, with RUT, phone and email masked in free text and `meta.patient_privacy` saying so. Clinical alerts (`flags`) are withheld in both modes, and a non-JSON body (an export, a file) is refused with `403 CONNECTED_APP_SENSITIVE_DATA`.
54198
+ */
54199
+ get: {
54200
+ parameters: {
54201
+ query?: never;
54202
+ header?: never;
54203
+ path?: never;
54204
+ cookie?: never;
54205
+ };
54206
+ requestBody?: never;
54207
+ responses: {
54208
+ /** @description The connections */
54209
+ 200: {
54210
+ headers: {
54211
+ [name: string]: unknown;
54212
+ };
54213
+ content: {
54214
+ /**
54215
+ * @example {
54216
+ * "data": [
54217
+ * {
54218
+ * "id": "bf0bf0bf-0000-4000-8000-000000000001",
54219
+ * "provider": "fintoc",
54220
+ * "institution_name": "Banco de Chile",
54221
+ * "holder_name": "Clínica Ejemplo SpA",
54222
+ * "accounts": [
54223
+ * {
54224
+ * "id": "acc_9Xz2Lm",
54225
+ * "number_masked": "••••4821"
54226
+ * }
54227
+ * ],
54228
+ * "enabled": true,
54229
+ * "connected_at": "2026-09-20T14:02:11.000Z",
54230
+ * "disconnected_at": null,
54231
+ * "last_sync_at": "2026-09-22T09:00:04.000Z",
54232
+ * "last_sync_status": "ok",
54233
+ * "last_sync_error": null,
54234
+ * "sync_cursor": "2026-09-22"
54235
+ * }
54236
+ * ]
54237
+ * }
54238
+ */
54239
+ "application/json": {
54240
+ data: components["schemas"]["BankFeedConnection"][];
54241
+ };
54242
+ };
54243
+ };
54244
+ /** @description Validation error */
54245
+ 400: {
54246
+ headers: {
54247
+ [name: string]: unknown;
54248
+ };
54249
+ content: {
54250
+ "application/json": components["schemas"]["Error"];
54251
+ };
54252
+ };
54253
+ /** @description Unauthorized */
54254
+ 401: {
54255
+ headers: {
54256
+ [name: string]: unknown;
54257
+ };
54258
+ content: {
54259
+ "application/json": components["schemas"]["Error"];
54260
+ };
54261
+ };
54262
+ /** @description Forbidden */
54263
+ 403: {
54264
+ headers: {
54265
+ [name: string]: unknown;
54266
+ };
54267
+ content: {
54268
+ "application/json": components["schemas"]["Error"];
54269
+ };
54270
+ };
54271
+ /** @description Not found */
54272
+ 404: {
54273
+ headers: {
54274
+ [name: string]: unknown;
54275
+ };
54276
+ content: {
54277
+ "application/json": components["schemas"]["Error"];
54278
+ };
54279
+ };
54280
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
54281
+ 409: {
54282
+ headers: {
54283
+ [name: string]: unknown;
54284
+ };
54285
+ content: {
54286
+ "application/json": components["schemas"]["Error"];
54287
+ };
54288
+ };
54289
+ /** @description Rate limited */
54290
+ 429: {
54291
+ headers: {
54292
+ [name: string]: unknown;
54293
+ };
54294
+ content: {
54295
+ "application/json": components["schemas"]["Error"];
54296
+ };
54297
+ };
54298
+ };
54299
+ };
54300
+ put?: never;
54301
+ post?: never;
54302
+ delete?: never;
54303
+ options?: never;
54304
+ head?: never;
54305
+ patch?: never;
54306
+ trace?: never;
54307
+ };
54308
+ "/clinic/bank-feed/fintoc/connect": {
54309
+ parameters: {
54310
+ query?: never;
54311
+ header?: never;
54312
+ path?: never;
54313
+ cookie?: never;
54314
+ };
54315
+ get?: never;
54316
+ put?: never;
54317
+ /**
54318
+ * Connect a bank through Fintoc
54319
+ * @description Send the `exchange_token` Fintoc's widget returns (or a `link_token`). The server swaps it for the long-lived link token, stores it encrypted, and queues the first pull. Requires the `bank_feed_fintoc` add-on — without it the answer is `402 ENTITLEMENT_NOT_ACTIVE` (the upsell). Reconnecting the same bank updates its connection. Requires `clinic_money:write`.
54320
+ *
54321
+ * **Connected apps:** every patient and contact in the response is a Seudónimo de paciente — initials plus a stable number, `"M.F. · #1001"` — unless the clinic allowed patient names, with RUT, phone and email masked in free text and `meta.patient_privacy` saying so. Clinical alerts (`flags`) are withheld in both modes, and a non-JSON body (an export, a file) is refused with `403 CONNECTED_APP_SENSITIVE_DATA`.
54322
+ */
54323
+ post: {
54324
+ parameters: {
54325
+ query?: never;
54326
+ header?: {
54327
+ /** @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. */
54328
+ "Idempotency-Key"?: string;
54329
+ };
54330
+ path?: never;
54331
+ cookie?: never;
54332
+ };
54333
+ requestBody?: {
54334
+ content: {
54335
+ /**
54336
+ * @example {
54337
+ * "exchange_token": "exch_7f3a9b2c1d"
54338
+ * }
54339
+ */
54340
+ "application/json": components["schemas"]["BankFeedFintocConnectBody"];
54341
+ };
54342
+ };
54343
+ responses: {
54344
+ /** @description The connection */
54345
+ 201: {
54346
+ headers: {
54347
+ [name: string]: unknown;
54348
+ };
54349
+ content: {
54350
+ /**
54351
+ * @example {
54352
+ * "data": {
54353
+ * "id": "bf0bf0bf-0000-4000-8000-000000000001",
54354
+ * "provider": "fintoc",
54355
+ * "institution_name": "Banco de Chile",
54356
+ * "holder_name": "Clínica Ejemplo SpA",
54357
+ * "accounts": [
54358
+ * {
54359
+ * "id": "acc_9Xz2Lm",
54360
+ * "number_masked": "••••4821"
54361
+ * }
54362
+ * ],
54363
+ * "enabled": true,
54364
+ * "connected_at": "2026-09-20T14:02:11.000Z",
54365
+ * "disconnected_at": null,
54366
+ * "last_sync_at": "2026-09-22T09:00:04.000Z",
54367
+ * "last_sync_status": "ok",
54368
+ * "last_sync_error": null,
54369
+ * "sync_cursor": "2026-09-22"
54370
+ * }
54371
+ * }
54372
+ */
54373
+ "application/json": {
54374
+ data: components["schemas"]["BankFeedConnection"];
54375
+ };
54376
+ };
54377
+ };
54378
+ /** @description Validation error */
54379
+ 400: {
54380
+ headers: {
54381
+ [name: string]: unknown;
54382
+ };
54383
+ content: {
54384
+ "application/json": components["schemas"]["Error"];
54385
+ };
54386
+ };
54387
+ /** @description Unauthorized */
54388
+ 401: {
54389
+ headers: {
54390
+ [name: string]: unknown;
54391
+ };
54392
+ content: {
54393
+ "application/json": components["schemas"]["Error"];
54394
+ };
54395
+ };
54396
+ /** @description Forbidden */
54397
+ 403: {
54398
+ headers: {
54399
+ [name: string]: unknown;
54400
+ };
54401
+ content: {
54402
+ "application/json": components["schemas"]["Error"];
54403
+ };
54404
+ };
54405
+ /** @description Not found */
54406
+ 404: {
54407
+ headers: {
54408
+ [name: string]: unknown;
54409
+ };
54410
+ content: {
54411
+ "application/json": components["schemas"]["Error"];
54412
+ };
54413
+ };
54414
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
54415
+ 409: {
54416
+ headers: {
54417
+ [name: string]: unknown;
54418
+ };
54419
+ content: {
54420
+ "application/json": components["schemas"]["Error"];
54421
+ };
54422
+ };
54423
+ /** @description Rate limited */
54424
+ 429: {
54425
+ headers: {
54426
+ [name: string]: unknown;
54427
+ };
54428
+ content: {
54429
+ "application/json": components["schemas"]["Error"];
54430
+ };
54431
+ };
54432
+ };
54433
+ };
54434
+ delete?: never;
54435
+ options?: never;
54436
+ head?: never;
54437
+ patch?: never;
54438
+ trace?: never;
54439
+ };
54440
+ "/clinic/bank-feed/connections/{id}/sync": {
54441
+ parameters: {
54442
+ query?: never;
54443
+ header?: never;
54444
+ path?: never;
54445
+ cookie?: never;
54446
+ };
54447
+ get?: never;
54448
+ put?: never;
54449
+ /**
54450
+ * Sincronizar ahora — enqueue a pull of one bank link
54451
+ * @description Enqueues the SAME job the daily tick uses; the stable per-connection jobId dedups with an in-flight sync. Requires `clinic_money:write`.
54452
+ *
54453
+ * **Connected apps:** every patient and contact in the response is a Seudónimo de paciente — initials plus a stable number, `"M.F. · #1001"` — unless the clinic allowed patient names, with RUT, phone and email masked in free text and `meta.patient_privacy` saying so. Clinical alerts (`flags`) are withheld in both modes, and a non-JSON body (an export, a file) is refused with `403 CONNECTED_APP_SENSITIVE_DATA`.
54454
+ */
54455
+ post: {
54456
+ parameters: {
54457
+ query?: never;
54458
+ header?: {
54459
+ /** @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. */
54460
+ "Idempotency-Key"?: string;
54461
+ };
54462
+ path: {
54463
+ id: string;
54464
+ };
54465
+ cookie?: never;
54466
+ };
54467
+ requestBody?: never;
54468
+ responses: {
54469
+ /** @description Enqueued */
54470
+ 202: {
54471
+ headers: {
54472
+ [name: string]: unknown;
54473
+ };
54474
+ content: {
54475
+ /**
54476
+ * @example {
54477
+ * "data": {
54478
+ * "enqueued": true
54479
+ * }
54480
+ * }
54481
+ */
54482
+ "application/json": {
54483
+ data: {
54484
+ enqueued: boolean;
53518
54485
  };
53519
54486
  };
53520
54487
  };
@@ -147083,6 +148050,12 @@ interface components {
147083
148050
  exp_year?: number;
147084
148051
  };
147085
148052
  };
148053
+ TransferClaimResult: {
148054
+ /** @description False when a claim was already pending (idempotent). */
148055
+ created: boolean;
148056
+ claimedAt: string;
148057
+ number: string;
148058
+ };
147086
148059
  /** @example 2026-01 */
147087
148060
  OverheadPeriod: string;
147088
148061
  /** @description A Mercado Pago checkout payment: its payment id, a link to it and its status. Null for every other movement. */
@@ -147353,6 +148326,82 @@ interface components {
147353
148326
  min_count: number;
147354
148327
  } | null;
147355
148328
  };
148329
+ PaymentRegistration: {
148330
+ /** Format: uuid */
148331
+ id: string;
148332
+ /** @enum {string} */
148333
+ status: "open" | "ambiguous" | "matched" | "dismissed" | "cancelled";
148334
+ /** @enum {string} */
148335
+ vendor: "dentalink" | "medilink" | "reservo";
148336
+ vendor_label: string;
148337
+ /** @enum {string} */
148338
+ provider: "mercadopago";
148339
+ /** @description The Mercado Pago payment number. */
148340
+ provider_reference: string;
148341
+ provider_payment_url: string;
148342
+ /** Format: uuid */
148343
+ customer_payment_id: string;
148344
+ /** Format: uuid */
148345
+ contact_id: string | null;
148346
+ amount_clp: number;
148347
+ paid_on: string;
148348
+ patient: {
148349
+ /** Format: uuid */
148350
+ id: string;
148351
+ name: string;
148352
+ rut: string | null;
148353
+ } | null;
148354
+ concept: {
148355
+ kind: string;
148356
+ label: string;
148357
+ appointment_starts_at: string | null;
148358
+ } | null;
148359
+ medio: {
148360
+ code: string | null;
148361
+ label: string;
148362
+ };
148363
+ matched: {
148364
+ /** Format: uuid */
148365
+ mirror_payment_id: string;
148366
+ /** @description The practice system's own pago number. */
148367
+ vendor_reference: string;
148368
+ received_on: string | null;
148369
+ amount_clp: number;
148370
+ medio: string | null;
148371
+ voided: boolean;
148372
+ /** @enum {string} */
148373
+ by: "auto_unique" | "auto_medio" | "auto_reference" | "staff";
148374
+ at: string;
148375
+ } | null;
148376
+ candidates: {
148377
+ /** Format: uuid */
148378
+ mirror_payment_id: string;
148379
+ /** @description The practice system's own pago number. */
148380
+ vendor_reference: string;
148381
+ received_on: string | null;
148382
+ amount_clp: number;
148383
+ medio: string | null;
148384
+ voided: boolean;
148385
+ }[];
148386
+ /** @enum {string|null} */
148387
+ dismissed_reason: "registered_elsewhere" | "not_needed" | null;
148388
+ overdue: boolean;
148389
+ reminded_at: string | null;
148390
+ created_at: string;
148391
+ };
148392
+ PaymentRegistrationSettings: {
148393
+ /** @enum {string|null} */
148394
+ vendor: "dentalink" | "medilink" | "reservo" | null;
148395
+ vendor_label: string | null;
148396
+ mercadopago_medio: string | null;
148397
+ suggested_medio: string | null;
148398
+ medios: {
148399
+ code: string;
148400
+ label: string;
148401
+ active: boolean;
148402
+ }[];
148403
+ reminder_business_days: number;
148404
+ };
147356
148405
  BankFeedSources: {
147357
148406
  email: {
147358
148407
  /** @enum {boolean} */