@vitrina/api 17.79.0 → 17.81.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 +234 -11
- package/dist/index.d.ts +234 -11
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -17075,6 +17075,31 @@ interface paths {
|
|
|
17075
17075
|
perUnitClpMonth?: number | null;
|
|
17076
17076
|
perUnitUfMonth?: number | null;
|
|
17077
17077
|
billedUnit?: string;
|
|
17078
|
+
/** @description Finanzas: banks the plan includes at no extra charge (1). */
|
|
17079
|
+
includedBanks?: number;
|
|
17080
|
+
/** @description Finanzas: UF per connected bank beyond the included ones, per month, billed monthly in arrears even on an annual plan (0.45). */
|
|
17081
|
+
extraBankUfMonth?: number | null;
|
|
17082
|
+
/** @description Finanzas: the base paid 12 months in advance at 20 % off. Buy it with `POST /entitlements/finanzas/activate` and `{ "billing_interval": "annual" }`. */
|
|
17083
|
+
annual?: {
|
|
17084
|
+
/** @description 12 × the monthly price, UF (18). */
|
|
17085
|
+
ufGrossYear: number;
|
|
17086
|
+
/** @description The annual discount, percent (20). */
|
|
17087
|
+
discountPct: number;
|
|
17088
|
+
/** @description The discount, UF (3.6). */
|
|
17089
|
+
ufDiscount: number;
|
|
17090
|
+
/** @description Net UF of the year, before IVA (14.4). */
|
|
17091
|
+
ufYear: number;
|
|
17092
|
+
/** @description The year expressed per month, UF (1.2). */
|
|
17093
|
+
ufMonthEquivalent: number;
|
|
17094
|
+
/** @description Net CLP of the year at today's UF; null when the UF is unknown. */
|
|
17095
|
+
clpYearEstimate: number | null;
|
|
17096
|
+
/** @description First Santiago day of the year if paid today (`YYYY-MM-DD`). */
|
|
17097
|
+
termStart: string;
|
|
17098
|
+
/** @description Last Santiago day of the year if paid today (`YYYY-MM-DD`). */
|
|
17099
|
+
termEnd: string;
|
|
17100
|
+
/** @description The unpaid annual purchase cobro, if one is out. */
|
|
17101
|
+
purchaseInvoiceId: string | null;
|
|
17102
|
+
};
|
|
17078
17103
|
/** @description The business types (`tenant.vertical`) this add-on is sold to. Omitted = every vertical. Read `offers` for the per-workspace answer. */
|
|
17079
17104
|
verticals?: string[];
|
|
17080
17105
|
}[];
|
|
@@ -17101,6 +17126,15 @@ interface paths {
|
|
|
17101
17126
|
};
|
|
17102
17127
|
/** @description Last calendar day (`YYYY-MM-DD`, America/Santiago) this add-on is free under a time-boxed waiver: no charge accrues through the end of that day and activation needs no payment method. It bills normally from 00:00 Santiago of the next day. `null` = no waiver. */
|
|
17103
17128
|
waiver_until?: string | null;
|
|
17129
|
+
/**
|
|
17130
|
+
* @description `annual` only while the row holds a paid 12-month term that has not ended (Vitrina Finanzas); a term that ended unrenewed reads `monthly`. Extra banks bill monthly either way.
|
|
17131
|
+
* @enum {string}
|
|
17132
|
+
*/
|
|
17133
|
+
billing_interval?: "monthly" | "annual";
|
|
17134
|
+
/** @description Start of the current (or last) paid annual term (ISO). */
|
|
17135
|
+
term_start?: string | null;
|
|
17136
|
+
/** @description End (exclusive, ISO) of the current (or last) paid annual term. A cancelled annual add-on stays active until here, then lapses. */
|
|
17137
|
+
term_end?: string | null;
|
|
17104
17138
|
created_at: string;
|
|
17105
17139
|
updated_at: string;
|
|
17106
17140
|
/** @description Who invoices this add-on. `vitrina` (default) = Vitrina bills it at the catalog price. Any other value names the partner whose plan covers it; Vitrina charges nothing, so show the add-on as included and never render the partner value or the catalog price. */
|
|
@@ -17114,6 +17148,24 @@ interface paths {
|
|
|
17114
17148
|
* @enum {string|null}
|
|
17115
17149
|
*/
|
|
17116
17150
|
covered_by: "complimentary" | "contract" | "not_billed" | null;
|
|
17151
|
+
/** @description The unpaid annual purchase cobro of this add-on (Vitrina Finanzas), or null. The add-on turns annual only when it is paid. */
|
|
17152
|
+
annual_purchase_invoice_id?: string | null;
|
|
17153
|
+
/** @description While annual: the last Santiago day (`YYYY-MM-DD`) the paid term covers. Null when monthly. */
|
|
17154
|
+
paid_until?: string | null;
|
|
17155
|
+
/** @description While annual, not cancelled and not going back to monthly: the Santiago day (`YYYY-MM-DD`) the term ends and its renewal starts. Null otherwise. */
|
|
17156
|
+
renews_on?: string | null;
|
|
17157
|
+
/**
|
|
17158
|
+
* @description `monthly` when the owner chose to go back to monthly at the term end (`PUT /entitlements/finanzas/interval`); null when the term renews.
|
|
17159
|
+
* @enum {string|null}
|
|
17160
|
+
*/
|
|
17161
|
+
next_billing_interval?: "monthly" | "annual" | null;
|
|
17162
|
+
/** @description When the 30-day renewal notice of the current term went out. */
|
|
17163
|
+
renewal_notice_sent_at?: string | null;
|
|
17164
|
+
/** @description While annual and renewing: the next year in UF after the 20 % and its pesos at today's UF (before IVA). Null otherwise. */
|
|
17165
|
+
renewal_preview?: {
|
|
17166
|
+
uf_period: number;
|
|
17167
|
+
clp_estimate: number | null;
|
|
17168
|
+
} | null;
|
|
17117
17169
|
}[];
|
|
17118
17170
|
usage: {
|
|
17119
17171
|
tasador: {
|
|
@@ -17219,7 +17271,7 @@ interface paths {
|
|
|
17219
17271
|
put?: never;
|
|
17220
17272
|
/**
|
|
17221
17273
|
* Self-serve activate an add-on (returns needs_enrollment without a payment mandate)
|
|
17222
|
-
* @description Grants `feature` to the workspace once an active payment mandate exists (`{ status: "active", entitlement }`); with none, answers `{ status: "needs_enrollment" }` and grants nothing — the caller routes the dealer through the Fintoc/Mercado Pago enrollment step and retries. No payment method is needed when the add-on costs the workspace nothing: its row is covered by another biller (`billed_by` other than `vitrina`) or sits inside an active `waiver_until` waiver; such an activation answers `active` and accrues no charge for the covered days. An add-on this workspace cannot buy answers 409 `ADDON_NOT_OFFERED` (`details.reason`: `sandbox` or `vertical`, the same answer `GET /entitlements` publishes in `offers`); reactivating an add-on the workspace still holds is never refused for that. Idempotent on an already-active feature (re-answers the same `active` row rather than erroring).
|
|
17274
|
+
* @description Grants `feature` to the workspace once an active payment mandate exists (`{ status: "active", entitlement }`); with none, answers `{ status: "needs_enrollment" }` and grants nothing — the caller routes the dealer through the Fintoc/Mercado Pago enrollment step and retries. No payment method is needed when the add-on costs the workspace nothing: its row is covered by another biller (`billed_by` other than `vitrina`) or sits inside an active `waiver_until` waiver; such an activation answers `active` and accrues no charge for the covered days. An add-on this workspace cannot buy answers 409 `ADDON_NOT_OFFERED` (`details.reason`: `sandbox` or `vertical`, the same answer `GET /entitlements` publishes in `offers`); reactivating an add-on the workspace still holds is never refused for that. Idempotent on an already-active feature (re-answers the same `active` row rather than erroring). ANNUAL (Vitrina Finanzas only, needs `billing:write`; monthly activation keeps `tenant:write`): body `{ "billing_interval": "annual", "payment": "card" | "transfer" }` issues ONE cobro for the base, 12 months at 20 % off (14.4 UF neto at the UF of the issue day, number `INV-{tenant}-AF{YYYYMM}`), with no payment method required, and answers `{ status: "awaiting_payment" | "active", billing_interval: "annual", invoice_id, invoice_number, uf_total, clp_total, due_at, purchase_expires_on, next_step, term_start, term_end }`. Finanzas opens (or turns annual) only when that cobro is paid; its year starts at the payment instant (after a running waiver). Unpaid, the cobro is voided 30 days after issue and nothing changes. Extra banks keep billing monthly. 409 `ANNUAL_NOT_AVAILABLE` (`details.reason`: `not_annual_feature`, `complimentary`, `billed_elsewhere`, `suspended`, `term_running`); 409 `ANNUAL_PURCHASE_PENDING` while an unpaid purchase is out (`details.invoice_id`).
|
|
17223
17275
|
*/
|
|
17224
17276
|
post: {
|
|
17225
17277
|
parameters: {
|
|
@@ -17233,7 +17285,22 @@ interface paths {
|
|
|
17233
17285
|
};
|
|
17234
17286
|
cookie?: never;
|
|
17235
17287
|
};
|
|
17236
|
-
requestBody?:
|
|
17288
|
+
requestBody?: {
|
|
17289
|
+
content: {
|
|
17290
|
+
/**
|
|
17291
|
+
* @example {
|
|
17292
|
+
* "billing_interval": "annual",
|
|
17293
|
+
* "payment": "transfer"
|
|
17294
|
+
* }
|
|
17295
|
+
*/
|
|
17296
|
+
"application/json": {
|
|
17297
|
+
/** @enum {string} */
|
|
17298
|
+
billing_interval?: "monthly" | "annual";
|
|
17299
|
+
/** @enum {string} */
|
|
17300
|
+
payment?: "card" | "transfer";
|
|
17301
|
+
};
|
|
17302
|
+
};
|
|
17303
|
+
};
|
|
17237
17304
|
responses: {
|
|
17238
17305
|
/** @description Activation result */
|
|
17239
17306
|
200: {
|
|
@@ -17453,6 +17520,133 @@ interface paths {
|
|
|
17453
17520
|
patch?: never;
|
|
17454
17521
|
trace?: never;
|
|
17455
17522
|
};
|
|
17523
|
+
"/entitlements/finanzas/interval": {
|
|
17524
|
+
parameters: {
|
|
17525
|
+
query?: never;
|
|
17526
|
+
header?: never;
|
|
17527
|
+
path?: never;
|
|
17528
|
+
cookie?: never;
|
|
17529
|
+
};
|
|
17530
|
+
get?: never;
|
|
17531
|
+
/**
|
|
17532
|
+
* Switch annual Vitrina Finanzas back to monthly at the term end
|
|
17533
|
+
* @description `monthly`: the paid year runs to its end with no refund and does not renew; from that day the base bills monthly in arrears. `annual` undoes it (the year renews). Monthly to annual is the purchase, `POST /entitlements/finanzas/activate` with `billing_interval: annual`. 409 `details.code`: `use_annual_purchase` (annual asked on a monthly row), `not_annual`, `plan_cancelling`, `next_cobro_issued` (the renewal Cobro is already out); 409 `ANNUAL_NOT_AVAILABLE` with `details.reason` `quoted` | `agency` | `contract` on `annual`: the 20 % annual discount is for the public price list only. Requires `billing:write`.
|
|
17534
|
+
*/
|
|
17535
|
+
put: {
|
|
17536
|
+
parameters: {
|
|
17537
|
+
query?: never;
|
|
17538
|
+
header?: never;
|
|
17539
|
+
path?: never;
|
|
17540
|
+
cookie?: never;
|
|
17541
|
+
};
|
|
17542
|
+
requestBody?: {
|
|
17543
|
+
content: {
|
|
17544
|
+
/**
|
|
17545
|
+
* @example {
|
|
17546
|
+
* "interval": "monthly"
|
|
17547
|
+
* }
|
|
17548
|
+
*/
|
|
17549
|
+
"application/json": {
|
|
17550
|
+
/** @enum {string} */
|
|
17551
|
+
interval: "monthly" | "annual";
|
|
17552
|
+
};
|
|
17553
|
+
};
|
|
17554
|
+
};
|
|
17555
|
+
responses: {
|
|
17556
|
+
/** @description When the change applies and the new price */
|
|
17557
|
+
200: {
|
|
17558
|
+
headers: {
|
|
17559
|
+
[name: string]: unknown;
|
|
17560
|
+
};
|
|
17561
|
+
content: {
|
|
17562
|
+
/**
|
|
17563
|
+
* @example {
|
|
17564
|
+
* "data": {
|
|
17565
|
+
* "interval": "monthly",
|
|
17566
|
+
* "effective_on": "2027-11-17",
|
|
17567
|
+
* "preview": {
|
|
17568
|
+
* "uf_period": 1.5,
|
|
17569
|
+
* "clp_estimate": 59785
|
|
17570
|
+
* }
|
|
17571
|
+
* }
|
|
17572
|
+
* }
|
|
17573
|
+
*/
|
|
17574
|
+
"application/json": {
|
|
17575
|
+
data: {
|
|
17576
|
+
/** @enum {string} */
|
|
17577
|
+
interval: "monthly" | "annual";
|
|
17578
|
+
effective_on: string;
|
|
17579
|
+
preview: {
|
|
17580
|
+
uf_period: number;
|
|
17581
|
+
clp_estimate: number | null;
|
|
17582
|
+
};
|
|
17583
|
+
};
|
|
17584
|
+
};
|
|
17585
|
+
};
|
|
17586
|
+
};
|
|
17587
|
+
/** @description Validation error */
|
|
17588
|
+
400: {
|
|
17589
|
+
headers: {
|
|
17590
|
+
[name: string]: unknown;
|
|
17591
|
+
};
|
|
17592
|
+
content: {
|
|
17593
|
+
"application/json": components["schemas"]["Error"];
|
|
17594
|
+
};
|
|
17595
|
+
};
|
|
17596
|
+
/** @description Unauthorized */
|
|
17597
|
+
401: {
|
|
17598
|
+
headers: {
|
|
17599
|
+
[name: string]: unknown;
|
|
17600
|
+
};
|
|
17601
|
+
content: {
|
|
17602
|
+
"application/json": components["schemas"]["Error"];
|
|
17603
|
+
};
|
|
17604
|
+
};
|
|
17605
|
+
/** @description Forbidden */
|
|
17606
|
+
403: {
|
|
17607
|
+
headers: {
|
|
17608
|
+
[name: string]: unknown;
|
|
17609
|
+
};
|
|
17610
|
+
content: {
|
|
17611
|
+
"application/json": components["schemas"]["Error"];
|
|
17612
|
+
};
|
|
17613
|
+
};
|
|
17614
|
+
/** @description Not found */
|
|
17615
|
+
404: {
|
|
17616
|
+
headers: {
|
|
17617
|
+
[name: string]: unknown;
|
|
17618
|
+
};
|
|
17619
|
+
content: {
|
|
17620
|
+
"application/json": components["schemas"]["Error"];
|
|
17621
|
+
};
|
|
17622
|
+
};
|
|
17623
|
+
/** @description Conflict (incl. Idempotency-Key reuse with different body) */
|
|
17624
|
+
409: {
|
|
17625
|
+
headers: {
|
|
17626
|
+
[name: string]: unknown;
|
|
17627
|
+
};
|
|
17628
|
+
content: {
|
|
17629
|
+
"application/json": components["schemas"]["Error"];
|
|
17630
|
+
};
|
|
17631
|
+
};
|
|
17632
|
+
/** @description Rate limited */
|
|
17633
|
+
429: {
|
|
17634
|
+
headers: {
|
|
17635
|
+
[name: string]: unknown;
|
|
17636
|
+
};
|
|
17637
|
+
content: {
|
|
17638
|
+
"application/json": components["schemas"]["Error"];
|
|
17639
|
+
};
|
|
17640
|
+
};
|
|
17641
|
+
};
|
|
17642
|
+
};
|
|
17643
|
+
post?: never;
|
|
17644
|
+
delete?: never;
|
|
17645
|
+
options?: never;
|
|
17646
|
+
head?: never;
|
|
17647
|
+
patch?: never;
|
|
17648
|
+
trace?: never;
|
|
17649
|
+
};
|
|
17456
17650
|
"/vehicles/catalog/brands": {
|
|
17457
17651
|
parameters: {
|
|
17458
17652
|
query?: never;
|
|
@@ -18513,6 +18707,8 @@ interface paths {
|
|
|
18513
18707
|
*
|
|
18514
18708
|
* **Publish in the same call (`publish_to`).** Optional. Name the marketplaces this vehicle should go to — portal slugs such as `chileautos` / `mercadolibre`, or integration ids from GET /marketplaces — and it is published right after it is saved, through the same path as POST /vehicles/{id}/publish. Omitted or `[]` saves only; there is no default. Every entry is validated first: a portal with no connected account, a slug matching several accounts, or an id from another workspace answers **422 and nothing is saved**. Once saved, the vehicle stays saved: a portal that fails to publish is an `error` entry in `publications`, never a failed request (still 201). The response then carries `publications`, one `PublishOutcome` per account (`published`, `pending` for queued transports such as `chileautos_panel`, `already_published`, or `error` with the reason). `publications` is absent when `publish_to` was not sent.
|
|
18515
18709
|
*
|
|
18710
|
+
* **Costo de compra in the same call (`purchase_cost_clp`).** Optional (vitrina-app#7719). The amount the dealership paid, recorded as the car’s Costo de compra exactly as `POST /vehicle-acquisitions` with `kind: "compra"` would; `invoice_includes_iva: true` says it includes IVA («Compra con factura»). Needs `dealership_economics:write`: without it the call is a **403 and nothing is saved**. The response then carries `acquisition` (the recorded row, the same shape `POST /vehicle-acquisitions` returns, shown only to callers holding `dealership_economics:read`); `acquisition: null` means the car was saved but its cost was not, and it can be typed on the car’s page. Both fields are create-only.
|
|
18711
|
+
*
|
|
18516
18712
|
* **Sanity range.** A price fans out to every connected portal, so a typo is stopped here. `price_amount` must be between 100.000 and 2.000.000.000 CLP (a UF price is bounded at the day's UF; other currencies are not bounded) and `odometer_value` between 0 and 2.000.000; `null` clears either and is always accepted. Outside the range: **422 `VEHICLE_VALUE_OUT_OF_RANGE`**, with a Spanish `message`, `field_errors.<field>` and `details.violations[]` (`field`, `reason` = `price_out_of_range` | `km_out_of_range`, `value`, `min`, `max`, `currency`). A price change beyond 10x up or down from the current price answers **422 `PRICE_CHANGE_CONFIRMATION_REQUIRED`** (`details.reason` = `large_price_change`, `current_price`, `requested_price`, `currency`, `factor`, `confirm_flag`) unless the body carries `confirm_large_price_change: true`; ask the user, then resend the same body with it. Nothing is written on either 422.
|
|
18517
18713
|
*
|
|
18518
18714
|
* **Normalization and `catalog_match`.** On create and update, `make` and `model` that equal an entry of GET /vehicles/catalog/brands and /catalog/models up to case, accents, spaces and hyphens are stored in the catalog's spelling ("toyota" → "Toyota", "mercedes benz" → "Mercedes-Benz", "rav 4" → "RAV4"); `fuel_type`, `gear_type` and `body_style` are stored as vocabulary codes ("Bencina" → `gasolina`, "Automática" → `automatica`, "Station Wagon" → `wagon`; codes: fuel `gasolina|diesel|hibrido|electrico|gnc|glp|otro`, gear `mecanica|automatica|otro`, body `sedan|hatchback|suv|camioneta|coupe|wagon|furgon|convertible|minivan|otro`; for `vehicle_type: moto` body_style is the «Tipo de moto» instead: `moto_calle|moto_deportiva|moto_touring|moto_trail|moto_enduro|moto_scooter|moto_custom|moto_cuatrimoto|moto_otro`, and "Trail" / "BODY.MOTORCYCLE.TRAIL" snap to `moto_trail`). Nothing is invented: a value with no match is stored exactly as sent. The response (and GET /vehicles/{id}) carries `catalog_match`: `make` / `model` are `matched` | `unmatched` | `missing` (`not_applicable` for a non-`auto` vehicle_type); `version` adds `approximate` (word overlap with a catalog version, same displacement) and `catalog_version` names the catalog version it matched or most resembles; `fuel_type` / `gear_type` / `body_style` are `matched` | `unmatched` | `missing`; `warnings[]` lists `{ field, code, message }` for everything not matched, with a Spanish `message` ready to show (codes: `make_missing`, `make_not_in_catalog`, `model_missing`, `model_not_in_catalog`, `version_approximate`, `version_not_in_catalog`, `fuel_type_not_recognized`, `gear_type_not_recognized`, `body_style_not_recognized`). A make or model that is not matched still saves, but Chileautos publishes it without a technical sheet (ficha). `catalog_match` is null only when the catalog could not be loaded. Example of an unmatched push: {"make":"matched","model":"unmatched","version":"unmatched","catalog_version":null,"fuel_type":"unmatched","gear_type":"matched","body_style":"missing","warnings":[{"field":"model","code":"model_not_in_catalog","message":"Modelo 'Rav-4 xx' no está en el catálogo de Toyota (GET /vehicles/catalog/models); Chileautos lo publicará sin ficha."},{"field":"fuel_type","code":"fuel_type_not_recognized","message":"Combustible 'Hidrógeno' no se reconoce; valores aceptados: gasolina, diesel, hibrido, electrico, gnc, glp, otro."}]}
|
|
@@ -18623,6 +18819,10 @@ interface paths {
|
|
|
18623
18819
|
* ]
|
|
18624
18820
|
*/
|
|
18625
18821
|
publish_to?: string[];
|
|
18822
|
+
/** @description Costo de compra del auto en pesos, opcional. Se registra en la misma llamada como el costo de compra del auto (lo mismo que `POST /vehicle-acquisitions` con `kind: "compra"`). Necesita el permiso `dealership_economics:write`; sin él la llamada responde 403 y no crea el auto. */
|
|
18823
|
+
purchase_cost_clp?: number;
|
|
18824
|
+
/** @description «Compra con factura (incluye IVA)» para `purchase_cost_clp`. Opcional, por defecto false. Con true el monto incluye IVA y el costo de compra queda sin IVA. */
|
|
18825
|
+
invoice_includes_iva?: boolean;
|
|
18626
18826
|
};
|
|
18627
18827
|
};
|
|
18628
18828
|
};
|
|
@@ -38323,7 +38523,7 @@ interface paths {
|
|
|
38323
38523
|
};
|
|
38324
38524
|
/**
|
|
38325
38525
|
* The clinic banded plan: band, count, price, review, pause state
|
|
38326
|
-
* @description Band (S/M/L/XL or quoted), the 3-month average of professionals who attended patients that produced it, the UF/month price with the design-partner lock honoured, the next band review, any announced move, the payment mandate, the pause state and where the non-payment ladder has got to.
|
|
38526
|
+
* @description Band (S/M/L/XL or quoted), the 3-month average of professionals who attended patients that produced it, the UF/month price with the design-partner lock honoured, the next band review, any announced move, the payment mandate, the pause state and where the non-payment ladder has got to. On an annual plan a move up is charged once as the difference for the months of the paid year left, at the annual price (`announced_remaining_months`, `announced_difference_uf`, `announced_difference_clp_estimate`), and a move down only shows as `pending_down_band` until the renewal.
|
|
38327
38527
|
*/
|
|
38328
38528
|
get: {
|
|
38329
38529
|
parameters: {
|
|
@@ -38452,6 +38652,23 @@ interface paths {
|
|
|
38452
38652
|
cancel_at_period_end: boolean;
|
|
38453
38653
|
ends_on: string | null;
|
|
38454
38654
|
plan_ended_at: string | null;
|
|
38655
|
+
/** @enum {string|null} */
|
|
38656
|
+
pending_down_band: "S" | "M" | "L" | "XL" | "quoted" | null;
|
|
38657
|
+
announced_remaining_months: number | null;
|
|
38658
|
+
announced_difference_uf: number | null;
|
|
38659
|
+
announced_difference_clp_estimate: number | null;
|
|
38660
|
+
/** @enum {string|null} */
|
|
38661
|
+
next_billing_interval: "monthly" | "annual" | null;
|
|
38662
|
+
renewal_notice_sent_at: string | null;
|
|
38663
|
+
renewal_preview: {
|
|
38664
|
+
/** @enum {string} */
|
|
38665
|
+
interval: "monthly" | "annual";
|
|
38666
|
+
/** @enum {string} */
|
|
38667
|
+
band: "S" | "M" | "L" | "XL" | "quoted";
|
|
38668
|
+
uf_month: number;
|
|
38669
|
+
uf_period: number;
|
|
38670
|
+
clp_estimate: number | null;
|
|
38671
|
+
} | null;
|
|
38455
38672
|
};
|
|
38456
38673
|
};
|
|
38457
38674
|
};
|
|
@@ -49943,7 +50160,7 @@ interface paths {
|
|
|
49943
50160
|
put?: never;
|
|
49944
50161
|
/**
|
|
49945
50162
|
* Record how a unit arrived, or its bare Costo de compra
|
|
49946
|
-
* @description Two shapes. (1) THE BARE COSTO DE COMPRA (vitrina-app#7612): `{ vehicle_id, kind: "compra", net_clp }` with no document link records what the dealership paid for a car of its own — the
|
|
50163
|
+
* @description Two shapes. (1) THE BARE COSTO DE COMPRA (vitrina-app#7612): `{ vehicle_id, kind: "compra", net_clp }` with no document link records what the dealership paid for a car of its own — the cost field of the profit report, of the car’s page and of the new-car form. `net_clp` is the amount typed: the total paid, unless `invoice_includes_iva: true` («Compra con factura (incluye IVA)», vitrina-app#7719) says it includes IVA; then the stored `net_clp` is the amount without IVA, `tax_clp` the IVA, `tax_treatment` afecto and `generates_fiscal_credit` true. A correction resends the tick; without it the cost is the whole amount again. Every response carries `invoice_includes_iva` and `amount_paid_clp` (what was typed) to prefill the field. Defaults: `acquired_on` = the day the car was created in Vitrina (dealership calendar), `tax_treatment` = the car’s IVA regime (the car’s, else the dealership default, else `exento`), `borne_by` = `automotora`, `generates_fiscal_credit` = false, `tax_clp` = null. The SAME call on a car that already has a bare cost replaces its amount and answers 200; a new cost answers 201. When the nota de compra the cost came from was VOIDED, the same call detaches the cost from it (same row, 200, defaults as above, the voided note’s retained cost lines withdrawn) and a later nota de compra can take it over again. 409 with `error.details.code`: `purchase_cost_on_purchase_note` (a live nota de compra: correct it there, `details.purchase_note_id`), `purchase_cost_on_trade_in` (the car came in as parte de pago, `details.sale_note_id`), `purchase_cost_consigned_vehicle` (a consigned car has no purchase cost). The profit report (`GET /margin`) counts the cost on the next read. (2) AN ACQUISITION UNDER ITS DOCUMENT: any kind naming its document (`purchase_note_id`, `consignment_contract_id`, `sale_note_id`); the same defaults and the same tick apply (nothing beyond the car, kind, document and amount is required since vitrina-app#7719), and a second acquisition for one unit is a 409.
|
|
49947
50164
|
*/
|
|
49948
50165
|
post: {
|
|
49949
50166
|
parameters: {
|
|
@@ -49971,7 +50188,7 @@ interface paths {
|
|
|
49971
50188
|
kind: "compra" | "consignacion" | "retoma";
|
|
49972
50189
|
/** Format: uuid */
|
|
49973
50190
|
counterparty_contact_id?: string | null;
|
|
49974
|
-
/** @description Fecha de adquisición.
|
|
50191
|
+
/** @description Fecha de adquisición. Opcional: por defecto el día en que el auto se creó en Vitrina (calendario de la automotora). */
|
|
49975
50192
|
acquired_on?: string;
|
|
49976
50193
|
/** Format: uuid */
|
|
49977
50194
|
purchase_note_id?: string | null;
|
|
@@ -49979,21 +50196,23 @@ interface paths {
|
|
|
49979
50196
|
consignment_contract_id?: string | null;
|
|
49980
50197
|
/** Format: uuid */
|
|
49981
50198
|
sale_note_id?: string | null;
|
|
49982
|
-
/** @description Costo de compra en pesos
|
|
50199
|
+
/** @description Costo de compra en pesos, el monto que escribe la automotora. Sin `invoice_includes_iva` es el costo completo. Con `invoice_includes_iva: true` el monto incluye IVA: se guarda sin IVA en `net_clp` y el IVA en `tax_clp`. */
|
|
49983
50200
|
net_clp: number;
|
|
49984
50201
|
tax_clp?: number | null;
|
|
49985
50202
|
/**
|
|
49986
|
-
* @description
|
|
50203
|
+
* @description Opcional. Por defecto el régimen de IVA del auto (el del auto, si no el de la automotora, si no exento); `afecto` con `invoice_includes_iva`.
|
|
49987
50204
|
* @enum {string}
|
|
49988
50205
|
*/
|
|
49989
50206
|
tax_treatment?: "afecto" | "exento" | "no_gravado" | "pass_through";
|
|
49990
50207
|
/**
|
|
49991
|
-
* @description
|
|
50208
|
+
* @description Opcional. Por defecto automotora.
|
|
49992
50209
|
* @enum {string}
|
|
49993
50210
|
*/
|
|
49994
50211
|
borne_by?: "automotora" | "cliente";
|
|
49995
|
-
/** @description
|
|
50212
|
+
/** @description Opcional. Por defecto false; true con `invoice_includes_iva`. */
|
|
49996
50213
|
generates_fiscal_credit?: boolean;
|
|
50214
|
+
/** @description «Compra con factura (incluye IVA)». Opcional, por defecto false. Con true el monto de `net_clp` incluye IVA: el costo de compra queda sin IVA, el IVA se guarda aparte (`tax_clp`), la compra queda afecta y con crédito fiscal. Manda sobre `tax_clp`, `tax_treatment` y `generates_fiscal_credit`. Al corregir un costo se manda de nuevo: sin él, el costo vuelve a ser el monto completo. */
|
|
50215
|
+
invoice_includes_iva?: boolean;
|
|
49997
50216
|
};
|
|
49998
50217
|
};
|
|
49999
50218
|
};
|
|
@@ -50023,7 +50242,9 @@ interface paths {
|
|
|
50023
50242
|
* "generates_fiscal_credit": false,
|
|
50024
50243
|
* "created_at": "2026-11-19T15:02:00.000Z",
|
|
50025
50244
|
* "updated_at": "2026-11-19T15:10:00.000Z",
|
|
50026
|
-
* "derived_tenencia": "propio"
|
|
50245
|
+
* "derived_tenencia": "propio",
|
|
50246
|
+
* "invoice_includes_iva": false,
|
|
50247
|
+
* "amount_paid_clp": 8500000
|
|
50027
50248
|
* }
|
|
50028
50249
|
* }
|
|
50029
50250
|
*/
|
|
@@ -50060,7 +50281,9 @@ interface paths {
|
|
|
50060
50281
|
* "generates_fiscal_credit": false,
|
|
50061
50282
|
* "created_at": "2026-11-19T15:02:00.000Z",
|
|
50062
50283
|
* "updated_at": "2026-11-19T15:02:00.000Z",
|
|
50063
|
-
* "derived_tenencia": "propio"
|
|
50284
|
+
* "derived_tenencia": "propio",
|
|
50285
|
+
* "invoice_includes_iva": false,
|
|
50286
|
+
* "amount_paid_clp": 8500000
|
|
50064
50287
|
* }
|
|
50065
50288
|
* }
|
|
50066
50289
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -17075,6 +17075,31 @@ interface paths {
|
|
|
17075
17075
|
perUnitClpMonth?: number | null;
|
|
17076
17076
|
perUnitUfMonth?: number | null;
|
|
17077
17077
|
billedUnit?: string;
|
|
17078
|
+
/** @description Finanzas: banks the plan includes at no extra charge (1). */
|
|
17079
|
+
includedBanks?: number;
|
|
17080
|
+
/** @description Finanzas: UF per connected bank beyond the included ones, per month, billed monthly in arrears even on an annual plan (0.45). */
|
|
17081
|
+
extraBankUfMonth?: number | null;
|
|
17082
|
+
/** @description Finanzas: the base paid 12 months in advance at 20 % off. Buy it with `POST /entitlements/finanzas/activate` and `{ "billing_interval": "annual" }`. */
|
|
17083
|
+
annual?: {
|
|
17084
|
+
/** @description 12 × the monthly price, UF (18). */
|
|
17085
|
+
ufGrossYear: number;
|
|
17086
|
+
/** @description The annual discount, percent (20). */
|
|
17087
|
+
discountPct: number;
|
|
17088
|
+
/** @description The discount, UF (3.6). */
|
|
17089
|
+
ufDiscount: number;
|
|
17090
|
+
/** @description Net UF of the year, before IVA (14.4). */
|
|
17091
|
+
ufYear: number;
|
|
17092
|
+
/** @description The year expressed per month, UF (1.2). */
|
|
17093
|
+
ufMonthEquivalent: number;
|
|
17094
|
+
/** @description Net CLP of the year at today's UF; null when the UF is unknown. */
|
|
17095
|
+
clpYearEstimate: number | null;
|
|
17096
|
+
/** @description First Santiago day of the year if paid today (`YYYY-MM-DD`). */
|
|
17097
|
+
termStart: string;
|
|
17098
|
+
/** @description Last Santiago day of the year if paid today (`YYYY-MM-DD`). */
|
|
17099
|
+
termEnd: string;
|
|
17100
|
+
/** @description The unpaid annual purchase cobro, if one is out. */
|
|
17101
|
+
purchaseInvoiceId: string | null;
|
|
17102
|
+
};
|
|
17078
17103
|
/** @description The business types (`tenant.vertical`) this add-on is sold to. Omitted = every vertical. Read `offers` for the per-workspace answer. */
|
|
17079
17104
|
verticals?: string[];
|
|
17080
17105
|
}[];
|
|
@@ -17101,6 +17126,15 @@ interface paths {
|
|
|
17101
17126
|
};
|
|
17102
17127
|
/** @description Last calendar day (`YYYY-MM-DD`, America/Santiago) this add-on is free under a time-boxed waiver: no charge accrues through the end of that day and activation needs no payment method. It bills normally from 00:00 Santiago of the next day. `null` = no waiver. */
|
|
17103
17128
|
waiver_until?: string | null;
|
|
17129
|
+
/**
|
|
17130
|
+
* @description `annual` only while the row holds a paid 12-month term that has not ended (Vitrina Finanzas); a term that ended unrenewed reads `monthly`. Extra banks bill monthly either way.
|
|
17131
|
+
* @enum {string}
|
|
17132
|
+
*/
|
|
17133
|
+
billing_interval?: "monthly" | "annual";
|
|
17134
|
+
/** @description Start of the current (or last) paid annual term (ISO). */
|
|
17135
|
+
term_start?: string | null;
|
|
17136
|
+
/** @description End (exclusive, ISO) of the current (or last) paid annual term. A cancelled annual add-on stays active until here, then lapses. */
|
|
17137
|
+
term_end?: string | null;
|
|
17104
17138
|
created_at: string;
|
|
17105
17139
|
updated_at: string;
|
|
17106
17140
|
/** @description Who invoices this add-on. `vitrina` (default) = Vitrina bills it at the catalog price. Any other value names the partner whose plan covers it; Vitrina charges nothing, so show the add-on as included and never render the partner value or the catalog price. */
|
|
@@ -17114,6 +17148,24 @@ interface paths {
|
|
|
17114
17148
|
* @enum {string|null}
|
|
17115
17149
|
*/
|
|
17116
17150
|
covered_by: "complimentary" | "contract" | "not_billed" | null;
|
|
17151
|
+
/** @description The unpaid annual purchase cobro of this add-on (Vitrina Finanzas), or null. The add-on turns annual only when it is paid. */
|
|
17152
|
+
annual_purchase_invoice_id?: string | null;
|
|
17153
|
+
/** @description While annual: the last Santiago day (`YYYY-MM-DD`) the paid term covers. Null when monthly. */
|
|
17154
|
+
paid_until?: string | null;
|
|
17155
|
+
/** @description While annual, not cancelled and not going back to monthly: the Santiago day (`YYYY-MM-DD`) the term ends and its renewal starts. Null otherwise. */
|
|
17156
|
+
renews_on?: string | null;
|
|
17157
|
+
/**
|
|
17158
|
+
* @description `monthly` when the owner chose to go back to monthly at the term end (`PUT /entitlements/finanzas/interval`); null when the term renews.
|
|
17159
|
+
* @enum {string|null}
|
|
17160
|
+
*/
|
|
17161
|
+
next_billing_interval?: "monthly" | "annual" | null;
|
|
17162
|
+
/** @description When the 30-day renewal notice of the current term went out. */
|
|
17163
|
+
renewal_notice_sent_at?: string | null;
|
|
17164
|
+
/** @description While annual and renewing: the next year in UF after the 20 % and its pesos at today's UF (before IVA). Null otherwise. */
|
|
17165
|
+
renewal_preview?: {
|
|
17166
|
+
uf_period: number;
|
|
17167
|
+
clp_estimate: number | null;
|
|
17168
|
+
} | null;
|
|
17117
17169
|
}[];
|
|
17118
17170
|
usage: {
|
|
17119
17171
|
tasador: {
|
|
@@ -17219,7 +17271,7 @@ interface paths {
|
|
|
17219
17271
|
put?: never;
|
|
17220
17272
|
/**
|
|
17221
17273
|
* Self-serve activate an add-on (returns needs_enrollment without a payment mandate)
|
|
17222
|
-
* @description Grants `feature` to the workspace once an active payment mandate exists (`{ status: "active", entitlement }`); with none, answers `{ status: "needs_enrollment" }` and grants nothing — the caller routes the dealer through the Fintoc/Mercado Pago enrollment step and retries. No payment method is needed when the add-on costs the workspace nothing: its row is covered by another biller (`billed_by` other than `vitrina`) or sits inside an active `waiver_until` waiver; such an activation answers `active` and accrues no charge for the covered days. An add-on this workspace cannot buy answers 409 `ADDON_NOT_OFFERED` (`details.reason`: `sandbox` or `vertical`, the same answer `GET /entitlements` publishes in `offers`); reactivating an add-on the workspace still holds is never refused for that. Idempotent on an already-active feature (re-answers the same `active` row rather than erroring).
|
|
17274
|
+
* @description Grants `feature` to the workspace once an active payment mandate exists (`{ status: "active", entitlement }`); with none, answers `{ status: "needs_enrollment" }` and grants nothing — the caller routes the dealer through the Fintoc/Mercado Pago enrollment step and retries. No payment method is needed when the add-on costs the workspace nothing: its row is covered by another biller (`billed_by` other than `vitrina`) or sits inside an active `waiver_until` waiver; such an activation answers `active` and accrues no charge for the covered days. An add-on this workspace cannot buy answers 409 `ADDON_NOT_OFFERED` (`details.reason`: `sandbox` or `vertical`, the same answer `GET /entitlements` publishes in `offers`); reactivating an add-on the workspace still holds is never refused for that. Idempotent on an already-active feature (re-answers the same `active` row rather than erroring). ANNUAL (Vitrina Finanzas only, needs `billing:write`; monthly activation keeps `tenant:write`): body `{ "billing_interval": "annual", "payment": "card" | "transfer" }` issues ONE cobro for the base, 12 months at 20 % off (14.4 UF neto at the UF of the issue day, number `INV-{tenant}-AF{YYYYMM}`), with no payment method required, and answers `{ status: "awaiting_payment" | "active", billing_interval: "annual", invoice_id, invoice_number, uf_total, clp_total, due_at, purchase_expires_on, next_step, term_start, term_end }`. Finanzas opens (or turns annual) only when that cobro is paid; its year starts at the payment instant (after a running waiver). Unpaid, the cobro is voided 30 days after issue and nothing changes. Extra banks keep billing monthly. 409 `ANNUAL_NOT_AVAILABLE` (`details.reason`: `not_annual_feature`, `complimentary`, `billed_elsewhere`, `suspended`, `term_running`); 409 `ANNUAL_PURCHASE_PENDING` while an unpaid purchase is out (`details.invoice_id`).
|
|
17223
17275
|
*/
|
|
17224
17276
|
post: {
|
|
17225
17277
|
parameters: {
|
|
@@ -17233,7 +17285,22 @@ interface paths {
|
|
|
17233
17285
|
};
|
|
17234
17286
|
cookie?: never;
|
|
17235
17287
|
};
|
|
17236
|
-
requestBody?:
|
|
17288
|
+
requestBody?: {
|
|
17289
|
+
content: {
|
|
17290
|
+
/**
|
|
17291
|
+
* @example {
|
|
17292
|
+
* "billing_interval": "annual",
|
|
17293
|
+
* "payment": "transfer"
|
|
17294
|
+
* }
|
|
17295
|
+
*/
|
|
17296
|
+
"application/json": {
|
|
17297
|
+
/** @enum {string} */
|
|
17298
|
+
billing_interval?: "monthly" | "annual";
|
|
17299
|
+
/** @enum {string} */
|
|
17300
|
+
payment?: "card" | "transfer";
|
|
17301
|
+
};
|
|
17302
|
+
};
|
|
17303
|
+
};
|
|
17237
17304
|
responses: {
|
|
17238
17305
|
/** @description Activation result */
|
|
17239
17306
|
200: {
|
|
@@ -17453,6 +17520,133 @@ interface paths {
|
|
|
17453
17520
|
patch?: never;
|
|
17454
17521
|
trace?: never;
|
|
17455
17522
|
};
|
|
17523
|
+
"/entitlements/finanzas/interval": {
|
|
17524
|
+
parameters: {
|
|
17525
|
+
query?: never;
|
|
17526
|
+
header?: never;
|
|
17527
|
+
path?: never;
|
|
17528
|
+
cookie?: never;
|
|
17529
|
+
};
|
|
17530
|
+
get?: never;
|
|
17531
|
+
/**
|
|
17532
|
+
* Switch annual Vitrina Finanzas back to monthly at the term end
|
|
17533
|
+
* @description `monthly`: the paid year runs to its end with no refund and does not renew; from that day the base bills monthly in arrears. `annual` undoes it (the year renews). Monthly to annual is the purchase, `POST /entitlements/finanzas/activate` with `billing_interval: annual`. 409 `details.code`: `use_annual_purchase` (annual asked on a monthly row), `not_annual`, `plan_cancelling`, `next_cobro_issued` (the renewal Cobro is already out); 409 `ANNUAL_NOT_AVAILABLE` with `details.reason` `quoted` | `agency` | `contract` on `annual`: the 20 % annual discount is for the public price list only. Requires `billing:write`.
|
|
17534
|
+
*/
|
|
17535
|
+
put: {
|
|
17536
|
+
parameters: {
|
|
17537
|
+
query?: never;
|
|
17538
|
+
header?: never;
|
|
17539
|
+
path?: never;
|
|
17540
|
+
cookie?: never;
|
|
17541
|
+
};
|
|
17542
|
+
requestBody?: {
|
|
17543
|
+
content: {
|
|
17544
|
+
/**
|
|
17545
|
+
* @example {
|
|
17546
|
+
* "interval": "monthly"
|
|
17547
|
+
* }
|
|
17548
|
+
*/
|
|
17549
|
+
"application/json": {
|
|
17550
|
+
/** @enum {string} */
|
|
17551
|
+
interval: "monthly" | "annual";
|
|
17552
|
+
};
|
|
17553
|
+
};
|
|
17554
|
+
};
|
|
17555
|
+
responses: {
|
|
17556
|
+
/** @description When the change applies and the new price */
|
|
17557
|
+
200: {
|
|
17558
|
+
headers: {
|
|
17559
|
+
[name: string]: unknown;
|
|
17560
|
+
};
|
|
17561
|
+
content: {
|
|
17562
|
+
/**
|
|
17563
|
+
* @example {
|
|
17564
|
+
* "data": {
|
|
17565
|
+
* "interval": "monthly",
|
|
17566
|
+
* "effective_on": "2027-11-17",
|
|
17567
|
+
* "preview": {
|
|
17568
|
+
* "uf_period": 1.5,
|
|
17569
|
+
* "clp_estimate": 59785
|
|
17570
|
+
* }
|
|
17571
|
+
* }
|
|
17572
|
+
* }
|
|
17573
|
+
*/
|
|
17574
|
+
"application/json": {
|
|
17575
|
+
data: {
|
|
17576
|
+
/** @enum {string} */
|
|
17577
|
+
interval: "monthly" | "annual";
|
|
17578
|
+
effective_on: string;
|
|
17579
|
+
preview: {
|
|
17580
|
+
uf_period: number;
|
|
17581
|
+
clp_estimate: number | null;
|
|
17582
|
+
};
|
|
17583
|
+
};
|
|
17584
|
+
};
|
|
17585
|
+
};
|
|
17586
|
+
};
|
|
17587
|
+
/** @description Validation error */
|
|
17588
|
+
400: {
|
|
17589
|
+
headers: {
|
|
17590
|
+
[name: string]: unknown;
|
|
17591
|
+
};
|
|
17592
|
+
content: {
|
|
17593
|
+
"application/json": components["schemas"]["Error"];
|
|
17594
|
+
};
|
|
17595
|
+
};
|
|
17596
|
+
/** @description Unauthorized */
|
|
17597
|
+
401: {
|
|
17598
|
+
headers: {
|
|
17599
|
+
[name: string]: unknown;
|
|
17600
|
+
};
|
|
17601
|
+
content: {
|
|
17602
|
+
"application/json": components["schemas"]["Error"];
|
|
17603
|
+
};
|
|
17604
|
+
};
|
|
17605
|
+
/** @description Forbidden */
|
|
17606
|
+
403: {
|
|
17607
|
+
headers: {
|
|
17608
|
+
[name: string]: unknown;
|
|
17609
|
+
};
|
|
17610
|
+
content: {
|
|
17611
|
+
"application/json": components["schemas"]["Error"];
|
|
17612
|
+
};
|
|
17613
|
+
};
|
|
17614
|
+
/** @description Not found */
|
|
17615
|
+
404: {
|
|
17616
|
+
headers: {
|
|
17617
|
+
[name: string]: unknown;
|
|
17618
|
+
};
|
|
17619
|
+
content: {
|
|
17620
|
+
"application/json": components["schemas"]["Error"];
|
|
17621
|
+
};
|
|
17622
|
+
};
|
|
17623
|
+
/** @description Conflict (incl. Idempotency-Key reuse with different body) */
|
|
17624
|
+
409: {
|
|
17625
|
+
headers: {
|
|
17626
|
+
[name: string]: unknown;
|
|
17627
|
+
};
|
|
17628
|
+
content: {
|
|
17629
|
+
"application/json": components["schemas"]["Error"];
|
|
17630
|
+
};
|
|
17631
|
+
};
|
|
17632
|
+
/** @description Rate limited */
|
|
17633
|
+
429: {
|
|
17634
|
+
headers: {
|
|
17635
|
+
[name: string]: unknown;
|
|
17636
|
+
};
|
|
17637
|
+
content: {
|
|
17638
|
+
"application/json": components["schemas"]["Error"];
|
|
17639
|
+
};
|
|
17640
|
+
};
|
|
17641
|
+
};
|
|
17642
|
+
};
|
|
17643
|
+
post?: never;
|
|
17644
|
+
delete?: never;
|
|
17645
|
+
options?: never;
|
|
17646
|
+
head?: never;
|
|
17647
|
+
patch?: never;
|
|
17648
|
+
trace?: never;
|
|
17649
|
+
};
|
|
17456
17650
|
"/vehicles/catalog/brands": {
|
|
17457
17651
|
parameters: {
|
|
17458
17652
|
query?: never;
|
|
@@ -18513,6 +18707,8 @@ interface paths {
|
|
|
18513
18707
|
*
|
|
18514
18708
|
* **Publish in the same call (`publish_to`).** Optional. Name the marketplaces this vehicle should go to — portal slugs such as `chileautos` / `mercadolibre`, or integration ids from GET /marketplaces — and it is published right after it is saved, through the same path as POST /vehicles/{id}/publish. Omitted or `[]` saves only; there is no default. Every entry is validated first: a portal with no connected account, a slug matching several accounts, or an id from another workspace answers **422 and nothing is saved**. Once saved, the vehicle stays saved: a portal that fails to publish is an `error` entry in `publications`, never a failed request (still 201). The response then carries `publications`, one `PublishOutcome` per account (`published`, `pending` for queued transports such as `chileautos_panel`, `already_published`, or `error` with the reason). `publications` is absent when `publish_to` was not sent.
|
|
18515
18709
|
*
|
|
18710
|
+
* **Costo de compra in the same call (`purchase_cost_clp`).** Optional (vitrina-app#7719). The amount the dealership paid, recorded as the car’s Costo de compra exactly as `POST /vehicle-acquisitions` with `kind: "compra"` would; `invoice_includes_iva: true` says it includes IVA («Compra con factura»). Needs `dealership_economics:write`: without it the call is a **403 and nothing is saved**. The response then carries `acquisition` (the recorded row, the same shape `POST /vehicle-acquisitions` returns, shown only to callers holding `dealership_economics:read`); `acquisition: null` means the car was saved but its cost was not, and it can be typed on the car’s page. Both fields are create-only.
|
|
18711
|
+
*
|
|
18516
18712
|
* **Sanity range.** A price fans out to every connected portal, so a typo is stopped here. `price_amount` must be between 100.000 and 2.000.000.000 CLP (a UF price is bounded at the day's UF; other currencies are not bounded) and `odometer_value` between 0 and 2.000.000; `null` clears either and is always accepted. Outside the range: **422 `VEHICLE_VALUE_OUT_OF_RANGE`**, with a Spanish `message`, `field_errors.<field>` and `details.violations[]` (`field`, `reason` = `price_out_of_range` | `km_out_of_range`, `value`, `min`, `max`, `currency`). A price change beyond 10x up or down from the current price answers **422 `PRICE_CHANGE_CONFIRMATION_REQUIRED`** (`details.reason` = `large_price_change`, `current_price`, `requested_price`, `currency`, `factor`, `confirm_flag`) unless the body carries `confirm_large_price_change: true`; ask the user, then resend the same body with it. Nothing is written on either 422.
|
|
18517
18713
|
*
|
|
18518
18714
|
* **Normalization and `catalog_match`.** On create and update, `make` and `model` that equal an entry of GET /vehicles/catalog/brands and /catalog/models up to case, accents, spaces and hyphens are stored in the catalog's spelling ("toyota" → "Toyota", "mercedes benz" → "Mercedes-Benz", "rav 4" → "RAV4"); `fuel_type`, `gear_type` and `body_style` are stored as vocabulary codes ("Bencina" → `gasolina`, "Automática" → `automatica`, "Station Wagon" → `wagon`; codes: fuel `gasolina|diesel|hibrido|electrico|gnc|glp|otro`, gear `mecanica|automatica|otro`, body `sedan|hatchback|suv|camioneta|coupe|wagon|furgon|convertible|minivan|otro`; for `vehicle_type: moto` body_style is the «Tipo de moto» instead: `moto_calle|moto_deportiva|moto_touring|moto_trail|moto_enduro|moto_scooter|moto_custom|moto_cuatrimoto|moto_otro`, and "Trail" / "BODY.MOTORCYCLE.TRAIL" snap to `moto_trail`). Nothing is invented: a value with no match is stored exactly as sent. The response (and GET /vehicles/{id}) carries `catalog_match`: `make` / `model` are `matched` | `unmatched` | `missing` (`not_applicable` for a non-`auto` vehicle_type); `version` adds `approximate` (word overlap with a catalog version, same displacement) and `catalog_version` names the catalog version it matched or most resembles; `fuel_type` / `gear_type` / `body_style` are `matched` | `unmatched` | `missing`; `warnings[]` lists `{ field, code, message }` for everything not matched, with a Spanish `message` ready to show (codes: `make_missing`, `make_not_in_catalog`, `model_missing`, `model_not_in_catalog`, `version_approximate`, `version_not_in_catalog`, `fuel_type_not_recognized`, `gear_type_not_recognized`, `body_style_not_recognized`). A make or model that is not matched still saves, but Chileautos publishes it without a technical sheet (ficha). `catalog_match` is null only when the catalog could not be loaded. Example of an unmatched push: {"make":"matched","model":"unmatched","version":"unmatched","catalog_version":null,"fuel_type":"unmatched","gear_type":"matched","body_style":"missing","warnings":[{"field":"model","code":"model_not_in_catalog","message":"Modelo 'Rav-4 xx' no está en el catálogo de Toyota (GET /vehicles/catalog/models); Chileautos lo publicará sin ficha."},{"field":"fuel_type","code":"fuel_type_not_recognized","message":"Combustible 'Hidrógeno' no se reconoce; valores aceptados: gasolina, diesel, hibrido, electrico, gnc, glp, otro."}]}
|
|
@@ -18623,6 +18819,10 @@ interface paths {
|
|
|
18623
18819
|
* ]
|
|
18624
18820
|
*/
|
|
18625
18821
|
publish_to?: string[];
|
|
18822
|
+
/** @description Costo de compra del auto en pesos, opcional. Se registra en la misma llamada como el costo de compra del auto (lo mismo que `POST /vehicle-acquisitions` con `kind: "compra"`). Necesita el permiso `dealership_economics:write`; sin él la llamada responde 403 y no crea el auto. */
|
|
18823
|
+
purchase_cost_clp?: number;
|
|
18824
|
+
/** @description «Compra con factura (incluye IVA)» para `purchase_cost_clp`. Opcional, por defecto false. Con true el monto incluye IVA y el costo de compra queda sin IVA. */
|
|
18825
|
+
invoice_includes_iva?: boolean;
|
|
18626
18826
|
};
|
|
18627
18827
|
};
|
|
18628
18828
|
};
|
|
@@ -38323,7 +38523,7 @@ interface paths {
|
|
|
38323
38523
|
};
|
|
38324
38524
|
/**
|
|
38325
38525
|
* The clinic banded plan: band, count, price, review, pause state
|
|
38326
|
-
* @description Band (S/M/L/XL or quoted), the 3-month average of professionals who attended patients that produced it, the UF/month price with the design-partner lock honoured, the next band review, any announced move, the payment mandate, the pause state and where the non-payment ladder has got to.
|
|
38526
|
+
* @description Band (S/M/L/XL or quoted), the 3-month average of professionals who attended patients that produced it, the UF/month price with the design-partner lock honoured, the next band review, any announced move, the payment mandate, the pause state and where the non-payment ladder has got to. On an annual plan a move up is charged once as the difference for the months of the paid year left, at the annual price (`announced_remaining_months`, `announced_difference_uf`, `announced_difference_clp_estimate`), and a move down only shows as `pending_down_band` until the renewal.
|
|
38327
38527
|
*/
|
|
38328
38528
|
get: {
|
|
38329
38529
|
parameters: {
|
|
@@ -38452,6 +38652,23 @@ interface paths {
|
|
|
38452
38652
|
cancel_at_period_end: boolean;
|
|
38453
38653
|
ends_on: string | null;
|
|
38454
38654
|
plan_ended_at: string | null;
|
|
38655
|
+
/** @enum {string|null} */
|
|
38656
|
+
pending_down_band: "S" | "M" | "L" | "XL" | "quoted" | null;
|
|
38657
|
+
announced_remaining_months: number | null;
|
|
38658
|
+
announced_difference_uf: number | null;
|
|
38659
|
+
announced_difference_clp_estimate: number | null;
|
|
38660
|
+
/** @enum {string|null} */
|
|
38661
|
+
next_billing_interval: "monthly" | "annual" | null;
|
|
38662
|
+
renewal_notice_sent_at: string | null;
|
|
38663
|
+
renewal_preview: {
|
|
38664
|
+
/** @enum {string} */
|
|
38665
|
+
interval: "monthly" | "annual";
|
|
38666
|
+
/** @enum {string} */
|
|
38667
|
+
band: "S" | "M" | "L" | "XL" | "quoted";
|
|
38668
|
+
uf_month: number;
|
|
38669
|
+
uf_period: number;
|
|
38670
|
+
clp_estimate: number | null;
|
|
38671
|
+
} | null;
|
|
38455
38672
|
};
|
|
38456
38673
|
};
|
|
38457
38674
|
};
|
|
@@ -49943,7 +50160,7 @@ interface paths {
|
|
|
49943
50160
|
put?: never;
|
|
49944
50161
|
/**
|
|
49945
50162
|
* Record how a unit arrived, or its bare Costo de compra
|
|
49946
|
-
* @description Two shapes. (1) THE BARE COSTO DE COMPRA (vitrina-app#7612): `{ vehicle_id, kind: "compra", net_clp }` with no document link records what the dealership paid for a car of its own — the
|
|
50163
|
+
* @description Two shapes. (1) THE BARE COSTO DE COMPRA (vitrina-app#7612): `{ vehicle_id, kind: "compra", net_clp }` with no document link records what the dealership paid for a car of its own — the cost field of the profit report, of the car’s page and of the new-car form. `net_clp` is the amount typed: the total paid, unless `invoice_includes_iva: true` («Compra con factura (incluye IVA)», vitrina-app#7719) says it includes IVA; then the stored `net_clp` is the amount without IVA, `tax_clp` the IVA, `tax_treatment` afecto and `generates_fiscal_credit` true. A correction resends the tick; without it the cost is the whole amount again. Every response carries `invoice_includes_iva` and `amount_paid_clp` (what was typed) to prefill the field. Defaults: `acquired_on` = the day the car was created in Vitrina (dealership calendar), `tax_treatment` = the car’s IVA regime (the car’s, else the dealership default, else `exento`), `borne_by` = `automotora`, `generates_fiscal_credit` = false, `tax_clp` = null. The SAME call on a car that already has a bare cost replaces its amount and answers 200; a new cost answers 201. When the nota de compra the cost came from was VOIDED, the same call detaches the cost from it (same row, 200, defaults as above, the voided note’s retained cost lines withdrawn) and a later nota de compra can take it over again. 409 with `error.details.code`: `purchase_cost_on_purchase_note` (a live nota de compra: correct it there, `details.purchase_note_id`), `purchase_cost_on_trade_in` (the car came in as parte de pago, `details.sale_note_id`), `purchase_cost_consigned_vehicle` (a consigned car has no purchase cost). The profit report (`GET /margin`) counts the cost on the next read. (2) AN ACQUISITION UNDER ITS DOCUMENT: any kind naming its document (`purchase_note_id`, `consignment_contract_id`, `sale_note_id`); the same defaults and the same tick apply (nothing beyond the car, kind, document and amount is required since vitrina-app#7719), and a second acquisition for one unit is a 409.
|
|
49947
50164
|
*/
|
|
49948
50165
|
post: {
|
|
49949
50166
|
parameters: {
|
|
@@ -49971,7 +50188,7 @@ interface paths {
|
|
|
49971
50188
|
kind: "compra" | "consignacion" | "retoma";
|
|
49972
50189
|
/** Format: uuid */
|
|
49973
50190
|
counterparty_contact_id?: string | null;
|
|
49974
|
-
/** @description Fecha de adquisición.
|
|
50191
|
+
/** @description Fecha de adquisición. Opcional: por defecto el día en que el auto se creó en Vitrina (calendario de la automotora). */
|
|
49975
50192
|
acquired_on?: string;
|
|
49976
50193
|
/** Format: uuid */
|
|
49977
50194
|
purchase_note_id?: string | null;
|
|
@@ -49979,21 +50196,23 @@ interface paths {
|
|
|
49979
50196
|
consignment_contract_id?: string | null;
|
|
49980
50197
|
/** Format: uuid */
|
|
49981
50198
|
sale_note_id?: string | null;
|
|
49982
|
-
/** @description Costo de compra en pesos
|
|
50199
|
+
/** @description Costo de compra en pesos, el monto que escribe la automotora. Sin `invoice_includes_iva` es el costo completo. Con `invoice_includes_iva: true` el monto incluye IVA: se guarda sin IVA en `net_clp` y el IVA en `tax_clp`. */
|
|
49983
50200
|
net_clp: number;
|
|
49984
50201
|
tax_clp?: number | null;
|
|
49985
50202
|
/**
|
|
49986
|
-
* @description
|
|
50203
|
+
* @description Opcional. Por defecto el régimen de IVA del auto (el del auto, si no el de la automotora, si no exento); `afecto` con `invoice_includes_iva`.
|
|
49987
50204
|
* @enum {string}
|
|
49988
50205
|
*/
|
|
49989
50206
|
tax_treatment?: "afecto" | "exento" | "no_gravado" | "pass_through";
|
|
49990
50207
|
/**
|
|
49991
|
-
* @description
|
|
50208
|
+
* @description Opcional. Por defecto automotora.
|
|
49992
50209
|
* @enum {string}
|
|
49993
50210
|
*/
|
|
49994
50211
|
borne_by?: "automotora" | "cliente";
|
|
49995
|
-
/** @description
|
|
50212
|
+
/** @description Opcional. Por defecto false; true con `invoice_includes_iva`. */
|
|
49996
50213
|
generates_fiscal_credit?: boolean;
|
|
50214
|
+
/** @description «Compra con factura (incluye IVA)». Opcional, por defecto false. Con true el monto de `net_clp` incluye IVA: el costo de compra queda sin IVA, el IVA se guarda aparte (`tax_clp`), la compra queda afecta y con crédito fiscal. Manda sobre `tax_clp`, `tax_treatment` y `generates_fiscal_credit`. Al corregir un costo se manda de nuevo: sin él, el costo vuelve a ser el monto completo. */
|
|
50215
|
+
invoice_includes_iva?: boolean;
|
|
49997
50216
|
};
|
|
49998
50217
|
};
|
|
49999
50218
|
};
|
|
@@ -50023,7 +50242,9 @@ interface paths {
|
|
|
50023
50242
|
* "generates_fiscal_credit": false,
|
|
50024
50243
|
* "created_at": "2026-11-19T15:02:00.000Z",
|
|
50025
50244
|
* "updated_at": "2026-11-19T15:10:00.000Z",
|
|
50026
|
-
* "derived_tenencia": "propio"
|
|
50245
|
+
* "derived_tenencia": "propio",
|
|
50246
|
+
* "invoice_includes_iva": false,
|
|
50247
|
+
* "amount_paid_clp": 8500000
|
|
50027
50248
|
* }
|
|
50028
50249
|
* }
|
|
50029
50250
|
*/
|
|
@@ -50060,7 +50281,9 @@ interface paths {
|
|
|
50060
50281
|
* "generates_fiscal_credit": false,
|
|
50061
50282
|
* "created_at": "2026-11-19T15:02:00.000Z",
|
|
50062
50283
|
* "updated_at": "2026-11-19T15:02:00.000Z",
|
|
50063
|
-
* "derived_tenencia": "propio"
|
|
50284
|
+
* "derived_tenencia": "propio",
|
|
50285
|
+
* "invoice_includes_iva": false,
|
|
50286
|
+
* "amount_paid_clp": 8500000
|
|
50064
50287
|
* }
|
|
50065
50288
|
* }
|
|
50066
50289
|
*/
|
package/package.json
CHANGED