@vitrina/api 17.37.2 → 17.38.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 +214 -4
- package/dist/index.d.ts +214 -4
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -38558,7 +38558,212 @@ interface paths {
|
|
|
38558
38558
|
delete?: never;
|
|
38559
38559
|
options?: never;
|
|
38560
38560
|
head?: never;
|
|
38561
|
-
|
|
38561
|
+
/**
|
|
38562
|
+
* Edit the price terms of an issued nota de venta
|
|
38563
|
+
* @description Corrects `net_clp`, `tax_clp` (null = not recorded, 0 = no tax), `tax_treatment` and/or `issued_at` on a nota de venta that is ISSUED but not approved and not voided. All optional, at least one; unknown keys are a 400. In one transaction the edit re-derives what issuing at the new terms would have: the buyer’s receivable (the sale note’s open obligation, re-stated from price + IVA + charged add-ons) and the participations’ DEFAULTED commissions (the margin basis and, when the sale’s day moves, the scheme rate); `discount_clp` follows. Payments already recorded, add-on lines, trade-ins, the credit and `list_price_clp` are kept. Responds with the same read as `GET /sale-notes/{id}`; sending the values it already has is a no-op 200.
|
|
38564
|
+
*
|
|
38565
|
+
* **409** with `details.blocked_reason` = `sale_note_approved` (an approved price binds the company) or `sale_note_voided`, and a Spanish message; the way out is void + re-issue. Requires `sale_notes:write`.
|
|
38566
|
+
*/
|
|
38567
|
+
patch: {
|
|
38568
|
+
parameters: {
|
|
38569
|
+
query?: never;
|
|
38570
|
+
header?: never;
|
|
38571
|
+
path: {
|
|
38572
|
+
id: string;
|
|
38573
|
+
};
|
|
38574
|
+
cookie?: never;
|
|
38575
|
+
};
|
|
38576
|
+
requestBody?: {
|
|
38577
|
+
content: {
|
|
38578
|
+
/**
|
|
38579
|
+
* @example {
|
|
38580
|
+
* "net_clp": 16386555,
|
|
38581
|
+
* "tax_clp": 3113445
|
|
38582
|
+
* }
|
|
38583
|
+
*/
|
|
38584
|
+
"application/json": {
|
|
38585
|
+
net_clp?: number;
|
|
38586
|
+
tax_clp?: number | null;
|
|
38587
|
+
/** @enum {string} */
|
|
38588
|
+
tax_treatment?: "afecto" | "exento" | "no_gravado" | "pass_through";
|
|
38589
|
+
/** Format: date-time */
|
|
38590
|
+
issued_at?: string;
|
|
38591
|
+
};
|
|
38592
|
+
};
|
|
38593
|
+
};
|
|
38594
|
+
responses: {
|
|
38595
|
+
/** @description The nota de venta, as GET /sale-notes/{id} reads it */
|
|
38596
|
+
200: {
|
|
38597
|
+
headers: {
|
|
38598
|
+
[name: string]: unknown;
|
|
38599
|
+
};
|
|
38600
|
+
content: {
|
|
38601
|
+
/**
|
|
38602
|
+
* @example {
|
|
38603
|
+
* "data": {
|
|
38604
|
+
* "id": "d4d4d4d4-0000-4000-8000-000000000001",
|
|
38605
|
+
* "tenant_id": "a1a1a1a1-0000-4000-8000-000000000001",
|
|
38606
|
+
* "display_id": "V-118",
|
|
38607
|
+
* "display_seq": 118,
|
|
38608
|
+
* "vehicle_id": "e1e1e1e1-0000-4000-8000-000000000002",
|
|
38609
|
+
* "buyer_contact_id": "22222222-0000-4000-8000-000000000002",
|
|
38610
|
+
* "lead_id": null,
|
|
38611
|
+
* "converted_from_reservation_id": null,
|
|
38612
|
+
* "seller_of_record": "automotora",
|
|
38613
|
+
* "salesperson_id": "11111111-0000-4000-8000-000000000001",
|
|
38614
|
+
* "net_clp": 11900000,
|
|
38615
|
+
* "list_price_clp": 12490000,
|
|
38616
|
+
* "discount_clp": 590000,
|
|
38617
|
+
* "tax_clp": 1900000,
|
|
38618
|
+
* "tax_treatment": "afecto",
|
|
38619
|
+
* "status": "issued",
|
|
38620
|
+
* "issued_at": "2026-09-19T13:00:00.000Z",
|
|
38621
|
+
* "emitted_by": "11111111-0000-4000-8000-000000000001",
|
|
38622
|
+
* "approved_by": null,
|
|
38623
|
+
* "approved_at": null,
|
|
38624
|
+
* "voided_at": null,
|
|
38625
|
+
* "void_reason": null,
|
|
38626
|
+
* "voided_by": null,
|
|
38627
|
+
* "created_at": "2026-09-19T13:00:00.000Z",
|
|
38628
|
+
* "updated_at": "2026-09-19T13:00:00.000Z",
|
|
38629
|
+
* "receivable_obligation_id": "01a1c1df-a6ea-779f-9310-bdbb2eadd184",
|
|
38630
|
+
* "print_missing_fields": [
|
|
38631
|
+
* {
|
|
38632
|
+
* "variable": "COMPRADOR_DOMICILIO",
|
|
38633
|
+
* "label": "Domicilio del comprador",
|
|
38634
|
+
* "fix": "buyer_contact",
|
|
38635
|
+
* "contact_id": "01a1ad2b-a52a-7b04-abf8-389e20e8217a"
|
|
38636
|
+
* }
|
|
38637
|
+
* ],
|
|
38638
|
+
* "payments": [
|
|
38639
|
+
* {
|
|
38640
|
+
* "id": "d6d6d6d6-0000-4000-8000-000000000002",
|
|
38641
|
+
* "tenant_id": "a1a1a1a1-0000-4000-8000-000000000001",
|
|
38642
|
+
* "reservation_id": null,
|
|
38643
|
+
* "sale_note_id": "d4d4d4d4-0000-4000-8000-000000000001",
|
|
38644
|
+
* "carried_from_reservation_id": null,
|
|
38645
|
+
* "instrument": "transferencia",
|
|
38646
|
+
* "amount_clp": 13800000,
|
|
38647
|
+
* "paid_on": "2026-09-19",
|
|
38648
|
+
* "bank": "Banco de Chile",
|
|
38649
|
+
* "account_number": null,
|
|
38650
|
+
* "document_number": null,
|
|
38651
|
+
* "note": null,
|
|
38652
|
+
* "card_fee_bps": null,
|
|
38653
|
+
* "card_surcharge_clp": null,
|
|
38654
|
+
* "card_surcharge_source": null,
|
|
38655
|
+
* "created_at": "2026-09-19T13:05:00.000Z"
|
|
38656
|
+
* }
|
|
38657
|
+
* ],
|
|
38658
|
+
* "totals": {
|
|
38659
|
+
* "total_a_pagar_clp": 13800000,
|
|
38660
|
+
* "total_pagos_clp": 13800000,
|
|
38661
|
+
* "saldo_clp": 0,
|
|
38662
|
+
* "recargo_tarjeta_clp": 0,
|
|
38663
|
+
* "total_a_cobrar_clp": 13800000,
|
|
38664
|
+
* "payment_count": 1,
|
|
38665
|
+
* "complete": true,
|
|
38666
|
+
* "gaps": []
|
|
38667
|
+
* },
|
|
38668
|
+
* "funding": {
|
|
38669
|
+
* "standing": "funded",
|
|
38670
|
+
* "balanced": true,
|
|
38671
|
+
* "terms": {
|
|
38672
|
+
* "price_clp": 13800000,
|
|
38673
|
+
* "add_on_charges_clp": 0,
|
|
38674
|
+
* "payments_clp": 13800000,
|
|
38675
|
+
* "retoma_clp": 0,
|
|
38676
|
+
* "credit_clp": 0
|
|
38677
|
+
* },
|
|
38678
|
+
* "total_a_pagar_clp": 13800000,
|
|
38679
|
+
* "total_consideration_clp": 13800000,
|
|
38680
|
+
* "saldo_clp": 0,
|
|
38681
|
+
* "gap_clp": null,
|
|
38682
|
+
* "saldo_a_favor_del_cliente_clp": null,
|
|
38683
|
+
* "payment_count": 1,
|
|
38684
|
+
* "complete": true,
|
|
38685
|
+
* "gaps": []
|
|
38686
|
+
* },
|
|
38687
|
+
* "trade_ins": [],
|
|
38688
|
+
* "credit": null,
|
|
38689
|
+
* "timeline": [
|
|
38690
|
+
* {
|
|
38691
|
+
* "step": "emitted",
|
|
38692
|
+
* "at": "2026-09-19T13:00:00.000Z",
|
|
38693
|
+
* "actor": {
|
|
38694
|
+
* "id": "11111111-0000-4000-8000-000000000001",
|
|
38695
|
+
* "name": "Martina Reyes",
|
|
38696
|
+
* "kind": "member"
|
|
38697
|
+
* }
|
|
38698
|
+
* }
|
|
38699
|
+
* ]
|
|
38700
|
+
* }
|
|
38701
|
+
* }
|
|
38702
|
+
*/
|
|
38703
|
+
"application/json": {
|
|
38704
|
+
data?: unknown;
|
|
38705
|
+
meta?: {
|
|
38706
|
+
[key: string]: unknown;
|
|
38707
|
+
};
|
|
38708
|
+
};
|
|
38709
|
+
};
|
|
38710
|
+
};
|
|
38711
|
+
/** @description Validation error */
|
|
38712
|
+
400: {
|
|
38713
|
+
headers: {
|
|
38714
|
+
[name: string]: unknown;
|
|
38715
|
+
};
|
|
38716
|
+
content: {
|
|
38717
|
+
"application/json": components["schemas"]["Error"];
|
|
38718
|
+
};
|
|
38719
|
+
};
|
|
38720
|
+
/** @description Unauthorized */
|
|
38721
|
+
401: {
|
|
38722
|
+
headers: {
|
|
38723
|
+
[name: string]: unknown;
|
|
38724
|
+
};
|
|
38725
|
+
content: {
|
|
38726
|
+
"application/json": components["schemas"]["Error"];
|
|
38727
|
+
};
|
|
38728
|
+
};
|
|
38729
|
+
/** @description Forbidden */
|
|
38730
|
+
403: {
|
|
38731
|
+
headers: {
|
|
38732
|
+
[name: string]: unknown;
|
|
38733
|
+
};
|
|
38734
|
+
content: {
|
|
38735
|
+
"application/json": components["schemas"]["Error"];
|
|
38736
|
+
};
|
|
38737
|
+
};
|
|
38738
|
+
/** @description Not found */
|
|
38739
|
+
404: {
|
|
38740
|
+
headers: {
|
|
38741
|
+
[name: string]: unknown;
|
|
38742
|
+
};
|
|
38743
|
+
content: {
|
|
38744
|
+
"application/json": components["schemas"]["Error"];
|
|
38745
|
+
};
|
|
38746
|
+
};
|
|
38747
|
+
/** @description Conflict (incl. Idempotency-Key reuse with different body) */
|
|
38748
|
+
409: {
|
|
38749
|
+
headers: {
|
|
38750
|
+
[name: string]: unknown;
|
|
38751
|
+
};
|
|
38752
|
+
content: {
|
|
38753
|
+
"application/json": components["schemas"]["Error"];
|
|
38754
|
+
};
|
|
38755
|
+
};
|
|
38756
|
+
/** @description Rate limited */
|
|
38757
|
+
429: {
|
|
38758
|
+
headers: {
|
|
38759
|
+
[name: string]: unknown;
|
|
38760
|
+
};
|
|
38761
|
+
content: {
|
|
38762
|
+
"application/json": components["schemas"]["Error"];
|
|
38763
|
+
};
|
|
38764
|
+
};
|
|
38765
|
+
};
|
|
38766
|
+
};
|
|
38562
38767
|
trace?: never;
|
|
38563
38768
|
};
|
|
38564
38769
|
"/sale-notes/{id}/buyer": {
|
|
@@ -39080,7 +39285,7 @@ interface paths {
|
|
|
39080
39285
|
};
|
|
39081
39286
|
/**
|
|
39082
39287
|
* The Vendedor a new nota de venta would get
|
|
39083
|
-
* @description Who `POST /sale-notes` credits as the **Vendedor** when its body names nobody (ADR 0114 §3), so a screen or an agent can propose that person up front: the assignee of the sale’s lead — the `lead_id` given, else the buyer’s lead on this car (`buyer_contact_id` + `vehicle_id`) — otherwise the car’s **Responsable del auto
|
|
39288
|
+
* @description Who `POST /sale-notes` credits as the **Vendedor** when its body names nobody (ADR 0114 §3), so a screen or an agent can propose that person up front: the assignee of the sale’s lead — the `lead_id` given, else the buyer’s lead on this car (`buyer_contact_id` + `vehicle_id`) — otherwise the car’s **Responsable del auto**, otherwise the **signed-in member** asking (never a Vitrina staff email, never an API key — for those the rung is skipped). A member who left the workspace is skipped. `source` says which rung answered (`lead_owner` | `vehicle_responsible` | `signed_in_user`) and `lead` (`id`, `display_id`) names the lead when it did. `data` is `null` when nobody can be proposed: the emit is then refused until a Vendedor is chosen. The inferred lead only proposes the Vendedor; it is never written as the nota de venta’s `lead_id`.
|
|
39084
39289
|
*/
|
|
39085
39290
|
get: {
|
|
39086
39291
|
parameters: {
|
|
@@ -44868,7 +45073,7 @@ interface paths {
|
|
|
44868
45073
|
head?: never;
|
|
44869
45074
|
/**
|
|
44870
45075
|
* Edit a live reservation
|
|
44871
|
-
* @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
|
|
45076
|
+
* @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), the salesperson, the holder (`holder_contact_id`, a contact of this workspace — 404 otherwise; the seña expectation and every payment applied to it move to the new holder) and the agreed price (`agreed_price_clp` > 0; 400 when below the money already paid or the expected seña; an estimated transfer cost — one stored with its breakdown — is re-estimated at the new price unless the request states one, a manual amount is kept). Never the unit. **409** once the hold is not `activa` (`details.reason = reservation_not_active`), or when a payment of the hold is also applied to another debt of the current holder (`details.reason = reservation_payment_shared`). Unknown keys are a 400. Answers the same shape as `GET /reservations/{id}`.
|
|
44872
45077
|
*/
|
|
44873
45078
|
patch: {
|
|
44874
45079
|
parameters: {
|
|
@@ -44883,6 +45088,7 @@ interface paths {
|
|
|
44883
45088
|
content: {
|
|
44884
45089
|
/**
|
|
44885
45090
|
* @example {
|
|
45091
|
+
* "agreed_price_clp": 19500000,
|
|
44886
45092
|
* "transfer_cost_clp": 250000,
|
|
44887
45093
|
* "transfer_cost_lines": null,
|
|
44888
45094
|
* "hold_expires_on": "2026-09-30"
|
|
@@ -44901,6 +45107,9 @@ interface paths {
|
|
|
44901
45107
|
keep_advertised?: boolean;
|
|
44902
45108
|
/** Format: uuid */
|
|
44903
45109
|
salesperson_id?: string | null;
|
|
45110
|
+
/** Format: uuid */
|
|
45111
|
+
holder_contact_id?: string;
|
|
45112
|
+
agreed_price_clp?: number;
|
|
44904
45113
|
};
|
|
44905
45114
|
};
|
|
44906
45115
|
};
|
|
@@ -45750,7 +45959,7 @@ interface paths {
|
|
|
45750
45959
|
put?: never;
|
|
45751
45960
|
/**
|
|
45752
45961
|
* Convert a reservation into a nota de venta
|
|
45753
|
-
* @description Produces a NEW sale-note document — 201, the same as `POST /sale-notes`. Scoped `sale_notes:write`, borrowed rather than a fifth reservations scope.
|
|
45962
|
+
* @description Produces a NEW sale-note document — 201, the same as `POST /sale-notes`. Scoped `sale_notes:write`, borrowed rather than a fifth reservations scope. `net_clp` omitted = the sale inherits the hold’s `agreed_price_clp`; stated = the sale closes at that price. A hold with no agreed price needs `net_clp` (400 otherwise).
|
|
45754
45963
|
*/
|
|
45755
45964
|
post: {
|
|
45756
45965
|
parameters: {
|
|
@@ -45779,6 +45988,7 @@ interface paths {
|
|
|
45779
45988
|
seller_of_record?: "consignante" | "retoma" | "automotora";
|
|
45780
45989
|
/** @enum {string} */
|
|
45781
45990
|
tax_treatment: "afecto" | "exento" | "no_gravado" | "pass_through";
|
|
45991
|
+
net_clp?: number;
|
|
45782
45992
|
tax_clp?: number | null;
|
|
45783
45993
|
/** Format: date-time */
|
|
45784
45994
|
issued_at?: string | null;
|
package/dist/index.d.ts
CHANGED
|
@@ -38558,7 +38558,212 @@ interface paths {
|
|
|
38558
38558
|
delete?: never;
|
|
38559
38559
|
options?: never;
|
|
38560
38560
|
head?: never;
|
|
38561
|
-
|
|
38561
|
+
/**
|
|
38562
|
+
* Edit the price terms of an issued nota de venta
|
|
38563
|
+
* @description Corrects `net_clp`, `tax_clp` (null = not recorded, 0 = no tax), `tax_treatment` and/or `issued_at` on a nota de venta that is ISSUED but not approved and not voided. All optional, at least one; unknown keys are a 400. In one transaction the edit re-derives what issuing at the new terms would have: the buyer’s receivable (the sale note’s open obligation, re-stated from price + IVA + charged add-ons) and the participations’ DEFAULTED commissions (the margin basis and, when the sale’s day moves, the scheme rate); `discount_clp` follows. Payments already recorded, add-on lines, trade-ins, the credit and `list_price_clp` are kept. Responds with the same read as `GET /sale-notes/{id}`; sending the values it already has is a no-op 200.
|
|
38564
|
+
*
|
|
38565
|
+
* **409** with `details.blocked_reason` = `sale_note_approved` (an approved price binds the company) or `sale_note_voided`, and a Spanish message; the way out is void + re-issue. Requires `sale_notes:write`.
|
|
38566
|
+
*/
|
|
38567
|
+
patch: {
|
|
38568
|
+
parameters: {
|
|
38569
|
+
query?: never;
|
|
38570
|
+
header?: never;
|
|
38571
|
+
path: {
|
|
38572
|
+
id: string;
|
|
38573
|
+
};
|
|
38574
|
+
cookie?: never;
|
|
38575
|
+
};
|
|
38576
|
+
requestBody?: {
|
|
38577
|
+
content: {
|
|
38578
|
+
/**
|
|
38579
|
+
* @example {
|
|
38580
|
+
* "net_clp": 16386555,
|
|
38581
|
+
* "tax_clp": 3113445
|
|
38582
|
+
* }
|
|
38583
|
+
*/
|
|
38584
|
+
"application/json": {
|
|
38585
|
+
net_clp?: number;
|
|
38586
|
+
tax_clp?: number | null;
|
|
38587
|
+
/** @enum {string} */
|
|
38588
|
+
tax_treatment?: "afecto" | "exento" | "no_gravado" | "pass_through";
|
|
38589
|
+
/** Format: date-time */
|
|
38590
|
+
issued_at?: string;
|
|
38591
|
+
};
|
|
38592
|
+
};
|
|
38593
|
+
};
|
|
38594
|
+
responses: {
|
|
38595
|
+
/** @description The nota de venta, as GET /sale-notes/{id} reads it */
|
|
38596
|
+
200: {
|
|
38597
|
+
headers: {
|
|
38598
|
+
[name: string]: unknown;
|
|
38599
|
+
};
|
|
38600
|
+
content: {
|
|
38601
|
+
/**
|
|
38602
|
+
* @example {
|
|
38603
|
+
* "data": {
|
|
38604
|
+
* "id": "d4d4d4d4-0000-4000-8000-000000000001",
|
|
38605
|
+
* "tenant_id": "a1a1a1a1-0000-4000-8000-000000000001",
|
|
38606
|
+
* "display_id": "V-118",
|
|
38607
|
+
* "display_seq": 118,
|
|
38608
|
+
* "vehicle_id": "e1e1e1e1-0000-4000-8000-000000000002",
|
|
38609
|
+
* "buyer_contact_id": "22222222-0000-4000-8000-000000000002",
|
|
38610
|
+
* "lead_id": null,
|
|
38611
|
+
* "converted_from_reservation_id": null,
|
|
38612
|
+
* "seller_of_record": "automotora",
|
|
38613
|
+
* "salesperson_id": "11111111-0000-4000-8000-000000000001",
|
|
38614
|
+
* "net_clp": 11900000,
|
|
38615
|
+
* "list_price_clp": 12490000,
|
|
38616
|
+
* "discount_clp": 590000,
|
|
38617
|
+
* "tax_clp": 1900000,
|
|
38618
|
+
* "tax_treatment": "afecto",
|
|
38619
|
+
* "status": "issued",
|
|
38620
|
+
* "issued_at": "2026-09-19T13:00:00.000Z",
|
|
38621
|
+
* "emitted_by": "11111111-0000-4000-8000-000000000001",
|
|
38622
|
+
* "approved_by": null,
|
|
38623
|
+
* "approved_at": null,
|
|
38624
|
+
* "voided_at": null,
|
|
38625
|
+
* "void_reason": null,
|
|
38626
|
+
* "voided_by": null,
|
|
38627
|
+
* "created_at": "2026-09-19T13:00:00.000Z",
|
|
38628
|
+
* "updated_at": "2026-09-19T13:00:00.000Z",
|
|
38629
|
+
* "receivable_obligation_id": "01a1c1df-a6ea-779f-9310-bdbb2eadd184",
|
|
38630
|
+
* "print_missing_fields": [
|
|
38631
|
+
* {
|
|
38632
|
+
* "variable": "COMPRADOR_DOMICILIO",
|
|
38633
|
+
* "label": "Domicilio del comprador",
|
|
38634
|
+
* "fix": "buyer_contact",
|
|
38635
|
+
* "contact_id": "01a1ad2b-a52a-7b04-abf8-389e20e8217a"
|
|
38636
|
+
* }
|
|
38637
|
+
* ],
|
|
38638
|
+
* "payments": [
|
|
38639
|
+
* {
|
|
38640
|
+
* "id": "d6d6d6d6-0000-4000-8000-000000000002",
|
|
38641
|
+
* "tenant_id": "a1a1a1a1-0000-4000-8000-000000000001",
|
|
38642
|
+
* "reservation_id": null,
|
|
38643
|
+
* "sale_note_id": "d4d4d4d4-0000-4000-8000-000000000001",
|
|
38644
|
+
* "carried_from_reservation_id": null,
|
|
38645
|
+
* "instrument": "transferencia",
|
|
38646
|
+
* "amount_clp": 13800000,
|
|
38647
|
+
* "paid_on": "2026-09-19",
|
|
38648
|
+
* "bank": "Banco de Chile",
|
|
38649
|
+
* "account_number": null,
|
|
38650
|
+
* "document_number": null,
|
|
38651
|
+
* "note": null,
|
|
38652
|
+
* "card_fee_bps": null,
|
|
38653
|
+
* "card_surcharge_clp": null,
|
|
38654
|
+
* "card_surcharge_source": null,
|
|
38655
|
+
* "created_at": "2026-09-19T13:05:00.000Z"
|
|
38656
|
+
* }
|
|
38657
|
+
* ],
|
|
38658
|
+
* "totals": {
|
|
38659
|
+
* "total_a_pagar_clp": 13800000,
|
|
38660
|
+
* "total_pagos_clp": 13800000,
|
|
38661
|
+
* "saldo_clp": 0,
|
|
38662
|
+
* "recargo_tarjeta_clp": 0,
|
|
38663
|
+
* "total_a_cobrar_clp": 13800000,
|
|
38664
|
+
* "payment_count": 1,
|
|
38665
|
+
* "complete": true,
|
|
38666
|
+
* "gaps": []
|
|
38667
|
+
* },
|
|
38668
|
+
* "funding": {
|
|
38669
|
+
* "standing": "funded",
|
|
38670
|
+
* "balanced": true,
|
|
38671
|
+
* "terms": {
|
|
38672
|
+
* "price_clp": 13800000,
|
|
38673
|
+
* "add_on_charges_clp": 0,
|
|
38674
|
+
* "payments_clp": 13800000,
|
|
38675
|
+
* "retoma_clp": 0,
|
|
38676
|
+
* "credit_clp": 0
|
|
38677
|
+
* },
|
|
38678
|
+
* "total_a_pagar_clp": 13800000,
|
|
38679
|
+
* "total_consideration_clp": 13800000,
|
|
38680
|
+
* "saldo_clp": 0,
|
|
38681
|
+
* "gap_clp": null,
|
|
38682
|
+
* "saldo_a_favor_del_cliente_clp": null,
|
|
38683
|
+
* "payment_count": 1,
|
|
38684
|
+
* "complete": true,
|
|
38685
|
+
* "gaps": []
|
|
38686
|
+
* },
|
|
38687
|
+
* "trade_ins": [],
|
|
38688
|
+
* "credit": null,
|
|
38689
|
+
* "timeline": [
|
|
38690
|
+
* {
|
|
38691
|
+
* "step": "emitted",
|
|
38692
|
+
* "at": "2026-09-19T13:00:00.000Z",
|
|
38693
|
+
* "actor": {
|
|
38694
|
+
* "id": "11111111-0000-4000-8000-000000000001",
|
|
38695
|
+
* "name": "Martina Reyes",
|
|
38696
|
+
* "kind": "member"
|
|
38697
|
+
* }
|
|
38698
|
+
* }
|
|
38699
|
+
* ]
|
|
38700
|
+
* }
|
|
38701
|
+
* }
|
|
38702
|
+
*/
|
|
38703
|
+
"application/json": {
|
|
38704
|
+
data?: unknown;
|
|
38705
|
+
meta?: {
|
|
38706
|
+
[key: string]: unknown;
|
|
38707
|
+
};
|
|
38708
|
+
};
|
|
38709
|
+
};
|
|
38710
|
+
};
|
|
38711
|
+
/** @description Validation error */
|
|
38712
|
+
400: {
|
|
38713
|
+
headers: {
|
|
38714
|
+
[name: string]: unknown;
|
|
38715
|
+
};
|
|
38716
|
+
content: {
|
|
38717
|
+
"application/json": components["schemas"]["Error"];
|
|
38718
|
+
};
|
|
38719
|
+
};
|
|
38720
|
+
/** @description Unauthorized */
|
|
38721
|
+
401: {
|
|
38722
|
+
headers: {
|
|
38723
|
+
[name: string]: unknown;
|
|
38724
|
+
};
|
|
38725
|
+
content: {
|
|
38726
|
+
"application/json": components["schemas"]["Error"];
|
|
38727
|
+
};
|
|
38728
|
+
};
|
|
38729
|
+
/** @description Forbidden */
|
|
38730
|
+
403: {
|
|
38731
|
+
headers: {
|
|
38732
|
+
[name: string]: unknown;
|
|
38733
|
+
};
|
|
38734
|
+
content: {
|
|
38735
|
+
"application/json": components["schemas"]["Error"];
|
|
38736
|
+
};
|
|
38737
|
+
};
|
|
38738
|
+
/** @description Not found */
|
|
38739
|
+
404: {
|
|
38740
|
+
headers: {
|
|
38741
|
+
[name: string]: unknown;
|
|
38742
|
+
};
|
|
38743
|
+
content: {
|
|
38744
|
+
"application/json": components["schemas"]["Error"];
|
|
38745
|
+
};
|
|
38746
|
+
};
|
|
38747
|
+
/** @description Conflict (incl. Idempotency-Key reuse with different body) */
|
|
38748
|
+
409: {
|
|
38749
|
+
headers: {
|
|
38750
|
+
[name: string]: unknown;
|
|
38751
|
+
};
|
|
38752
|
+
content: {
|
|
38753
|
+
"application/json": components["schemas"]["Error"];
|
|
38754
|
+
};
|
|
38755
|
+
};
|
|
38756
|
+
/** @description Rate limited */
|
|
38757
|
+
429: {
|
|
38758
|
+
headers: {
|
|
38759
|
+
[name: string]: unknown;
|
|
38760
|
+
};
|
|
38761
|
+
content: {
|
|
38762
|
+
"application/json": components["schemas"]["Error"];
|
|
38763
|
+
};
|
|
38764
|
+
};
|
|
38765
|
+
};
|
|
38766
|
+
};
|
|
38562
38767
|
trace?: never;
|
|
38563
38768
|
};
|
|
38564
38769
|
"/sale-notes/{id}/buyer": {
|
|
@@ -39080,7 +39285,7 @@ interface paths {
|
|
|
39080
39285
|
};
|
|
39081
39286
|
/**
|
|
39082
39287
|
* The Vendedor a new nota de venta would get
|
|
39083
|
-
* @description Who `POST /sale-notes` credits as the **Vendedor** when its body names nobody (ADR 0114 §3), so a screen or an agent can propose that person up front: the assignee of the sale’s lead — the `lead_id` given, else the buyer’s lead on this car (`buyer_contact_id` + `vehicle_id`) — otherwise the car’s **Responsable del auto
|
|
39288
|
+
* @description Who `POST /sale-notes` credits as the **Vendedor** when its body names nobody (ADR 0114 §3), so a screen or an agent can propose that person up front: the assignee of the sale’s lead — the `lead_id` given, else the buyer’s lead on this car (`buyer_contact_id` + `vehicle_id`) — otherwise the car’s **Responsable del auto**, otherwise the **signed-in member** asking (never a Vitrina staff email, never an API key — for those the rung is skipped). A member who left the workspace is skipped. `source` says which rung answered (`lead_owner` | `vehicle_responsible` | `signed_in_user`) and `lead` (`id`, `display_id`) names the lead when it did. `data` is `null` when nobody can be proposed: the emit is then refused until a Vendedor is chosen. The inferred lead only proposes the Vendedor; it is never written as the nota de venta’s `lead_id`.
|
|
39084
39289
|
*/
|
|
39085
39290
|
get: {
|
|
39086
39291
|
parameters: {
|
|
@@ -44868,7 +45073,7 @@ interface paths {
|
|
|
44868
45073
|
head?: never;
|
|
44869
45074
|
/**
|
|
44870
45075
|
* Edit a live reservation
|
|
44871
|
-
* @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
|
|
45076
|
+
* @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), the salesperson, the holder (`holder_contact_id`, a contact of this workspace — 404 otherwise; the seña expectation and every payment applied to it move to the new holder) and the agreed price (`agreed_price_clp` > 0; 400 when below the money already paid or the expected seña; an estimated transfer cost — one stored with its breakdown — is re-estimated at the new price unless the request states one, a manual amount is kept). Never the unit. **409** once the hold is not `activa` (`details.reason = reservation_not_active`), or when a payment of the hold is also applied to another debt of the current holder (`details.reason = reservation_payment_shared`). Unknown keys are a 400. Answers the same shape as `GET /reservations/{id}`.
|
|
44872
45077
|
*/
|
|
44873
45078
|
patch: {
|
|
44874
45079
|
parameters: {
|
|
@@ -44883,6 +45088,7 @@ interface paths {
|
|
|
44883
45088
|
content: {
|
|
44884
45089
|
/**
|
|
44885
45090
|
* @example {
|
|
45091
|
+
* "agreed_price_clp": 19500000,
|
|
44886
45092
|
* "transfer_cost_clp": 250000,
|
|
44887
45093
|
* "transfer_cost_lines": null,
|
|
44888
45094
|
* "hold_expires_on": "2026-09-30"
|
|
@@ -44901,6 +45107,9 @@ interface paths {
|
|
|
44901
45107
|
keep_advertised?: boolean;
|
|
44902
45108
|
/** Format: uuid */
|
|
44903
45109
|
salesperson_id?: string | null;
|
|
45110
|
+
/** Format: uuid */
|
|
45111
|
+
holder_contact_id?: string;
|
|
45112
|
+
agreed_price_clp?: number;
|
|
44904
45113
|
};
|
|
44905
45114
|
};
|
|
44906
45115
|
};
|
|
@@ -45750,7 +45959,7 @@ interface paths {
|
|
|
45750
45959
|
put?: never;
|
|
45751
45960
|
/**
|
|
45752
45961
|
* Convert a reservation into a nota de venta
|
|
45753
|
-
* @description Produces a NEW sale-note document — 201, the same as `POST /sale-notes`. Scoped `sale_notes:write`, borrowed rather than a fifth reservations scope.
|
|
45962
|
+
* @description Produces a NEW sale-note document — 201, the same as `POST /sale-notes`. Scoped `sale_notes:write`, borrowed rather than a fifth reservations scope. `net_clp` omitted = the sale inherits the hold’s `agreed_price_clp`; stated = the sale closes at that price. A hold with no agreed price needs `net_clp` (400 otherwise).
|
|
45754
45963
|
*/
|
|
45755
45964
|
post: {
|
|
45756
45965
|
parameters: {
|
|
@@ -45779,6 +45988,7 @@ interface paths {
|
|
|
45779
45988
|
seller_of_record?: "consignante" | "retoma" | "automotora";
|
|
45780
45989
|
/** @enum {string} */
|
|
45781
45990
|
tax_treatment: "afecto" | "exento" | "no_gravado" | "pass_through";
|
|
45991
|
+
net_clp?: number;
|
|
45782
45992
|
tax_clp?: number | null;
|
|
45783
45993
|
/** Format: date-time */
|
|
45784
45994
|
issued_at?: string | null;
|
package/package.json
CHANGED