@vitrina/api 17.47.0 → 17.48.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 +1043 -0
- package/dist/index.d.ts +1043 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -39468,6 +39468,968 @@ interface paths {
|
|
|
39468
39468
|
patch?: never;
|
|
39469
39469
|
trace?: never;
|
|
39470
39470
|
};
|
|
39471
|
+
"/sale-notes/{id}/payments/{paymentId}/remove": {
|
|
39472
|
+
parameters: {
|
|
39473
|
+
query?: never;
|
|
39474
|
+
header?: never;
|
|
39475
|
+
path?: never;
|
|
39476
|
+
cookie?: never;
|
|
39477
|
+
};
|
|
39478
|
+
get?: never;
|
|
39479
|
+
put?: never;
|
|
39480
|
+
/**
|
|
39481
|
+
* Remove a payment from a nota de venta (issued or approved)
|
|
39482
|
+
* @description Removes one payment applied to a nota de venta that is ISSUED or APPROVED and not voided (app#7319). `reason` is required (one line, ≤ 300). What happens depends on what the money is, so no money fact becomes false:
|
|
39483
|
+
*
|
|
39484
|
+
* * a payment the staff typed (`provenance: manual`) is **reversed**: the row is kept and marked reversed (actor, instant, reason, the same reversal as `POST /payments/{id}/reverse`) and every live allocation of it is released. It stops counting on the note and on the reserva it was carried from;
|
|
39485
|
+
* * a payment the bank or a gateway proved (`provenance: verified`) is **released** from this note only: the money did arrive, so it stays as the buyer’s credit (Pagos, «por asignar») to apply elsewhere or refund.
|
|
39486
|
+
*
|
|
39487
|
+
* In the same transaction a `history` entry is written (`kind: payment`, `changes.payment: { from: { payment_id, instrument, amount_clp, on_note_clp, paid_on, provenance }, to: null }`, `changes.removal: { from: null, to: { effect, reason } }`); a compraventa printed before it reads `compraventa_outdated: true`. Adding a payment is `POST /document-payments` with `sale_note_id`; it writes the mirror entry (`changes.payment: { from: null, to: {…} }`). To change an amount, remove and add again. The receivable is not re-stated (what the buyer owes does not change); `totals`, saldo and `funding` follow.
|
|
39488
|
+
*
|
|
39489
|
+
* Responds with the same read as `GET /sale-notes/{id}` plus `payment_removal: { payment_id, effect: reversed | released, amount_clp, on_note_clp, reason, reservation_deposit, change_id }`. `reservation_deposit` names the reserva a carried payment came from and what the removal did to its seña: `no_longer_counted` (reversed) or `still_counted` (released); `null` otherwise.
|
|
39490
|
+
*
|
|
39491
|
+
* **404** when the payment is not applied to this note. **409** `details.blocked_reason` = `sale_note_voided`; `payment_already_removed`; `payment_shared` (a typed payment also applied to another debt of the buyer that is not this sale or its reserva: release it from the note in Pagos instead, or take it off the other debt first; `details.obligation_ids`). Requires `document_payments:write`.
|
|
39492
|
+
*/
|
|
39493
|
+
post: {
|
|
39494
|
+
parameters: {
|
|
39495
|
+
query?: never;
|
|
39496
|
+
header?: {
|
|
39497
|
+
/** @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. */
|
|
39498
|
+
"Idempotency-Key"?: string;
|
|
39499
|
+
};
|
|
39500
|
+
path: {
|
|
39501
|
+
id: string;
|
|
39502
|
+
paymentId: string;
|
|
39503
|
+
};
|
|
39504
|
+
cookie?: never;
|
|
39505
|
+
};
|
|
39506
|
+
requestBody?: {
|
|
39507
|
+
content: {
|
|
39508
|
+
/**
|
|
39509
|
+
* @example {
|
|
39510
|
+
* "reason": "Se registró dos veces"
|
|
39511
|
+
* }
|
|
39512
|
+
*/
|
|
39513
|
+
"application/json": components["schemas"]["RemoveSaleNotePaymentBody"];
|
|
39514
|
+
};
|
|
39515
|
+
};
|
|
39516
|
+
responses: {
|
|
39517
|
+
/** @description The nota de venta, as GET /sale-notes/{id} reads it, plus the removal */
|
|
39518
|
+
200: {
|
|
39519
|
+
headers: {
|
|
39520
|
+
[name: string]: unknown;
|
|
39521
|
+
};
|
|
39522
|
+
content: {
|
|
39523
|
+
/**
|
|
39524
|
+
* @example {
|
|
39525
|
+
* "data": {
|
|
39526
|
+
* "id": "d4d4d4d4-0000-4000-8000-000000000001",
|
|
39527
|
+
* "tenant_id": "a1a1a1a1-0000-4000-8000-000000000001",
|
|
39528
|
+
* "display_id": "V-118",
|
|
39529
|
+
* "display_seq": 118,
|
|
39530
|
+
* "vehicle_id": "e1e1e1e1-0000-4000-8000-000000000002",
|
|
39531
|
+
* "buyer_contact_id": "22222222-0000-4000-8000-000000000002",
|
|
39532
|
+
* "lead_id": null,
|
|
39533
|
+
* "converted_from_reservation_id": null,
|
|
39534
|
+
* "seller_of_record": "automotora",
|
|
39535
|
+
* "salesperson_id": "11111111-0000-4000-8000-000000000001",
|
|
39536
|
+
* "net_clp": 11900000,
|
|
39537
|
+
* "list_price_clp": 12490000,
|
|
39538
|
+
* "discount_clp": 590000,
|
|
39539
|
+
* "tax_clp": 1900000,
|
|
39540
|
+
* "tax_treatment": "afecto",
|
|
39541
|
+
* "status": "issued",
|
|
39542
|
+
* "issued_at": "2026-09-19T13:00:00.000Z",
|
|
39543
|
+
* "emitted_by": "11111111-0000-4000-8000-000000000001",
|
|
39544
|
+
* "approved_by": null,
|
|
39545
|
+
* "approved_at": null,
|
|
39546
|
+
* "voided_at": null,
|
|
39547
|
+
* "void_reason": null,
|
|
39548
|
+
* "voided_by": null,
|
|
39549
|
+
* "created_at": "2026-09-19T13:00:00.000Z",
|
|
39550
|
+
* "updated_at": "2026-09-19T13:00:00.000Z",
|
|
39551
|
+
* "receivable_obligation_id": "01a1c1df-a6ea-779f-9310-bdbb2eadd184",
|
|
39552
|
+
* "print_missing_fields": [
|
|
39553
|
+
* {
|
|
39554
|
+
* "variable": "COMPRADOR_DOMICILIO",
|
|
39555
|
+
* "label": "Domicilio del comprador",
|
|
39556
|
+
* "fix": "buyer_contact",
|
|
39557
|
+
* "contact_id": "01a1ad2b-a52a-7b04-abf8-389e20e8217a"
|
|
39558
|
+
* }
|
|
39559
|
+
* ],
|
|
39560
|
+
* "payments": [
|
|
39561
|
+
* {
|
|
39562
|
+
* "id": "d6d6d6d6-0000-4000-8000-000000000002",
|
|
39563
|
+
* "tenant_id": "a1a1a1a1-0000-4000-8000-000000000001",
|
|
39564
|
+
* "reservation_id": null,
|
|
39565
|
+
* "sale_note_id": "d4d4d4d4-0000-4000-8000-000000000001",
|
|
39566
|
+
* "carried_from_reservation_id": null,
|
|
39567
|
+
* "instrument": "transferencia",
|
|
39568
|
+
* "amount_clp": 13800000,
|
|
39569
|
+
* "paid_on": "2026-09-19",
|
|
39570
|
+
* "bank": "Banco de Chile",
|
|
39571
|
+
* "account_number": null,
|
|
39572
|
+
* "document_number": null,
|
|
39573
|
+
* "note": null,
|
|
39574
|
+
* "card_fee_bps": null,
|
|
39575
|
+
* "card_surcharge_clp": null,
|
|
39576
|
+
* "card_surcharge_source": null,
|
|
39577
|
+
* "created_at": "2026-09-19T13:05:00.000Z"
|
|
39578
|
+
* }
|
|
39579
|
+
* ],
|
|
39580
|
+
* "totals": {
|
|
39581
|
+
* "total_a_pagar_clp": 13800000,
|
|
39582
|
+
* "total_pagos_clp": 13800000,
|
|
39583
|
+
* "saldo_clp": 0,
|
|
39584
|
+
* "recargo_tarjeta_clp": 0,
|
|
39585
|
+
* "total_a_cobrar_clp": 13800000,
|
|
39586
|
+
* "payment_count": 1,
|
|
39587
|
+
* "complete": true,
|
|
39588
|
+
* "gaps": []
|
|
39589
|
+
* },
|
|
39590
|
+
* "funding": {
|
|
39591
|
+
* "standing": "funded",
|
|
39592
|
+
* "balanced": true,
|
|
39593
|
+
* "terms": {
|
|
39594
|
+
* "price_clp": 13800000,
|
|
39595
|
+
* "add_on_charges_clp": 0,
|
|
39596
|
+
* "payments_clp": 13800000,
|
|
39597
|
+
* "retoma_clp": 0,
|
|
39598
|
+
* "credit_clp": 0
|
|
39599
|
+
* },
|
|
39600
|
+
* "total_a_pagar_clp": 13800000,
|
|
39601
|
+
* "total_consideration_clp": 13800000,
|
|
39602
|
+
* "saldo_clp": 0,
|
|
39603
|
+
* "gap_clp": null,
|
|
39604
|
+
* "saldo_a_favor_del_cliente_clp": null,
|
|
39605
|
+
* "payment_count": 1,
|
|
39606
|
+
* "complete": true,
|
|
39607
|
+
* "gaps": []
|
|
39608
|
+
* },
|
|
39609
|
+
* "trade_ins": [],
|
|
39610
|
+
* "credit": null,
|
|
39611
|
+
* "timeline": [
|
|
39612
|
+
* {
|
|
39613
|
+
* "step": "emitted",
|
|
39614
|
+
* "at": "2026-09-19T13:00:00.000Z",
|
|
39615
|
+
* "actor": {
|
|
39616
|
+
* "id": "11111111-0000-4000-8000-000000000001",
|
|
39617
|
+
* "name": "Martina Reyes",
|
|
39618
|
+
* "kind": "member"
|
|
39619
|
+
* }
|
|
39620
|
+
* }
|
|
39621
|
+
* ],
|
|
39622
|
+
* "payment_removal": {
|
|
39623
|
+
* "payment_id": "01a1c1df-a6ea-779f-9310-bdbb2eadd1b1",
|
|
39624
|
+
* "effect": "reversed",
|
|
39625
|
+
* "amount_clp": 500000,
|
|
39626
|
+
* "on_note_clp": 500000,
|
|
39627
|
+
* "reason": "Se registró dos veces",
|
|
39628
|
+
* "reservation_deposit": null,
|
|
39629
|
+
* "change_id": "01a1c1df-a6ea-779f-9310-bdbb2eadd1b2"
|
|
39630
|
+
* }
|
|
39631
|
+
* }
|
|
39632
|
+
* }
|
|
39633
|
+
*/
|
|
39634
|
+
"application/json": {
|
|
39635
|
+
data: components["schemas"]["SaleNotePaymentRemoved"];
|
|
39636
|
+
meta?: {
|
|
39637
|
+
[key: string]: unknown;
|
|
39638
|
+
};
|
|
39639
|
+
};
|
|
39640
|
+
};
|
|
39641
|
+
};
|
|
39642
|
+
/** @description Validation error */
|
|
39643
|
+
400: {
|
|
39644
|
+
headers: {
|
|
39645
|
+
[name: string]: unknown;
|
|
39646
|
+
};
|
|
39647
|
+
content: {
|
|
39648
|
+
"application/json": components["schemas"]["Error"];
|
|
39649
|
+
};
|
|
39650
|
+
};
|
|
39651
|
+
/** @description Unauthorized */
|
|
39652
|
+
401: {
|
|
39653
|
+
headers: {
|
|
39654
|
+
[name: string]: unknown;
|
|
39655
|
+
};
|
|
39656
|
+
content: {
|
|
39657
|
+
"application/json": components["schemas"]["Error"];
|
|
39658
|
+
};
|
|
39659
|
+
};
|
|
39660
|
+
/** @description Forbidden */
|
|
39661
|
+
403: {
|
|
39662
|
+
headers: {
|
|
39663
|
+
[name: string]: unknown;
|
|
39664
|
+
};
|
|
39665
|
+
content: {
|
|
39666
|
+
"application/json": components["schemas"]["Error"];
|
|
39667
|
+
};
|
|
39668
|
+
};
|
|
39669
|
+
/** @description Not found */
|
|
39670
|
+
404: {
|
|
39671
|
+
headers: {
|
|
39672
|
+
[name: string]: unknown;
|
|
39673
|
+
};
|
|
39674
|
+
content: {
|
|
39675
|
+
"application/json": components["schemas"]["Error"];
|
|
39676
|
+
};
|
|
39677
|
+
};
|
|
39678
|
+
/** @description Conflict (incl. Idempotency-Key reuse with different body) */
|
|
39679
|
+
409: {
|
|
39680
|
+
headers: {
|
|
39681
|
+
[name: string]: unknown;
|
|
39682
|
+
};
|
|
39683
|
+
content: {
|
|
39684
|
+
"application/json": components["schemas"]["Error"];
|
|
39685
|
+
};
|
|
39686
|
+
};
|
|
39687
|
+
/** @description Rate limited */
|
|
39688
|
+
429: {
|
|
39689
|
+
headers: {
|
|
39690
|
+
[name: string]: unknown;
|
|
39691
|
+
};
|
|
39692
|
+
content: {
|
|
39693
|
+
"application/json": components["schemas"]["Error"];
|
|
39694
|
+
};
|
|
39695
|
+
};
|
|
39696
|
+
};
|
|
39697
|
+
};
|
|
39698
|
+
delete?: never;
|
|
39699
|
+
options?: never;
|
|
39700
|
+
head?: never;
|
|
39701
|
+
patch?: never;
|
|
39702
|
+
trace?: never;
|
|
39703
|
+
};
|
|
39704
|
+
"/sale-notes/{id}/add-ons/{lineId}": {
|
|
39705
|
+
parameters: {
|
|
39706
|
+
query?: never;
|
|
39707
|
+
header?: never;
|
|
39708
|
+
path?: never;
|
|
39709
|
+
cookie?: never;
|
|
39710
|
+
};
|
|
39711
|
+
get?: never;
|
|
39712
|
+
put?: never;
|
|
39713
|
+
post?: never;
|
|
39714
|
+
/**
|
|
39715
|
+
* Remove an add-on from an issued or approved nota de venta
|
|
39716
|
+
* @description Removes one add-on line (app#7318) from a nota de venta that is ISSUED or APPROVED and not voided. Only an add-on line can be removed; the vehicle line cannot be reached. In one transaction the receivable is re-stated and a `history` entry is written (`kind: add_on`, `changes.add_on: { from: <the line>, to: null }`); a compraventa printed before it reads `compraventa_outdated: true`. Responds with the same read as `GET /sale-notes/{id}`.
|
|
39717
|
+
*
|
|
39718
|
+
* **404** when `lineId` is not an add-on line of this note; **409** `details.blocked_reason` = `sale_note_voided`. Requires `sale_notes:write`.
|
|
39719
|
+
*/
|
|
39720
|
+
delete: {
|
|
39721
|
+
parameters: {
|
|
39722
|
+
query?: never;
|
|
39723
|
+
header?: never;
|
|
39724
|
+
path: {
|
|
39725
|
+
id: string;
|
|
39726
|
+
lineId: string;
|
|
39727
|
+
};
|
|
39728
|
+
cookie?: never;
|
|
39729
|
+
};
|
|
39730
|
+
requestBody?: never;
|
|
39731
|
+
responses: {
|
|
39732
|
+
/** @description The nota de venta, as GET /sale-notes/{id} reads it */
|
|
39733
|
+
200: {
|
|
39734
|
+
headers: {
|
|
39735
|
+
[name: string]: unknown;
|
|
39736
|
+
};
|
|
39737
|
+
content: {
|
|
39738
|
+
/**
|
|
39739
|
+
* @example {
|
|
39740
|
+
* "data": {
|
|
39741
|
+
* "id": "d4d4d4d4-0000-4000-8000-000000000001",
|
|
39742
|
+
* "tenant_id": "a1a1a1a1-0000-4000-8000-000000000001",
|
|
39743
|
+
* "display_id": "V-118",
|
|
39744
|
+
* "display_seq": 118,
|
|
39745
|
+
* "vehicle_id": "e1e1e1e1-0000-4000-8000-000000000002",
|
|
39746
|
+
* "buyer_contact_id": "22222222-0000-4000-8000-000000000002",
|
|
39747
|
+
* "lead_id": null,
|
|
39748
|
+
* "converted_from_reservation_id": null,
|
|
39749
|
+
* "seller_of_record": "automotora",
|
|
39750
|
+
* "salesperson_id": "11111111-0000-4000-8000-000000000001",
|
|
39751
|
+
* "net_clp": 11900000,
|
|
39752
|
+
* "list_price_clp": 12490000,
|
|
39753
|
+
* "discount_clp": 590000,
|
|
39754
|
+
* "tax_clp": 1900000,
|
|
39755
|
+
* "tax_treatment": "afecto",
|
|
39756
|
+
* "status": "issued",
|
|
39757
|
+
* "issued_at": "2026-09-19T13:00:00.000Z",
|
|
39758
|
+
* "emitted_by": "11111111-0000-4000-8000-000000000001",
|
|
39759
|
+
* "approved_by": null,
|
|
39760
|
+
* "approved_at": null,
|
|
39761
|
+
* "voided_at": null,
|
|
39762
|
+
* "void_reason": null,
|
|
39763
|
+
* "voided_by": null,
|
|
39764
|
+
* "created_at": "2026-09-19T13:00:00.000Z",
|
|
39765
|
+
* "updated_at": "2026-09-19T13:00:00.000Z",
|
|
39766
|
+
* "receivable_obligation_id": "01a1c1df-a6ea-779f-9310-bdbb2eadd184",
|
|
39767
|
+
* "print_missing_fields": [
|
|
39768
|
+
* {
|
|
39769
|
+
* "variable": "COMPRADOR_DOMICILIO",
|
|
39770
|
+
* "label": "Domicilio del comprador",
|
|
39771
|
+
* "fix": "buyer_contact",
|
|
39772
|
+
* "contact_id": "01a1ad2b-a52a-7b04-abf8-389e20e8217a"
|
|
39773
|
+
* }
|
|
39774
|
+
* ],
|
|
39775
|
+
* "payments": [
|
|
39776
|
+
* {
|
|
39777
|
+
* "id": "d6d6d6d6-0000-4000-8000-000000000002",
|
|
39778
|
+
* "tenant_id": "a1a1a1a1-0000-4000-8000-000000000001",
|
|
39779
|
+
* "reservation_id": null,
|
|
39780
|
+
* "sale_note_id": "d4d4d4d4-0000-4000-8000-000000000001",
|
|
39781
|
+
* "carried_from_reservation_id": null,
|
|
39782
|
+
* "instrument": "transferencia",
|
|
39783
|
+
* "amount_clp": 13800000,
|
|
39784
|
+
* "paid_on": "2026-09-19",
|
|
39785
|
+
* "bank": "Banco de Chile",
|
|
39786
|
+
* "account_number": null,
|
|
39787
|
+
* "document_number": null,
|
|
39788
|
+
* "note": null,
|
|
39789
|
+
* "card_fee_bps": null,
|
|
39790
|
+
* "card_surcharge_clp": null,
|
|
39791
|
+
* "card_surcharge_source": null,
|
|
39792
|
+
* "created_at": "2026-09-19T13:05:00.000Z"
|
|
39793
|
+
* }
|
|
39794
|
+
* ],
|
|
39795
|
+
* "totals": {
|
|
39796
|
+
* "total_a_pagar_clp": 13800000,
|
|
39797
|
+
* "total_pagos_clp": 13800000,
|
|
39798
|
+
* "saldo_clp": 0,
|
|
39799
|
+
* "recargo_tarjeta_clp": 0,
|
|
39800
|
+
* "total_a_cobrar_clp": 13800000,
|
|
39801
|
+
* "payment_count": 1,
|
|
39802
|
+
* "complete": true,
|
|
39803
|
+
* "gaps": []
|
|
39804
|
+
* },
|
|
39805
|
+
* "funding": {
|
|
39806
|
+
* "standing": "funded",
|
|
39807
|
+
* "balanced": true,
|
|
39808
|
+
* "terms": {
|
|
39809
|
+
* "price_clp": 13800000,
|
|
39810
|
+
* "add_on_charges_clp": 0,
|
|
39811
|
+
* "payments_clp": 13800000,
|
|
39812
|
+
* "retoma_clp": 0,
|
|
39813
|
+
* "credit_clp": 0
|
|
39814
|
+
* },
|
|
39815
|
+
* "total_a_pagar_clp": 13800000,
|
|
39816
|
+
* "total_consideration_clp": 13800000,
|
|
39817
|
+
* "saldo_clp": 0,
|
|
39818
|
+
* "gap_clp": null,
|
|
39819
|
+
* "saldo_a_favor_del_cliente_clp": null,
|
|
39820
|
+
* "payment_count": 1,
|
|
39821
|
+
* "complete": true,
|
|
39822
|
+
* "gaps": []
|
|
39823
|
+
* },
|
|
39824
|
+
* "trade_ins": [],
|
|
39825
|
+
* "credit": null,
|
|
39826
|
+
* "timeline": [
|
|
39827
|
+
* {
|
|
39828
|
+
* "step": "emitted",
|
|
39829
|
+
* "at": "2026-09-19T13:00:00.000Z",
|
|
39830
|
+
* "actor": {
|
|
39831
|
+
* "id": "11111111-0000-4000-8000-000000000001",
|
|
39832
|
+
* "name": "Martina Reyes",
|
|
39833
|
+
* "kind": "member"
|
|
39834
|
+
* }
|
|
39835
|
+
* }
|
|
39836
|
+
* ],
|
|
39837
|
+
* "transfer_tax": {
|
|
39838
|
+
* "line_id": "01a1c1df-a6ea-779f-9310-bdbb2eadd1a7",
|
|
39839
|
+
* "charge_clp": 120000,
|
|
39840
|
+
* "source": "calculated",
|
|
39841
|
+
* "at_current_price_clp": 135000,
|
|
39842
|
+
* "gaps": [],
|
|
39843
|
+
* "recalculation_offered": true
|
|
39844
|
+
* },
|
|
39845
|
+
* "history": [
|
|
39846
|
+
* {
|
|
39847
|
+
* "id": "01a1c1df-a6ea-779f-9310-bdbb2eadd1a8",
|
|
39848
|
+
* "kind": "add_on",
|
|
39849
|
+
* "changes": {
|
|
39850
|
+
* "add_on": {
|
|
39851
|
+
* "from": {
|
|
39852
|
+
* "line_id": "01a1c1df-a6ea-779f-9310-bdbb2eadd1a9",
|
|
39853
|
+
* "kind": "otro",
|
|
39854
|
+
* "description": "Garantía extendida",
|
|
39855
|
+
* "charge_clp": 119000,
|
|
39856
|
+
* "tax_treatment": "afecto"
|
|
39857
|
+
* },
|
|
39858
|
+
* "to": {
|
|
39859
|
+
* "line_id": "01a1c1df-a6ea-779f-9310-bdbb2eadd1a9",
|
|
39860
|
+
* "kind": "otro",
|
|
39861
|
+
* "description": "Garantía extendida 24 meses",
|
|
39862
|
+
* "charge_clp": 150000,
|
|
39863
|
+
* "tax_treatment": "afecto"
|
|
39864
|
+
* }
|
|
39865
|
+
* }
|
|
39866
|
+
* },
|
|
39867
|
+
* "at": "2026-11-15T13:20:00.000Z",
|
|
39868
|
+
* "actor": null,
|
|
39869
|
+
* "on_approved_note": true,
|
|
39870
|
+
* "price_approval_id": null,
|
|
39871
|
+
* "authorised_by": null
|
|
39872
|
+
* }
|
|
39873
|
+
* ],
|
|
39874
|
+
* "compraventa_outdated": false,
|
|
39875
|
+
* "pending_price_change": null
|
|
39876
|
+
* }
|
|
39877
|
+
* }
|
|
39878
|
+
*/
|
|
39879
|
+
"application/json": {
|
|
39880
|
+
data: components["schemas"]["SaleNoteRead"];
|
|
39881
|
+
meta?: {
|
|
39882
|
+
[key: string]: unknown;
|
|
39883
|
+
};
|
|
39884
|
+
};
|
|
39885
|
+
};
|
|
39886
|
+
};
|
|
39887
|
+
/** @description Validation error */
|
|
39888
|
+
400: {
|
|
39889
|
+
headers: {
|
|
39890
|
+
[name: string]: unknown;
|
|
39891
|
+
};
|
|
39892
|
+
content: {
|
|
39893
|
+
"application/json": components["schemas"]["Error"];
|
|
39894
|
+
};
|
|
39895
|
+
};
|
|
39896
|
+
/** @description Unauthorized */
|
|
39897
|
+
401: {
|
|
39898
|
+
headers: {
|
|
39899
|
+
[name: string]: unknown;
|
|
39900
|
+
};
|
|
39901
|
+
content: {
|
|
39902
|
+
"application/json": components["schemas"]["Error"];
|
|
39903
|
+
};
|
|
39904
|
+
};
|
|
39905
|
+
/** @description Forbidden */
|
|
39906
|
+
403: {
|
|
39907
|
+
headers: {
|
|
39908
|
+
[name: string]: unknown;
|
|
39909
|
+
};
|
|
39910
|
+
content: {
|
|
39911
|
+
"application/json": components["schemas"]["Error"];
|
|
39912
|
+
};
|
|
39913
|
+
};
|
|
39914
|
+
/** @description Not found */
|
|
39915
|
+
404: {
|
|
39916
|
+
headers: {
|
|
39917
|
+
[name: string]: unknown;
|
|
39918
|
+
};
|
|
39919
|
+
content: {
|
|
39920
|
+
"application/json": components["schemas"]["Error"];
|
|
39921
|
+
};
|
|
39922
|
+
};
|
|
39923
|
+
/** @description Conflict (incl. Idempotency-Key reuse with different body) */
|
|
39924
|
+
409: {
|
|
39925
|
+
headers: {
|
|
39926
|
+
[name: string]: unknown;
|
|
39927
|
+
};
|
|
39928
|
+
content: {
|
|
39929
|
+
"application/json": components["schemas"]["Error"];
|
|
39930
|
+
};
|
|
39931
|
+
};
|
|
39932
|
+
/** @description Rate limited */
|
|
39933
|
+
429: {
|
|
39934
|
+
headers: {
|
|
39935
|
+
[name: string]: unknown;
|
|
39936
|
+
};
|
|
39937
|
+
content: {
|
|
39938
|
+
"application/json": components["schemas"]["Error"];
|
|
39939
|
+
};
|
|
39940
|
+
};
|
|
39941
|
+
};
|
|
39942
|
+
};
|
|
39943
|
+
options?: never;
|
|
39944
|
+
head?: never;
|
|
39945
|
+
/**
|
|
39946
|
+
* Change an add-on on an issued or approved nota de venta
|
|
39947
|
+
* @description Changes one add-on line (app#7318) on a nota de venta that is ISSUED or APPROVED and not voided: `description`, `charge_clp` (what the buyer pays for it, IVA included on an afecto «Otro») and, on an «Otro» line only, `tax_treatment` (`afecto` | `exento`). All optional, at least one; unknown keys are a 400. The line keeps its id, position, framing, beneficiary and fee citation; on a `reembolso_mandato` line the cost follows the amount. A statutory line’s treatment follows its framing: sending a different one is a **400** on `tax_treatment`. In one transaction the buyer’s receivable is re-stated (total a pagar, saldo and funding standing follow) and a `history` entry is written (`kind: add_on`, `changes.add_on: { from, to }`, each a snapshot `{ line_id, kind, description, charge_clp, tax_treatment }`); a compraventa printed before it reads `compraventa_outdated: true`. The vehicle’s price does not move, so no price approval is involved. Sending what the line already says is a no-op (no history). Responds with the same read as `GET /sale-notes/{id}`.
|
|
39948
|
+
*
|
|
39949
|
+
* **404** when `lineId` is not an add-on line of this note; **409** `details.blocked_reason` = `sale_note_voided`. Requires `sale_notes:write`.
|
|
39950
|
+
*/
|
|
39951
|
+
patch: {
|
|
39952
|
+
parameters: {
|
|
39953
|
+
query?: never;
|
|
39954
|
+
header?: never;
|
|
39955
|
+
path: {
|
|
39956
|
+
id: string;
|
|
39957
|
+
lineId: string;
|
|
39958
|
+
};
|
|
39959
|
+
cookie?: never;
|
|
39960
|
+
};
|
|
39961
|
+
requestBody?: {
|
|
39962
|
+
content: {
|
|
39963
|
+
/**
|
|
39964
|
+
* @example {
|
|
39965
|
+
* "description": "Garantía extendida 24 meses",
|
|
39966
|
+
* "charge_clp": 150000
|
|
39967
|
+
* }
|
|
39968
|
+
*/
|
|
39969
|
+
"application/json": components["schemas"]["ChangeSaleNoteAddOnBody"];
|
|
39970
|
+
};
|
|
39971
|
+
};
|
|
39972
|
+
responses: {
|
|
39973
|
+
/** @description The nota de venta, as GET /sale-notes/{id} reads it */
|
|
39974
|
+
200: {
|
|
39975
|
+
headers: {
|
|
39976
|
+
[name: string]: unknown;
|
|
39977
|
+
};
|
|
39978
|
+
content: {
|
|
39979
|
+
/**
|
|
39980
|
+
* @example {
|
|
39981
|
+
* "data": {
|
|
39982
|
+
* "id": "d4d4d4d4-0000-4000-8000-000000000001",
|
|
39983
|
+
* "tenant_id": "a1a1a1a1-0000-4000-8000-000000000001",
|
|
39984
|
+
* "display_id": "V-118",
|
|
39985
|
+
* "display_seq": 118,
|
|
39986
|
+
* "vehicle_id": "e1e1e1e1-0000-4000-8000-000000000002",
|
|
39987
|
+
* "buyer_contact_id": "22222222-0000-4000-8000-000000000002",
|
|
39988
|
+
* "lead_id": null,
|
|
39989
|
+
* "converted_from_reservation_id": null,
|
|
39990
|
+
* "seller_of_record": "automotora",
|
|
39991
|
+
* "salesperson_id": "11111111-0000-4000-8000-000000000001",
|
|
39992
|
+
* "net_clp": 11900000,
|
|
39993
|
+
* "list_price_clp": 12490000,
|
|
39994
|
+
* "discount_clp": 590000,
|
|
39995
|
+
* "tax_clp": 1900000,
|
|
39996
|
+
* "tax_treatment": "afecto",
|
|
39997
|
+
* "status": "issued",
|
|
39998
|
+
* "issued_at": "2026-09-19T13:00:00.000Z",
|
|
39999
|
+
* "emitted_by": "11111111-0000-4000-8000-000000000001",
|
|
40000
|
+
* "approved_by": null,
|
|
40001
|
+
* "approved_at": null,
|
|
40002
|
+
* "voided_at": null,
|
|
40003
|
+
* "void_reason": null,
|
|
40004
|
+
* "voided_by": null,
|
|
40005
|
+
* "created_at": "2026-09-19T13:00:00.000Z",
|
|
40006
|
+
* "updated_at": "2026-09-19T13:00:00.000Z",
|
|
40007
|
+
* "receivable_obligation_id": "01a1c1df-a6ea-779f-9310-bdbb2eadd184",
|
|
40008
|
+
* "print_missing_fields": [
|
|
40009
|
+
* {
|
|
40010
|
+
* "variable": "COMPRADOR_DOMICILIO",
|
|
40011
|
+
* "label": "Domicilio del comprador",
|
|
40012
|
+
* "fix": "buyer_contact",
|
|
40013
|
+
* "contact_id": "01a1ad2b-a52a-7b04-abf8-389e20e8217a"
|
|
40014
|
+
* }
|
|
40015
|
+
* ],
|
|
40016
|
+
* "payments": [
|
|
40017
|
+
* {
|
|
40018
|
+
* "id": "d6d6d6d6-0000-4000-8000-000000000002",
|
|
40019
|
+
* "tenant_id": "a1a1a1a1-0000-4000-8000-000000000001",
|
|
40020
|
+
* "reservation_id": null,
|
|
40021
|
+
* "sale_note_id": "d4d4d4d4-0000-4000-8000-000000000001",
|
|
40022
|
+
* "carried_from_reservation_id": null,
|
|
40023
|
+
* "instrument": "transferencia",
|
|
40024
|
+
* "amount_clp": 13800000,
|
|
40025
|
+
* "paid_on": "2026-09-19",
|
|
40026
|
+
* "bank": "Banco de Chile",
|
|
40027
|
+
* "account_number": null,
|
|
40028
|
+
* "document_number": null,
|
|
40029
|
+
* "note": null,
|
|
40030
|
+
* "card_fee_bps": null,
|
|
40031
|
+
* "card_surcharge_clp": null,
|
|
40032
|
+
* "card_surcharge_source": null,
|
|
40033
|
+
* "created_at": "2026-09-19T13:05:00.000Z"
|
|
40034
|
+
* }
|
|
40035
|
+
* ],
|
|
40036
|
+
* "totals": {
|
|
40037
|
+
* "total_a_pagar_clp": 13800000,
|
|
40038
|
+
* "total_pagos_clp": 13800000,
|
|
40039
|
+
* "saldo_clp": 0,
|
|
40040
|
+
* "recargo_tarjeta_clp": 0,
|
|
40041
|
+
* "total_a_cobrar_clp": 13800000,
|
|
40042
|
+
* "payment_count": 1,
|
|
40043
|
+
* "complete": true,
|
|
40044
|
+
* "gaps": []
|
|
40045
|
+
* },
|
|
40046
|
+
* "funding": {
|
|
40047
|
+
* "standing": "funded",
|
|
40048
|
+
* "balanced": true,
|
|
40049
|
+
* "terms": {
|
|
40050
|
+
* "price_clp": 13800000,
|
|
40051
|
+
* "add_on_charges_clp": 0,
|
|
40052
|
+
* "payments_clp": 13800000,
|
|
40053
|
+
* "retoma_clp": 0,
|
|
40054
|
+
* "credit_clp": 0
|
|
40055
|
+
* },
|
|
40056
|
+
* "total_a_pagar_clp": 13800000,
|
|
40057
|
+
* "total_consideration_clp": 13800000,
|
|
40058
|
+
* "saldo_clp": 0,
|
|
40059
|
+
* "gap_clp": null,
|
|
40060
|
+
* "saldo_a_favor_del_cliente_clp": null,
|
|
40061
|
+
* "payment_count": 1,
|
|
40062
|
+
* "complete": true,
|
|
40063
|
+
* "gaps": []
|
|
40064
|
+
* },
|
|
40065
|
+
* "trade_ins": [],
|
|
40066
|
+
* "credit": null,
|
|
40067
|
+
* "timeline": [
|
|
40068
|
+
* {
|
|
40069
|
+
* "step": "emitted",
|
|
40070
|
+
* "at": "2026-09-19T13:00:00.000Z",
|
|
40071
|
+
* "actor": {
|
|
40072
|
+
* "id": "11111111-0000-4000-8000-000000000001",
|
|
40073
|
+
* "name": "Martina Reyes",
|
|
40074
|
+
* "kind": "member"
|
|
40075
|
+
* }
|
|
40076
|
+
* }
|
|
40077
|
+
* ],
|
|
40078
|
+
* "transfer_tax": {
|
|
40079
|
+
* "line_id": "01a1c1df-a6ea-779f-9310-bdbb2eadd1a7",
|
|
40080
|
+
* "charge_clp": 120000,
|
|
40081
|
+
* "source": "calculated",
|
|
40082
|
+
* "at_current_price_clp": 135000,
|
|
40083
|
+
* "gaps": [],
|
|
40084
|
+
* "recalculation_offered": true
|
|
40085
|
+
* },
|
|
40086
|
+
* "history": [
|
|
40087
|
+
* {
|
|
40088
|
+
* "id": "01a1c1df-a6ea-779f-9310-bdbb2eadd1a8",
|
|
40089
|
+
* "kind": "add_on",
|
|
40090
|
+
* "changes": {
|
|
40091
|
+
* "add_on": {
|
|
40092
|
+
* "from": {
|
|
40093
|
+
* "line_id": "01a1c1df-a6ea-779f-9310-bdbb2eadd1a9",
|
|
40094
|
+
* "kind": "otro",
|
|
40095
|
+
* "description": "Garantía extendida",
|
|
40096
|
+
* "charge_clp": 119000,
|
|
40097
|
+
* "tax_treatment": "afecto"
|
|
40098
|
+
* },
|
|
40099
|
+
* "to": {
|
|
40100
|
+
* "line_id": "01a1c1df-a6ea-779f-9310-bdbb2eadd1a9",
|
|
40101
|
+
* "kind": "otro",
|
|
40102
|
+
* "description": "Garantía extendida 24 meses",
|
|
40103
|
+
* "charge_clp": 150000,
|
|
40104
|
+
* "tax_treatment": "afecto"
|
|
40105
|
+
* }
|
|
40106
|
+
* }
|
|
40107
|
+
* },
|
|
40108
|
+
* "at": "2026-11-15T13:20:00.000Z",
|
|
40109
|
+
* "actor": null,
|
|
40110
|
+
* "on_approved_note": true,
|
|
40111
|
+
* "price_approval_id": null,
|
|
40112
|
+
* "authorised_by": null
|
|
40113
|
+
* }
|
|
40114
|
+
* ],
|
|
40115
|
+
* "compraventa_outdated": false,
|
|
40116
|
+
* "pending_price_change": null
|
|
40117
|
+
* }
|
|
40118
|
+
* }
|
|
40119
|
+
*/
|
|
40120
|
+
"application/json": {
|
|
40121
|
+
data: components["schemas"]["SaleNoteRead"];
|
|
40122
|
+
meta?: {
|
|
40123
|
+
[key: string]: unknown;
|
|
40124
|
+
};
|
|
40125
|
+
};
|
|
40126
|
+
};
|
|
40127
|
+
};
|
|
40128
|
+
/** @description Validation error */
|
|
40129
|
+
400: {
|
|
40130
|
+
headers: {
|
|
40131
|
+
[name: string]: unknown;
|
|
40132
|
+
};
|
|
40133
|
+
content: {
|
|
40134
|
+
"application/json": components["schemas"]["Error"];
|
|
40135
|
+
};
|
|
40136
|
+
};
|
|
40137
|
+
/** @description Unauthorized */
|
|
40138
|
+
401: {
|
|
40139
|
+
headers: {
|
|
40140
|
+
[name: string]: unknown;
|
|
40141
|
+
};
|
|
40142
|
+
content: {
|
|
40143
|
+
"application/json": components["schemas"]["Error"];
|
|
40144
|
+
};
|
|
40145
|
+
};
|
|
40146
|
+
/** @description Forbidden */
|
|
40147
|
+
403: {
|
|
40148
|
+
headers: {
|
|
40149
|
+
[name: string]: unknown;
|
|
40150
|
+
};
|
|
40151
|
+
content: {
|
|
40152
|
+
"application/json": components["schemas"]["Error"];
|
|
40153
|
+
};
|
|
40154
|
+
};
|
|
40155
|
+
/** @description Not found */
|
|
40156
|
+
404: {
|
|
40157
|
+
headers: {
|
|
40158
|
+
[name: string]: unknown;
|
|
40159
|
+
};
|
|
40160
|
+
content: {
|
|
40161
|
+
"application/json": components["schemas"]["Error"];
|
|
40162
|
+
};
|
|
40163
|
+
};
|
|
40164
|
+
/** @description Conflict (incl. Idempotency-Key reuse with different body) */
|
|
40165
|
+
409: {
|
|
40166
|
+
headers: {
|
|
40167
|
+
[name: string]: unknown;
|
|
40168
|
+
};
|
|
40169
|
+
content: {
|
|
40170
|
+
"application/json": components["schemas"]["Error"];
|
|
40171
|
+
};
|
|
40172
|
+
};
|
|
40173
|
+
/** @description Rate limited */
|
|
40174
|
+
429: {
|
|
40175
|
+
headers: {
|
|
40176
|
+
[name: string]: unknown;
|
|
40177
|
+
};
|
|
40178
|
+
content: {
|
|
40179
|
+
"application/json": components["schemas"]["Error"];
|
|
40180
|
+
};
|
|
40181
|
+
};
|
|
40182
|
+
};
|
|
40183
|
+
};
|
|
40184
|
+
trace?: never;
|
|
40185
|
+
};
|
|
40186
|
+
"/sale-notes/{id}/add-ons/{lineId}/recalculate": {
|
|
40187
|
+
parameters: {
|
|
40188
|
+
query?: never;
|
|
40189
|
+
header?: never;
|
|
40190
|
+
path?: never;
|
|
40191
|
+
cookie?: never;
|
|
40192
|
+
};
|
|
40193
|
+
get?: never;
|
|
40194
|
+
put?: never;
|
|
40195
|
+
/**
|
|
40196
|
+
* Recalculate the transfer tax at the note’s current price
|
|
40197
|
+
* @description Rewrites a `transferencia_municipal` line (app#7318) with the transfer tax computed at the note’s CURRENT price (the same computation as `POST /transfer-tax/preview`, as of the note’s issue day, with permiso de circulación) and the citation of the rate row it used; a reembolso’s cost follows. Only ever on this explicit request: after a price correction `GET /sale-notes/{id}` reads `transfer_tax: { line_id, charge_clp, source: calculated | typed, at_current_price_clp, gaps, recalculation_offered }`, and `recalculation_offered` is `true` only for a CALCULATED line whose amount differs from the current price’s. A typed line is never offered one, but may still be recalculated on request. Re-states the receivable and writes a `history` entry (`kind: add_on`, the `to` snapshot carries `recalculated: true`); a no-op when the amount already matches. Responds with the same read as `GET /sale-notes/{id}`.
|
|
40198
|
+
*
|
|
40199
|
+
* **400** when the line is not the transfer tax; **404** when `lineId` is not an add-on line of this note; **409** `details.blocked_reason` = `transfer_tax_incomplete` (with `details.gaps`) when it cannot be computed, or `sale_note_voided`. Requires `sale_notes:write`.
|
|
40200
|
+
*/
|
|
40201
|
+
post: {
|
|
40202
|
+
parameters: {
|
|
40203
|
+
query?: never;
|
|
40204
|
+
header?: {
|
|
40205
|
+
/** @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. */
|
|
40206
|
+
"Idempotency-Key"?: string;
|
|
40207
|
+
};
|
|
40208
|
+
path: {
|
|
40209
|
+
id: string;
|
|
40210
|
+
lineId: string;
|
|
40211
|
+
};
|
|
40212
|
+
cookie?: never;
|
|
40213
|
+
};
|
|
40214
|
+
requestBody?: never;
|
|
40215
|
+
responses: {
|
|
40216
|
+
/** @description The nota de venta, as GET /sale-notes/{id} reads it */
|
|
40217
|
+
200: {
|
|
40218
|
+
headers: {
|
|
40219
|
+
[name: string]: unknown;
|
|
40220
|
+
};
|
|
40221
|
+
content: {
|
|
40222
|
+
/**
|
|
40223
|
+
* @example {
|
|
40224
|
+
* "data": {
|
|
40225
|
+
* "id": "d4d4d4d4-0000-4000-8000-000000000001",
|
|
40226
|
+
* "tenant_id": "a1a1a1a1-0000-4000-8000-000000000001",
|
|
40227
|
+
* "display_id": "V-118",
|
|
40228
|
+
* "display_seq": 118,
|
|
40229
|
+
* "vehicle_id": "e1e1e1e1-0000-4000-8000-000000000002",
|
|
40230
|
+
* "buyer_contact_id": "22222222-0000-4000-8000-000000000002",
|
|
40231
|
+
* "lead_id": null,
|
|
40232
|
+
* "converted_from_reservation_id": null,
|
|
40233
|
+
* "seller_of_record": "automotora",
|
|
40234
|
+
* "salesperson_id": "11111111-0000-4000-8000-000000000001",
|
|
40235
|
+
* "net_clp": 11900000,
|
|
40236
|
+
* "list_price_clp": 12490000,
|
|
40237
|
+
* "discount_clp": 590000,
|
|
40238
|
+
* "tax_clp": 1900000,
|
|
40239
|
+
* "tax_treatment": "afecto",
|
|
40240
|
+
* "status": "issued",
|
|
40241
|
+
* "issued_at": "2026-09-19T13:00:00.000Z",
|
|
40242
|
+
* "emitted_by": "11111111-0000-4000-8000-000000000001",
|
|
40243
|
+
* "approved_by": null,
|
|
40244
|
+
* "approved_at": null,
|
|
40245
|
+
* "voided_at": null,
|
|
40246
|
+
* "void_reason": null,
|
|
40247
|
+
* "voided_by": null,
|
|
40248
|
+
* "created_at": "2026-09-19T13:00:00.000Z",
|
|
40249
|
+
* "updated_at": "2026-09-19T13:00:00.000Z",
|
|
40250
|
+
* "receivable_obligation_id": "01a1c1df-a6ea-779f-9310-bdbb2eadd184",
|
|
40251
|
+
* "print_missing_fields": [
|
|
40252
|
+
* {
|
|
40253
|
+
* "variable": "COMPRADOR_DOMICILIO",
|
|
40254
|
+
* "label": "Domicilio del comprador",
|
|
40255
|
+
* "fix": "buyer_contact",
|
|
40256
|
+
* "contact_id": "01a1ad2b-a52a-7b04-abf8-389e20e8217a"
|
|
40257
|
+
* }
|
|
40258
|
+
* ],
|
|
40259
|
+
* "payments": [
|
|
40260
|
+
* {
|
|
40261
|
+
* "id": "d6d6d6d6-0000-4000-8000-000000000002",
|
|
40262
|
+
* "tenant_id": "a1a1a1a1-0000-4000-8000-000000000001",
|
|
40263
|
+
* "reservation_id": null,
|
|
40264
|
+
* "sale_note_id": "d4d4d4d4-0000-4000-8000-000000000001",
|
|
40265
|
+
* "carried_from_reservation_id": null,
|
|
40266
|
+
* "instrument": "transferencia",
|
|
40267
|
+
* "amount_clp": 13800000,
|
|
40268
|
+
* "paid_on": "2026-09-19",
|
|
40269
|
+
* "bank": "Banco de Chile",
|
|
40270
|
+
* "account_number": null,
|
|
40271
|
+
* "document_number": null,
|
|
40272
|
+
* "note": null,
|
|
40273
|
+
* "card_fee_bps": null,
|
|
40274
|
+
* "card_surcharge_clp": null,
|
|
40275
|
+
* "card_surcharge_source": null,
|
|
40276
|
+
* "created_at": "2026-09-19T13:05:00.000Z"
|
|
40277
|
+
* }
|
|
40278
|
+
* ],
|
|
40279
|
+
* "totals": {
|
|
40280
|
+
* "total_a_pagar_clp": 13800000,
|
|
40281
|
+
* "total_pagos_clp": 13800000,
|
|
40282
|
+
* "saldo_clp": 0,
|
|
40283
|
+
* "recargo_tarjeta_clp": 0,
|
|
40284
|
+
* "total_a_cobrar_clp": 13800000,
|
|
40285
|
+
* "payment_count": 1,
|
|
40286
|
+
* "complete": true,
|
|
40287
|
+
* "gaps": []
|
|
40288
|
+
* },
|
|
40289
|
+
* "funding": {
|
|
40290
|
+
* "standing": "funded",
|
|
40291
|
+
* "balanced": true,
|
|
40292
|
+
* "terms": {
|
|
40293
|
+
* "price_clp": 13800000,
|
|
40294
|
+
* "add_on_charges_clp": 0,
|
|
40295
|
+
* "payments_clp": 13800000,
|
|
40296
|
+
* "retoma_clp": 0,
|
|
40297
|
+
* "credit_clp": 0
|
|
40298
|
+
* },
|
|
40299
|
+
* "total_a_pagar_clp": 13800000,
|
|
40300
|
+
* "total_consideration_clp": 13800000,
|
|
40301
|
+
* "saldo_clp": 0,
|
|
40302
|
+
* "gap_clp": null,
|
|
40303
|
+
* "saldo_a_favor_del_cliente_clp": null,
|
|
40304
|
+
* "payment_count": 1,
|
|
40305
|
+
* "complete": true,
|
|
40306
|
+
* "gaps": []
|
|
40307
|
+
* },
|
|
40308
|
+
* "trade_ins": [],
|
|
40309
|
+
* "credit": null,
|
|
40310
|
+
* "timeline": [
|
|
40311
|
+
* {
|
|
40312
|
+
* "step": "emitted",
|
|
40313
|
+
* "at": "2026-09-19T13:00:00.000Z",
|
|
40314
|
+
* "actor": {
|
|
40315
|
+
* "id": "11111111-0000-4000-8000-000000000001",
|
|
40316
|
+
* "name": "Martina Reyes",
|
|
40317
|
+
* "kind": "member"
|
|
40318
|
+
* }
|
|
40319
|
+
* }
|
|
40320
|
+
* ],
|
|
40321
|
+
* "transfer_tax": {
|
|
40322
|
+
* "line_id": "01a1c1df-a6ea-779f-9310-bdbb2eadd1a7",
|
|
40323
|
+
* "charge_clp": 120000,
|
|
40324
|
+
* "source": "calculated",
|
|
40325
|
+
* "at_current_price_clp": 135000,
|
|
40326
|
+
* "gaps": [],
|
|
40327
|
+
* "recalculation_offered": true
|
|
40328
|
+
* },
|
|
40329
|
+
* "history": [
|
|
40330
|
+
* {
|
|
40331
|
+
* "id": "01a1c1df-a6ea-779f-9310-bdbb2eadd1a8",
|
|
40332
|
+
* "kind": "add_on",
|
|
40333
|
+
* "changes": {
|
|
40334
|
+
* "add_on": {
|
|
40335
|
+
* "from": {
|
|
40336
|
+
* "line_id": "01a1c1df-a6ea-779f-9310-bdbb2eadd1a9",
|
|
40337
|
+
* "kind": "otro",
|
|
40338
|
+
* "description": "Garantía extendida",
|
|
40339
|
+
* "charge_clp": 119000,
|
|
40340
|
+
* "tax_treatment": "afecto"
|
|
40341
|
+
* },
|
|
40342
|
+
* "to": {
|
|
40343
|
+
* "line_id": "01a1c1df-a6ea-779f-9310-bdbb2eadd1a9",
|
|
40344
|
+
* "kind": "otro",
|
|
40345
|
+
* "description": "Garantía extendida 24 meses",
|
|
40346
|
+
* "charge_clp": 150000,
|
|
40347
|
+
* "tax_treatment": "afecto"
|
|
40348
|
+
* }
|
|
40349
|
+
* }
|
|
40350
|
+
* },
|
|
40351
|
+
* "at": "2026-11-15T13:20:00.000Z",
|
|
40352
|
+
* "actor": null,
|
|
40353
|
+
* "on_approved_note": true,
|
|
40354
|
+
* "price_approval_id": null,
|
|
40355
|
+
* "authorised_by": null
|
|
40356
|
+
* }
|
|
40357
|
+
* ],
|
|
40358
|
+
* "compraventa_outdated": false,
|
|
40359
|
+
* "pending_price_change": null
|
|
40360
|
+
* }
|
|
40361
|
+
* }
|
|
40362
|
+
*/
|
|
40363
|
+
"application/json": {
|
|
40364
|
+
data: components["schemas"]["SaleNoteRead"];
|
|
40365
|
+
meta?: {
|
|
40366
|
+
[key: string]: unknown;
|
|
40367
|
+
};
|
|
40368
|
+
};
|
|
40369
|
+
};
|
|
40370
|
+
};
|
|
40371
|
+
/** @description Validation error */
|
|
40372
|
+
400: {
|
|
40373
|
+
headers: {
|
|
40374
|
+
[name: string]: unknown;
|
|
40375
|
+
};
|
|
40376
|
+
content: {
|
|
40377
|
+
"application/json": components["schemas"]["Error"];
|
|
40378
|
+
};
|
|
40379
|
+
};
|
|
40380
|
+
/** @description Unauthorized */
|
|
40381
|
+
401: {
|
|
40382
|
+
headers: {
|
|
40383
|
+
[name: string]: unknown;
|
|
40384
|
+
};
|
|
40385
|
+
content: {
|
|
40386
|
+
"application/json": components["schemas"]["Error"];
|
|
40387
|
+
};
|
|
40388
|
+
};
|
|
40389
|
+
/** @description Forbidden */
|
|
40390
|
+
403: {
|
|
40391
|
+
headers: {
|
|
40392
|
+
[name: string]: unknown;
|
|
40393
|
+
};
|
|
40394
|
+
content: {
|
|
40395
|
+
"application/json": components["schemas"]["Error"];
|
|
40396
|
+
};
|
|
40397
|
+
};
|
|
40398
|
+
/** @description Not found */
|
|
40399
|
+
404: {
|
|
40400
|
+
headers: {
|
|
40401
|
+
[name: string]: unknown;
|
|
40402
|
+
};
|
|
40403
|
+
content: {
|
|
40404
|
+
"application/json": components["schemas"]["Error"];
|
|
40405
|
+
};
|
|
40406
|
+
};
|
|
40407
|
+
/** @description Conflict (incl. Idempotency-Key reuse with different body) */
|
|
40408
|
+
409: {
|
|
40409
|
+
headers: {
|
|
40410
|
+
[name: string]: unknown;
|
|
40411
|
+
};
|
|
40412
|
+
content: {
|
|
40413
|
+
"application/json": components["schemas"]["Error"];
|
|
40414
|
+
};
|
|
40415
|
+
};
|
|
40416
|
+
/** @description Rate limited */
|
|
40417
|
+
429: {
|
|
40418
|
+
headers: {
|
|
40419
|
+
[name: string]: unknown;
|
|
40420
|
+
};
|
|
40421
|
+
content: {
|
|
40422
|
+
"application/json": components["schemas"]["Error"];
|
|
40423
|
+
};
|
|
40424
|
+
};
|
|
40425
|
+
};
|
|
40426
|
+
};
|
|
40427
|
+
delete?: never;
|
|
40428
|
+
options?: never;
|
|
40429
|
+
head?: never;
|
|
40430
|
+
patch?: never;
|
|
40431
|
+
trace?: never;
|
|
40432
|
+
};
|
|
39471
40433
|
"/sale-notes/{id}/approve": {
|
|
39472
40434
|
parameters: {
|
|
39473
40435
|
query?: never;
|
|
@@ -149854,6 +150816,8 @@ interface paths {
|
|
|
149854
150816
|
* `deducciones_clp` is the Σ of the dueño share of every retained cost line the settlement discharged, and `deductions` lists them one by one (`cost_entry_id`, `label`, `entry_date`, `dueno_clp`). Selling a consigned car deducts them all: `monto_owner_clp` is `amount_venta_clp` minus the comisión minus `deducciones_clp`.
|
|
149855
150817
|
*
|
|
149856
150818
|
* `sends` is the log of `POST /consignments/{id}/liquidacion/send`, newest first (last 10): `channel`, `to`, `sent_at`, `by` (member or API key id) and `by_name`. `whatsapp_send_enabled` says whether the workspace may send it on WhatsApp (its staff-WhatsApp switch is on); when false, offer email only.
|
|
150819
|
+
*
|
|
150820
|
+
* `settlement_difference` (app#7320): `null` unless the sale’s price was corrected after this liquidación was paid (or adjustments exist). The record above is never rewritten; this says `paid_with_price_clp`, `current_price_clp`, `paid_to_owner_clp`, `due_to_owner_clp` (the owner’s share at the current price with this liquidación’s own terms and deductions), `adjusted_clp`, `difference_clp` (positive: the dealer owes the owner; negative: the owner owes the dealer), `status` and the `adjustments`. Close it with `POST /consignments/{id}/liquidacion/adjustments`.
|
|
149857
150821
|
*/
|
|
149858
150822
|
get: {
|
|
149859
150823
|
parameters: {
|
|
@@ -283990,6 +284954,51 @@ interface components {
|
|
|
283990
284954
|
requested_price_clp: number;
|
|
283991
284955
|
proposed_terms: components["schemas"]["ProposedSaleNoteTerms"];
|
|
283992
284956
|
};
|
|
284957
|
+
SaleNoteTransferTax: {
|
|
284958
|
+
/** Format: uuid */
|
|
284959
|
+
line_id: string;
|
|
284960
|
+
charge_clp: number;
|
|
284961
|
+
/** @enum {string} */
|
|
284962
|
+
source: "calculated" | "typed";
|
|
284963
|
+
at_current_price_clp: number | null;
|
|
284964
|
+
gaps: {
|
|
284965
|
+
input: string;
|
|
284966
|
+
detail: string;
|
|
284967
|
+
}[];
|
|
284968
|
+
recalculation_offered: boolean;
|
|
284969
|
+
};
|
|
284970
|
+
SettlementDifference: {
|
|
284971
|
+
/** Format: uuid */
|
|
284972
|
+
liquidacion_id: string;
|
|
284973
|
+
/** Format: uuid */
|
|
284974
|
+
consignment_contract_id: string;
|
|
284975
|
+
/** Format: uuid */
|
|
284976
|
+
sale_note_id: string;
|
|
284977
|
+
liquidacion_paid_at: string;
|
|
284978
|
+
paid_with_price_clp: number;
|
|
284979
|
+
current_price_clp: number;
|
|
284980
|
+
paid_to_owner_clp: number;
|
|
284981
|
+
comision_at_current_price_clp: number | null;
|
|
284982
|
+
due_to_owner_clp: number;
|
|
284983
|
+
adjusted_clp: number;
|
|
284984
|
+
difference_clp: number;
|
|
284985
|
+
/** @enum {string} */
|
|
284986
|
+
status: "dealer_owes_owner" | "owner_owes_dealer" | "settled";
|
|
284987
|
+
adjustments: {
|
|
284988
|
+
/** Format: uuid */
|
|
284989
|
+
id: string;
|
|
284990
|
+
/** @enum {string} */
|
|
284991
|
+
direction: "pago_complementario" | "reintegro";
|
|
284992
|
+
amount_clp: number;
|
|
284993
|
+
paid_at: string;
|
|
284994
|
+
/** @enum {string|null} */
|
|
284995
|
+
payout_method: "transferencia" | "vale_vista" | "cheque" | "efectivo" | null;
|
|
284996
|
+
note: string | null;
|
|
284997
|
+
/** Format: uuid */
|
|
284998
|
+
recorded_by: string | null;
|
|
284999
|
+
created_at: string;
|
|
285000
|
+
}[];
|
|
285001
|
+
};
|
|
283993
285002
|
SaleNoteRead: {
|
|
283994
285003
|
/** Format: uuid */
|
|
283995
285004
|
id: string;
|
|
@@ -284006,6 +285015,8 @@ interface components {
|
|
|
284006
285015
|
history: components["schemas"]["SaleNoteHistoryEntry"][];
|
|
284007
285016
|
compraventa_outdated: boolean;
|
|
284008
285017
|
pending_price_change: components["schemas"]["SaleNotePendingPriceChange"] | null;
|
|
285018
|
+
transfer_tax: components["schemas"]["SaleNoteTransferTax"] | null;
|
|
285019
|
+
settlement_difference: components["schemas"]["SettlementDifference"] | null;
|
|
284009
285020
|
} & {
|
|
284010
285021
|
[key: string]: unknown;
|
|
284011
285022
|
};
|
|
@@ -284022,6 +285033,38 @@ interface components {
|
|
|
284022
285033
|
} & {
|
|
284023
285034
|
[key: string]: unknown;
|
|
284024
285035
|
});
|
|
285036
|
+
SaleNotePaymentRemoval: {
|
|
285037
|
+
/** Format: uuid */
|
|
285038
|
+
payment_id: string;
|
|
285039
|
+
/** @enum {string} */
|
|
285040
|
+
effect: "reversed" | "released";
|
|
285041
|
+
amount_clp: number;
|
|
285042
|
+
on_note_clp: number;
|
|
285043
|
+
reason: string;
|
|
285044
|
+
reservation_deposit: {
|
|
285045
|
+
/** Format: uuid */
|
|
285046
|
+
reservation_id: string;
|
|
285047
|
+
reservation_folio: string | null;
|
|
285048
|
+
/** @enum {string} */
|
|
285049
|
+
effect: "no_longer_counted" | "still_counted";
|
|
285050
|
+
} | null;
|
|
285051
|
+
/** Format: uuid */
|
|
285052
|
+
change_id: string | null;
|
|
285053
|
+
};
|
|
285054
|
+
SaleNotePaymentRemoved: components["schemas"]["SaleNoteRead"] & ({
|
|
285055
|
+
payment_removal: components["schemas"]["SaleNotePaymentRemoval"];
|
|
285056
|
+
} & {
|
|
285057
|
+
[key: string]: unknown;
|
|
285058
|
+
});
|
|
285059
|
+
RemoveSaleNotePaymentBody: {
|
|
285060
|
+
reason: string;
|
|
285061
|
+
};
|
|
285062
|
+
ChangeSaleNoteAddOnBody: {
|
|
285063
|
+
description?: string;
|
|
285064
|
+
charge_clp?: number;
|
|
285065
|
+
/** @enum {string} */
|
|
285066
|
+
tax_treatment?: "afecto" | "exento" | "no_gravado" | "pass_through";
|
|
285067
|
+
};
|
|
284025
285068
|
ReservationConverted: {
|
|
284026
285069
|
reservation: {
|
|
284027
285070
|
/** Format: uuid */
|