@vitrina/api 14.66.0 → 14.71.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 +941 -211
  2. package/dist/index.d.ts +941 -211
  3. package/package.json +1 -1
package/dist/index.d.cts CHANGED
@@ -6028,6 +6028,7 @@ interface paths {
6028
6028
  * "slug": "generic-sales",
6029
6029
  * "kind": "sales",
6030
6030
  * "is_fallback": true,
6031
+ * "direction": "sell_to_customer",
6031
6032
  * "template_key": "generic_sales",
6032
6033
  * "template_version": 1,
6033
6034
  * "template_locale": "es",
@@ -6043,6 +6044,7 @@ interface paths {
6043
6044
  * "slug": "generic-support",
6044
6045
  * "kind": "ticket",
6045
6046
  * "is_fallback": true,
6047
+ * "direction": "sell_to_customer",
6046
6048
  * "template_key": "generic_support",
6047
6049
  * "template_version": 1,
6048
6050
  * "template_locale": "es",
@@ -6123,7 +6125,7 @@ interface paths {
6123
6125
  put?: never;
6124
6126
  /**
6125
6127
  * Create pipeline
6126
- * @description Creates an EMPTY board — a board with no stages accepts no cards, so follow it with `POST /stages/bulk`, or start from a shipped template with `POST /pipeline-templates/{key}/apply` instead. A workspace holds exactly one FALLBACK board per kind — the board a card lands on when nobody named one. `is_fallback: true` promotes this board and demotes the current holder of that kind; `false` is ignored (promote the other board instead, so there is never a moment with no fallback).
6128
+ * @description Creates an EMPTY board — a board with no stages accepts no cards, so follow it with `POST /stages/bulk`, or start from a shipped template with `POST /pipeline-templates/{key}/apply` instead. A workspace holds exactly one FALLBACK board per kind — the board a card lands on when nobody named one. `is_fallback: true` promotes this board and demotes the current holder of that kind; `false` is ignored (promote the other board instead, so there is never a moment with no fallback). `direction` says who the board's customers are: `sell_to_customer` (we sell to the contact; the default) or `buy_from_customer` (we buy from, or consign for, the contact: acquisition, consignación, buyback). The conversation-driven stage mover picks its qualification questions from it; the board's name never decides it. Boards applied from a template take the template's direction.
6127
6129
  */
6128
6130
  post: {
6129
6131
  parameters: {
@@ -6157,6 +6159,8 @@ interface paths {
6157
6159
  kind?: "ticket" | "sales" | "vehicle";
6158
6160
  /** @default false */
6159
6161
  is_fallback?: boolean;
6162
+ /** @enum {string} */
6163
+ direction?: "sell_to_customer" | "buy_from_customer";
6160
6164
  };
6161
6165
  };
6162
6166
  };
@@ -6177,6 +6181,7 @@ interface paths {
6177
6181
  * "slug": "ventas-mayoristas",
6178
6182
  * "kind": "sales",
6179
6183
  * "is_fallback": false,
6184
+ * "direction": "sell_to_customer",
6180
6185
  * "template_key": null,
6181
6186
  * "template_version": null,
6182
6187
  * "template_locale": null,
@@ -6650,6 +6655,7 @@ interface paths {
6650
6655
  * "slug": "generic-sales",
6651
6656
  * "kind": "sales",
6652
6657
  * "is_fallback": true,
6658
+ * "direction": "sell_to_customer",
6653
6659
  * "template_key": "generic_sales",
6654
6660
  * "template_version": 1,
6655
6661
  * "template_locale": "es",
@@ -7080,6 +7086,7 @@ interface paths {
7080
7086
  * "slug": "generic-sales",
7081
7087
  * "kind": "sales",
7082
7088
  * "is_fallback": true,
7089
+ * "direction": "sell_to_customer",
7083
7090
  * "template_key": "generic_sales",
7084
7091
  * "template_version": 1,
7085
7092
  * "template_locale": "es",
@@ -7236,7 +7243,7 @@ interface paths {
7236
7243
  };
7237
7244
  /**
7238
7245
  * Update pipeline
7239
- * @description Only the fields present in the body are written. `kind` is editable only for a non-fallback, EMPTY board that is not the last of its kind — otherwise 409. A workspace holds exactly one FALLBACK board per kind — the board a card lands on when nobody named one. `is_fallback: true` promotes this board and demotes the current holder of that kind; `false` is ignored (promote the other board instead, so there is never a moment with no fallback).
7246
+ * @description Only the fields present in the body are written. `kind` is editable only for a non-fallback, EMPTY board that is not the last of its kind — otherwise 409. A workspace holds exactly one FALLBACK board per kind — the board a card lands on when nobody named one. `is_fallback: true` promotes this board and demotes the current holder of that kind; `false` is ignored (promote the other board instead, so there is never a moment with no fallback). `direction` says who the board's customers are: `sell_to_customer` (we sell to the contact; the default) or `buy_from_customer` (we buy from, or consign for, the contact: acquisition, consignación, buyback). The conversation-driven stage mover picks its qualification questions from it; the board's name never decides it. Boards applied from a template take the template's direction.
7240
7247
  */
7241
7248
  put: {
7242
7249
  parameters: {
@@ -7261,6 +7268,8 @@ interface paths {
7261
7268
  /** @enum {string} */
7262
7269
  kind?: "ticket" | "sales" | "vehicle";
7263
7270
  is_fallback?: boolean;
7271
+ /** @enum {string} */
7272
+ direction?: "sell_to_customer" | "buy_from_customer";
7264
7273
  /** Format: uuid */
7265
7274
  default_team_id?: string | null;
7266
7275
  };
@@ -7283,6 +7292,7 @@ interface paths {
7283
7292
  * "slug": "ventas-mayoristas",
7284
7293
  * "kind": "sales",
7285
7294
  * "is_fallback": false,
7295
+ * "direction": "sell_to_customer",
7286
7296
  * "template_key": null,
7287
7297
  * "template_version": null,
7288
7298
  * "template_locale": null,
@@ -17892,7 +17902,7 @@ interface paths {
17892
17902
  /** Format: uuid */
17893
17903
  responsible_user_id?: string | null;
17894
17904
  /**
17895
- * @description OPTIONAL. Marketplaces to publish this vehicle to right after it is saved — the same effect as a follow-up POST /vehicles/{id}/publish, in one call. Omitted or `[]` means save only and publish nowhere: there is no default and no tenant-level setting. Each entry is either a portal slug (`chileautos`, `chileautos_panel`, `linze`, `mercadolibre`, `yapo`) or a marketplace integration id (the `id` of a row from GET /marketplaces). A portal slug resolves to the connected account the workspace has for that portal, whichever transport it uses (`chileautos` reaches the certified API account or the `chileautos_panel` account). Every entry is validated BEFORE the vehicle is written, and any bad entry answers 422 with nothing saved: a slug with no connected account, a slug matching more than one account (pass the integration id instead), an id that is not one of this workspace's accounts, or a portal that does not accept this vehicle type. Entries resolving to the same account are deduplicated. A portal FAILING to publish never fails the save — see `publications` in the response. On PUT, `publish_to` only ADDS portals: a portal where the vehicle is already live or queued is a no-op (`already_published`), never a second ad, and a portal left out is NOT unpublished — removal is DELETE /vehicles/{id}/publications/{pubId}.
17905
+ * @description OPTIONAL. Marketplaces to publish this vehicle to right after it is saved — the same effect as a follow-up POST /vehicles/{id}/publish, in one call. Omitted or `[]` means save only and publish nowhere: there is no default and no tenant-level setting. Each entry is either a portal slug (`chileautos`, `chileautos_panel`, `linze`, `mercadolibre`, `veekls`, `yapo`) or a marketplace integration id (the `id` of a row from GET /marketplaces). A portal slug resolves to the connected account the workspace has for that portal, whichever transport it uses (`chileautos` reaches the certified API account or the `chileautos_panel` account). Every entry is validated BEFORE the vehicle is written, and any bad entry answers 422 with nothing saved: a slug with no connected account, a slug matching more than one account (pass the integration id instead), an id that is not one of this workspace's accounts, or a portal that does not accept this vehicle type. Entries resolving to the same account are deduplicated. A portal FAILING to publish never fails the save — see `publications` in the response. On PUT, `publish_to` only ADDS portals: a portal where the vehicle is already live or queued is a no-op (`already_published`), never a second ad, and a portal left out is NOT unpublished — removal is DELETE /vehicles/{id}/publications/{pubId}.
17896
17906
  * @example [
17897
17907
  * "chileautos",
17898
17908
  * "mercadolibre"
@@ -18544,7 +18554,7 @@ interface paths {
18544
18554
  /** Format: uuid */
18545
18555
  responsible_user_id?: string | null;
18546
18556
  /**
18547
- * @description OPTIONAL. Marketplaces to publish this vehicle to right after it is saved — the same effect as a follow-up POST /vehicles/{id}/publish, in one call. Omitted or `[]` means save only and publish nowhere: there is no default and no tenant-level setting. Each entry is either a portal slug (`chileautos`, `chileautos_panel`, `linze`, `mercadolibre`, `yapo`) or a marketplace integration id (the `id` of a row from GET /marketplaces). A portal slug resolves to the connected account the workspace has for that portal, whichever transport it uses (`chileautos` reaches the certified API account or the `chileautos_panel` account). Every entry is validated BEFORE the vehicle is written, and any bad entry answers 422 with nothing saved: a slug with no connected account, a slug matching more than one account (pass the integration id instead), an id that is not one of this workspace's accounts, or a portal that does not accept this vehicle type. Entries resolving to the same account are deduplicated. A portal FAILING to publish never fails the save — see `publications` in the response. On PUT, `publish_to` only ADDS portals: a portal where the vehicle is already live or queued is a no-op (`already_published`), never a second ad, and a portal left out is NOT unpublished — removal is DELETE /vehicles/{id}/publications/{pubId}.
18557
+ * @description OPTIONAL. Marketplaces to publish this vehicle to right after it is saved — the same effect as a follow-up POST /vehicles/{id}/publish, in one call. Omitted or `[]` means save only and publish nowhere: there is no default and no tenant-level setting. Each entry is either a portal slug (`chileautos`, `chileautos_panel`, `linze`, `mercadolibre`, `veekls`, `yapo`) or a marketplace integration id (the `id` of a row from GET /marketplaces). A portal slug resolves to the connected account the workspace has for that portal, whichever transport it uses (`chileautos` reaches the certified API account or the `chileautos_panel` account). Every entry is validated BEFORE the vehicle is written, and any bad entry answers 422 with nothing saved: a slug with no connected account, a slug matching more than one account (pass the integration id instead), an id that is not one of this workspace's accounts, or a portal that does not accept this vehicle type. Entries resolving to the same account are deduplicated. A portal FAILING to publish never fails the save — see `publications` in the response. On PUT, `publish_to` only ADDS portals: a portal where the vehicle is already live or queued is a no-op (`already_published`), never a second ad, and a portal left out is NOT unpublished — removal is DELETE /vehicles/{id}/publications/{pubId}.
18548
18558
  * @example [
18549
18559
  * "chileautos",
18550
18560
  * "mercadolibre"
@@ -18733,7 +18743,7 @@ interface paths {
18733
18743
  post?: never;
18734
18744
  /**
18735
18745
  * Delete a vehicle
18736
- * @description Soft-delete: the row and its history remain, `deleted_at` is stamped, and it drops out of every default list and out of the public stock API. Existing publications are NOT closed by this call — close ads first (`POST /vehicles/{id}/close-ads`) if the vehicle is live on any portal.
18746
+ * @description Soft-delete: the row and its history remain, `deleted_at` is stamped, and it drops out of every default list and out of the public stock API. Before the soft-delete it schedules the close of every live ad on every connected portal (the same retry-backed pipeline as `POST /vehicles/{id}/close-ads`). A vehicle a negocio holds (`reservado`, `vendido`, or carrying a live nota de venta) cannot be deleted: 409 with `details.code: "vehicle_held_by_negocio"`. Deleting an already deleted vehicle is a 204 no-op.
18737
18747
  */
18738
18748
  delete: {
18739
18749
  parameters: {
@@ -21709,10 +21719,21 @@ interface paths {
21709
21719
  };
21710
21720
  /** Format: uuid */
21711
21721
  pipeline_id?: string;
21722
+ /** Format: uuid */
21723
+ stage_id?: string;
21712
21724
  value_amount?: number;
21713
21725
  value_currency?: string;
21714
21726
  item_label?: string;
21715
21727
  source_ref?: string;
21728
+ fields?: {
21729
+ label: string;
21730
+ value: string;
21731
+ }[];
21732
+ form_title?: string;
21733
+ highlight?: {
21734
+ label: string;
21735
+ value: string;
21736
+ };
21716
21737
  /** @enum {string} */
21717
21738
  intent?: "buy" | "sell" | "financing" | "trade_in";
21718
21739
  hp_website?: string;
@@ -43460,6 +43481,21 @@ interface paths {
43460
43481
  * "taken_at": "2026-09-18T16:40:00.000Z",
43461
43482
  * "hold_expires_on": "2026-09-25",
43462
43483
  * "keep_advertised": true,
43484
+ * "transfer_cost_clp": 217740,
43485
+ * "transfer_cost_lines": [
43486
+ * {
43487
+ * "kind": "transferencia_municipal",
43488
+ * "label": "Impuesto a la transferencia (1,5 %)",
43489
+ * "amount_clp": 178500,
43490
+ * "fee_effective_from": "1979-12-29"
43491
+ * },
43492
+ * {
43493
+ * "kind": "arancel_registro_civil",
43494
+ * "label": "Inscripción en el Registro Civil",
43495
+ * "amount_clp": 39240,
43496
+ * "fee_effective_from": "2026-04-01"
43497
+ * }
43498
+ * ],
43463
43499
  * "status": "activa",
43464
43500
  * "abono_disposition": null,
43465
43501
  * "abono_disposition_reason": null,
@@ -43542,178 +43578,840 @@ interface paths {
43542
43578
  };
43543
43579
  };
43544
43580
  put?: never;
43545
- /**
43546
- * Take a reservation
43547
- * @description Takes a hold on a unit — the ONLY thing on this wave that locks inventory (a cotización creates no hold). Born `activa`; there is no draft state and no `status` field to supply.
43548
- *
43549
- * `vehicle_id` and `holder_contact_id` are required and must belong to the calling workspace; a foreign id and a nonexistent one answer identically (404), deliberately, because a difference between them is an existence oracle.
43550
- *
43551
- * `hold_expires_on` is REQUIRED and has no default (BR-241, corrected): unlike a cotización, a reserva locks the unit and can take a non-refundable deposit, so every hold states its own term rather than inheriting a silent policy number. `agreed_price_clp`, omitted, copies the vehicle's current asking price (BR-242) — that is a real default, not zero. `keep_advertised`, omitted, keeps the column default `true` (the marketplace ads stay live); an explicit `false` is the per-reserva opt-out that retracts them through the existing cierre queue, and it is set-once — there is no endpoint to change it on a standing hold.
43552
- *
43553
- * **Exactly one ACTIVE hold per unit.** A second `take` on a unit that already has one is a **409**, enforced by a partial unique index so a race loses too. Unknown body keys are a **400**. Answers 201.
43554
- */
43555
- post: {
43556
- parameters: {
43557
- query?: never;
43558
- header?: {
43559
- /** @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. */
43560
- "Idempotency-Key"?: string;
43561
- };
43562
- path?: never;
43563
- cookie?: never;
43564
- };
43565
- requestBody?: {
43566
- content: {
43567
- /**
43568
- * @example {
43569
- * "vehicle_id": "e1e1e1e1-0000-4000-8000-000000000001",
43570
- * "holder_contact_id": "22222222-0000-4000-8000-000000000002",
43571
- * "salesperson_id": "11111111-0000-4000-8000-000000000001",
43572
- * "agreed_price_clp": 11900000,
43573
- * "hold_expires_on": "2026-09-25",
43574
- * "keep_advertised": true
43575
- * }
43576
- */
43577
- "application/json": {
43578
- /** Format: uuid */
43579
- vehicle_id: string;
43580
- /** Format: uuid */
43581
- holder_contact_id: string;
43582
- /** Format: uuid */
43583
- salesperson_id?: string | null;
43584
- agreed_price_clp?: number | null;
43585
- /** Format: date-time */
43586
- taken_at?: string | null;
43587
- hold_expires_on: string;
43588
- keep_advertised?: boolean;
43589
- };
43590
- };
43591
- };
43592
- responses: {
43593
- /** @description The reservation */
43594
- 201: {
43595
- headers: {
43596
- [name: string]: unknown;
43597
- };
43598
- content: {
43599
- /**
43600
- * @example {
43601
- * "data": {
43602
- * "id": "d3d3d3d3-0000-4000-8000-000000000001",
43603
- * "tenant_id": "a1a1a1a1-0000-4000-8000-000000000001",
43604
- * "display_id": "R-18",
43605
- * "display_seq": 18,
43606
- * "vehicle_id": "e1e1e1e1-0000-4000-8000-000000000001",
43607
- * "holder_contact_id": "22222222-0000-4000-8000-000000000002",
43608
- * "salesperson_id": "11111111-0000-4000-8000-000000000001",
43609
- * "agreed_price_clp": 11900000,
43610
- * "abono_expected_clp": 300000,
43611
- * "taken_at": "2026-09-18T16:40:00.000Z",
43612
- * "hold_expires_on": "2026-09-25",
43613
- * "keep_advertised": true,
43614
- * "status": "activa",
43615
- * "abono_disposition": null,
43616
- * "abono_disposition_reason": null,
43617
- * "abono_disposition_at": null,
43618
- * "abono_disposition_by": null,
43619
- * "voided_at": null,
43620
- * "void_reason": null,
43621
- * "voided_by": null,
43622
- * "created_at": "2026-09-18T16:40:00.000Z",
43623
- * "updated_at": "2026-09-18T16:40:00.000Z"
43624
- * }
43625
- * }
43626
- */
43627
- "application/json": {
43628
- data?: unknown;
43629
- };
43630
- };
43631
- };
43632
- /** @description Validation error */
43633
- 400: {
43634
- headers: {
43635
- [name: string]: unknown;
43636
- };
43637
- content: {
43638
- "application/json": components["schemas"]["Error"];
43639
- };
43640
- };
43641
- /** @description Unauthorized */
43642
- 401: {
43643
- headers: {
43644
- [name: string]: unknown;
43645
- };
43646
- content: {
43647
- "application/json": components["schemas"]["Error"];
43648
- };
43649
- };
43650
- /** @description Forbidden */
43651
- 403: {
43652
- headers: {
43653
- [name: string]: unknown;
43654
- };
43655
- content: {
43656
- "application/json": components["schemas"]["Error"];
43657
- };
43658
- };
43659
- /** @description Not found */
43660
- 404: {
43661
- headers: {
43662
- [name: string]: unknown;
43663
- };
43664
- content: {
43665
- "application/json": components["schemas"]["Error"];
43666
- };
43667
- };
43668
- /** @description Conflict (incl. Idempotency-Key reuse with different body) */
43669
- 409: {
43670
- headers: {
43671
- [name: string]: unknown;
43672
- };
43673
- content: {
43674
- "application/json": components["schemas"]["Error"];
43675
- };
43676
- };
43677
- /** @description Rate limited */
43678
- 429: {
43679
- headers: {
43680
- [name: string]: unknown;
43681
- };
43682
- content: {
43683
- "application/json": components["schemas"]["Error"];
43684
- };
43685
- };
43686
- };
43687
- };
43581
+ /**
43582
+ * Take a reservation
43583
+ * @description Takes a hold on a unit — the ONLY thing on this wave that locks inventory (a cotización creates no hold). Born `activa`; there is no draft state and no `status` field to supply.
43584
+ *
43585
+ * `vehicle_id` and `holder_contact_id` are required and must belong to the calling workspace; a foreign id and a nonexistent one answer identically (404), deliberately, because a difference between them is an existence oracle.
43586
+ *
43587
+ * `hold_expires_on` is REQUIRED and has no default (BR-241, corrected): unlike a cotización, a reserva locks the unit and can take a non-refundable deposit, so every hold states its own term rather than inheriting a silent policy number. `agreed_price_clp`, omitted, copies the vehicle's current asking price (BR-242) — that is a real default, not zero. `keep_advertised`, omitted, keeps the column default `true` (the marketplace ads stay live); an explicit `false` is the per-reserva opt-out that retracts them through the existing cierre queue, and it is set-once — there is no endpoint to change it on a standing hold.
43588
+ *
43589
+ * **Exactly one ACTIVE hold per unit.** A second `take` on a unit that already has one is a **409**, enforced by a partial unique index so a race loses too. Unknown body keys are a **400**. Answers 201.
43590
+ */
43591
+ post: {
43592
+ parameters: {
43593
+ query?: never;
43594
+ header?: {
43595
+ /** @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. */
43596
+ "Idempotency-Key"?: string;
43597
+ };
43598
+ path?: never;
43599
+ cookie?: never;
43600
+ };
43601
+ requestBody?: {
43602
+ content: {
43603
+ /**
43604
+ * @example {
43605
+ * "vehicle_id": "e1e1e1e1-0000-4000-8000-000000000001",
43606
+ * "holder_contact_id": "22222222-0000-4000-8000-000000000002",
43607
+ * "salesperson_id": "11111111-0000-4000-8000-000000000001",
43608
+ * "agreed_price_clp": 11900000,
43609
+ * "hold_expires_on": "2026-09-25",
43610
+ * "keep_advertised": true
43611
+ * }
43612
+ */
43613
+ "application/json": {
43614
+ /** Format: uuid */
43615
+ vehicle_id: string;
43616
+ /** Format: uuid */
43617
+ holder_contact_id: string;
43618
+ /** Format: uuid */
43619
+ salesperson_id?: string | null;
43620
+ agreed_price_clp?: number | null;
43621
+ /** Format: date-time */
43622
+ taken_at?: string | null;
43623
+ hold_expires_on: string;
43624
+ keep_advertised?: boolean;
43625
+ transfer_cost_clp?: number | null;
43626
+ transfer_cost_lines?: {
43627
+ /** @enum {string} */
43628
+ kind: "transferencia_municipal" | "arancel_registro_civil" | "notarial" | "inscripcion" | "soap" | "tag";
43629
+ label: string;
43630
+ amount_clp: number;
43631
+ fee_effective_from?: string | null;
43632
+ }[] | null;
43633
+ abono_expected_clp?: number | null;
43634
+ };
43635
+ };
43636
+ };
43637
+ responses: {
43638
+ /** @description The reservation */
43639
+ 201: {
43640
+ headers: {
43641
+ [name: string]: unknown;
43642
+ };
43643
+ content: {
43644
+ /**
43645
+ * @example {
43646
+ * "data": {
43647
+ * "id": "d3d3d3d3-0000-4000-8000-000000000001",
43648
+ * "tenant_id": "a1a1a1a1-0000-4000-8000-000000000001",
43649
+ * "display_id": "R-18",
43650
+ * "display_seq": 18,
43651
+ * "vehicle_id": "e1e1e1e1-0000-4000-8000-000000000001",
43652
+ * "holder_contact_id": "22222222-0000-4000-8000-000000000002",
43653
+ * "salesperson_id": "11111111-0000-4000-8000-000000000001",
43654
+ * "agreed_price_clp": 11900000,
43655
+ * "abono_expected_clp": 300000,
43656
+ * "taken_at": "2026-09-18T16:40:00.000Z",
43657
+ * "hold_expires_on": "2026-09-25",
43658
+ * "keep_advertised": true,
43659
+ * "transfer_cost_clp": 217740,
43660
+ * "transfer_cost_lines": [
43661
+ * {
43662
+ * "kind": "transferencia_municipal",
43663
+ * "label": "Impuesto a la transferencia (1,5 %)",
43664
+ * "amount_clp": 178500,
43665
+ * "fee_effective_from": "1979-12-29"
43666
+ * },
43667
+ * {
43668
+ * "kind": "arancel_registro_civil",
43669
+ * "label": "Inscripción en el Registro Civil",
43670
+ * "amount_clp": 39240,
43671
+ * "fee_effective_from": "2026-04-01"
43672
+ * }
43673
+ * ],
43674
+ * "status": "activa",
43675
+ * "abono_disposition": null,
43676
+ * "abono_disposition_reason": null,
43677
+ * "abono_disposition_at": null,
43678
+ * "abono_disposition_by": null,
43679
+ * "voided_at": null,
43680
+ * "void_reason": null,
43681
+ * "voided_by": null,
43682
+ * "created_at": "2026-09-18T16:40:00.000Z",
43683
+ * "updated_at": "2026-09-18T16:40:00.000Z"
43684
+ * }
43685
+ * }
43686
+ */
43687
+ "application/json": {
43688
+ data?: unknown;
43689
+ };
43690
+ };
43691
+ };
43692
+ /** @description Validation error */
43693
+ 400: {
43694
+ headers: {
43695
+ [name: string]: unknown;
43696
+ };
43697
+ content: {
43698
+ "application/json": components["schemas"]["Error"];
43699
+ };
43700
+ };
43701
+ /** @description Unauthorized */
43702
+ 401: {
43703
+ headers: {
43704
+ [name: string]: unknown;
43705
+ };
43706
+ content: {
43707
+ "application/json": components["schemas"]["Error"];
43708
+ };
43709
+ };
43710
+ /** @description Forbidden */
43711
+ 403: {
43712
+ headers: {
43713
+ [name: string]: unknown;
43714
+ };
43715
+ content: {
43716
+ "application/json": components["schemas"]["Error"];
43717
+ };
43718
+ };
43719
+ /** @description Not found */
43720
+ 404: {
43721
+ headers: {
43722
+ [name: string]: unknown;
43723
+ };
43724
+ content: {
43725
+ "application/json": components["schemas"]["Error"];
43726
+ };
43727
+ };
43728
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
43729
+ 409: {
43730
+ headers: {
43731
+ [name: string]: unknown;
43732
+ };
43733
+ content: {
43734
+ "application/json": components["schemas"]["Error"];
43735
+ };
43736
+ };
43737
+ /** @description Rate limited */
43738
+ 429: {
43739
+ headers: {
43740
+ [name: string]: unknown;
43741
+ };
43742
+ content: {
43743
+ "application/json": components["schemas"]["Error"];
43744
+ };
43745
+ };
43746
+ };
43747
+ };
43748
+ delete?: never;
43749
+ options?: never;
43750
+ head?: never;
43751
+ patch?: never;
43752
+ trace?: never;
43753
+ };
43754
+ "/reservations/{id}": {
43755
+ parameters: {
43756
+ query?: never;
43757
+ header?: never;
43758
+ path?: never;
43759
+ cookie?: never;
43760
+ };
43761
+ /**
43762
+ * Fetch one reservation, with its payments and totals
43763
+ * @description Accepts the UUID or the folio (`R-12`).
43764
+ */
43765
+ get: {
43766
+ parameters: {
43767
+ query?: never;
43768
+ header?: never;
43769
+ path: {
43770
+ id: string;
43771
+ };
43772
+ cookie?: never;
43773
+ };
43774
+ requestBody?: never;
43775
+ responses: {
43776
+ /** @description The reservation, its payments and totals */
43777
+ 200: {
43778
+ headers: {
43779
+ [name: string]: unknown;
43780
+ };
43781
+ content: {
43782
+ /**
43783
+ * @example {
43784
+ * "data": {
43785
+ * "id": "d3d3d3d3-0000-4000-8000-000000000001",
43786
+ * "tenant_id": "a1a1a1a1-0000-4000-8000-000000000001",
43787
+ * "display_id": "R-18",
43788
+ * "display_seq": 18,
43789
+ * "vehicle_id": "e1e1e1e1-0000-4000-8000-000000000001",
43790
+ * "holder_contact_id": "22222222-0000-4000-8000-000000000002",
43791
+ * "salesperson_id": "11111111-0000-4000-8000-000000000001",
43792
+ * "agreed_price_clp": 11900000,
43793
+ * "abono_expected_clp": 300000,
43794
+ * "taken_at": "2026-09-18T16:40:00.000Z",
43795
+ * "hold_expires_on": "2026-09-25",
43796
+ * "keep_advertised": true,
43797
+ * "transfer_cost_clp": 217740,
43798
+ * "transfer_cost_lines": [
43799
+ * {
43800
+ * "kind": "transferencia_municipal",
43801
+ * "label": "Impuesto a la transferencia (1,5 %)",
43802
+ * "amount_clp": 178500,
43803
+ * "fee_effective_from": "1979-12-29"
43804
+ * },
43805
+ * {
43806
+ * "kind": "arancel_registro_civil",
43807
+ * "label": "Inscripción en el Registro Civil",
43808
+ * "amount_clp": 39240,
43809
+ * "fee_effective_from": "2026-04-01"
43810
+ * }
43811
+ * ],
43812
+ * "status": "activa",
43813
+ * "abono_disposition": null,
43814
+ * "abono_disposition_reason": null,
43815
+ * "abono_disposition_at": null,
43816
+ * "abono_disposition_by": null,
43817
+ * "voided_at": null,
43818
+ * "void_reason": null,
43819
+ * "voided_by": null,
43820
+ * "created_at": "2026-09-18T16:40:00.000Z",
43821
+ * "updated_at": "2026-09-18T16:40:00.000Z",
43822
+ * "payments": [
43823
+ * {
43824
+ * "id": "d6d6d6d6-0000-4000-8000-000000000001",
43825
+ * "tenant_id": "a1a1a1a1-0000-4000-8000-000000000001",
43826
+ * "reservation_id": "d3d3d3d3-0000-4000-8000-000000000001",
43827
+ * "sale_note_id": null,
43828
+ * "carried_from_reservation_id": null,
43829
+ * "instrument": "transferencia",
43830
+ * "amount_clp": 300000,
43831
+ * "paid_on": "2026-09-18",
43832
+ * "bank": "Banco Estado",
43833
+ * "account_number": null,
43834
+ * "document_number": null,
43835
+ * "note": "abono al tomar la reserva",
43836
+ * "card_fee_bps": null,
43837
+ * "card_surcharge_clp": null,
43838
+ * "card_surcharge_source": null,
43839
+ * "created_at": "2026-09-18T16:41:02.000Z"
43840
+ * }
43841
+ * ],
43842
+ * "totals": {
43843
+ * "total_a_pagar_clp": 300000,
43844
+ * "total_pagos_clp": 300000,
43845
+ * "saldo_clp": 0,
43846
+ * "recargo_tarjeta_clp": 0,
43847
+ * "total_a_cobrar_clp": 300000,
43848
+ * "payment_count": 1,
43849
+ * "complete": true,
43850
+ * "gaps": []
43851
+ * },
43852
+ * "converted_to_sale_note": null,
43853
+ * "holder": {
43854
+ * "id": "22222222-0000-4000-8000-000000000002",
43855
+ * "name": "Ana Pérez Soto",
43856
+ * "tax_id": "19312475-5",
43857
+ * "email": "ana.perez@example.com",
43858
+ * "phone": "+56987654321",
43859
+ * "address_street": "Av. Ejemplo",
43860
+ * "address_number": "1234",
43861
+ * "address_unit": "Depto 56",
43862
+ * "comuna_code": "13123",
43863
+ * "comuna_name": "Providencia"
43864
+ * },
43865
+ * "sends": [
43866
+ * {
43867
+ * "channel": "email",
43868
+ * "to": "ana.perez@example.com",
43869
+ * "sent_at": "2026-09-18T16:45:10.000Z",
43870
+ * "by": "11111111-0000-4000-8000-000000000001"
43871
+ * }
43872
+ * ]
43873
+ * }
43874
+ * }
43875
+ */
43876
+ "application/json": {
43877
+ data?: unknown;
43878
+ meta?: {
43879
+ [key: string]: unknown;
43880
+ };
43881
+ };
43882
+ };
43883
+ };
43884
+ /** @description Validation error */
43885
+ 400: {
43886
+ headers: {
43887
+ [name: string]: unknown;
43888
+ };
43889
+ content: {
43890
+ "application/json": components["schemas"]["Error"];
43891
+ };
43892
+ };
43893
+ /** @description Unauthorized */
43894
+ 401: {
43895
+ headers: {
43896
+ [name: string]: unknown;
43897
+ };
43898
+ content: {
43899
+ "application/json": components["schemas"]["Error"];
43900
+ };
43901
+ };
43902
+ /** @description Forbidden */
43903
+ 403: {
43904
+ headers: {
43905
+ [name: string]: unknown;
43906
+ };
43907
+ content: {
43908
+ "application/json": components["schemas"]["Error"];
43909
+ };
43910
+ };
43911
+ /** @description Not found */
43912
+ 404: {
43913
+ headers: {
43914
+ [name: string]: unknown;
43915
+ };
43916
+ content: {
43917
+ "application/json": components["schemas"]["Error"];
43918
+ };
43919
+ };
43920
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
43921
+ 409: {
43922
+ headers: {
43923
+ [name: string]: unknown;
43924
+ };
43925
+ content: {
43926
+ "application/json": components["schemas"]["Error"];
43927
+ };
43928
+ };
43929
+ /** @description Rate limited */
43930
+ 429: {
43931
+ headers: {
43932
+ [name: string]: unknown;
43933
+ };
43934
+ content: {
43935
+ "application/json": components["schemas"]["Error"];
43936
+ };
43937
+ };
43938
+ };
43939
+ };
43940
+ put?: never;
43941
+ post?: never;
43942
+ delete?: never;
43943
+ options?: never;
43944
+ head?: never;
43945
+ /**
43946
+ * Edit a live reservation
43947
+ * @description Changes what a LIVE hold may change after it was taken: the transfer cost (`transfer_cost_clp` alone = a manual amount and clears the breakdown), the term (`hold_expires_on`, never a past day — it also moves the seña’s deadline), the advertising decision (`keep_advertised`, through the existing cierre queue) and the salesperson. Never the price, the holder or the unit. **409** once the hold is not `activa`. Unknown keys are a 400. Answers the same shape as `GET /reservations/{id}`.
43948
+ */
43949
+ patch: {
43950
+ parameters: {
43951
+ query?: never;
43952
+ header?: never;
43953
+ path: {
43954
+ id: string;
43955
+ };
43956
+ cookie?: never;
43957
+ };
43958
+ requestBody?: {
43959
+ content: {
43960
+ /**
43961
+ * @example {
43962
+ * "transfer_cost_clp": 250000,
43963
+ * "transfer_cost_lines": null,
43964
+ * "hold_expires_on": "2026-09-30"
43965
+ * }
43966
+ */
43967
+ "application/json": {
43968
+ transfer_cost_clp?: number | null;
43969
+ transfer_cost_lines?: {
43970
+ /** @enum {string} */
43971
+ kind: "transferencia_municipal" | "arancel_registro_civil" | "notarial" | "inscripcion" | "soap" | "tag";
43972
+ label: string;
43973
+ amount_clp: number;
43974
+ fee_effective_from?: string | null;
43975
+ }[] | null;
43976
+ hold_expires_on?: string;
43977
+ keep_advertised?: boolean;
43978
+ /** Format: uuid */
43979
+ salesperson_id?: string | null;
43980
+ };
43981
+ };
43982
+ };
43983
+ responses: {
43984
+ /** @description The reservation, its payments, holder and sends */
43985
+ 200: {
43986
+ headers: {
43987
+ [name: string]: unknown;
43988
+ };
43989
+ content: {
43990
+ /**
43991
+ * @example {
43992
+ * "data": {
43993
+ * "id": "d3d3d3d3-0000-4000-8000-000000000001",
43994
+ * "tenant_id": "a1a1a1a1-0000-4000-8000-000000000001",
43995
+ * "display_id": "R-18",
43996
+ * "display_seq": 18,
43997
+ * "vehicle_id": "e1e1e1e1-0000-4000-8000-000000000001",
43998
+ * "holder_contact_id": "22222222-0000-4000-8000-000000000002",
43999
+ * "salesperson_id": "11111111-0000-4000-8000-000000000001",
44000
+ * "agreed_price_clp": 11900000,
44001
+ * "abono_expected_clp": 300000,
44002
+ * "taken_at": "2026-09-18T16:40:00.000Z",
44003
+ * "hold_expires_on": "2026-09-25",
44004
+ * "keep_advertised": true,
44005
+ * "transfer_cost_clp": 217740,
44006
+ * "transfer_cost_lines": [
44007
+ * {
44008
+ * "kind": "transferencia_municipal",
44009
+ * "label": "Impuesto a la transferencia (1,5 %)",
44010
+ * "amount_clp": 178500,
44011
+ * "fee_effective_from": "1979-12-29"
44012
+ * },
44013
+ * {
44014
+ * "kind": "arancel_registro_civil",
44015
+ * "label": "Inscripción en el Registro Civil",
44016
+ * "amount_clp": 39240,
44017
+ * "fee_effective_from": "2026-04-01"
44018
+ * }
44019
+ * ],
44020
+ * "status": "activa",
44021
+ * "abono_disposition": null,
44022
+ * "abono_disposition_reason": null,
44023
+ * "abono_disposition_at": null,
44024
+ * "abono_disposition_by": null,
44025
+ * "voided_at": null,
44026
+ * "void_reason": null,
44027
+ * "voided_by": null,
44028
+ * "created_at": "2026-09-18T16:40:00.000Z",
44029
+ * "updated_at": "2026-09-18T16:40:00.000Z",
44030
+ * "payments": [
44031
+ * {
44032
+ * "id": "d6d6d6d6-0000-4000-8000-000000000001",
44033
+ * "tenant_id": "a1a1a1a1-0000-4000-8000-000000000001",
44034
+ * "reservation_id": "d3d3d3d3-0000-4000-8000-000000000001",
44035
+ * "sale_note_id": null,
44036
+ * "carried_from_reservation_id": null,
44037
+ * "instrument": "transferencia",
44038
+ * "amount_clp": 300000,
44039
+ * "paid_on": "2026-09-18",
44040
+ * "bank": "Banco Estado",
44041
+ * "account_number": null,
44042
+ * "document_number": null,
44043
+ * "note": "abono al tomar la reserva",
44044
+ * "card_fee_bps": null,
44045
+ * "card_surcharge_clp": null,
44046
+ * "card_surcharge_source": null,
44047
+ * "created_at": "2026-09-18T16:41:02.000Z"
44048
+ * }
44049
+ * ],
44050
+ * "totals": {
44051
+ * "total_a_pagar_clp": 300000,
44052
+ * "total_pagos_clp": 300000,
44053
+ * "saldo_clp": 0,
44054
+ * "recargo_tarjeta_clp": 0,
44055
+ * "total_a_cobrar_clp": 300000,
44056
+ * "payment_count": 1,
44057
+ * "complete": true,
44058
+ * "gaps": []
44059
+ * },
44060
+ * "converted_to_sale_note": null,
44061
+ * "holder": {
44062
+ * "id": "22222222-0000-4000-8000-000000000002",
44063
+ * "name": "Ana Pérez Soto",
44064
+ * "tax_id": "19312475-5",
44065
+ * "email": "ana.perez@example.com",
44066
+ * "phone": "+56987654321",
44067
+ * "address_street": "Av. Ejemplo",
44068
+ * "address_number": "1234",
44069
+ * "address_unit": "Depto 56",
44070
+ * "comuna_code": "13123",
44071
+ * "comuna_name": "Providencia"
44072
+ * },
44073
+ * "sends": [
44074
+ * {
44075
+ * "channel": "email",
44076
+ * "to": "ana.perez@example.com",
44077
+ * "sent_at": "2026-09-18T16:45:10.000Z",
44078
+ * "by": "11111111-0000-4000-8000-000000000001"
44079
+ * }
44080
+ * ]
44081
+ * }
44082
+ * }
44083
+ */
44084
+ "application/json": {
44085
+ data?: unknown;
44086
+ meta?: {
44087
+ [key: string]: unknown;
44088
+ };
44089
+ };
44090
+ };
44091
+ };
44092
+ /** @description Validation error */
44093
+ 400: {
44094
+ headers: {
44095
+ [name: string]: unknown;
44096
+ };
44097
+ content: {
44098
+ "application/json": components["schemas"]["Error"];
44099
+ };
44100
+ };
44101
+ /** @description Unauthorized */
44102
+ 401: {
44103
+ headers: {
44104
+ [name: string]: unknown;
44105
+ };
44106
+ content: {
44107
+ "application/json": components["schemas"]["Error"];
44108
+ };
44109
+ };
44110
+ /** @description Forbidden */
44111
+ 403: {
44112
+ headers: {
44113
+ [name: string]: unknown;
44114
+ };
44115
+ content: {
44116
+ "application/json": components["schemas"]["Error"];
44117
+ };
44118
+ };
44119
+ /** @description Not found */
44120
+ 404: {
44121
+ headers: {
44122
+ [name: string]: unknown;
44123
+ };
44124
+ content: {
44125
+ "application/json": components["schemas"]["Error"];
44126
+ };
44127
+ };
44128
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
44129
+ 409: {
44130
+ headers: {
44131
+ [name: string]: unknown;
44132
+ };
44133
+ content: {
44134
+ "application/json": components["schemas"]["Error"];
44135
+ };
44136
+ };
44137
+ /** @description Rate limited */
44138
+ 429: {
44139
+ headers: {
44140
+ [name: string]: unknown;
44141
+ };
44142
+ content: {
44143
+ "application/json": components["schemas"]["Error"];
44144
+ };
44145
+ };
44146
+ };
44147
+ };
44148
+ trace?: never;
44149
+ };
44150
+ "/reservations/transfer-cost-estimate": {
44151
+ parameters: {
44152
+ query?: never;
44153
+ header?: never;
44154
+ path?: never;
44155
+ cookie?: never;
44156
+ };
44157
+ /**
44158
+ * Estimate the transfer cost of a reserva
44159
+ * @description What the buyer would pay for the transfer of this unit at this price, today: the 1,5 % impuesto de transferencia (base = max(precio, tasación fiscal); the agreed price when the SII has no tasación for the model) plus the Registro Civil arancel in force. Computed by the statutory add-on machinery (`fee_schedule`), never a second fee table. Notaría is not included (no platform figure exists); `basis` says so. `agreed_price_clp` omitted = the vehicle’s asking price. Read-only.
44160
+ */
44161
+ get: {
44162
+ parameters: {
44163
+ query: {
44164
+ vehicle_id: string;
44165
+ agreed_price_clp?: number | null;
44166
+ };
44167
+ header?: never;
44168
+ path?: never;
44169
+ cookie?: never;
44170
+ };
44171
+ requestBody?: never;
44172
+ responses: {
44173
+ /** @description The estimate: total, lines and a Spanish basis sentence */
44174
+ 200: {
44175
+ headers: {
44176
+ [name: string]: unknown;
44177
+ };
44178
+ content: {
44179
+ /**
44180
+ * @example {
44181
+ * "data": {
44182
+ * "total_clp": 217740,
44183
+ * "lines": [
44184
+ * {
44185
+ * "kind": "transferencia_municipal",
44186
+ * "label": "Impuesto a la transferencia (1,5 %)",
44187
+ * "amount_clp": 178500,
44188
+ * "fee_effective_from": "1979-12-29"
44189
+ * },
44190
+ * {
44191
+ * "kind": "arancel_registro_civil",
44192
+ * "label": "Inscripción en el Registro Civil",
44193
+ * "amount_clp": 39240,
44194
+ * "fee_effective_from": "2026-04-01"
44195
+ * }
44196
+ * ],
44197
+ * "basis": "Estimado: 1,5 % sobre el mayor valor entre el precio acordado y la tasación fiscal + arancel vigente del Registro Civil. No incluye notaría; ajusta el monto si corresponde.",
44198
+ * "agreed_price_clp": 11900000
44199
+ * }
44200
+ * }
44201
+ */
44202
+ "application/json": {
44203
+ data?: unknown;
44204
+ meta?: {
44205
+ [key: string]: unknown;
44206
+ };
44207
+ };
44208
+ };
44209
+ };
44210
+ /** @description Validation error */
44211
+ 400: {
44212
+ headers: {
44213
+ [name: string]: unknown;
44214
+ };
44215
+ content: {
44216
+ "application/json": components["schemas"]["Error"];
44217
+ };
44218
+ };
44219
+ /** @description Unauthorized */
44220
+ 401: {
44221
+ headers: {
44222
+ [name: string]: unknown;
44223
+ };
44224
+ content: {
44225
+ "application/json": components["schemas"]["Error"];
44226
+ };
44227
+ };
44228
+ /** @description Forbidden */
44229
+ 403: {
44230
+ headers: {
44231
+ [name: string]: unknown;
44232
+ };
44233
+ content: {
44234
+ "application/json": components["schemas"]["Error"];
44235
+ };
44236
+ };
44237
+ /** @description Not found */
44238
+ 404: {
44239
+ headers: {
44240
+ [name: string]: unknown;
44241
+ };
44242
+ content: {
44243
+ "application/json": components["schemas"]["Error"];
44244
+ };
44245
+ };
44246
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
44247
+ 409: {
44248
+ headers: {
44249
+ [name: string]: unknown;
44250
+ };
44251
+ content: {
44252
+ "application/json": components["schemas"]["Error"];
44253
+ };
44254
+ };
44255
+ /** @description Rate limited */
44256
+ 429: {
44257
+ headers: {
44258
+ [name: string]: unknown;
44259
+ };
44260
+ content: {
44261
+ "application/json": components["schemas"]["Error"];
44262
+ };
44263
+ };
44264
+ };
44265
+ };
44266
+ put?: never;
44267
+ post?: never;
44268
+ delete?: never;
44269
+ options?: never;
44270
+ head?: never;
44271
+ patch?: never;
44272
+ trace?: never;
44273
+ };
44274
+ "/reservations/{id}/pdf": {
44275
+ parameters: {
44276
+ query?: never;
44277
+ header?: never;
44278
+ path?: never;
44279
+ cookie?: never;
44280
+ };
44281
+ /**
44282
+ * Print the comprobante de reserva (PDF)
44283
+ * @description The workspace’s `reservation` template (else the platform starter) filled with the hold: folio, dates, dealership, holder (name, RUT, email, phone, address), unit, agreed price, abonos, saldo and transfer cost with its breakdown, signatures. RUT and domicilio print only for a caller that also holds `contacts:read` («—» otherwise). Never a 409: a fact not on record prints «—». Inline by default; `?download=1` answers as an attachment. Filename `reserva-<PATENTE>-<marca-modelo>.pdf` (e.g. `reserva-JLGJ43-mini-countryman-s.pdf`); the folio stands in for a missing plate, and `reserva-<folio>.pdf` when nothing is known.
44284
+ */
44285
+ get: {
44286
+ parameters: {
44287
+ query?: {
44288
+ download?: "0" | "1" | "true" | "false";
44289
+ };
44290
+ header?: never;
44291
+ path: {
44292
+ id: string;
44293
+ };
44294
+ cookie?: never;
44295
+ };
44296
+ requestBody?: never;
44297
+ responses: {
44298
+ /** @description The PDF */
44299
+ 200: {
44300
+ headers: {
44301
+ [name: string]: unknown;
44302
+ };
44303
+ content: {
44304
+ "application/pdf": string;
44305
+ };
44306
+ };
44307
+ /** @description Validation error */
44308
+ 400: {
44309
+ headers: {
44310
+ [name: string]: unknown;
44311
+ };
44312
+ content: {
44313
+ "application/json": components["schemas"]["Error"];
44314
+ };
44315
+ };
44316
+ /** @description Unauthorized */
44317
+ 401: {
44318
+ headers: {
44319
+ [name: string]: unknown;
44320
+ };
44321
+ content: {
44322
+ "application/json": components["schemas"]["Error"];
44323
+ };
44324
+ };
44325
+ /** @description Forbidden */
44326
+ 403: {
44327
+ headers: {
44328
+ [name: string]: unknown;
44329
+ };
44330
+ content: {
44331
+ "application/json": components["schemas"]["Error"];
44332
+ };
44333
+ };
44334
+ /** @description Not found */
44335
+ 404: {
44336
+ headers: {
44337
+ [name: string]: unknown;
44338
+ };
44339
+ content: {
44340
+ "application/json": components["schemas"]["Error"];
44341
+ };
44342
+ };
44343
+ /** @description Conflict (incl. Idempotency-Key reuse with different body) */
44344
+ 409: {
44345
+ headers: {
44346
+ [name: string]: unknown;
44347
+ };
44348
+ content: {
44349
+ "application/json": components["schemas"]["Error"];
44350
+ };
44351
+ };
44352
+ /** @description Rate limited */
44353
+ 429: {
44354
+ headers: {
44355
+ [name: string]: unknown;
44356
+ };
44357
+ content: {
44358
+ "application/json": components["schemas"]["Error"];
44359
+ };
44360
+ };
44361
+ };
44362
+ };
44363
+ put?: never;
44364
+ post?: never;
43688
44365
  delete?: never;
43689
44366
  options?: never;
43690
44367
  head?: never;
43691
44368
  patch?: never;
43692
44369
  trace?: never;
43693
44370
  };
43694
- "/reservations/{id}": {
44371
+ "/reservations/{id}/send": {
43695
44372
  parameters: {
43696
44373
  query?: never;
43697
44374
  header?: never;
43698
44375
  path?: never;
43699
44376
  cookie?: never;
43700
44377
  };
44378
+ get?: never;
44379
+ put?: never;
43701
44380
  /**
43702
- * Fetch one reservation, with its payments and totals
43703
- * @description Accepts the UUID or the folio (`R-12`).
44381
+ * Send the comprobante de reserva to the customer
44382
+ * @description Renders the current comprobante and sends it — always a person’s explicit act, never retried. `email`: the PDF attached, to the holder’s email or `to`. `whatsapp` (also needs `messages:send`): the PDF as a document in the holder’s WhatsApp conversation; **409** with `details.reason` = `whatsapp_window_closed` outside the 24 h window, `no_whatsapp_thread`, `no_phone`; `no_email` for email; Needs `contacts:read` too (the comprobante carries the holder’s RUT and address). `delivery_unconfirmed` when the provider errored (check the conversation before sending again). Each send is recorded and listed in `GET /reservations/{id}` → `sends`.
43704
44383
  */
43705
- get: {
44384
+ post: {
43706
44385
  parameters: {
43707
44386
  query?: never;
43708
- header?: never;
44387
+ header?: {
44388
+ /** @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. */
44389
+ "Idempotency-Key"?: string;
44390
+ };
43709
44391
  path: {
43710
44392
  id: string;
43711
44393
  };
43712
44394
  cookie?: never;
43713
44395
  };
43714
- requestBody?: never;
44396
+ requestBody?: {
44397
+ content: {
44398
+ /**
44399
+ * @example {
44400
+ * "channel": "email"
44401
+ * }
44402
+ */
44403
+ "application/json": {
44404
+ /** @enum {string} */
44405
+ channel: "email" | "whatsapp";
44406
+ to?: string;
44407
+ message?: string;
44408
+ /** @description Advertencia de envío codes to go ahead over — every code from a 409 `OUTBOUND_WARNING` response's `reasons`, e.g. `["quiet_hours"]`. Recorded in the audit log and the outbound ledger. Has no effect on a Bloqueo (422 `OUTBOUND_BLOCKED`). */
44409
+ acknowledge?: string[];
44410
+ };
44411
+ };
44412
+ };
43715
44413
  responses: {
43716
- /** @description The reservation, its payments and totals */
44414
+ /** @description What was sent, to whom and when */
43717
44415
  200: {
43718
44416
  headers: {
43719
44417
  [name: string]: unknown;
@@ -43722,59 +44420,10 @@ interface paths {
43722
44420
  /**
43723
44421
  * @example {
43724
44422
  * "data": {
43725
- * "id": "d3d3d3d3-0000-4000-8000-000000000001",
43726
- * "tenant_id": "a1a1a1a1-0000-4000-8000-000000000001",
43727
- * "display_id": "R-18",
43728
- * "display_seq": 18,
43729
- * "vehicle_id": "e1e1e1e1-0000-4000-8000-000000000001",
43730
- * "holder_contact_id": "22222222-0000-4000-8000-000000000002",
43731
- * "salesperson_id": "11111111-0000-4000-8000-000000000001",
43732
- * "agreed_price_clp": 11900000,
43733
- * "abono_expected_clp": 300000,
43734
- * "taken_at": "2026-09-18T16:40:00.000Z",
43735
- * "hold_expires_on": "2026-09-25",
43736
- * "keep_advertised": true,
43737
- * "status": "activa",
43738
- * "abono_disposition": null,
43739
- * "abono_disposition_reason": null,
43740
- * "abono_disposition_at": null,
43741
- * "abono_disposition_by": null,
43742
- * "voided_at": null,
43743
- * "void_reason": null,
43744
- * "voided_by": null,
43745
- * "created_at": "2026-09-18T16:40:00.000Z",
43746
- * "updated_at": "2026-09-18T16:40:00.000Z",
43747
- * "payments": [
43748
- * {
43749
- * "id": "d6d6d6d6-0000-4000-8000-000000000001",
43750
- * "tenant_id": "a1a1a1a1-0000-4000-8000-000000000001",
43751
- * "reservation_id": "d3d3d3d3-0000-4000-8000-000000000001",
43752
- * "sale_note_id": null,
43753
- * "carried_from_reservation_id": null,
43754
- * "instrument": "transferencia",
43755
- * "amount_clp": 300000,
43756
- * "paid_on": "2026-09-18",
43757
- * "bank": "Banco Estado",
43758
- * "account_number": null,
43759
- * "document_number": null,
43760
- * "note": "abono al tomar la reserva",
43761
- * "card_fee_bps": null,
43762
- * "card_surcharge_clp": null,
43763
- * "card_surcharge_source": null,
43764
- * "created_at": "2026-09-18T16:41:02.000Z"
43765
- * }
43766
- * ],
43767
- * "totals": {
43768
- * "total_a_pagar_clp": 300000,
43769
- * "total_pagos_clp": 300000,
43770
- * "saldo_clp": 0,
43771
- * "recargo_tarjeta_clp": 0,
43772
- * "total_a_cobrar_clp": 300000,
43773
- * "payment_count": 1,
43774
- * "complete": true,
43775
- * "gaps": []
43776
- * },
43777
- * "converted_to_sale_note": null
44423
+ * "channel": "email",
44424
+ * "to": "ana.perez@example.com",
44425
+ * "sent_at": "2026-09-18T16:45:10.000Z",
44426
+ * "message_id": null
43778
44427
  * }
43779
44428
  * }
43780
44429
  */
@@ -43842,8 +44491,6 @@ interface paths {
43842
44491
  };
43843
44492
  };
43844
44493
  };
43845
- put?: never;
43846
- post?: never;
43847
44494
  delete?: never;
43848
44495
  options?: never;
43849
44496
  head?: never;
@@ -43909,6 +44556,21 @@ interface paths {
43909
44556
  * "taken_at": "2026-09-18T16:40:00.000Z",
43910
44557
  * "hold_expires_on": "2026-09-25",
43911
44558
  * "keep_advertised": true,
44559
+ * "transfer_cost_clp": 217740,
44560
+ * "transfer_cost_lines": [
44561
+ * {
44562
+ * "kind": "transferencia_municipal",
44563
+ * "label": "Impuesto a la transferencia (1,5 %)",
44564
+ * "amount_clp": 178500,
44565
+ * "fee_effective_from": "1979-12-29"
44566
+ * },
44567
+ * {
44568
+ * "kind": "arancel_registro_civil",
44569
+ * "label": "Inscripción en el Registro Civil",
44570
+ * "amount_clp": 39240,
44571
+ * "fee_effective_from": "2026-04-01"
44572
+ * }
44573
+ * ],
43912
44574
  * "status": "anulada",
43913
44575
  * "abono_disposition": null,
43914
44576
  * "abono_disposition_reason": null,
@@ -44055,6 +44717,21 @@ interface paths {
44055
44717
  * "taken_at": "2026-09-18T16:40:00.000Z",
44056
44718
  * "hold_expires_on": "2026-09-25",
44057
44719
  * "keep_advertised": true,
44720
+ * "transfer_cost_clp": 217740,
44721
+ * "transfer_cost_lines": [
44722
+ * {
44723
+ * "kind": "transferencia_municipal",
44724
+ * "label": "Impuesto a la transferencia (1,5 %)",
44725
+ * "amount_clp": 178500,
44726
+ * "fee_effective_from": "1979-12-29"
44727
+ * },
44728
+ * {
44729
+ * "kind": "arancel_registro_civil",
44730
+ * "label": "Inscripción en el Registro Civil",
44731
+ * "amount_clp": 39240,
44732
+ * "fee_effective_from": "2026-04-01"
44733
+ * }
44734
+ * ],
44058
44735
  * "status": "anulada",
44059
44736
  * "abono_disposition": "devuelto",
44060
44737
  * "abono_disposition_reason": "el cliente desistió; se devolvió el abono",
@@ -44182,6 +44859,7 @@ interface paths {
44182
44859
  /** Format: date-time */
44183
44860
  issued_at?: string | null;
44184
44861
  lead_id?: string | null;
44862
+ carry_transfer_cost?: boolean;
44185
44863
  };
44186
44864
  };
44187
44865
  };
@@ -44208,6 +44886,21 @@ interface paths {
44208
44886
  * "taken_at": "2026-09-18T16:40:00.000Z",
44209
44887
  * "hold_expires_on": "2026-09-25",
44210
44888
  * "keep_advertised": true,
44889
+ * "transfer_cost_clp": 217740,
44890
+ * "transfer_cost_lines": [
44891
+ * {
44892
+ * "kind": "transferencia_municipal",
44893
+ * "label": "Impuesto a la transferencia (1,5 %)",
44894
+ * "amount_clp": 178500,
44895
+ * "fee_effective_from": "1979-12-29"
44896
+ * },
44897
+ * {
44898
+ * "kind": "arancel_registro_civil",
44899
+ * "label": "Inscripción en el Registro Civil",
44900
+ * "amount_clp": 39240,
44901
+ * "fee_effective_from": "2026-04-01"
44902
+ * }
44903
+ * ],
44211
44904
  * "status": "completada",
44212
44905
  * "abono_disposition": "aplicado",
44213
44906
  * "abono_disposition_reason": null,
@@ -87361,6 +88054,8 @@ interface paths {
87361
88054
  *
87362
88055
  * **`reason` is not stored, but it IS shown**: the text is appended to that customer notice, and nowhere else. Nothing persists it on the appointment, so put the internal explanation in a note on the lead or conversation if it needs to survive — and write `reason` as something the customer may read.
87363
88056
  *
88057
+ * **`postpone: true`** is the same cancellation for a customer who cannot make it with no new date yet: everything above happens, and the appointment is ALSO recorded as postponed — `metadata.postponed` = `{ at, reason, by }`, the one place `reason` is stored. The lead stays open (a cancelled visit steps it back to qualified, never to lost).
88058
+ *
87364
88059
  * An appointment imported FROM Google is not deleted upstream — the calendar owns those, so the cancellation is local and the event stays on the customer’s calendar.
87365
88060
  */
87366
88061
  post: {
@@ -87384,6 +88079,7 @@ interface paths {
87384
88079
  */
87385
88080
  "application/json": {
87386
88081
  reason?: string;
88082
+ postpone?: boolean;
87387
88083
  };
87388
88084
  };
87389
88085
  };
@@ -119909,6 +120605,8 @@ interface paths {
119909
120605
  * `handoff_urgent: boolean` (#2969) is a plain `conversation` column, not a per-route annotation: true while an open/pending AI-handoff thread's customer is still waiting on us and Jev read their newest pending message as urgent (a clinic post-treatment complication, or an explicit same-day deadline) — kept in sync by the same classification that also tightens the re-notify cadence, and present on every conversation read, list included, because the inbox shows the flag on the conversation ROW too, not only its header.
119910
120606
  *
119911
120607
  * Carries `ad_origin` exactly as `GET /conversations` rows do.
120608
+ *
120609
+ * `reply_via` (THIS ROUTE ONLY): non-null on a conversation that cannot carry a reply (a website form or a Yapo lead) — the WhatsApp thread to answer in, or `conversation_id: null` when the contact has none open yet.
119912
120610
  */
119913
120611
  get: {
119914
120612
  parameters: {
@@ -120071,6 +120769,7 @@ interface paths {
120071
120769
  data: {
120072
120770
  ad_origin: components["schemas"]["AdOrigin"];
120073
120771
  campaign_origin?: components["schemas"]["ConversationCampaignOrigin"];
120772
+ reply_via?: components["schemas"]["ConversationReplyVia"];
120074
120773
  };
120075
120774
  meta?: {
120076
120775
  [key: string]: unknown;
@@ -120920,6 +121619,8 @@ interface paths {
120920
121619
  *
120921
121620
  * **Instagram and Messenger reply window.** A reply from a signed-in member may go out up to 7 days after the customer's last message: past the standard 24 hours it is sent with Meta's `HUMAN_AGENT` tag. Past 7 days — or when the customer never wrote — it is refused with 422 `MESSAGING_WINDOW_CLOSED` and nothing is stored. Every other caller (API key, personal token, connected app) keeps the 24-hour window.
120922
121621
  *
121622
+ * **Read-only channels.** A website form (`website`) or Yapo lead conversation has no reply rail: the send is refused with 409 `CHANNEL_READ_ONLY` (`details.channel`) and nothing is stored or queued. The same holds for templates, attachments, location, Flows and voice notes. Answer on WhatsApp — see `reply_via` on `GET /conversations/{id}`.
121623
+ *
120923
121624
  * Requires `messages:send` in addition to `conversations:write`. Sent by an API key, a personal token or a connected app, it goes through the política de envíos first — 422 `OUTBOUND_BLOCKED`, 409 `OUTBOUND_WARNING` (resend with `acknowledge`) or, for a connected app past its fan-out limit, 202 `pending_approval`. A member in the UI is not checked.
120924
121625
  */
120925
121626
  post: {
@@ -177918,7 +178619,7 @@ interface paths {
177918
178619
  * Create an order
177919
178620
  * @description A native order for a contact. **Prices come from the catalog**: each line names a `variant_id` (or the `product_id` of a product without variants) and a quantity, and its unit price is the variant’s price, else the product’s, frozen on the line. There is no price field. A line on an inactive item, an item without a CLP price, or more units than the store would sell (tracked stock, policy `deny`) is refused with 422 / 409 naming the line.
177920
178621
  *
177921
- * With `status: pending_payment` (the default) the payment opens in the same write: one obligation group of kind `order` (`obligation_group_id`) with one `product` obligation per line, so `POST /orders/{id}/payment-link` (or «Enviar link de pago» with `group_id`) charges it on Mercado Pago. When that payment settles the order becomes `paid` and its native stock is decremented once. The lead (`lead_id`, else the conversation’s open lead) moves to «Carrito o cotización» on an `ecommerce_orders` board. Fires `order.created`. Requires `orders:write`.
178622
+ * With `status: pending_payment` (the default) the payment opens in the same write: one obligation group of kind `order` (`obligation_group_id`) with one `product` obligation per line, so `POST /orders/{id}/payment-link` (or «Enviar link de pago» with `group_id`) charges it on Mercado Pago. When that payment settles the order becomes `paid` and its native stock is decremented once. The lead (`lead_id`, else the conversation’s open lead) moves to «Carrito» on an `ecommerce_orders` board. Fires `order.created`. Requires `orders:write`.
177922
178623
  */
177923
178624
  post: {
177924
178625
  parameters: {
@@ -203401,6 +204102,19 @@ interface components {
203401
204102
  /** @description The newest message in the thread is that send — «Enviada · sin respuesta». */
203402
204103
  awaiting_reply: boolean;
203403
204104
  } | null;
204105
+ /** @description Non-null ONLY when this conversation cannot carry a reply (a website form, `website`, or a Yapo lead, `yapo`): every send on it answers 409 `CHANNEL_READ_ONLY`, and this names the WhatsApp thread to use instead. Absent on every channel that can reply. */
204106
+ ConversationReplyVia: {
204107
+ /** @enum {string} */
204108
+ channel: "whatsapp";
204109
+ /**
204110
+ * Format: uuid
204111
+ * @description The contact's most recent open WhatsApp conversation in this workspace — answer there. `null`: none yet; open one with `POST /conversations/whatsapp` and send a template through `POST /conversations/{id}/templates`.
204112
+ */
204113
+ conversation_id: string | null;
204114
+ /** Format: uuid */
204115
+ contact_id: string | null;
204116
+ contact_phone: string | null;
204117
+ } | null;
203404
204118
  MessageAttachment: {
203405
204119
  /** @description Position in `media_urls`. */
203406
204120
  index: number;
@@ -203416,6 +204130,18 @@ interface components {
203416
204130
  */
203417
204131
  playback_mime: "audio/mp4" | "audio/mpeg" | "audio/aac" | null;
203418
204132
  };
204133
+ MessageForm: {
204134
+ title?: string;
204135
+ /** @description The headline figure, e.g. «Cotización» · «hasta $500.000». */
204136
+ highlight?: {
204137
+ label: string;
204138
+ value: string;
204139
+ };
204140
+ fields: {
204141
+ label: string;
204142
+ value: string;
204143
+ }[];
204144
+ };
203419
204145
  Message: {
203420
204146
  id: string;
203421
204147
  conversation_id: string;
@@ -203432,6 +204158,10 @@ interface components {
203432
204158
  media_urls?: string[] | null;
203433
204159
  /** @description One entry per `media_urls` entry, same order — see MessageAttachment. */
203434
204160
  attachments?: components["schemas"]["MessageAttachment"][];
204161
+ /** @description Channel-specific extras. `form` is set on the first message of a website-form conversation (see MessageForm). */
204162
+ metadata?: {
204163
+ form?: components["schemas"]["MessageForm"];
204164
+ } | null;
203435
204165
  created_at: string;
203436
204166
  };
203437
204167
  PendingApproval: {