@vitrina/api 15.15.0 → 15.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -88356,6 +88356,180 @@ interface paths {
88356
88356
  };
88357
88357
  trace?: never;
88358
88358
  };
88359
+ "/finanzas/produccion": {
88360
+ parameters: {
88361
+ query?: never;
88362
+ header?: never;
88363
+ path?: never;
88364
+ cookie?: never;
88365
+ };
88366
+ /**
88367
+ * Producción, cobrado y boleteado (clinics)
88368
+ * @description The clinic’s bridge per month and for the range: **producción** (treatments performed), **cobrado** (patient payments received) and **boleteado** (boletas DTE 39/41 issued, at totals, minus notas de crédito on boletas), with **por cobrar** (produced, not paid) and **anticipos** (paid, not produced) per patient, so that producción − por cobrar + anticipos = cobrado; the range column nets per patient. Clinic money authority: a clinic mirrored from Dentalink/Medilink reads producción and cobrado only from the mirror (`source: clinic_mirror`), otherwise from Vitrina’s registers; bank movements are never income. Boletas are checked against payments both ways (`payments_without_boleta`, `boletas_without_payment`): first the link the clinic system holds, then a boleta to the payment’s own patient, then a monthly summary boleta (to the generic receiver 66.666.666-6 or to nobody, named by no payment) covers its month’s remaining payments (`monthly_boletas`). `ingresos_resultado_clp` is the Resultado’s income for the same months, to read next to it. A caller without the patient roster sees «Paciente A. P.» and no RUT. Other verticals answer `is_clinic: false` with empty figures. Requires the `finanzas` add-on — without it every Finanzas operation answers `402 ENTITLEMENT_NOT_ACTIVE` (`details.required = ["finanzas"]`). Requires `finanzas_reports:read`.
88369
+ */
88370
+ get: {
88371
+ parameters: {
88372
+ query?: {
88373
+ from?: string;
88374
+ to?: string;
88375
+ limit?: number;
88376
+ };
88377
+ header?: never;
88378
+ path?: never;
88379
+ cookie?: never;
88380
+ };
88381
+ requestBody?: never;
88382
+ responses: {
88383
+ /** @description The bridge */
88384
+ 200: {
88385
+ headers: {
88386
+ [name: string]: unknown;
88387
+ };
88388
+ content: {
88389
+ /**
88390
+ * @example {
88391
+ * "data": {
88392
+ * "from": "2026-10",
88393
+ * "to": "2026-10",
88394
+ * "current_month": "2026-11",
88395
+ * "currency": "CLP",
88396
+ * "is_clinic": true,
88397
+ * "source": "clinic_mirror",
88398
+ * "boletas_source": "finanzas",
88399
+ * "months": [
88400
+ * {
88401
+ * "month": "2026-10",
88402
+ * "label": "octubre 2026",
88403
+ * "proforma": false,
88404
+ * "produccion_clp": 61340000,
88405
+ * "cobrado_clp": 58204222,
88406
+ * "boleteado_clp": 57726146,
88407
+ * "por_cobrar_clp": 4955778,
88408
+ * "anticipos_clp": 1820000,
88409
+ * "cobrado_sin_boleta_clp": 478076,
88410
+ * "boletas_sin_pago_clp": 0,
88411
+ * "ingresos_resultado_clp": 57726146
88412
+ * }
88413
+ * ],
88414
+ * "total": {
88415
+ * "produccion_clp": 61340000,
88416
+ * "cobrado_clp": 58204222,
88417
+ * "boleteado_clp": 57726146,
88418
+ * "por_cobrar_clp": 4955778,
88419
+ * "anticipos_clp": 1820000,
88420
+ * "cobrado_sin_boleta_clp": 478076,
88421
+ * "boletas_sin_pago_clp": 0,
88422
+ * "ingresos_resultado_clp": 57726146
88423
+ * },
88424
+ * "payments_without_boleta": {
88425
+ * "count": 3,
88426
+ * "total_clp": 478076,
88427
+ * "items": [
88428
+ * {
88429
+ * "payment_id": "0190a3c2-5d1e-7b6a-9f20-4c1d2e3f7101",
88430
+ * "source": "clinic_mirror",
88431
+ * "day": "2026-10-31",
88432
+ * "amount_clp": 250000,
88433
+ * "without_boleta_clp": 250000,
88434
+ * "reason": "sin_boleta",
88435
+ * "folios": [],
88436
+ * "patient": {
88437
+ * "id": "0190a3c2-5d1e-7b6a-9f20-4c1d2e3f7301",
88438
+ * "name": "Paciente A. P.",
88439
+ * "rut": null
88440
+ * }
88441
+ * }
88442
+ * ]
88443
+ * },
88444
+ * "boletas_without_payment": {
88445
+ * "count": 0,
88446
+ * "total_clp": 0,
88447
+ * "items": []
88448
+ * },
88449
+ * "monthly_boletas": [
88450
+ * {
88451
+ * "document_id": "0190a3c2-5d1e-7b6a-9f20-4c1d2e3f7201",
88452
+ * "dte_type": 41,
88453
+ * "folio": "1204",
88454
+ * "day": "2026-10-31",
88455
+ * "month": "2026-10",
88456
+ * "total_clp": 57726146,
88457
+ * "covered_clp": 57726146,
88458
+ * "payments": 412
88459
+ * }
88460
+ * ]
88461
+ * }
88462
+ * }
88463
+ */
88464
+ "application/json": {
88465
+ data: components["schemas"]["FinanzasPuente"];
88466
+ };
88467
+ };
88468
+ };
88469
+ /** @description Validation error */
88470
+ 400: {
88471
+ headers: {
88472
+ [name: string]: unknown;
88473
+ };
88474
+ content: {
88475
+ "application/json": components["schemas"]["Error"];
88476
+ };
88477
+ };
88478
+ /** @description Unauthorized */
88479
+ 401: {
88480
+ headers: {
88481
+ [name: string]: unknown;
88482
+ };
88483
+ content: {
88484
+ "application/json": components["schemas"]["Error"];
88485
+ };
88486
+ };
88487
+ /** @description Forbidden */
88488
+ 403: {
88489
+ headers: {
88490
+ [name: string]: unknown;
88491
+ };
88492
+ content: {
88493
+ "application/json": components["schemas"]["Error"];
88494
+ };
88495
+ };
88496
+ /** @description Not found */
88497
+ 404: {
88498
+ headers: {
88499
+ [name: string]: unknown;
88500
+ };
88501
+ content: {
88502
+ "application/json": components["schemas"]["Error"];
88503
+ };
88504
+ };
88505
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
88506
+ 409: {
88507
+ headers: {
88508
+ [name: string]: unknown;
88509
+ };
88510
+ content: {
88511
+ "application/json": components["schemas"]["Error"];
88512
+ };
88513
+ };
88514
+ /** @description Rate limited */
88515
+ 429: {
88516
+ headers: {
88517
+ [name: string]: unknown;
88518
+ };
88519
+ content: {
88520
+ "application/json": components["schemas"]["Error"];
88521
+ };
88522
+ };
88523
+ };
88524
+ };
88525
+ put?: never;
88526
+ post?: never;
88527
+ delete?: never;
88528
+ options?: never;
88529
+ head?: never;
88530
+ patch?: never;
88531
+ trace?: never;
88532
+ };
88359
88533
  "/clinic/evidence-cards": {
88360
88534
  parameters: {
88361
88535
  query?: never;
@@ -229644,7 +229818,7 @@ interface paths {
229644
229818
  get: {
229645
229819
  parameters: {
229646
229820
  query?: {
229647
- status?: ("draft" | "pending_payment" | "paid" | "preparing" | "shipped" | "delivered" | "cancelled" | "refunded")[];
229821
+ status?: ("draft" | "pending_payment" | "paid" | "preparing" | "ready_for_pickup" | "shipped" | "delivered" | "cancelled" | "refunded")[];
229648
229822
  source?: ("native" | "shopify" | "woocommerce")[];
229649
229823
  contact_id?: string;
229650
229824
  conversation_id?: string;
@@ -229691,6 +229865,7 @@ interface paths {
229691
229865
  * "item_count": 2,
229692
229866
  * "stock_decremented_at": null,
229693
229867
  * "paid_at": null,
229868
+ * "ready_for_pickup_at": null,
229694
229869
  * "shipped_at": null,
229695
229870
  * "delivered_at": null,
229696
229871
  * "cancelled_at": null,
@@ -229950,6 +230125,7 @@ interface paths {
229950
230125
  * "item_count": 2,
229951
230126
  * "stock_decremented_at": null,
229952
230127
  * "paid_at": null,
230128
+ * "ready_for_pickup_at": null,
229953
230129
  * "shipped_at": null,
229954
230130
  * "delivered_at": null,
229955
230131
  * "cancelled_at": null,
@@ -230091,7 +230267,7 @@ interface paths {
230091
230267
  };
230092
230268
  /**
230093
230269
  * Get an order
230094
- * @description One order with its lines, by uuid or display id (`O-42`). `status` is the order’s lifecycle; whether money arrived is the ledger’s (`GET /obligations?group_id=…`). Requires `orders:read`.
230270
+ * @description One order with its lines and the buyer emails it sent (`buyer_emails`: kind, status, sent_at), by uuid or display id (`O-42`). `status` is the order’s lifecycle; whether money arrived is the ledger’s (`GET /obligations?group_id=…`). Requires `orders:read`.
230095
230271
  */
230096
230272
  get: {
230097
230273
  parameters: {
@@ -230118,7 +230294,7 @@ interface paths {
230118
230294
  * "display_id": "O-42",
230119
230295
  * "source": "native",
230120
230296
  * "external_id": null,
230121
- * "status": "pending_payment",
230297
+ * "status": "paid",
230122
230298
  * "contact_id": "0199e3b0-0000-7000-8000-0000000000c1",
230123
230299
  * "conversation_id": "0199e3b0-0000-7000-8000-0000000000c2",
230124
230300
  * "lead_id": "0199e3b0-0000-7000-8000-0000000000c3",
@@ -230136,6 +230312,7 @@ interface paths {
230136
230312
  * "item_count": 2,
230137
230313
  * "stock_decremented_at": null,
230138
230314
  * "paid_at": null,
230315
+ * "ready_for_pickup_at": null,
230139
230316
  * "shipped_at": null,
230140
230317
  * "delivered_at": null,
230141
230318
  * "cancelled_at": null,
@@ -230197,12 +230374,24 @@ interface paths {
230197
230374
  * "line_total_clp": 20000,
230198
230375
  * "obligation_id": "0199e3b0-0000-7000-8000-0000000000a2"
230199
230376
  * }
230377
+ * ],
230378
+ * "buyer_emails": [
230379
+ * {
230380
+ * "kind": "order_confirmed",
230381
+ * "status": "delivered",
230382
+ * "to": "comprador@example.com",
230383
+ * "sent_at": "2026-10-31T14:02:11.000Z",
230384
+ * "delivered_at": "2026-10-31T14:02:13.000Z",
230385
+ * "failed_at": null,
230386
+ * "attempts": 1,
230387
+ * "created_at": "2026-10-31T14:02:10.000Z"
230388
+ * }
230200
230389
  * ]
230201
230390
  * }
230202
230391
  * }
230203
230392
  */
230204
230393
  "application/json": {
230205
- data: components["schemas"]["CommerceOrder"];
230394
+ data: components["schemas"]["CommerceOrderDetail"];
230206
230395
  };
230207
230396
  };
230208
230397
  };
@@ -230329,6 +230518,7 @@ interface paths {
230329
230518
  * "item_count": 2,
230330
230519
  * "stock_decremented_at": null,
230331
230520
  * "paid_at": null,
230521
+ * "ready_for_pickup_at": null,
230332
230522
  * "shipped_at": null,
230333
230523
  * "delivered_at": null,
230334
230524
  * "cancelled_at": null,
@@ -230596,7 +230786,7 @@ interface paths {
230596
230786
  put?: never;
230597
230787
  /**
230598
230788
  * Move a paid order along fulfilment
230599
- * @description `paid → preparing → shipped → delivered`; a step may be skipped (paid → shipped). An unpaid order answers 409 `invalid_transition`. The lead follows on an `ecommerce_orders` board (Despachado, Postventa). Fires `order.status_changed`. Requires `orders:write`.
230789
+ * @description Courier: `paid → preparing → shipped → delivered`. Pickup: `paid → preparing → ready_for_pickup → delivered` («Listo para retiro»). A step may be skipped (paid → shipped, paid → delivered). An unpaid order answers 409 `invalid_transition`; `ready_for_pickup` on a courier order 409 `not_a_pickup_order`; `shipped` on a pickup order 409 `pickup_order_not_shipped`. A storefront buyer is emailed once per step (ready_for_pickup, shipped, delivered; the confirmation goes out when it is paid), and a failed email never fails the move. The lead follows on an `ecommerce_orders` board (Despachado, Postventa). Fires `order.status_changed`. Requires `orders:write`.
230600
230790
  */
230601
230791
  post: {
230602
230792
  parameters: {
@@ -230619,10 +230809,10 @@ interface paths {
230619
230809
  */
230620
230810
  "application/json": {
230621
230811
  /**
230622
- * @description The next fulfilment step. A paid order may skip steps (paid → shipped).
230812
+ * @description The next fulfilment step. A paid order may skip steps (paid → shipped). `ready_for_pickup` («Listo para retiro») only for `delivery.method = pickup` (else 409 `not_a_pickup_order`); a pickup order is never `shipped` (409 `pickup_order_not_shipped`). Each of paid, ready_for_pickup, shipped and delivered emails a storefront buyer once.
230623
230813
  * @enum {string}
230624
230814
  */
230625
- status: "preparing" | "shipped" | "delivered";
230815
+ status: "preparing" | "ready_for_pickup" | "shipped" | "delivered";
230626
230816
  };
230627
230817
  };
230628
230818
  };
@@ -230659,6 +230849,7 @@ interface paths {
230659
230849
  * "item_count": 2,
230660
230850
  * "stock_decremented_at": null,
230661
230851
  * "paid_at": null,
230852
+ * "ready_for_pickup_at": null,
230662
230853
  * "shipped_at": null,
230663
230854
  * "delivered_at": null,
230664
230855
  * "cancelled_at": null,
@@ -230862,6 +231053,7 @@ interface paths {
230862
231053
  * "item_count": 2,
230863
231054
  * "stock_decremented_at": null,
230864
231055
  * "paid_at": null,
231056
+ * "ready_for_pickup_at": null,
230865
231057
  * "shipped_at": null,
230866
231058
  * "delivered_at": null,
230867
231059
  * "cancelled_at": "2026-10-15T12:30:00.000Z",
@@ -231069,6 +231261,7 @@ interface paths {
231069
231261
  * "item_count": 2,
231070
231262
  * "stock_decremented_at": null,
231071
231263
  * "paid_at": "2026-10-15T12:05:00.000Z",
231264
+ * "ready_for_pickup_at": null,
231072
231265
  * "shipped_at": null,
231073
231266
  * "delivered_at": null,
231074
231267
  * "cancelled_at": null,
@@ -258762,6 +258955,109 @@ interface components {
258762
258955
  updated_by: string | null;
258763
258956
  updated_at: string | null;
258764
258957
  };
258958
+ FinanzasPuente: {
258959
+ from: string;
258960
+ to: string;
258961
+ current_month: string;
258962
+ /** @enum {string} */
258963
+ currency: "CLP";
258964
+ is_clinic: boolean;
258965
+ /**
258966
+ * @description Where producción and cobrado come from: the clinic system mirror (Dentalink/Medilink) or Vitrina’s own registers. Never both.
258967
+ * @enum {string|null}
258968
+ */
258969
+ source: "clinic_mirror" | "vitrina" | null;
258970
+ /** @enum {string} */
258971
+ boletas_source: "finanzas" | "clinic_register" | "none";
258972
+ months: {
258973
+ month: string;
258974
+ label: string;
258975
+ proforma: boolean;
258976
+ /** @description Treatments performed (the clinic system’s value). */
258977
+ produccion_clp: number;
258978
+ /** @description Patient payments received. */
258979
+ cobrado_clp: number;
258980
+ /** @description Boletas issued (DTE 39/41, at totals), minus notas de crédito on boletas. */
258981
+ boleteado_clp: number;
258982
+ /** @description Produced and not paid in the period, per patient. */
258983
+ por_cobrar_clp: number;
258984
+ /** @description Paid and not produced in the period, per patient. */
258985
+ anticipos_clp: number;
258986
+ cobrado_sin_boleta_clp: number;
258987
+ boletas_sin_pago_clp: number;
258988
+ /** @description The Resultado’s «Ingresos» (issued documents, net) for the same months. */
258989
+ ingresos_resultado_clp: number;
258990
+ }[];
258991
+ /** @description The range, netted per patient. */
258992
+ total: {
258993
+ /** @description Treatments performed (the clinic system’s value). */
258994
+ produccion_clp: number;
258995
+ /** @description Patient payments received. */
258996
+ cobrado_clp: number;
258997
+ /** @description Boletas issued (DTE 39/41, at totals), minus notas de crédito on boletas. */
258998
+ boleteado_clp: number;
258999
+ /** @description Produced and not paid in the period, per patient. */
259000
+ por_cobrar_clp: number;
259001
+ /** @description Paid and not produced in the period, per patient. */
259002
+ anticipos_clp: number;
259003
+ cobrado_sin_boleta_clp: number;
259004
+ boletas_sin_pago_clp: number;
259005
+ /** @description The Resultado’s «Ingresos» (issued documents, net) for the same months. */
259006
+ ingresos_resultado_clp: number;
259007
+ };
259008
+ payments_without_boleta: {
259009
+ count: number;
259010
+ total_clp: number;
259011
+ items: {
259012
+ /** Format: uuid */
259013
+ payment_id: string;
259014
+ /** @enum {string} */
259015
+ source: "clinic_mirror" | "vitrina";
259016
+ day: string;
259017
+ amount_clp: number;
259018
+ without_boleta_clp: number;
259019
+ /** @enum {string} */
259020
+ reason: "sin_boleta" | "boleta_no_encontrada";
259021
+ folios: string[];
259022
+ patient: {
259023
+ /** Format: uuid */
259024
+ id: string;
259025
+ /** @description Full name; «Paciente A. P.» for a caller without the patient roster. */
259026
+ name: string;
259027
+ rut: string | null;
259028
+ } | null;
259029
+ }[];
259030
+ };
259031
+ boletas_without_payment: {
259032
+ count: number;
259033
+ total_clp: number;
259034
+ items: {
259035
+ document_id: string;
259036
+ dte_type: number | null;
259037
+ folio: string | null;
259038
+ day: string;
259039
+ total_clp: number;
259040
+ without_payment_clp: number;
259041
+ receiver: {
259042
+ name: string | null;
259043
+ rut: string | null;
259044
+ /** Format: uuid */
259045
+ patient_id: string | null;
259046
+ };
259047
+ monthly_summary: boolean;
259048
+ }[];
259049
+ };
259050
+ monthly_boletas: {
259051
+ document_id: string;
259052
+ dte_type: number | null;
259053
+ folio: string | null;
259054
+ day: string;
259055
+ month: string;
259056
+ total_clp: number;
259057
+ covered_clp: number;
259058
+ payments: number;
259059
+ }[];
259060
+ };
258765
259061
  ClinicImportedBalanceBudget: {
258766
259062
  /** Format: uuid */
258767
259063
  budget_id: string;
@@ -267652,7 +267948,7 @@ interface components {
267652
267948
  order_id: string;
267653
267949
  display_id: string;
267654
267950
  /** @enum {string} */
267655
- status: "draft" | "pending_payment" | "paid" | "preparing" | "shipped" | "delivered" | "cancelled" | "refunded";
267951
+ status: "draft" | "pending_payment" | "paid" | "preparing" | "ready_for_pickup" | "shipped" | "delivered" | "cancelled" | "refunded";
267656
267952
  total_clp: number;
267657
267953
  currency: string;
267658
267954
  lines: {
@@ -267742,7 +268038,120 @@ interface components {
267742
268038
  /** @description A store order: the store's modification time as of the last applied store event. */
267743
268039
  external_updated_at: string | null;
267744
268040
  /** @enum {string} */
267745
- status: "draft" | "pending_payment" | "paid" | "preparing" | "shipped" | "delivered" | "cancelled" | "refunded";
268041
+ status: "draft" | "pending_payment" | "paid" | "preparing" | "ready_for_pickup" | "shipped" | "delivered" | "cancelled" | "refunded";
268042
+ /** Format: uuid */
268043
+ contact_id: string | null;
268044
+ /** Format: uuid */
268045
+ conversation_id: string | null;
268046
+ /** Format: uuid */
268047
+ lead_id: string | null;
268048
+ /** Format: uuid */
268049
+ obligation_group_id: string | null;
268050
+ currency: string;
268051
+ delivery: {
268052
+ [key: string]: unknown;
268053
+ };
268054
+ notes: string | null;
268055
+ /** @description What the order charges for delivery (a courier quote frozen at checkout, `delivery.method = shipping`). Included in `total_clp`. */
268056
+ shipping_clp: number;
268057
+ /** @description Σ of the lines + `shipping_clp`. */
268058
+ total_clp: number;
268059
+ item_count: number;
268060
+ stock_decremented_at: string | null;
268061
+ paid_at: string | null;
268062
+ /** @description A pickup order: when the store marked it ready («Listo para retiro»), first time. */
268063
+ ready_for_pickup_at: string | null;
268064
+ shipped_at: string | null;
268065
+ delivered_at: string | null;
268066
+ cancelled_at: string | null;
268067
+ cancelled_reason: string | null;
268068
+ /** @description When a paid order was refunded in full (`status: refunded`). */
268069
+ refunded_at: string | null;
268070
+ refund_reason: string | null;
268071
+ /** @description The payment provider refund id (Mercado Pago refund id, or the Webpay refund authorization code), when returned. */
268072
+ refund_reference: string | null;
268073
+ /** @description A storefront checkout’s buyer as declared at purchase (`POST /orders/checkout`). `{}` for orders created by staff or the agent: the contact is the buyer. */
268074
+ buyer: {
268075
+ name?: string | null;
268076
+ rut?: string | null;
268077
+ phone?: string | null;
268078
+ email?: string | null;
268079
+ };
268080
+ /** @description A storefront checkout’s ad touch (utm_*, fbclid, gclid, anonymous_id, fbp, fbc). `{}` otherwise. */
268081
+ attribution: {
268082
+ [key: string]: string;
268083
+ };
268084
+ /** @description A storefront checkout’s browser InitiateCheckout `eventID` (the server InitiateCheckout and Purchase reuse it). Null otherwise. */
268085
+ client_event_id: string | null;
268086
+ /** @description A storefront checkout’s return pages. Null = the Vitrina receipt page. */
268087
+ return_urls: {
268088
+ success: string;
268089
+ failure: string;
268090
+ pending: string;
268091
+ } | null;
268092
+ /** Format: uuid */
268093
+ created_by: string | null;
268094
+ created_at: string;
268095
+ updated_at: string;
268096
+ lines: {
268097
+ /** Format: uuid */
268098
+ id: string;
268099
+ position: number;
268100
+ /** Format: uuid */
268101
+ product_id: string | null;
268102
+ /** Format: uuid */
268103
+ variant_id: string | null;
268104
+ title: string;
268105
+ variant_title: string | null;
268106
+ /** @description The variant’s option values frozen at creation (`[{name: "Color", value: "Negro"}]`). Empty for a simple product and for lines created before 2026-10-29. */
268107
+ variant_options: {
268108
+ name: string;
268109
+ value: string;
268110
+ }[];
268111
+ sku: string | null;
268112
+ unit_price_clp: number;
268113
+ quantity: number;
268114
+ line_total_clp: number;
268115
+ /** Format: uuid */
268116
+ obligation_id: string | null;
268117
+ }[];
268118
+ };
268119
+ OrderBuyerEmail: {
268120
+ /**
268121
+ * @description Which step: order_confirmed (paid), ready_for_pickup, shipped, delivered.
268122
+ * @enum {string}
268123
+ */
268124
+ kind: "order_confirmed" | "ready_for_pickup" | "shipped" | "delivered";
268125
+ /**
268126
+ * @description `pending` while sending; `sent` accepted by the mail provider; `delivered` the buyer’s server took it; `failed` not sent (retried while attempts remain); `bounced` / `complained` reported back by the provider.
268127
+ * @enum {string}
268128
+ */
268129
+ status: "pending" | "sent" | "delivered" | "failed" | "bounced" | "complained";
268130
+ /** @description The buyer address it went to. */
268131
+ to: string;
268132
+ sent_at: string | null;
268133
+ delivered_at: string | null;
268134
+ failed_at: string | null;
268135
+ attempts: number;
268136
+ created_at: string;
268137
+ };
268138
+ CommerceOrderDetail: {
268139
+ /** Format: uuid */
268140
+ id: string;
268141
+ /** Format: uuid */
268142
+ tenant_id: string;
268143
+ display_id: string;
268144
+ /** @enum {string} */
268145
+ source: "native" | "shopify" | "woocommerce";
268146
+ external_id: string | null;
268147
+ /** @description A store order: the number the store shows (it can differ from `external_id`). Null for a native order. */
268148
+ external_number: string | null;
268149
+ /** @description A store order: the store's own payment page, where the buyer pays with the store's gateways. Null for a native order. */
268150
+ store_payment_url: string | null;
268151
+ /** @description A store order: the store's modification time as of the last applied store event. */
268152
+ external_updated_at: string | null;
268153
+ /** @enum {string} */
268154
+ status: "draft" | "pending_payment" | "paid" | "preparing" | "ready_for_pickup" | "shipped" | "delivered" | "cancelled" | "refunded";
267746
268155
  /** Format: uuid */
267747
268156
  contact_id: string | null;
267748
268157
  /** Format: uuid */
@@ -267763,6 +268172,8 @@ interface components {
267763
268172
  item_count: number;
267764
268173
  stock_decremented_at: string | null;
267765
268174
  paid_at: string | null;
268175
+ /** @description A pickup order: when the store marked it ready («Listo para retiro»), first time. */
268176
+ ready_for_pickup_at: string | null;
267766
268177
  shipped_at: string | null;
267767
268178
  delivered_at: string | null;
267768
268179
  cancelled_at: string | null;
@@ -267817,6 +268228,8 @@ interface components {
267817
268228
  /** Format: uuid */
267818
268229
  obligation_id: string | null;
267819
268230
  }[];
268231
+ /** @description The emails this order’s storefront buyer got, oldest first (#6270): at most one per kind. `[]` for orders without a buyer email (staff/agent orders hear in their conversation). Only on `GET /orders/{id}`. */
268232
+ buyer_emails: components["schemas"]["OrderBuyerEmail"][];
267820
268233
  };
267821
268234
  OrderRefundResult: {
267822
268235
  order: components["schemas"]["CommerceOrder"];
package/dist/index.d.ts CHANGED
@@ -88356,6 +88356,180 @@ interface paths {
88356
88356
  };
88357
88357
  trace?: never;
88358
88358
  };
88359
+ "/finanzas/produccion": {
88360
+ parameters: {
88361
+ query?: never;
88362
+ header?: never;
88363
+ path?: never;
88364
+ cookie?: never;
88365
+ };
88366
+ /**
88367
+ * Producción, cobrado y boleteado (clinics)
88368
+ * @description The clinic’s bridge per month and for the range: **producción** (treatments performed), **cobrado** (patient payments received) and **boleteado** (boletas DTE 39/41 issued, at totals, minus notas de crédito on boletas), with **por cobrar** (produced, not paid) and **anticipos** (paid, not produced) per patient, so that producción − por cobrar + anticipos = cobrado; the range column nets per patient. Clinic money authority: a clinic mirrored from Dentalink/Medilink reads producción and cobrado only from the mirror (`source: clinic_mirror`), otherwise from Vitrina’s registers; bank movements are never income. Boletas are checked against payments both ways (`payments_without_boleta`, `boletas_without_payment`): first the link the clinic system holds, then a boleta to the payment’s own patient, then a monthly summary boleta (to the generic receiver 66.666.666-6 or to nobody, named by no payment) covers its month’s remaining payments (`monthly_boletas`). `ingresos_resultado_clp` is the Resultado’s income for the same months, to read next to it. A caller without the patient roster sees «Paciente A. P.» and no RUT. Other verticals answer `is_clinic: false` with empty figures. Requires the `finanzas` add-on — without it every Finanzas operation answers `402 ENTITLEMENT_NOT_ACTIVE` (`details.required = ["finanzas"]`). Requires `finanzas_reports:read`.
88369
+ */
88370
+ get: {
88371
+ parameters: {
88372
+ query?: {
88373
+ from?: string;
88374
+ to?: string;
88375
+ limit?: number;
88376
+ };
88377
+ header?: never;
88378
+ path?: never;
88379
+ cookie?: never;
88380
+ };
88381
+ requestBody?: never;
88382
+ responses: {
88383
+ /** @description The bridge */
88384
+ 200: {
88385
+ headers: {
88386
+ [name: string]: unknown;
88387
+ };
88388
+ content: {
88389
+ /**
88390
+ * @example {
88391
+ * "data": {
88392
+ * "from": "2026-10",
88393
+ * "to": "2026-10",
88394
+ * "current_month": "2026-11",
88395
+ * "currency": "CLP",
88396
+ * "is_clinic": true,
88397
+ * "source": "clinic_mirror",
88398
+ * "boletas_source": "finanzas",
88399
+ * "months": [
88400
+ * {
88401
+ * "month": "2026-10",
88402
+ * "label": "octubre 2026",
88403
+ * "proforma": false,
88404
+ * "produccion_clp": 61340000,
88405
+ * "cobrado_clp": 58204222,
88406
+ * "boleteado_clp": 57726146,
88407
+ * "por_cobrar_clp": 4955778,
88408
+ * "anticipos_clp": 1820000,
88409
+ * "cobrado_sin_boleta_clp": 478076,
88410
+ * "boletas_sin_pago_clp": 0,
88411
+ * "ingresos_resultado_clp": 57726146
88412
+ * }
88413
+ * ],
88414
+ * "total": {
88415
+ * "produccion_clp": 61340000,
88416
+ * "cobrado_clp": 58204222,
88417
+ * "boleteado_clp": 57726146,
88418
+ * "por_cobrar_clp": 4955778,
88419
+ * "anticipos_clp": 1820000,
88420
+ * "cobrado_sin_boleta_clp": 478076,
88421
+ * "boletas_sin_pago_clp": 0,
88422
+ * "ingresos_resultado_clp": 57726146
88423
+ * },
88424
+ * "payments_without_boleta": {
88425
+ * "count": 3,
88426
+ * "total_clp": 478076,
88427
+ * "items": [
88428
+ * {
88429
+ * "payment_id": "0190a3c2-5d1e-7b6a-9f20-4c1d2e3f7101",
88430
+ * "source": "clinic_mirror",
88431
+ * "day": "2026-10-31",
88432
+ * "amount_clp": 250000,
88433
+ * "without_boleta_clp": 250000,
88434
+ * "reason": "sin_boleta",
88435
+ * "folios": [],
88436
+ * "patient": {
88437
+ * "id": "0190a3c2-5d1e-7b6a-9f20-4c1d2e3f7301",
88438
+ * "name": "Paciente A. P.",
88439
+ * "rut": null
88440
+ * }
88441
+ * }
88442
+ * ]
88443
+ * },
88444
+ * "boletas_without_payment": {
88445
+ * "count": 0,
88446
+ * "total_clp": 0,
88447
+ * "items": []
88448
+ * },
88449
+ * "monthly_boletas": [
88450
+ * {
88451
+ * "document_id": "0190a3c2-5d1e-7b6a-9f20-4c1d2e3f7201",
88452
+ * "dte_type": 41,
88453
+ * "folio": "1204",
88454
+ * "day": "2026-10-31",
88455
+ * "month": "2026-10",
88456
+ * "total_clp": 57726146,
88457
+ * "covered_clp": 57726146,
88458
+ * "payments": 412
88459
+ * }
88460
+ * ]
88461
+ * }
88462
+ * }
88463
+ */
88464
+ "application/json": {
88465
+ data: components["schemas"]["FinanzasPuente"];
88466
+ };
88467
+ };
88468
+ };
88469
+ /** @description Validation error */
88470
+ 400: {
88471
+ headers: {
88472
+ [name: string]: unknown;
88473
+ };
88474
+ content: {
88475
+ "application/json": components["schemas"]["Error"];
88476
+ };
88477
+ };
88478
+ /** @description Unauthorized */
88479
+ 401: {
88480
+ headers: {
88481
+ [name: string]: unknown;
88482
+ };
88483
+ content: {
88484
+ "application/json": components["schemas"]["Error"];
88485
+ };
88486
+ };
88487
+ /** @description Forbidden */
88488
+ 403: {
88489
+ headers: {
88490
+ [name: string]: unknown;
88491
+ };
88492
+ content: {
88493
+ "application/json": components["schemas"]["Error"];
88494
+ };
88495
+ };
88496
+ /** @description Not found */
88497
+ 404: {
88498
+ headers: {
88499
+ [name: string]: unknown;
88500
+ };
88501
+ content: {
88502
+ "application/json": components["schemas"]["Error"];
88503
+ };
88504
+ };
88505
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
88506
+ 409: {
88507
+ headers: {
88508
+ [name: string]: unknown;
88509
+ };
88510
+ content: {
88511
+ "application/json": components["schemas"]["Error"];
88512
+ };
88513
+ };
88514
+ /** @description Rate limited */
88515
+ 429: {
88516
+ headers: {
88517
+ [name: string]: unknown;
88518
+ };
88519
+ content: {
88520
+ "application/json": components["schemas"]["Error"];
88521
+ };
88522
+ };
88523
+ };
88524
+ };
88525
+ put?: never;
88526
+ post?: never;
88527
+ delete?: never;
88528
+ options?: never;
88529
+ head?: never;
88530
+ patch?: never;
88531
+ trace?: never;
88532
+ };
88359
88533
  "/clinic/evidence-cards": {
88360
88534
  parameters: {
88361
88535
  query?: never;
@@ -229644,7 +229818,7 @@ interface paths {
229644
229818
  get: {
229645
229819
  parameters: {
229646
229820
  query?: {
229647
- status?: ("draft" | "pending_payment" | "paid" | "preparing" | "shipped" | "delivered" | "cancelled" | "refunded")[];
229821
+ status?: ("draft" | "pending_payment" | "paid" | "preparing" | "ready_for_pickup" | "shipped" | "delivered" | "cancelled" | "refunded")[];
229648
229822
  source?: ("native" | "shopify" | "woocommerce")[];
229649
229823
  contact_id?: string;
229650
229824
  conversation_id?: string;
@@ -229691,6 +229865,7 @@ interface paths {
229691
229865
  * "item_count": 2,
229692
229866
  * "stock_decremented_at": null,
229693
229867
  * "paid_at": null,
229868
+ * "ready_for_pickup_at": null,
229694
229869
  * "shipped_at": null,
229695
229870
  * "delivered_at": null,
229696
229871
  * "cancelled_at": null,
@@ -229950,6 +230125,7 @@ interface paths {
229950
230125
  * "item_count": 2,
229951
230126
  * "stock_decremented_at": null,
229952
230127
  * "paid_at": null,
230128
+ * "ready_for_pickup_at": null,
229953
230129
  * "shipped_at": null,
229954
230130
  * "delivered_at": null,
229955
230131
  * "cancelled_at": null,
@@ -230091,7 +230267,7 @@ interface paths {
230091
230267
  };
230092
230268
  /**
230093
230269
  * Get an order
230094
- * @description One order with its lines, by uuid or display id (`O-42`). `status` is the order’s lifecycle; whether money arrived is the ledger’s (`GET /obligations?group_id=…`). Requires `orders:read`.
230270
+ * @description One order with its lines and the buyer emails it sent (`buyer_emails`: kind, status, sent_at), by uuid or display id (`O-42`). `status` is the order’s lifecycle; whether money arrived is the ledger’s (`GET /obligations?group_id=…`). Requires `orders:read`.
230095
230271
  */
230096
230272
  get: {
230097
230273
  parameters: {
@@ -230118,7 +230294,7 @@ interface paths {
230118
230294
  * "display_id": "O-42",
230119
230295
  * "source": "native",
230120
230296
  * "external_id": null,
230121
- * "status": "pending_payment",
230297
+ * "status": "paid",
230122
230298
  * "contact_id": "0199e3b0-0000-7000-8000-0000000000c1",
230123
230299
  * "conversation_id": "0199e3b0-0000-7000-8000-0000000000c2",
230124
230300
  * "lead_id": "0199e3b0-0000-7000-8000-0000000000c3",
@@ -230136,6 +230312,7 @@ interface paths {
230136
230312
  * "item_count": 2,
230137
230313
  * "stock_decremented_at": null,
230138
230314
  * "paid_at": null,
230315
+ * "ready_for_pickup_at": null,
230139
230316
  * "shipped_at": null,
230140
230317
  * "delivered_at": null,
230141
230318
  * "cancelled_at": null,
@@ -230197,12 +230374,24 @@ interface paths {
230197
230374
  * "line_total_clp": 20000,
230198
230375
  * "obligation_id": "0199e3b0-0000-7000-8000-0000000000a2"
230199
230376
  * }
230377
+ * ],
230378
+ * "buyer_emails": [
230379
+ * {
230380
+ * "kind": "order_confirmed",
230381
+ * "status": "delivered",
230382
+ * "to": "comprador@example.com",
230383
+ * "sent_at": "2026-10-31T14:02:11.000Z",
230384
+ * "delivered_at": "2026-10-31T14:02:13.000Z",
230385
+ * "failed_at": null,
230386
+ * "attempts": 1,
230387
+ * "created_at": "2026-10-31T14:02:10.000Z"
230388
+ * }
230200
230389
  * ]
230201
230390
  * }
230202
230391
  * }
230203
230392
  */
230204
230393
  "application/json": {
230205
- data: components["schemas"]["CommerceOrder"];
230394
+ data: components["schemas"]["CommerceOrderDetail"];
230206
230395
  };
230207
230396
  };
230208
230397
  };
@@ -230329,6 +230518,7 @@ interface paths {
230329
230518
  * "item_count": 2,
230330
230519
  * "stock_decremented_at": null,
230331
230520
  * "paid_at": null,
230521
+ * "ready_for_pickup_at": null,
230332
230522
  * "shipped_at": null,
230333
230523
  * "delivered_at": null,
230334
230524
  * "cancelled_at": null,
@@ -230596,7 +230786,7 @@ interface paths {
230596
230786
  put?: never;
230597
230787
  /**
230598
230788
  * Move a paid order along fulfilment
230599
- * @description `paid → preparing → shipped → delivered`; a step may be skipped (paid → shipped). An unpaid order answers 409 `invalid_transition`. The lead follows on an `ecommerce_orders` board (Despachado, Postventa). Fires `order.status_changed`. Requires `orders:write`.
230789
+ * @description Courier: `paid → preparing → shipped → delivered`. Pickup: `paid → preparing → ready_for_pickup → delivered` («Listo para retiro»). A step may be skipped (paid → shipped, paid → delivered). An unpaid order answers 409 `invalid_transition`; `ready_for_pickup` on a courier order 409 `not_a_pickup_order`; `shipped` on a pickup order 409 `pickup_order_not_shipped`. A storefront buyer is emailed once per step (ready_for_pickup, shipped, delivered; the confirmation goes out when it is paid), and a failed email never fails the move. The lead follows on an `ecommerce_orders` board (Despachado, Postventa). Fires `order.status_changed`. Requires `orders:write`.
230600
230790
  */
230601
230791
  post: {
230602
230792
  parameters: {
@@ -230619,10 +230809,10 @@ interface paths {
230619
230809
  */
230620
230810
  "application/json": {
230621
230811
  /**
230622
- * @description The next fulfilment step. A paid order may skip steps (paid → shipped).
230812
+ * @description The next fulfilment step. A paid order may skip steps (paid → shipped). `ready_for_pickup` («Listo para retiro») only for `delivery.method = pickup` (else 409 `not_a_pickup_order`); a pickup order is never `shipped` (409 `pickup_order_not_shipped`). Each of paid, ready_for_pickup, shipped and delivered emails a storefront buyer once.
230623
230813
  * @enum {string}
230624
230814
  */
230625
- status: "preparing" | "shipped" | "delivered";
230815
+ status: "preparing" | "ready_for_pickup" | "shipped" | "delivered";
230626
230816
  };
230627
230817
  };
230628
230818
  };
@@ -230659,6 +230849,7 @@ interface paths {
230659
230849
  * "item_count": 2,
230660
230850
  * "stock_decremented_at": null,
230661
230851
  * "paid_at": null,
230852
+ * "ready_for_pickup_at": null,
230662
230853
  * "shipped_at": null,
230663
230854
  * "delivered_at": null,
230664
230855
  * "cancelled_at": null,
@@ -230862,6 +231053,7 @@ interface paths {
230862
231053
  * "item_count": 2,
230863
231054
  * "stock_decremented_at": null,
230864
231055
  * "paid_at": null,
231056
+ * "ready_for_pickup_at": null,
230865
231057
  * "shipped_at": null,
230866
231058
  * "delivered_at": null,
230867
231059
  * "cancelled_at": "2026-10-15T12:30:00.000Z",
@@ -231069,6 +231261,7 @@ interface paths {
231069
231261
  * "item_count": 2,
231070
231262
  * "stock_decremented_at": null,
231071
231263
  * "paid_at": "2026-10-15T12:05:00.000Z",
231264
+ * "ready_for_pickup_at": null,
231072
231265
  * "shipped_at": null,
231073
231266
  * "delivered_at": null,
231074
231267
  * "cancelled_at": null,
@@ -258762,6 +258955,109 @@ interface components {
258762
258955
  updated_by: string | null;
258763
258956
  updated_at: string | null;
258764
258957
  };
258958
+ FinanzasPuente: {
258959
+ from: string;
258960
+ to: string;
258961
+ current_month: string;
258962
+ /** @enum {string} */
258963
+ currency: "CLP";
258964
+ is_clinic: boolean;
258965
+ /**
258966
+ * @description Where producción and cobrado come from: the clinic system mirror (Dentalink/Medilink) or Vitrina’s own registers. Never both.
258967
+ * @enum {string|null}
258968
+ */
258969
+ source: "clinic_mirror" | "vitrina" | null;
258970
+ /** @enum {string} */
258971
+ boletas_source: "finanzas" | "clinic_register" | "none";
258972
+ months: {
258973
+ month: string;
258974
+ label: string;
258975
+ proforma: boolean;
258976
+ /** @description Treatments performed (the clinic system’s value). */
258977
+ produccion_clp: number;
258978
+ /** @description Patient payments received. */
258979
+ cobrado_clp: number;
258980
+ /** @description Boletas issued (DTE 39/41, at totals), minus notas de crédito on boletas. */
258981
+ boleteado_clp: number;
258982
+ /** @description Produced and not paid in the period, per patient. */
258983
+ por_cobrar_clp: number;
258984
+ /** @description Paid and not produced in the period, per patient. */
258985
+ anticipos_clp: number;
258986
+ cobrado_sin_boleta_clp: number;
258987
+ boletas_sin_pago_clp: number;
258988
+ /** @description The Resultado’s «Ingresos» (issued documents, net) for the same months. */
258989
+ ingresos_resultado_clp: number;
258990
+ }[];
258991
+ /** @description The range, netted per patient. */
258992
+ total: {
258993
+ /** @description Treatments performed (the clinic system’s value). */
258994
+ produccion_clp: number;
258995
+ /** @description Patient payments received. */
258996
+ cobrado_clp: number;
258997
+ /** @description Boletas issued (DTE 39/41, at totals), minus notas de crédito on boletas. */
258998
+ boleteado_clp: number;
258999
+ /** @description Produced and not paid in the period, per patient. */
259000
+ por_cobrar_clp: number;
259001
+ /** @description Paid and not produced in the period, per patient. */
259002
+ anticipos_clp: number;
259003
+ cobrado_sin_boleta_clp: number;
259004
+ boletas_sin_pago_clp: number;
259005
+ /** @description The Resultado’s «Ingresos» (issued documents, net) for the same months. */
259006
+ ingresos_resultado_clp: number;
259007
+ };
259008
+ payments_without_boleta: {
259009
+ count: number;
259010
+ total_clp: number;
259011
+ items: {
259012
+ /** Format: uuid */
259013
+ payment_id: string;
259014
+ /** @enum {string} */
259015
+ source: "clinic_mirror" | "vitrina";
259016
+ day: string;
259017
+ amount_clp: number;
259018
+ without_boleta_clp: number;
259019
+ /** @enum {string} */
259020
+ reason: "sin_boleta" | "boleta_no_encontrada";
259021
+ folios: string[];
259022
+ patient: {
259023
+ /** Format: uuid */
259024
+ id: string;
259025
+ /** @description Full name; «Paciente A. P.» for a caller without the patient roster. */
259026
+ name: string;
259027
+ rut: string | null;
259028
+ } | null;
259029
+ }[];
259030
+ };
259031
+ boletas_without_payment: {
259032
+ count: number;
259033
+ total_clp: number;
259034
+ items: {
259035
+ document_id: string;
259036
+ dte_type: number | null;
259037
+ folio: string | null;
259038
+ day: string;
259039
+ total_clp: number;
259040
+ without_payment_clp: number;
259041
+ receiver: {
259042
+ name: string | null;
259043
+ rut: string | null;
259044
+ /** Format: uuid */
259045
+ patient_id: string | null;
259046
+ };
259047
+ monthly_summary: boolean;
259048
+ }[];
259049
+ };
259050
+ monthly_boletas: {
259051
+ document_id: string;
259052
+ dte_type: number | null;
259053
+ folio: string | null;
259054
+ day: string;
259055
+ month: string;
259056
+ total_clp: number;
259057
+ covered_clp: number;
259058
+ payments: number;
259059
+ }[];
259060
+ };
258765
259061
  ClinicImportedBalanceBudget: {
258766
259062
  /** Format: uuid */
258767
259063
  budget_id: string;
@@ -267652,7 +267948,7 @@ interface components {
267652
267948
  order_id: string;
267653
267949
  display_id: string;
267654
267950
  /** @enum {string} */
267655
- status: "draft" | "pending_payment" | "paid" | "preparing" | "shipped" | "delivered" | "cancelled" | "refunded";
267951
+ status: "draft" | "pending_payment" | "paid" | "preparing" | "ready_for_pickup" | "shipped" | "delivered" | "cancelled" | "refunded";
267656
267952
  total_clp: number;
267657
267953
  currency: string;
267658
267954
  lines: {
@@ -267742,7 +268038,120 @@ interface components {
267742
268038
  /** @description A store order: the store's modification time as of the last applied store event. */
267743
268039
  external_updated_at: string | null;
267744
268040
  /** @enum {string} */
267745
- status: "draft" | "pending_payment" | "paid" | "preparing" | "shipped" | "delivered" | "cancelled" | "refunded";
268041
+ status: "draft" | "pending_payment" | "paid" | "preparing" | "ready_for_pickup" | "shipped" | "delivered" | "cancelled" | "refunded";
268042
+ /** Format: uuid */
268043
+ contact_id: string | null;
268044
+ /** Format: uuid */
268045
+ conversation_id: string | null;
268046
+ /** Format: uuid */
268047
+ lead_id: string | null;
268048
+ /** Format: uuid */
268049
+ obligation_group_id: string | null;
268050
+ currency: string;
268051
+ delivery: {
268052
+ [key: string]: unknown;
268053
+ };
268054
+ notes: string | null;
268055
+ /** @description What the order charges for delivery (a courier quote frozen at checkout, `delivery.method = shipping`). Included in `total_clp`. */
268056
+ shipping_clp: number;
268057
+ /** @description Σ of the lines + `shipping_clp`. */
268058
+ total_clp: number;
268059
+ item_count: number;
268060
+ stock_decremented_at: string | null;
268061
+ paid_at: string | null;
268062
+ /** @description A pickup order: when the store marked it ready («Listo para retiro»), first time. */
268063
+ ready_for_pickup_at: string | null;
268064
+ shipped_at: string | null;
268065
+ delivered_at: string | null;
268066
+ cancelled_at: string | null;
268067
+ cancelled_reason: string | null;
268068
+ /** @description When a paid order was refunded in full (`status: refunded`). */
268069
+ refunded_at: string | null;
268070
+ refund_reason: string | null;
268071
+ /** @description The payment provider refund id (Mercado Pago refund id, or the Webpay refund authorization code), when returned. */
268072
+ refund_reference: string | null;
268073
+ /** @description A storefront checkout’s buyer as declared at purchase (`POST /orders/checkout`). `{}` for orders created by staff or the agent: the contact is the buyer. */
268074
+ buyer: {
268075
+ name?: string | null;
268076
+ rut?: string | null;
268077
+ phone?: string | null;
268078
+ email?: string | null;
268079
+ };
268080
+ /** @description A storefront checkout’s ad touch (utm_*, fbclid, gclid, anonymous_id, fbp, fbc). `{}` otherwise. */
268081
+ attribution: {
268082
+ [key: string]: string;
268083
+ };
268084
+ /** @description A storefront checkout’s browser InitiateCheckout `eventID` (the server InitiateCheckout and Purchase reuse it). Null otherwise. */
268085
+ client_event_id: string | null;
268086
+ /** @description A storefront checkout’s return pages. Null = the Vitrina receipt page. */
268087
+ return_urls: {
268088
+ success: string;
268089
+ failure: string;
268090
+ pending: string;
268091
+ } | null;
268092
+ /** Format: uuid */
268093
+ created_by: string | null;
268094
+ created_at: string;
268095
+ updated_at: string;
268096
+ lines: {
268097
+ /** Format: uuid */
268098
+ id: string;
268099
+ position: number;
268100
+ /** Format: uuid */
268101
+ product_id: string | null;
268102
+ /** Format: uuid */
268103
+ variant_id: string | null;
268104
+ title: string;
268105
+ variant_title: string | null;
268106
+ /** @description The variant’s option values frozen at creation (`[{name: "Color", value: "Negro"}]`). Empty for a simple product and for lines created before 2026-10-29. */
268107
+ variant_options: {
268108
+ name: string;
268109
+ value: string;
268110
+ }[];
268111
+ sku: string | null;
268112
+ unit_price_clp: number;
268113
+ quantity: number;
268114
+ line_total_clp: number;
268115
+ /** Format: uuid */
268116
+ obligation_id: string | null;
268117
+ }[];
268118
+ };
268119
+ OrderBuyerEmail: {
268120
+ /**
268121
+ * @description Which step: order_confirmed (paid), ready_for_pickup, shipped, delivered.
268122
+ * @enum {string}
268123
+ */
268124
+ kind: "order_confirmed" | "ready_for_pickup" | "shipped" | "delivered";
268125
+ /**
268126
+ * @description `pending` while sending; `sent` accepted by the mail provider; `delivered` the buyer’s server took it; `failed` not sent (retried while attempts remain); `bounced` / `complained` reported back by the provider.
268127
+ * @enum {string}
268128
+ */
268129
+ status: "pending" | "sent" | "delivered" | "failed" | "bounced" | "complained";
268130
+ /** @description The buyer address it went to. */
268131
+ to: string;
268132
+ sent_at: string | null;
268133
+ delivered_at: string | null;
268134
+ failed_at: string | null;
268135
+ attempts: number;
268136
+ created_at: string;
268137
+ };
268138
+ CommerceOrderDetail: {
268139
+ /** Format: uuid */
268140
+ id: string;
268141
+ /** Format: uuid */
268142
+ tenant_id: string;
268143
+ display_id: string;
268144
+ /** @enum {string} */
268145
+ source: "native" | "shopify" | "woocommerce";
268146
+ external_id: string | null;
268147
+ /** @description A store order: the number the store shows (it can differ from `external_id`). Null for a native order. */
268148
+ external_number: string | null;
268149
+ /** @description A store order: the store's own payment page, where the buyer pays with the store's gateways. Null for a native order. */
268150
+ store_payment_url: string | null;
268151
+ /** @description A store order: the store's modification time as of the last applied store event. */
268152
+ external_updated_at: string | null;
268153
+ /** @enum {string} */
268154
+ status: "draft" | "pending_payment" | "paid" | "preparing" | "ready_for_pickup" | "shipped" | "delivered" | "cancelled" | "refunded";
267746
268155
  /** Format: uuid */
267747
268156
  contact_id: string | null;
267748
268157
  /** Format: uuid */
@@ -267763,6 +268172,8 @@ interface components {
267763
268172
  item_count: number;
267764
268173
  stock_decremented_at: string | null;
267765
268174
  paid_at: string | null;
268175
+ /** @description A pickup order: when the store marked it ready («Listo para retiro»), first time. */
268176
+ ready_for_pickup_at: string | null;
267766
268177
  shipped_at: string | null;
267767
268178
  delivered_at: string | null;
267768
268179
  cancelled_at: string | null;
@@ -267817,6 +268228,8 @@ interface components {
267817
268228
  /** Format: uuid */
267818
268229
  obligation_id: string | null;
267819
268230
  }[];
268231
+ /** @description The emails this order’s storefront buyer got, oldest first (#6270): at most one per kind. `[]` for orders without a buyer email (staff/agent orders hear in their conversation). Only on `GET /orders/{id}`. */
268232
+ buyer_emails: components["schemas"]["OrderBuyerEmail"][];
267820
268233
  };
267821
268234
  OrderRefundResult: {
267822
268235
  order: components["schemas"]["CommerceOrder"];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitrina/api",
3
- "version": "15.15.0",
3
+ "version": "15.16.0",
4
4
  "description": "Typed TypeScript SDK for the Vitrina API pública — generated from the committed openapi.public.json (ADR 0106).",
5
5
  "type": "module",
6
6
  "license": "MIT",