@vitrina/api 14.45.0 → 14.46.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 +1827 -466
- package/dist/index.d.ts +1827 -466
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -22430,6 +22430,7 @@ interface paths {
|
|
|
22430
22430
|
status?: "open" | "won" | "lost" | "unqualified";
|
|
22431
22431
|
source?: "conversation" | "marketplace" | "manual" | "import" | "ai_agent" | "chileautos" | "yapo" | "mercadolibre" | "website" | "facebook_marketplace" | "form" | "campaign";
|
|
22432
22432
|
intent?: "buy" | "sell" | "financing" | "trade_in";
|
|
22433
|
+
acquisition_type?: "compra" | "consignacion" | "unknown";
|
|
22433
22434
|
owner_user_id?: string;
|
|
22434
22435
|
team_id?: string;
|
|
22435
22436
|
contact_id?: string;
|
|
@@ -22778,6 +22779,11 @@ interface paths {
|
|
|
22778
22779
|
source?: "conversation" | "marketplace" | "manual" | "import" | "ai_agent" | "chileautos" | "yapo" | "mercadolibre" | "website" | "facebook_marketplace" | "campaign";
|
|
22779
22780
|
/** @enum {string} */
|
|
22780
22781
|
intent?: "buy" | "sell" | "financing" | "trade_in";
|
|
22782
|
+
/**
|
|
22783
|
+
* @description «Compra y consignación»: compra (direct purchase) | consignacion | unknown. Set on intake when known; reaching the «Comprado» / «Consignado» stage stamps it and overwrites an earlier value. Read back as null on a lead that was never on that board.
|
|
22784
|
+
* @enum {string|null}
|
|
22785
|
+
*/
|
|
22786
|
+
acquisition_type?: "compra" | "consignacion" | "unknown" | null;
|
|
22781
22787
|
source_ref?: string | null;
|
|
22782
22788
|
value_amount?: number | null;
|
|
22783
22789
|
value_currency?: string | null;
|
|
@@ -24389,6 +24395,11 @@ interface paths {
|
|
|
24389
24395
|
temperature_reason?: string | null;
|
|
24390
24396
|
/** @enum {string} */
|
|
24391
24397
|
lost_reason?: "bought_elsewhere" | "financing_rejected" | "unit_unavailable" | "price" | "not_ready" | "unresponsive" | "other";
|
|
24398
|
+
/**
|
|
24399
|
+
* @description «Compra y consignación»: compra (direct purchase) | consignacion | unknown. Set on intake when known; reaching the «Comprado» / «Consignado» stage stamps it and overwrites an earlier value. Read back as null on a lead that was never on that board.
|
|
24400
|
+
* @enum {string|null}
|
|
24401
|
+
*/
|
|
24402
|
+
acquisition_type?: "compra" | "consignacion" | "unknown" | null;
|
|
24392
24403
|
};
|
|
24393
24404
|
};
|
|
24394
24405
|
};
|
|
@@ -65065,7 +65076,7 @@ interface paths {
|
|
|
65065
65076
|
patch?: never;
|
|
65066
65077
|
trace?: never;
|
|
65067
65078
|
};
|
|
65068
|
-
"/clinic/
|
|
65079
|
+
"/clinic/commissions/history": {
|
|
65069
65080
|
parameters: {
|
|
65070
65081
|
query?: never;
|
|
65071
65082
|
header?: never;
|
|
@@ -65073,17 +65084,15 @@ interface paths {
|
|
|
65073
65084
|
cookie?: never;
|
|
65074
65085
|
};
|
|
65075
65086
|
/**
|
|
65076
|
-
*
|
|
65077
|
-
* @description
|
|
65087
|
+
* A professional’s commission history, Vitrina and Dentalink
|
|
65088
|
+
* @description One professional’s months, newest first, so the whole history is in one place: for each month `settled_by` (`vitrina` from «primer mes que liquida Vitrina» on, `dentalink` before it), Vitrina’s own lines (`native`: counts and Σ, `read_only: false`), the liquidaciones Dentalink settled and the migration imported (`imported`, labelled «Importada de Dentalink», `read_only: true`, Dentalink’s own total) and the Dentalink exports the clinic uploaded for pages the reader could not reach (`exports`, `read_only: true`). Imported months are never recomputed, approved or exported and never count as months Vitrina computed. 404 unknown professional. Requires `clinic_money:read`.
|
|
65089
|
+
*
|
|
65090
|
+
* **Connected apps:** every patient and contact in the response is a Seudónimo de paciente — initials plus a stable number, `"M.F. · #1001"` — unless the clinic allowed patient names, with RUT, phone and email masked in free text and `meta.patient_privacy` saying so. Clinical alerts (`flags`) are withheld in both modes, and a non-JSON body (an export, a file) is refused with `403 CONNECTED_APP_SENSITIVE_DATA`.
|
|
65078
65091
|
*/
|
|
65079
65092
|
get: {
|
|
65080
65093
|
parameters: {
|
|
65081
|
-
query
|
|
65082
|
-
|
|
65083
|
-
status?: "pending" | "matched" | "closed" | "all";
|
|
65084
|
-
contact_id?: string;
|
|
65085
|
-
limit?: number;
|
|
65086
|
-
offset?: number | null;
|
|
65094
|
+
query: {
|
|
65095
|
+
professional_id: string;
|
|
65087
65096
|
};
|
|
65088
65097
|
header?: never;
|
|
65089
65098
|
path?: never;
|
|
@@ -65091,7 +65100,7 @@ interface paths {
|
|
|
65091
65100
|
};
|
|
65092
65101
|
requestBody?: never;
|
|
65093
65102
|
responses: {
|
|
65094
|
-
/** @description
|
|
65103
|
+
/** @description Commission history */
|
|
65095
65104
|
200: {
|
|
65096
65105
|
headers: {
|
|
65097
65106
|
[name: string]: unknown;
|
|
@@ -65099,63 +65108,57 @@ interface paths {
|
|
|
65099
65108
|
content: {
|
|
65100
65109
|
/**
|
|
65101
65110
|
* @example {
|
|
65102
|
-
* "data":
|
|
65103
|
-
*
|
|
65104
|
-
*
|
|
65105
|
-
*
|
|
65106
|
-
*
|
|
65107
|
-
*
|
|
65108
|
-
*
|
|
65109
|
-
*
|
|
65110
|
-
*
|
|
65111
|
-
*
|
|
65112
|
-
*
|
|
65113
|
-
*
|
|
65114
|
-
*
|
|
65115
|
-
*
|
|
65116
|
-
*
|
|
65117
|
-
*
|
|
65118
|
-
* "
|
|
65119
|
-
*
|
|
65120
|
-
* "concept": {
|
|
65121
|
-
* "kind": "appointment_deposit",
|
|
65122
|
-
* "label": "Abono cita",
|
|
65123
|
-
* "appointment_starts_at": "2026-10-09T13:00:00.000Z"
|
|
65124
|
-
* },
|
|
65125
|
-
* "medio": {
|
|
65126
|
-
* "code": "30",
|
|
65127
|
-
* "label": "Mercado Pago"
|
|
65128
|
-
* },
|
|
65129
|
-
* "matched": {
|
|
65130
|
-
* "mirror_payment_id": "0199c3a0-5555-7000-8000-000000000005",
|
|
65131
|
-
* "vendor_reference": "88123",
|
|
65132
|
-
* "received_on": "2026-10-05",
|
|
65133
|
-
* "amount_clp": 30000,
|
|
65134
|
-
* "medio": "Mercado Pago",
|
|
65135
|
-
* "voided": false,
|
|
65136
|
-
* "by": "auto_unique",
|
|
65137
|
-
* "at": "2026-10-05T18:20:00.000Z"
|
|
65111
|
+
* "data": {
|
|
65112
|
+
* "professional_id": "0192f0c4-0000-7000-8000-000000000001",
|
|
65113
|
+
* "first_native_money_month": "2026-11",
|
|
65114
|
+
* "months": [
|
|
65115
|
+
* {
|
|
65116
|
+
* "period": "2026-11",
|
|
65117
|
+
* "settled_by": "vitrina",
|
|
65118
|
+
* "native": {
|
|
65119
|
+
* "source": "vitrina",
|
|
65120
|
+
* "read_only": false,
|
|
65121
|
+
* "lines": 42,
|
|
65122
|
+
* "amount_clp": 1260000,
|
|
65123
|
+
* "computed": 0,
|
|
65124
|
+
* "approved": 42,
|
|
65125
|
+
* "exported": 0
|
|
65126
|
+
* },
|
|
65127
|
+
* "imported": [],
|
|
65128
|
+
* "exports": []
|
|
65138
65129
|
* },
|
|
65139
|
-
*
|
|
65140
|
-
*
|
|
65141
|
-
*
|
|
65142
|
-
*
|
|
65143
|
-
*
|
|
65144
|
-
*
|
|
65145
|
-
*
|
|
65146
|
-
*
|
|
65147
|
-
*
|
|
65148
|
-
*
|
|
65149
|
-
*
|
|
65130
|
+
* {
|
|
65131
|
+
* "period": "2026-10",
|
|
65132
|
+
* "settled_by": "dentalink",
|
|
65133
|
+
* "native": null,
|
|
65134
|
+
* "imported": [
|
|
65135
|
+
* {
|
|
65136
|
+
* "id": "0192f0c4-0000-7000-8000-000000000002",
|
|
65137
|
+
* "source": "dentalink_import",
|
|
65138
|
+
* "label": "Importada de Dentalink",
|
|
65139
|
+
* "read_only": true,
|
|
65140
|
+
* "external_id": "9001",
|
|
65141
|
+
* "location_id": null,
|
|
65142
|
+
* "location_name": "Central",
|
|
65143
|
+
* "period_from": "2026-10-01",
|
|
65144
|
+
* "period_to": "2026-10-31",
|
|
65145
|
+
* "total_clp": 1180000,
|
|
65146
|
+
* "lines_total_clp": 1180000,
|
|
65147
|
+
* "deductions_clp": -80000,
|
|
65148
|
+
* "line_count": 38,
|
|
65149
|
+
* "imported_at": "2026-11-05T14:00:00.000Z"
|
|
65150
|
+
* }
|
|
65151
|
+
* ],
|
|
65152
|
+
* "exports": []
|
|
65153
|
+
* }
|
|
65154
|
+
* ]
|
|
65150
65155
|
* }
|
|
65151
65156
|
* }
|
|
65152
65157
|
*/
|
|
65153
65158
|
"application/json": {
|
|
65154
|
-
data
|
|
65155
|
-
meta
|
|
65156
|
-
|
|
65157
|
-
limit: number;
|
|
65158
|
-
offset: number;
|
|
65159
|
+
data?: unknown;
|
|
65160
|
+
meta?: {
|
|
65161
|
+
[key: string]: unknown;
|
|
65159
65162
|
};
|
|
65160
65163
|
};
|
|
65161
65164
|
};
|
|
@@ -65224,7 +65227,7 @@ interface paths {
|
|
|
65224
65227
|
patch?: never;
|
|
65225
65228
|
trace?: never;
|
|
65226
65229
|
};
|
|
65227
|
-
"/clinic/
|
|
65230
|
+
"/clinic/commissions/imported/{id}": {
|
|
65228
65231
|
parameters: {
|
|
65229
65232
|
query?: never;
|
|
65230
65233
|
header?: never;
|
|
@@ -65232,136 +65235,23 @@ interface paths {
|
|
|
65232
65235
|
cookie?: never;
|
|
65233
65236
|
};
|
|
65234
65237
|
/**
|
|
65235
|
-
*
|
|
65236
|
-
* @description
|
|
65238
|
+
* One liquidación imported from Dentalink, with its lines
|
|
65239
|
+
* @description A liquidación as Dentalink settled it (read-only, «Importada de Dentalink»): dentist, sucursal, period, Dentalink’s total, the page’s own total and deductions, and its lines (day, prestación, base, rate in basis points, deductions, amount). The paciente is the migrated ficha’s id when resolvable and the INITIALS — never a name, like the native liquidación PDF. 404 unknown id. Requires `clinic_money:read`.
|
|
65240
|
+
*
|
|
65241
|
+
* **Connected apps:** every patient and contact in the response is a Seudónimo de paciente — initials plus a stable number, `"M.F. · #1001"` — unless the clinic allowed patient names, with RUT, phone and email masked in free text and `meta.patient_privacy` saying so. Clinical alerts (`flags`) are withheld in both modes, and a non-JSON body (an export, a file) is refused with `403 CONNECTED_APP_SENSITIVE_DATA`.
|
|
65237
65242
|
*/
|
|
65238
65243
|
get: {
|
|
65239
65244
|
parameters: {
|
|
65240
65245
|
query?: never;
|
|
65241
65246
|
header?: never;
|
|
65242
|
-
path
|
|
65243
|
-
|
|
65244
|
-
};
|
|
65245
|
-
requestBody?: never;
|
|
65246
|
-
responses: {
|
|
65247
|
-
/** @description The settings */
|
|
65248
|
-
200: {
|
|
65249
|
-
headers: {
|
|
65250
|
-
[name: string]: unknown;
|
|
65251
|
-
};
|
|
65252
|
-
content: {
|
|
65253
|
-
/**
|
|
65254
|
-
* @example {
|
|
65255
|
-
* "data": {
|
|
65256
|
-
* "vendor": "dentalink",
|
|
65257
|
-
* "vendor_label": "Dentalink",
|
|
65258
|
-
* "mercadopago_medio": null,
|
|
65259
|
-
* "suggested_medio": "30",
|
|
65260
|
-
* "medios": [
|
|
65261
|
-
* {
|
|
65262
|
-
* "code": "2",
|
|
65263
|
-
* "label": "Tarjeta de débito",
|
|
65264
|
-
* "active": true
|
|
65265
|
-
* },
|
|
65266
|
-
* {
|
|
65267
|
-
* "code": "30",
|
|
65268
|
-
* "label": "Mercado Pago",
|
|
65269
|
-
* "active": true
|
|
65270
|
-
* }
|
|
65271
|
-
* ],
|
|
65272
|
-
* "reminder_business_days": 2
|
|
65273
|
-
* }
|
|
65274
|
-
* }
|
|
65275
|
-
*/
|
|
65276
|
-
"application/json": {
|
|
65277
|
-
data: components["schemas"]["PaymentRegistrationSettings"];
|
|
65278
|
-
};
|
|
65279
|
-
};
|
|
65280
|
-
};
|
|
65281
|
-
/** @description Validation error */
|
|
65282
|
-
400: {
|
|
65283
|
-
headers: {
|
|
65284
|
-
[name: string]: unknown;
|
|
65285
|
-
};
|
|
65286
|
-
content: {
|
|
65287
|
-
"application/json": components["schemas"]["Error"];
|
|
65288
|
-
};
|
|
65289
|
-
};
|
|
65290
|
-
/** @description Unauthorized */
|
|
65291
|
-
401: {
|
|
65292
|
-
headers: {
|
|
65293
|
-
[name: string]: unknown;
|
|
65294
|
-
};
|
|
65295
|
-
content: {
|
|
65296
|
-
"application/json": components["schemas"]["Error"];
|
|
65297
|
-
};
|
|
65298
|
-
};
|
|
65299
|
-
/** @description Forbidden */
|
|
65300
|
-
403: {
|
|
65301
|
-
headers: {
|
|
65302
|
-
[name: string]: unknown;
|
|
65303
|
-
};
|
|
65304
|
-
content: {
|
|
65305
|
-
"application/json": components["schemas"]["Error"];
|
|
65306
|
-
};
|
|
65307
|
-
};
|
|
65308
|
-
/** @description Not found */
|
|
65309
|
-
404: {
|
|
65310
|
-
headers: {
|
|
65311
|
-
[name: string]: unknown;
|
|
65312
|
-
};
|
|
65313
|
-
content: {
|
|
65314
|
-
"application/json": components["schemas"]["Error"];
|
|
65315
|
-
};
|
|
65316
|
-
};
|
|
65317
|
-
/** @description Conflict (incl. Idempotency-Key reuse with different body) */
|
|
65318
|
-
409: {
|
|
65319
|
-
headers: {
|
|
65320
|
-
[name: string]: unknown;
|
|
65321
|
-
};
|
|
65322
|
-
content: {
|
|
65323
|
-
"application/json": components["schemas"]["Error"];
|
|
65324
|
-
};
|
|
65325
|
-
};
|
|
65326
|
-
/** @description Rate limited */
|
|
65327
|
-
429: {
|
|
65328
|
-
headers: {
|
|
65329
|
-
[name: string]: unknown;
|
|
65330
|
-
};
|
|
65331
|
-
content: {
|
|
65332
|
-
"application/json": components["schemas"]["Error"];
|
|
65333
|
-
};
|
|
65247
|
+
path: {
|
|
65248
|
+
id: string;
|
|
65334
65249
|
};
|
|
65335
|
-
};
|
|
65336
|
-
};
|
|
65337
|
-
/**
|
|
65338
|
-
* Choose the Mercado Pago medio / the reminder delay
|
|
65339
|
-
* @description Sets the vendor medio that stands for Mercado Pago (it must be one of the clinic's medios; 400 `unknown_medio`) and/or the reminder delay in business days (1–15). Re-runs the matcher: a chosen medio can settle an ambiguous task. `clinic_admin:write`.
|
|
65340
|
-
*/
|
|
65341
|
-
put: {
|
|
65342
|
-
parameters: {
|
|
65343
|
-
query?: never;
|
|
65344
|
-
header?: never;
|
|
65345
|
-
path?: never;
|
|
65346
65250
|
cookie?: never;
|
|
65347
65251
|
};
|
|
65348
|
-
requestBody?:
|
|
65349
|
-
content: {
|
|
65350
|
-
/**
|
|
65351
|
-
* @example {
|
|
65352
|
-
* "mercadopago_medio": "30",
|
|
65353
|
-
* "reminder_business_days": 2
|
|
65354
|
-
* }
|
|
65355
|
-
*/
|
|
65356
|
-
"application/json": {
|
|
65357
|
-
/** @description The vendor medio that stands for Mercado Pago; null clears it. */
|
|
65358
|
-
mercadopago_medio?: string | null;
|
|
65359
|
-
reminder_business_days?: number;
|
|
65360
|
-
};
|
|
65361
|
-
};
|
|
65362
|
-
};
|
|
65252
|
+
requestBody?: never;
|
|
65363
65253
|
responses: {
|
|
65364
|
-
/** @description
|
|
65254
|
+
/** @description Imported liquidación */
|
|
65365
65255
|
200: {
|
|
65366
65256
|
headers: {
|
|
65367
65257
|
[name: string]: unknown;
|
|
@@ -65370,28 +65260,58 @@ interface paths {
|
|
|
65370
65260
|
/**
|
|
65371
65261
|
* @example {
|
|
65372
65262
|
* "data": {
|
|
65373
|
-
* "
|
|
65374
|
-
* "
|
|
65375
|
-
* "
|
|
65376
|
-
* "
|
|
65377
|
-
* "
|
|
65263
|
+
* "id": "0192f0c4-0000-7000-8000-000000000002",
|
|
65264
|
+
* "source": "dentalink_import",
|
|
65265
|
+
* "label": "Importada de Dentalink",
|
|
65266
|
+
* "read_only": true,
|
|
65267
|
+
* "professional_id": "0192f0c4-0000-7000-8000-000000000001",
|
|
65268
|
+
* "external_id": "9001",
|
|
65269
|
+
* "location_id": "0192f0c4-0000-7000-8000-000000000003",
|
|
65270
|
+
* "location_name": "Central",
|
|
65271
|
+
* "period": "2026-10",
|
|
65272
|
+
* "period_from": "2026-10-01",
|
|
65273
|
+
* "period_to": "2026-10-31",
|
|
65274
|
+
* "total_clp": 152000,
|
|
65275
|
+
* "lines_total_clp": 152000,
|
|
65276
|
+
* "deductions_clp": -80000,
|
|
65277
|
+
* "line_count": 2,
|
|
65278
|
+
* "imported_at": "2026-11-05T14:00:00.000Z",
|
|
65279
|
+
* "lines": [
|
|
65378
65280
|
* {
|
|
65379
|
-
* "
|
|
65380
|
-
* "
|
|
65381
|
-
* "
|
|
65281
|
+
* "position": 0,
|
|
65282
|
+
* "performed_on": "2026-10-02",
|
|
65283
|
+
* "treatment": "Obturación resina",
|
|
65284
|
+
* "patient": {
|
|
65285
|
+
* "id": "0192f0c4-0000-7000-8000-000000000004",
|
|
65286
|
+
* "initials": "APE"
|
|
65287
|
+
* },
|
|
65288
|
+
* "base_clp": 60000,
|
|
65289
|
+
* "rate_bps": 4000,
|
|
65290
|
+
* "deductions_clp": 0,
|
|
65291
|
+
* "amount_clp": 24000
|
|
65382
65292
|
* },
|
|
65383
65293
|
* {
|
|
65384
|
-
* "
|
|
65385
|
-
* "
|
|
65386
|
-
* "
|
|
65294
|
+
* "position": 1,
|
|
65295
|
+
* "performed_on": "2026-10-15",
|
|
65296
|
+
* "treatment": "Corona metal porcelana",
|
|
65297
|
+
* "patient": {
|
|
65298
|
+
* "id": null,
|
|
65299
|
+
* "initials": "BFD"
|
|
65300
|
+
* },
|
|
65301
|
+
* "base_clp": 400000,
|
|
65302
|
+
* "rate_bps": 4000,
|
|
65303
|
+
* "deductions_clp": -80000,
|
|
65304
|
+
* "amount_clp": 128000
|
|
65387
65305
|
* }
|
|
65388
|
-
* ]
|
|
65389
|
-
* "reminder_business_days": 2
|
|
65306
|
+
* ]
|
|
65390
65307
|
* }
|
|
65391
65308
|
* }
|
|
65392
65309
|
*/
|
|
65393
65310
|
"application/json": {
|
|
65394
|
-
data
|
|
65311
|
+
data?: unknown;
|
|
65312
|
+
meta?: {
|
|
65313
|
+
[key: string]: unknown;
|
|
65314
|
+
};
|
|
65395
65315
|
};
|
|
65396
65316
|
};
|
|
65397
65317
|
};
|
|
@@ -65451,6 +65371,7 @@ interface paths {
|
|
|
65451
65371
|
};
|
|
65452
65372
|
};
|
|
65453
65373
|
};
|
|
65374
|
+
put?: never;
|
|
65454
65375
|
post?: never;
|
|
65455
65376
|
delete?: never;
|
|
65456
65377
|
options?: never;
|
|
@@ -65458,30 +65379,59 @@ interface paths {
|
|
|
65458
65379
|
patch?: never;
|
|
65459
65380
|
trace?: never;
|
|
65460
65381
|
};
|
|
65461
|
-
"/clinic/
|
|
65382
|
+
"/clinic/commissions/imported-exports": {
|
|
65462
65383
|
parameters: {
|
|
65463
65384
|
query?: never;
|
|
65464
65385
|
header?: never;
|
|
65465
65386
|
path?: never;
|
|
65466
65387
|
cookie?: never;
|
|
65467
65388
|
};
|
|
65389
|
+
get?: never;
|
|
65390
|
+
put?: never;
|
|
65468
65391
|
/**
|
|
65469
|
-
*
|
|
65470
|
-
* @description
|
|
65392
|
+
* Upload Dentalink’s own export of a liquidación
|
|
65393
|
+
* @description The manual fallback for a liquidación the migration reader could not reach (gap `liquidacion_unreachable` / `liquidacion_unparseable`, whose detail names the professional, sucursal and month): Dentalink’s export (PDF, Excel, CSV or an image; `content` as base64 or a `data:` URL; at most 20 MB), stored against that professional, month and sucursal and shown in the professional’s history in place of the imported liquidación. A new upload for the same slot replaces the previous. Only a month Dentalink settled: 409 `month_owned_by_vitrina` otherwise. 400 `liquidacion_export_type` / `_encoding` / `_empty` / `_too_large`; 404 unknown professional. Requires `clinic_money:write`.
|
|
65394
|
+
*
|
|
65395
|
+
* **Connected apps:** every patient and contact in the response is a Seudónimo de paciente — initials plus a stable number, `"M.F. · #1001"` — unless the clinic allowed patient names, with RUT, phone and email masked in free text and `meta.patient_privacy` saying so. Clinical alerts (`flags`) are withheld in both modes, and a non-JSON body (an export, a file) is refused with `403 CONNECTED_APP_SENSITIVE_DATA`.
|
|
65471
65396
|
*/
|
|
65472
|
-
|
|
65397
|
+
post: {
|
|
65473
65398
|
parameters: {
|
|
65474
65399
|
query?: never;
|
|
65475
|
-
header?:
|
|
65476
|
-
|
|
65477
|
-
|
|
65400
|
+
header?: {
|
|
65401
|
+
/** @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. */
|
|
65402
|
+
"Idempotency-Key"?: string;
|
|
65478
65403
|
};
|
|
65404
|
+
path?: never;
|
|
65479
65405
|
cookie?: never;
|
|
65480
65406
|
};
|
|
65481
|
-
requestBody?:
|
|
65407
|
+
requestBody?: {
|
|
65408
|
+
content: {
|
|
65409
|
+
/**
|
|
65410
|
+
* @example {
|
|
65411
|
+
* "professional_id": "0192f0c4-0000-7000-8000-000000000001",
|
|
65412
|
+
* "period": "2026-09",
|
|
65413
|
+
* "location_id": "0192f0c4-0000-7000-8000-000000000003",
|
|
65414
|
+
* "external_id": "9000",
|
|
65415
|
+
* "file_name": "liquidacion-septiembre.pdf",
|
|
65416
|
+
* "content": "data:application/pdf;base64,JVBERi0xLjQK"
|
|
65417
|
+
* }
|
|
65418
|
+
*/
|
|
65419
|
+
"application/json": {
|
|
65420
|
+
/** Format: uuid */
|
|
65421
|
+
professional_id: string;
|
|
65422
|
+
period: string;
|
|
65423
|
+
/** Format: uuid */
|
|
65424
|
+
location_id?: string | null;
|
|
65425
|
+
external_id?: string | null;
|
|
65426
|
+
file_name: string;
|
|
65427
|
+
mime_type?: string;
|
|
65428
|
+
content: string;
|
|
65429
|
+
};
|
|
65430
|
+
};
|
|
65431
|
+
};
|
|
65482
65432
|
responses: {
|
|
65483
|
-
/** @description
|
|
65484
|
-
|
|
65433
|
+
/** @description Liquidación export */
|
|
65434
|
+
201: {
|
|
65485
65435
|
headers: {
|
|
65486
65436
|
[name: string]: unknown;
|
|
65487
65437
|
};
|
|
@@ -65489,51 +65439,653 @@ interface paths {
|
|
|
65489
65439
|
/**
|
|
65490
65440
|
* @example {
|
|
65491
65441
|
* "data": {
|
|
65492
|
-
* "id": "
|
|
65493
|
-
* "
|
|
65494
|
-
* "
|
|
65495
|
-
* "
|
|
65496
|
-
* "
|
|
65497
|
-
* "
|
|
65498
|
-
* "
|
|
65499
|
-
* "
|
|
65500
|
-
* "
|
|
65501
|
-
* "
|
|
65502
|
-
* "
|
|
65503
|
-
* "patient": {
|
|
65504
|
-
* "id": "0199c3a0-4444-7000-8000-000000000004",
|
|
65505
|
-
* "name": "Ana Pérez",
|
|
65506
|
-
* "rut": "11.111.111-1"
|
|
65507
|
-
* },
|
|
65508
|
-
* "concept": {
|
|
65509
|
-
* "kind": "appointment_deposit",
|
|
65510
|
-
* "label": "Abono cita",
|
|
65511
|
-
* "appointment_starts_at": "2026-10-09T13:00:00.000Z"
|
|
65512
|
-
* },
|
|
65513
|
-
* "medio": {
|
|
65514
|
-
* "code": "30",
|
|
65515
|
-
* "label": "Mercado Pago"
|
|
65516
|
-
* },
|
|
65517
|
-
* "matched": {
|
|
65518
|
-
* "mirror_payment_id": "0199c3a0-5555-7000-8000-000000000005",
|
|
65519
|
-
* "vendor_reference": "88123",
|
|
65520
|
-
* "received_on": "2026-10-05",
|
|
65521
|
-
* "amount_clp": 30000,
|
|
65522
|
-
* "medio": "Mercado Pago",
|
|
65523
|
-
* "voided": false,
|
|
65524
|
-
* "by": "auto_unique",
|
|
65525
|
-
* "at": "2026-10-05T18:20:00.000Z"
|
|
65526
|
-
* },
|
|
65527
|
-
* "candidates": [],
|
|
65528
|
-
* "dismissed_reason": null,
|
|
65529
|
-
* "overdue": false,
|
|
65530
|
-
* "reminded_at": null,
|
|
65531
|
-
* "created_at": "2026-10-05T14:02:11.000Z"
|
|
65442
|
+
* "id": "0192f0c4-0000-7000-8000-000000000005",
|
|
65443
|
+
* "source": "dentalink_export",
|
|
65444
|
+
* "label": "Exportación de Dentalink",
|
|
65445
|
+
* "read_only": true,
|
|
65446
|
+
* "location_id": "0192f0c4-0000-7000-8000-000000000003",
|
|
65447
|
+
* "location_name": "Central",
|
|
65448
|
+
* "external_id": "9000",
|
|
65449
|
+
* "file_name": "liquidacion-septiembre.pdf",
|
|
65450
|
+
* "mime_type": "application/pdf",
|
|
65451
|
+
* "size_bytes": 48213,
|
|
65452
|
+
* "uploaded_at": "2026-11-06T13:10:00.000Z"
|
|
65532
65453
|
* }
|
|
65533
65454
|
* }
|
|
65534
65455
|
*/
|
|
65535
65456
|
"application/json": {
|
|
65536
|
-
data
|
|
65457
|
+
data?: unknown;
|
|
65458
|
+
};
|
|
65459
|
+
};
|
|
65460
|
+
};
|
|
65461
|
+
/** @description Validation error */
|
|
65462
|
+
400: {
|
|
65463
|
+
headers: {
|
|
65464
|
+
[name: string]: unknown;
|
|
65465
|
+
};
|
|
65466
|
+
content: {
|
|
65467
|
+
"application/json": components["schemas"]["Error"];
|
|
65468
|
+
};
|
|
65469
|
+
};
|
|
65470
|
+
/** @description Unauthorized */
|
|
65471
|
+
401: {
|
|
65472
|
+
headers: {
|
|
65473
|
+
[name: string]: unknown;
|
|
65474
|
+
};
|
|
65475
|
+
content: {
|
|
65476
|
+
"application/json": components["schemas"]["Error"];
|
|
65477
|
+
};
|
|
65478
|
+
};
|
|
65479
|
+
/** @description Forbidden */
|
|
65480
|
+
403: {
|
|
65481
|
+
headers: {
|
|
65482
|
+
[name: string]: unknown;
|
|
65483
|
+
};
|
|
65484
|
+
content: {
|
|
65485
|
+
"application/json": components["schemas"]["Error"];
|
|
65486
|
+
};
|
|
65487
|
+
};
|
|
65488
|
+
/** @description Not found */
|
|
65489
|
+
404: {
|
|
65490
|
+
headers: {
|
|
65491
|
+
[name: string]: unknown;
|
|
65492
|
+
};
|
|
65493
|
+
content: {
|
|
65494
|
+
"application/json": components["schemas"]["Error"];
|
|
65495
|
+
};
|
|
65496
|
+
};
|
|
65497
|
+
/** @description Conflict (incl. Idempotency-Key reuse with different body) */
|
|
65498
|
+
409: {
|
|
65499
|
+
headers: {
|
|
65500
|
+
[name: string]: unknown;
|
|
65501
|
+
};
|
|
65502
|
+
content: {
|
|
65503
|
+
"application/json": components["schemas"]["Error"];
|
|
65504
|
+
};
|
|
65505
|
+
};
|
|
65506
|
+
/** @description Rate limited */
|
|
65507
|
+
429: {
|
|
65508
|
+
headers: {
|
|
65509
|
+
[name: string]: unknown;
|
|
65510
|
+
};
|
|
65511
|
+
content: {
|
|
65512
|
+
"application/json": components["schemas"]["Error"];
|
|
65513
|
+
};
|
|
65514
|
+
};
|
|
65515
|
+
};
|
|
65516
|
+
};
|
|
65517
|
+
delete?: never;
|
|
65518
|
+
options?: never;
|
|
65519
|
+
head?: never;
|
|
65520
|
+
patch?: never;
|
|
65521
|
+
trace?: never;
|
|
65522
|
+
};
|
|
65523
|
+
"/clinic/commissions/imported-exports/{id}/file": {
|
|
65524
|
+
parameters: {
|
|
65525
|
+
query?: never;
|
|
65526
|
+
header?: never;
|
|
65527
|
+
path?: never;
|
|
65528
|
+
cookie?: never;
|
|
65529
|
+
};
|
|
65530
|
+
/**
|
|
65531
|
+
* Download an uploaded Dentalink liquidación export
|
|
65532
|
+
* @description The file the clinic uploaded, as uploaded (its own content type). 404 unknown id. Requires `clinic_money:read`.
|
|
65533
|
+
*
|
|
65534
|
+
* **Connected apps:** every patient and contact in the response is a Seudónimo de paciente — initials plus a stable number, `"M.F. · #1001"` — unless the clinic allowed patient names, with RUT, phone and email masked in free text and `meta.patient_privacy` saying so. Clinical alerts (`flags`) are withheld in both modes, and a non-JSON body (an export, a file) is refused with `403 CONNECTED_APP_SENSITIVE_DATA`.
|
|
65535
|
+
*/
|
|
65536
|
+
get: {
|
|
65537
|
+
parameters: {
|
|
65538
|
+
query?: never;
|
|
65539
|
+
header?: never;
|
|
65540
|
+
path: {
|
|
65541
|
+
id: string;
|
|
65542
|
+
};
|
|
65543
|
+
cookie?: never;
|
|
65544
|
+
};
|
|
65545
|
+
requestBody?: never;
|
|
65546
|
+
responses: {
|
|
65547
|
+
/** @description The file */
|
|
65548
|
+
200: {
|
|
65549
|
+
headers: {
|
|
65550
|
+
[name: string]: unknown;
|
|
65551
|
+
};
|
|
65552
|
+
content: {
|
|
65553
|
+
"application/octet-stream": string;
|
|
65554
|
+
};
|
|
65555
|
+
};
|
|
65556
|
+
/** @description Validation error */
|
|
65557
|
+
400: {
|
|
65558
|
+
headers: {
|
|
65559
|
+
[name: string]: unknown;
|
|
65560
|
+
};
|
|
65561
|
+
content: {
|
|
65562
|
+
"application/json": components["schemas"]["Error"];
|
|
65563
|
+
};
|
|
65564
|
+
};
|
|
65565
|
+
/** @description Unauthorized */
|
|
65566
|
+
401: {
|
|
65567
|
+
headers: {
|
|
65568
|
+
[name: string]: unknown;
|
|
65569
|
+
};
|
|
65570
|
+
content: {
|
|
65571
|
+
"application/json": components["schemas"]["Error"];
|
|
65572
|
+
};
|
|
65573
|
+
};
|
|
65574
|
+
/** @description Forbidden */
|
|
65575
|
+
403: {
|
|
65576
|
+
headers: {
|
|
65577
|
+
[name: string]: unknown;
|
|
65578
|
+
};
|
|
65579
|
+
content: {
|
|
65580
|
+
"application/json": components["schemas"]["Error"];
|
|
65581
|
+
};
|
|
65582
|
+
};
|
|
65583
|
+
/** @description Not found */
|
|
65584
|
+
404: {
|
|
65585
|
+
headers: {
|
|
65586
|
+
[name: string]: unknown;
|
|
65587
|
+
};
|
|
65588
|
+
content: {
|
|
65589
|
+
"application/json": components["schemas"]["Error"];
|
|
65590
|
+
};
|
|
65591
|
+
};
|
|
65592
|
+
/** @description Conflict (incl. Idempotency-Key reuse with different body) */
|
|
65593
|
+
409: {
|
|
65594
|
+
headers: {
|
|
65595
|
+
[name: string]: unknown;
|
|
65596
|
+
};
|
|
65597
|
+
content: {
|
|
65598
|
+
"application/json": components["schemas"]["Error"];
|
|
65599
|
+
};
|
|
65600
|
+
};
|
|
65601
|
+
/** @description Rate limited */
|
|
65602
|
+
429: {
|
|
65603
|
+
headers: {
|
|
65604
|
+
[name: string]: unknown;
|
|
65605
|
+
};
|
|
65606
|
+
content: {
|
|
65607
|
+
"application/json": components["schemas"]["Error"];
|
|
65608
|
+
};
|
|
65609
|
+
};
|
|
65610
|
+
};
|
|
65611
|
+
};
|
|
65612
|
+
put?: never;
|
|
65613
|
+
post?: never;
|
|
65614
|
+
delete?: never;
|
|
65615
|
+
options?: never;
|
|
65616
|
+
head?: never;
|
|
65617
|
+
patch?: never;
|
|
65618
|
+
trace?: never;
|
|
65619
|
+
};
|
|
65620
|
+
"/clinic/payment-registrations": {
|
|
65621
|
+
parameters: {
|
|
65622
|
+
query?: never;
|
|
65623
|
+
header?: never;
|
|
65624
|
+
path?: never;
|
|
65625
|
+
cookie?: never;
|
|
65626
|
+
};
|
|
65627
|
+
/**
|
|
65628
|
+
* Mercado Pago payments to register in the practice system
|
|
65629
|
+
* @description The reception tasks: each Mercado Pago payment of a clinic whose Dentalink / Medilink / Reservo authors its money, pre-filled (patient and RUT, amount, medio, MP number, date, what it paid) and, once the mirror brings the pago in, its match. `status=pending` (default) = `open` + `ambiguous` (an ambiguous task lists its `candidates`). `payments:read`.
|
|
65630
|
+
*/
|
|
65631
|
+
get: {
|
|
65632
|
+
parameters: {
|
|
65633
|
+
query?: {
|
|
65634
|
+
/** @description `pending` = open + ambiguous (default); `closed` = matched, dismissed or cancelled. */
|
|
65635
|
+
status?: "pending" | "matched" | "closed" | "all";
|
|
65636
|
+
contact_id?: string;
|
|
65637
|
+
limit?: number;
|
|
65638
|
+
offset?: number | null;
|
|
65639
|
+
};
|
|
65640
|
+
header?: never;
|
|
65641
|
+
path?: never;
|
|
65642
|
+
cookie?: never;
|
|
65643
|
+
};
|
|
65644
|
+
requestBody?: never;
|
|
65645
|
+
responses: {
|
|
65646
|
+
/** @description The tasks, newest payment first */
|
|
65647
|
+
200: {
|
|
65648
|
+
headers: {
|
|
65649
|
+
[name: string]: unknown;
|
|
65650
|
+
};
|
|
65651
|
+
content: {
|
|
65652
|
+
/**
|
|
65653
|
+
* @example {
|
|
65654
|
+
* "data": [
|
|
65655
|
+
* {
|
|
65656
|
+
* "id": "0199c3a0-1111-7000-8000-000000000001",
|
|
65657
|
+
* "status": "matched",
|
|
65658
|
+
* "vendor": "dentalink",
|
|
65659
|
+
* "vendor_label": "Dentalink",
|
|
65660
|
+
* "provider": "mercadopago",
|
|
65661
|
+
* "provider_reference": "182050716739",
|
|
65662
|
+
* "provider_payment_url": "https://www.mercadopago.cl/activities?q=182050716739",
|
|
65663
|
+
* "customer_payment_id": "0199c3a0-2222-7000-8000-000000000002",
|
|
65664
|
+
* "contact_id": "0199c3a0-3333-7000-8000-000000000003",
|
|
65665
|
+
* "amount_clp": 30000,
|
|
65666
|
+
* "paid_on": "2026-10-05",
|
|
65667
|
+
* "patient": {
|
|
65668
|
+
* "id": "0199c3a0-4444-7000-8000-000000000004",
|
|
65669
|
+
* "name": "Ana Pérez",
|
|
65670
|
+
* "rut": "11.111.111-1"
|
|
65671
|
+
* },
|
|
65672
|
+
* "concept": {
|
|
65673
|
+
* "kind": "appointment_deposit",
|
|
65674
|
+
* "label": "Abono cita",
|
|
65675
|
+
* "appointment_starts_at": "2026-10-09T13:00:00.000Z"
|
|
65676
|
+
* },
|
|
65677
|
+
* "medio": {
|
|
65678
|
+
* "code": "30",
|
|
65679
|
+
* "label": "Mercado Pago"
|
|
65680
|
+
* },
|
|
65681
|
+
* "matched": {
|
|
65682
|
+
* "mirror_payment_id": "0199c3a0-5555-7000-8000-000000000005",
|
|
65683
|
+
* "vendor_reference": "88123",
|
|
65684
|
+
* "received_on": "2026-10-05",
|
|
65685
|
+
* "amount_clp": 30000,
|
|
65686
|
+
* "medio": "Mercado Pago",
|
|
65687
|
+
* "voided": false,
|
|
65688
|
+
* "by": "auto_unique",
|
|
65689
|
+
* "at": "2026-10-05T18:20:00.000Z"
|
|
65690
|
+
* },
|
|
65691
|
+
* "candidates": [],
|
|
65692
|
+
* "dismissed_reason": null,
|
|
65693
|
+
* "overdue": false,
|
|
65694
|
+
* "reminded_at": null,
|
|
65695
|
+
* "created_at": "2026-10-05T14:02:11.000Z"
|
|
65696
|
+
* }
|
|
65697
|
+
* ],
|
|
65698
|
+
* "meta": {
|
|
65699
|
+
* "total": 1,
|
|
65700
|
+
* "limit": 50,
|
|
65701
|
+
* "offset": 0
|
|
65702
|
+
* }
|
|
65703
|
+
* }
|
|
65704
|
+
*/
|
|
65705
|
+
"application/json": {
|
|
65706
|
+
data: components["schemas"]["PaymentRegistration"][];
|
|
65707
|
+
meta: {
|
|
65708
|
+
total: number;
|
|
65709
|
+
limit: number;
|
|
65710
|
+
offset: number;
|
|
65711
|
+
};
|
|
65712
|
+
};
|
|
65713
|
+
};
|
|
65714
|
+
};
|
|
65715
|
+
/** @description Validation error */
|
|
65716
|
+
400: {
|
|
65717
|
+
headers: {
|
|
65718
|
+
[name: string]: unknown;
|
|
65719
|
+
};
|
|
65720
|
+
content: {
|
|
65721
|
+
"application/json": components["schemas"]["Error"];
|
|
65722
|
+
};
|
|
65723
|
+
};
|
|
65724
|
+
/** @description Unauthorized */
|
|
65725
|
+
401: {
|
|
65726
|
+
headers: {
|
|
65727
|
+
[name: string]: unknown;
|
|
65728
|
+
};
|
|
65729
|
+
content: {
|
|
65730
|
+
"application/json": components["schemas"]["Error"];
|
|
65731
|
+
};
|
|
65732
|
+
};
|
|
65733
|
+
/** @description Forbidden */
|
|
65734
|
+
403: {
|
|
65735
|
+
headers: {
|
|
65736
|
+
[name: string]: unknown;
|
|
65737
|
+
};
|
|
65738
|
+
content: {
|
|
65739
|
+
"application/json": components["schemas"]["Error"];
|
|
65740
|
+
};
|
|
65741
|
+
};
|
|
65742
|
+
/** @description Not found */
|
|
65743
|
+
404: {
|
|
65744
|
+
headers: {
|
|
65745
|
+
[name: string]: unknown;
|
|
65746
|
+
};
|
|
65747
|
+
content: {
|
|
65748
|
+
"application/json": components["schemas"]["Error"];
|
|
65749
|
+
};
|
|
65750
|
+
};
|
|
65751
|
+
/** @description Conflict (incl. Idempotency-Key reuse with different body) */
|
|
65752
|
+
409: {
|
|
65753
|
+
headers: {
|
|
65754
|
+
[name: string]: unknown;
|
|
65755
|
+
};
|
|
65756
|
+
content: {
|
|
65757
|
+
"application/json": components["schemas"]["Error"];
|
|
65758
|
+
};
|
|
65759
|
+
};
|
|
65760
|
+
/** @description Rate limited */
|
|
65761
|
+
429: {
|
|
65762
|
+
headers: {
|
|
65763
|
+
[name: string]: unknown;
|
|
65764
|
+
};
|
|
65765
|
+
content: {
|
|
65766
|
+
"application/json": components["schemas"]["Error"];
|
|
65767
|
+
};
|
|
65768
|
+
};
|
|
65769
|
+
};
|
|
65770
|
+
};
|
|
65771
|
+
put?: never;
|
|
65772
|
+
post?: never;
|
|
65773
|
+
delete?: never;
|
|
65774
|
+
options?: never;
|
|
65775
|
+
head?: never;
|
|
65776
|
+
patch?: never;
|
|
65777
|
+
trace?: never;
|
|
65778
|
+
};
|
|
65779
|
+
"/clinic/payment-registrations/settings": {
|
|
65780
|
+
parameters: {
|
|
65781
|
+
query?: never;
|
|
65782
|
+
header?: never;
|
|
65783
|
+
path?: never;
|
|
65784
|
+
cookie?: never;
|
|
65785
|
+
};
|
|
65786
|
+
/**
|
|
65787
|
+
* Which vendor medio stands for Mercado Pago
|
|
65788
|
+
* @description The practice system, its medios (the synced `medio_pago` catalog for Dentalink / Medilink, the fixed list for Reservo), the one chosen as Mercado Pago, a name-based suggestion, and after how many business days an unregistered payment reminds reception (default 2). `payments:read`.
|
|
65789
|
+
*/
|
|
65790
|
+
get: {
|
|
65791
|
+
parameters: {
|
|
65792
|
+
query?: never;
|
|
65793
|
+
header?: never;
|
|
65794
|
+
path?: never;
|
|
65795
|
+
cookie?: never;
|
|
65796
|
+
};
|
|
65797
|
+
requestBody?: never;
|
|
65798
|
+
responses: {
|
|
65799
|
+
/** @description The settings */
|
|
65800
|
+
200: {
|
|
65801
|
+
headers: {
|
|
65802
|
+
[name: string]: unknown;
|
|
65803
|
+
};
|
|
65804
|
+
content: {
|
|
65805
|
+
/**
|
|
65806
|
+
* @example {
|
|
65807
|
+
* "data": {
|
|
65808
|
+
* "vendor": "dentalink",
|
|
65809
|
+
* "vendor_label": "Dentalink",
|
|
65810
|
+
* "mercadopago_medio": null,
|
|
65811
|
+
* "suggested_medio": "30",
|
|
65812
|
+
* "medios": [
|
|
65813
|
+
* {
|
|
65814
|
+
* "code": "2",
|
|
65815
|
+
* "label": "Tarjeta de débito",
|
|
65816
|
+
* "active": true
|
|
65817
|
+
* },
|
|
65818
|
+
* {
|
|
65819
|
+
* "code": "30",
|
|
65820
|
+
* "label": "Mercado Pago",
|
|
65821
|
+
* "active": true
|
|
65822
|
+
* }
|
|
65823
|
+
* ],
|
|
65824
|
+
* "reminder_business_days": 2
|
|
65825
|
+
* }
|
|
65826
|
+
* }
|
|
65827
|
+
*/
|
|
65828
|
+
"application/json": {
|
|
65829
|
+
data: components["schemas"]["PaymentRegistrationSettings"];
|
|
65830
|
+
};
|
|
65831
|
+
};
|
|
65832
|
+
};
|
|
65833
|
+
/** @description Validation error */
|
|
65834
|
+
400: {
|
|
65835
|
+
headers: {
|
|
65836
|
+
[name: string]: unknown;
|
|
65837
|
+
};
|
|
65838
|
+
content: {
|
|
65839
|
+
"application/json": components["schemas"]["Error"];
|
|
65840
|
+
};
|
|
65841
|
+
};
|
|
65842
|
+
/** @description Unauthorized */
|
|
65843
|
+
401: {
|
|
65844
|
+
headers: {
|
|
65845
|
+
[name: string]: unknown;
|
|
65846
|
+
};
|
|
65847
|
+
content: {
|
|
65848
|
+
"application/json": components["schemas"]["Error"];
|
|
65849
|
+
};
|
|
65850
|
+
};
|
|
65851
|
+
/** @description Forbidden */
|
|
65852
|
+
403: {
|
|
65853
|
+
headers: {
|
|
65854
|
+
[name: string]: unknown;
|
|
65855
|
+
};
|
|
65856
|
+
content: {
|
|
65857
|
+
"application/json": components["schemas"]["Error"];
|
|
65858
|
+
};
|
|
65859
|
+
};
|
|
65860
|
+
/** @description Not found */
|
|
65861
|
+
404: {
|
|
65862
|
+
headers: {
|
|
65863
|
+
[name: string]: unknown;
|
|
65864
|
+
};
|
|
65865
|
+
content: {
|
|
65866
|
+
"application/json": components["schemas"]["Error"];
|
|
65867
|
+
};
|
|
65868
|
+
};
|
|
65869
|
+
/** @description Conflict (incl. Idempotency-Key reuse with different body) */
|
|
65870
|
+
409: {
|
|
65871
|
+
headers: {
|
|
65872
|
+
[name: string]: unknown;
|
|
65873
|
+
};
|
|
65874
|
+
content: {
|
|
65875
|
+
"application/json": components["schemas"]["Error"];
|
|
65876
|
+
};
|
|
65877
|
+
};
|
|
65878
|
+
/** @description Rate limited */
|
|
65879
|
+
429: {
|
|
65880
|
+
headers: {
|
|
65881
|
+
[name: string]: unknown;
|
|
65882
|
+
};
|
|
65883
|
+
content: {
|
|
65884
|
+
"application/json": components["schemas"]["Error"];
|
|
65885
|
+
};
|
|
65886
|
+
};
|
|
65887
|
+
};
|
|
65888
|
+
};
|
|
65889
|
+
/**
|
|
65890
|
+
* Choose the Mercado Pago medio / the reminder delay
|
|
65891
|
+
* @description Sets the vendor medio that stands for Mercado Pago (it must be one of the clinic's medios; 400 `unknown_medio`) and/or the reminder delay in business days (1–15). Re-runs the matcher: a chosen medio can settle an ambiguous task. `clinic_admin:write`.
|
|
65892
|
+
*/
|
|
65893
|
+
put: {
|
|
65894
|
+
parameters: {
|
|
65895
|
+
query?: never;
|
|
65896
|
+
header?: never;
|
|
65897
|
+
path?: never;
|
|
65898
|
+
cookie?: never;
|
|
65899
|
+
};
|
|
65900
|
+
requestBody?: {
|
|
65901
|
+
content: {
|
|
65902
|
+
/**
|
|
65903
|
+
* @example {
|
|
65904
|
+
* "mercadopago_medio": "30",
|
|
65905
|
+
* "reminder_business_days": 2
|
|
65906
|
+
* }
|
|
65907
|
+
*/
|
|
65908
|
+
"application/json": {
|
|
65909
|
+
/** @description The vendor medio that stands for Mercado Pago; null clears it. */
|
|
65910
|
+
mercadopago_medio?: string | null;
|
|
65911
|
+
reminder_business_days?: number;
|
|
65912
|
+
};
|
|
65913
|
+
};
|
|
65914
|
+
};
|
|
65915
|
+
responses: {
|
|
65916
|
+
/** @description The settings */
|
|
65917
|
+
200: {
|
|
65918
|
+
headers: {
|
|
65919
|
+
[name: string]: unknown;
|
|
65920
|
+
};
|
|
65921
|
+
content: {
|
|
65922
|
+
/**
|
|
65923
|
+
* @example {
|
|
65924
|
+
* "data": {
|
|
65925
|
+
* "vendor": "dentalink",
|
|
65926
|
+
* "vendor_label": "Dentalink",
|
|
65927
|
+
* "mercadopago_medio": null,
|
|
65928
|
+
* "suggested_medio": "30",
|
|
65929
|
+
* "medios": [
|
|
65930
|
+
* {
|
|
65931
|
+
* "code": "2",
|
|
65932
|
+
* "label": "Tarjeta de débito",
|
|
65933
|
+
* "active": true
|
|
65934
|
+
* },
|
|
65935
|
+
* {
|
|
65936
|
+
* "code": "30",
|
|
65937
|
+
* "label": "Mercado Pago",
|
|
65938
|
+
* "active": true
|
|
65939
|
+
* }
|
|
65940
|
+
* ],
|
|
65941
|
+
* "reminder_business_days": 2
|
|
65942
|
+
* }
|
|
65943
|
+
* }
|
|
65944
|
+
*/
|
|
65945
|
+
"application/json": {
|
|
65946
|
+
data: components["schemas"]["PaymentRegistrationSettings"];
|
|
65947
|
+
};
|
|
65948
|
+
};
|
|
65949
|
+
};
|
|
65950
|
+
/** @description Validation error */
|
|
65951
|
+
400: {
|
|
65952
|
+
headers: {
|
|
65953
|
+
[name: string]: unknown;
|
|
65954
|
+
};
|
|
65955
|
+
content: {
|
|
65956
|
+
"application/json": components["schemas"]["Error"];
|
|
65957
|
+
};
|
|
65958
|
+
};
|
|
65959
|
+
/** @description Unauthorized */
|
|
65960
|
+
401: {
|
|
65961
|
+
headers: {
|
|
65962
|
+
[name: string]: unknown;
|
|
65963
|
+
};
|
|
65964
|
+
content: {
|
|
65965
|
+
"application/json": components["schemas"]["Error"];
|
|
65966
|
+
};
|
|
65967
|
+
};
|
|
65968
|
+
/** @description Forbidden */
|
|
65969
|
+
403: {
|
|
65970
|
+
headers: {
|
|
65971
|
+
[name: string]: unknown;
|
|
65972
|
+
};
|
|
65973
|
+
content: {
|
|
65974
|
+
"application/json": components["schemas"]["Error"];
|
|
65975
|
+
};
|
|
65976
|
+
};
|
|
65977
|
+
/** @description Not found */
|
|
65978
|
+
404: {
|
|
65979
|
+
headers: {
|
|
65980
|
+
[name: string]: unknown;
|
|
65981
|
+
};
|
|
65982
|
+
content: {
|
|
65983
|
+
"application/json": components["schemas"]["Error"];
|
|
65984
|
+
};
|
|
65985
|
+
};
|
|
65986
|
+
/** @description Conflict (incl. Idempotency-Key reuse with different body) */
|
|
65987
|
+
409: {
|
|
65988
|
+
headers: {
|
|
65989
|
+
[name: string]: unknown;
|
|
65990
|
+
};
|
|
65991
|
+
content: {
|
|
65992
|
+
"application/json": components["schemas"]["Error"];
|
|
65993
|
+
};
|
|
65994
|
+
};
|
|
65995
|
+
/** @description Rate limited */
|
|
65996
|
+
429: {
|
|
65997
|
+
headers: {
|
|
65998
|
+
[name: string]: unknown;
|
|
65999
|
+
};
|
|
66000
|
+
content: {
|
|
66001
|
+
"application/json": components["schemas"]["Error"];
|
|
66002
|
+
};
|
|
66003
|
+
};
|
|
66004
|
+
};
|
|
66005
|
+
};
|
|
66006
|
+
post?: never;
|
|
66007
|
+
delete?: never;
|
|
66008
|
+
options?: never;
|
|
66009
|
+
head?: never;
|
|
66010
|
+
patch?: never;
|
|
66011
|
+
trace?: never;
|
|
66012
|
+
};
|
|
66013
|
+
"/clinic/payment-registrations/{id}": {
|
|
66014
|
+
parameters: {
|
|
66015
|
+
query?: never;
|
|
66016
|
+
header?: never;
|
|
66017
|
+
path?: never;
|
|
66018
|
+
cookie?: never;
|
|
66019
|
+
};
|
|
66020
|
+
/**
|
|
66021
|
+
* One Mercado Pago payment registration task
|
|
66022
|
+
* @description One task, as the list returns it. `payments:read`.
|
|
66023
|
+
*/
|
|
66024
|
+
get: {
|
|
66025
|
+
parameters: {
|
|
66026
|
+
query?: never;
|
|
66027
|
+
header?: never;
|
|
66028
|
+
path: {
|
|
66029
|
+
id: string;
|
|
66030
|
+
};
|
|
66031
|
+
cookie?: never;
|
|
66032
|
+
};
|
|
66033
|
+
requestBody?: never;
|
|
66034
|
+
responses: {
|
|
66035
|
+
/** @description The task */
|
|
66036
|
+
200: {
|
|
66037
|
+
headers: {
|
|
66038
|
+
[name: string]: unknown;
|
|
66039
|
+
};
|
|
66040
|
+
content: {
|
|
66041
|
+
/**
|
|
66042
|
+
* @example {
|
|
66043
|
+
* "data": {
|
|
66044
|
+
* "id": "0199c3a0-1111-7000-8000-000000000001",
|
|
66045
|
+
* "status": "matched",
|
|
66046
|
+
* "vendor": "dentalink",
|
|
66047
|
+
* "vendor_label": "Dentalink",
|
|
66048
|
+
* "provider": "mercadopago",
|
|
66049
|
+
* "provider_reference": "182050716739",
|
|
66050
|
+
* "provider_payment_url": "https://www.mercadopago.cl/activities?q=182050716739",
|
|
66051
|
+
* "customer_payment_id": "0199c3a0-2222-7000-8000-000000000002",
|
|
66052
|
+
* "contact_id": "0199c3a0-3333-7000-8000-000000000003",
|
|
66053
|
+
* "amount_clp": 30000,
|
|
66054
|
+
* "paid_on": "2026-10-05",
|
|
66055
|
+
* "patient": {
|
|
66056
|
+
* "id": "0199c3a0-4444-7000-8000-000000000004",
|
|
66057
|
+
* "name": "Ana Pérez",
|
|
66058
|
+
* "rut": "11.111.111-1"
|
|
66059
|
+
* },
|
|
66060
|
+
* "concept": {
|
|
66061
|
+
* "kind": "appointment_deposit",
|
|
66062
|
+
* "label": "Abono cita",
|
|
66063
|
+
* "appointment_starts_at": "2026-10-09T13:00:00.000Z"
|
|
66064
|
+
* },
|
|
66065
|
+
* "medio": {
|
|
66066
|
+
* "code": "30",
|
|
66067
|
+
* "label": "Mercado Pago"
|
|
66068
|
+
* },
|
|
66069
|
+
* "matched": {
|
|
66070
|
+
* "mirror_payment_id": "0199c3a0-5555-7000-8000-000000000005",
|
|
66071
|
+
* "vendor_reference": "88123",
|
|
66072
|
+
* "received_on": "2026-10-05",
|
|
66073
|
+
* "amount_clp": 30000,
|
|
66074
|
+
* "medio": "Mercado Pago",
|
|
66075
|
+
* "voided": false,
|
|
66076
|
+
* "by": "auto_unique",
|
|
66077
|
+
* "at": "2026-10-05T18:20:00.000Z"
|
|
66078
|
+
* },
|
|
66079
|
+
* "candidates": [],
|
|
66080
|
+
* "dismissed_reason": null,
|
|
66081
|
+
* "overdue": false,
|
|
66082
|
+
* "reminded_at": null,
|
|
66083
|
+
* "created_at": "2026-10-05T14:02:11.000Z"
|
|
66084
|
+
* }
|
|
66085
|
+
* }
|
|
66086
|
+
*/
|
|
66087
|
+
"application/json": {
|
|
66088
|
+
data: components["schemas"]["PaymentRegistration"];
|
|
65537
66089
|
};
|
|
65538
66090
|
};
|
|
65539
66091
|
};
|
|
@@ -156084,7 +156636,8 @@ interface paths {
|
|
|
156084
156636
|
* }
|
|
156085
156637
|
* ],
|
|
156086
156638
|
* "presets": [
|
|
156087
|
-
* "vitrina_automotora_v1"
|
|
156639
|
+
* "vitrina_automotora_v1",
|
|
156640
|
+
* "vitrina_clinica_v1"
|
|
156088
156641
|
* ]
|
|
156089
156642
|
* }
|
|
156090
156643
|
* }
|
|
@@ -156250,18 +156803,18 @@ interface paths {
|
|
|
156250
156803
|
*/
|
|
156251
156804
|
intake?: "inbox" | "demo";
|
|
156252
156805
|
/**
|
|
156253
|
-
* @description A built-in mapping
|
|
156806
|
+
* @description A built-in mapping: `vitrina_automotora_v1` (the Vitrina «Automotoras» form) or `vitrina_clinica_v1` (the «Clínicas» form: role, professionals to size, agenda system; vertical `clinica`). Replaces `mapping`.
|
|
156254
156807
|
* @enum {string}
|
|
156255
156808
|
*/
|
|
156256
|
-
preset?: "vitrina_automotora_v1";
|
|
156257
|
-
/** @description Per-question rules. A rule names the Meta question (`source`, compared lowercase / without accents / with `_` for spaces; `aliases` add more spellings), where its answer goes (`target`: contact.name, contact.first_name, contact.last_name, contact.phone, contact.email, contact.company, qualification.role, qualification.size, qualification.sellers, note), and optionally `values` (normalised answer → stored value). Every answer is kept in the lead note whatever its rule; a missing answer never blocks the lead. */
|
|
156809
|
+
preset?: "vitrina_automotora_v1" | "vitrina_clinica_v1";
|
|
156810
|
+
/** @description Per-question rules. A rule names the Meta question (`source`, compared lowercase / without accents / with `_` for spaces; `aliases` add more spellings), where its answer goes (`target`: contact.name, contact.first_name, contact.last_name, contact.phone, contact.email, contact.company, qualification.role, qualification.size, qualification.sellers, qualification.agenda_system, note), and optionally `values` (normalised answer → stored value). Every answer is kept in the lead note whatever its rule; a missing answer never blocks the lead. */
|
|
156258
156811
|
mapping?: {
|
|
156259
156812
|
/** @default [] */
|
|
156260
156813
|
rules?: {
|
|
156261
156814
|
source: string;
|
|
156262
156815
|
aliases?: string[];
|
|
156263
156816
|
/** @enum {string} */
|
|
156264
|
-
target: "contact.name" | "contact.first_name" | "contact.last_name" | "contact.phone" | "contact.email" | "contact.company" | "qualification.role" | "qualification.size" | "qualification.sellers" | "note";
|
|
156817
|
+
target: "contact.name" | "contact.first_name" | "contact.last_name" | "contact.phone" | "contact.email" | "contact.company" | "qualification.role" | "qualification.size" | "qualification.sellers" | "qualification.agenda_system" | "note";
|
|
156265
156818
|
label?: string;
|
|
156266
156819
|
values?: {
|
|
156267
156820
|
[key: string]: string;
|
|
@@ -161322,15 +161875,442 @@ interface paths {
|
|
|
161322
161875
|
};
|
|
161323
161876
|
};
|
|
161324
161877
|
};
|
|
161325
|
-
put?: never;
|
|
161326
|
-
post?: never;
|
|
161878
|
+
put?: never;
|
|
161879
|
+
post?: never;
|
|
161880
|
+
delete?: never;
|
|
161881
|
+
options?: never;
|
|
161882
|
+
head?: never;
|
|
161883
|
+
patch?: never;
|
|
161884
|
+
trace?: never;
|
|
161885
|
+
};
|
|
161886
|
+
"/messaging-accounts/email/discover": {
|
|
161887
|
+
parameters: {
|
|
161888
|
+
query?: never;
|
|
161889
|
+
header?: never;
|
|
161890
|
+
path?: never;
|
|
161891
|
+
cookie?: never;
|
|
161892
|
+
};
|
|
161893
|
+
get?: never;
|
|
161894
|
+
put?: never;
|
|
161895
|
+
/**
|
|
161896
|
+
* Detect a mailbox's IMAP/SMTP settings from its address
|
|
161897
|
+
* @description Finds the IMAP and SMTP host, port and TLS mode for an email address the way Thunderbird and Outlook do, trying in order: the MX (Google / Microsoft 365 → `oauth` hint), the domain's autoconfig, Thunderbird's ISPDB, Outlook autodiscover (what cPanel hosting answers), SRV records, and finally the usual hostnames that accept a connection. The first source with a hit wins; each candidate names its `source`. **Nothing is persisted.**
|
|
161898
|
+
*
|
|
161899
|
+
* Without `password`: the ranked `candidates`. With `password`: the candidates are also logged in to, in order (at most 4, about 15 s in all), and `verified` is the first whose IMAP AND SMTP logins passed; otherwise `attempts` carries each leg's error and `error_kind` — `auth` means the server answered and refused the password, `unreachable` / `timeout` / `tls` mean the server could not be reached. When `oauth` is set (Gmail / Microsoft 365), connect through the OAuth flow instead; no login is tried.
|
|
161900
|
+
*
|
|
161901
|
+
* Then connect with `POST /messaging-accounts/email`, sending `verified` (or the chosen candidate) with the password on both legs. Finding nothing is `200` with `candidates: []`. Rate-limited per workspace (`429`).
|
|
161902
|
+
*/
|
|
161903
|
+
post: {
|
|
161904
|
+
parameters: {
|
|
161905
|
+
query?: never;
|
|
161906
|
+
header?: {
|
|
161907
|
+
/** @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. */
|
|
161908
|
+
"Idempotency-Key"?: string;
|
|
161909
|
+
};
|
|
161910
|
+
path?: never;
|
|
161911
|
+
cookie?: never;
|
|
161912
|
+
};
|
|
161913
|
+
requestBody?: {
|
|
161914
|
+
content: {
|
|
161915
|
+
/**
|
|
161916
|
+
* @example {
|
|
161917
|
+
* "email": "contacto@automotora-ejemplo.cl",
|
|
161918
|
+
* "password": "contraseña-del-buzón"
|
|
161919
|
+
* }
|
|
161920
|
+
*/
|
|
161921
|
+
"application/json": {
|
|
161922
|
+
/** Format: email */
|
|
161923
|
+
email: string;
|
|
161924
|
+
password?: string;
|
|
161925
|
+
};
|
|
161926
|
+
};
|
|
161927
|
+
};
|
|
161928
|
+
responses: {
|
|
161929
|
+
/** @description Ranked candidates and, with a password, the login results */
|
|
161930
|
+
200: {
|
|
161931
|
+
headers: {
|
|
161932
|
+
[name: string]: unknown;
|
|
161933
|
+
};
|
|
161934
|
+
content: {
|
|
161935
|
+
/**
|
|
161936
|
+
* @example {
|
|
161937
|
+
* "data": {
|
|
161938
|
+
* "domain": "automotora-ejemplo.cl",
|
|
161939
|
+
* "oauth": null,
|
|
161940
|
+
* "candidates": [
|
|
161941
|
+
* {
|
|
161942
|
+
* "source": "autodiscover",
|
|
161943
|
+
* "imap": {
|
|
161944
|
+
* "host": "mail.automotora-ejemplo.cl",
|
|
161945
|
+
* "port": 993,
|
|
161946
|
+
* "secure": true,
|
|
161947
|
+
* "user": "contacto@automotora-ejemplo.cl"
|
|
161948
|
+
* },
|
|
161949
|
+
* "smtp": {
|
|
161950
|
+
* "host": "mail.automotora-ejemplo.cl",
|
|
161951
|
+
* "port": 465,
|
|
161952
|
+
* "secure": true,
|
|
161953
|
+
* "user": "contacto@automotora-ejemplo.cl"
|
|
161954
|
+
* }
|
|
161955
|
+
* }
|
|
161956
|
+
* ],
|
|
161957
|
+
* "verified": null,
|
|
161958
|
+
* "attempts": [
|
|
161959
|
+
* {
|
|
161960
|
+
* "candidate": {
|
|
161961
|
+
* "source": "autodiscover",
|
|
161962
|
+
* "imap": {
|
|
161963
|
+
* "host": "mail.automotora-ejemplo.cl",
|
|
161964
|
+
* "port": 993,
|
|
161965
|
+
* "secure": true,
|
|
161966
|
+
* "user": "contacto@automotora-ejemplo.cl"
|
|
161967
|
+
* },
|
|
161968
|
+
* "smtp": {
|
|
161969
|
+
* "host": "mail.automotora-ejemplo.cl",
|
|
161970
|
+
* "port": 465,
|
|
161971
|
+
* "secure": true,
|
|
161972
|
+
* "user": "contacto@automotora-ejemplo.cl"
|
|
161973
|
+
* }
|
|
161974
|
+
* },
|
|
161975
|
+
* "ok": false,
|
|
161976
|
+
* "imap": {
|
|
161977
|
+
* "ok": false,
|
|
161978
|
+
* "error": "Command failed: Authentication failed.",
|
|
161979
|
+
* "error_kind": "auth"
|
|
161980
|
+
* },
|
|
161981
|
+
* "smtp": {
|
|
161982
|
+
* "ok": false,
|
|
161983
|
+
* "error": "Invalid login: 535 Incorrect authentication data",
|
|
161984
|
+
* "error_kind": "auth"
|
|
161985
|
+
* }
|
|
161986
|
+
* }
|
|
161987
|
+
* ]
|
|
161988
|
+
* }
|
|
161989
|
+
* }
|
|
161990
|
+
*/
|
|
161991
|
+
"application/json": {
|
|
161992
|
+
data: {
|
|
161993
|
+
domain: string;
|
|
161994
|
+
/** @enum {string|null} */
|
|
161995
|
+
oauth: "gmail" | "outlook" | null;
|
|
161996
|
+
candidates: {
|
|
161997
|
+
/** @enum {string} */
|
|
161998
|
+
source: "oauth_hint" | "autoconfig" | "ispdb" | "autodiscover" | "srv" | "guess";
|
|
161999
|
+
imap: {
|
|
162000
|
+
host: string;
|
|
162001
|
+
port: number;
|
|
162002
|
+
/** @description true = implicit TLS (993/465); false = STARTTLS (143/587) */
|
|
162003
|
+
secure: boolean;
|
|
162004
|
+
/** @description Login name, placeholders already expanded */
|
|
162005
|
+
user: string;
|
|
162006
|
+
};
|
|
162007
|
+
smtp: {
|
|
162008
|
+
host: string;
|
|
162009
|
+
port: number;
|
|
162010
|
+
/** @description true = implicit TLS (993/465); false = STARTTLS (143/587) */
|
|
162011
|
+
secure: boolean;
|
|
162012
|
+
/** @description Login name, placeholders already expanded */
|
|
162013
|
+
user: string;
|
|
162014
|
+
};
|
|
162015
|
+
}[];
|
|
162016
|
+
verified: {
|
|
162017
|
+
/** @enum {string} */
|
|
162018
|
+
source: "oauth_hint" | "autoconfig" | "ispdb" | "autodiscover" | "srv" | "guess";
|
|
162019
|
+
imap: {
|
|
162020
|
+
host: string;
|
|
162021
|
+
port: number;
|
|
162022
|
+
/** @description true = implicit TLS (993/465); false = STARTTLS (143/587) */
|
|
162023
|
+
secure: boolean;
|
|
162024
|
+
/** @description Login name, placeholders already expanded */
|
|
162025
|
+
user: string;
|
|
162026
|
+
};
|
|
162027
|
+
smtp: {
|
|
162028
|
+
host: string;
|
|
162029
|
+
port: number;
|
|
162030
|
+
/** @description true = implicit TLS (993/465); false = STARTTLS (143/587) */
|
|
162031
|
+
secure: boolean;
|
|
162032
|
+
/** @description Login name, placeholders already expanded */
|
|
162033
|
+
user: string;
|
|
162034
|
+
};
|
|
162035
|
+
} | null;
|
|
162036
|
+
attempts: {
|
|
162037
|
+
candidate: {
|
|
162038
|
+
/** @enum {string} */
|
|
162039
|
+
source: "oauth_hint" | "autoconfig" | "ispdb" | "autodiscover" | "srv" | "guess";
|
|
162040
|
+
imap: {
|
|
162041
|
+
host: string;
|
|
162042
|
+
port: number;
|
|
162043
|
+
/** @description true = implicit TLS (993/465); false = STARTTLS (143/587) */
|
|
162044
|
+
secure: boolean;
|
|
162045
|
+
/** @description Login name, placeholders already expanded */
|
|
162046
|
+
user: string;
|
|
162047
|
+
};
|
|
162048
|
+
smtp: {
|
|
162049
|
+
host: string;
|
|
162050
|
+
port: number;
|
|
162051
|
+
/** @description true = implicit TLS (993/465); false = STARTTLS (143/587) */
|
|
162052
|
+
secure: boolean;
|
|
162053
|
+
/** @description Login name, placeholders already expanded */
|
|
162054
|
+
user: string;
|
|
162055
|
+
};
|
|
162056
|
+
};
|
|
162057
|
+
ok: boolean;
|
|
162058
|
+
imap: {
|
|
162059
|
+
ok: boolean;
|
|
162060
|
+
error: string | null;
|
|
162061
|
+
/** @enum {string|null} */
|
|
162062
|
+
error_kind: "auth" | "unreachable" | "tls" | "timeout" | "other" | null;
|
|
162063
|
+
};
|
|
162064
|
+
smtp: {
|
|
162065
|
+
ok: boolean;
|
|
162066
|
+
error: string | null;
|
|
162067
|
+
/** @enum {string|null} */
|
|
162068
|
+
error_kind: "auth" | "unreachable" | "tls" | "timeout" | "other" | null;
|
|
162069
|
+
};
|
|
162070
|
+
}[];
|
|
162071
|
+
};
|
|
162072
|
+
};
|
|
162073
|
+
};
|
|
162074
|
+
};
|
|
162075
|
+
/** @description Validation error */
|
|
162076
|
+
400: {
|
|
162077
|
+
headers: {
|
|
162078
|
+
[name: string]: unknown;
|
|
162079
|
+
};
|
|
162080
|
+
content: {
|
|
162081
|
+
"application/json": components["schemas"]["Error"];
|
|
162082
|
+
};
|
|
162083
|
+
};
|
|
162084
|
+
/** @description Unauthorized */
|
|
162085
|
+
401: {
|
|
162086
|
+
headers: {
|
|
162087
|
+
[name: string]: unknown;
|
|
162088
|
+
};
|
|
162089
|
+
content: {
|
|
162090
|
+
"application/json": components["schemas"]["Error"];
|
|
162091
|
+
};
|
|
162092
|
+
};
|
|
162093
|
+
/** @description Forbidden */
|
|
162094
|
+
403: {
|
|
162095
|
+
headers: {
|
|
162096
|
+
[name: string]: unknown;
|
|
162097
|
+
};
|
|
162098
|
+
content: {
|
|
162099
|
+
"application/json": components["schemas"]["Error"];
|
|
162100
|
+
};
|
|
162101
|
+
};
|
|
162102
|
+
/** @description Not found */
|
|
162103
|
+
404: {
|
|
162104
|
+
headers: {
|
|
162105
|
+
[name: string]: unknown;
|
|
162106
|
+
};
|
|
162107
|
+
content: {
|
|
162108
|
+
"application/json": components["schemas"]["Error"];
|
|
162109
|
+
};
|
|
162110
|
+
};
|
|
162111
|
+
/** @description Conflict (incl. Idempotency-Key reuse with different body) */
|
|
162112
|
+
409: {
|
|
162113
|
+
headers: {
|
|
162114
|
+
[name: string]: unknown;
|
|
162115
|
+
};
|
|
162116
|
+
content: {
|
|
162117
|
+
"application/json": components["schemas"]["Error"];
|
|
162118
|
+
};
|
|
162119
|
+
};
|
|
162120
|
+
/** @description Rate limited */
|
|
162121
|
+
429: {
|
|
162122
|
+
headers: {
|
|
162123
|
+
[name: string]: unknown;
|
|
162124
|
+
};
|
|
162125
|
+
content: {
|
|
162126
|
+
"application/json": components["schemas"]["Error"];
|
|
162127
|
+
};
|
|
162128
|
+
};
|
|
162129
|
+
};
|
|
162130
|
+
};
|
|
162131
|
+
delete?: never;
|
|
162132
|
+
options?: never;
|
|
162133
|
+
head?: never;
|
|
162134
|
+
patch?: never;
|
|
162135
|
+
trace?: never;
|
|
162136
|
+
};
|
|
162137
|
+
"/messaging-accounts/email/test": {
|
|
162138
|
+
parameters: {
|
|
162139
|
+
query?: never;
|
|
162140
|
+
header?: never;
|
|
162141
|
+
path?: never;
|
|
162142
|
+
cookie?: never;
|
|
162143
|
+
};
|
|
162144
|
+
get?: never;
|
|
162145
|
+
put?: never;
|
|
162146
|
+
/**
|
|
162147
|
+
* Test IMAP/SMTP credentials
|
|
162148
|
+
* @description Dials both legs with the supplied credentials and reports each independently — **nothing is persisted**, so this is the safe way to let someone iterate on a mailbox configuration.
|
|
162149
|
+
*
|
|
162150
|
+
* **Run `POST /messaging-accounts/email/discover` first** to get the `imap` / `smtp` host, port and TLS mode instead of guessing them. If discover returns `oauth` (Gmail / Microsoft 365), do NOT use this route: have the owner connect it with the OAuth sign-in (Conectar Gmail / Microsoft 365 in the app), which needs no password.
|
|
162151
|
+
*
|
|
162152
|
+
* The two legs fail independently: a mailbox can read (IMAP fine) and be unable to send (SMTP wrong), so read both results rather than treating the response as one boolean. `error_kind` says why a leg failed: `auth` = the server answered and refused the password, `unreachable` / `timeout` / `tls` = the server could not be reached with those settings. `imap.user` / `smtp.user` default to `email` when omitted, which is right for most providers.
|
|
162153
|
+
*
|
|
162154
|
+
* **The password is the mailbox owner’s real password.** Sending it through an AI chat puts it in that chat’s transcript — only do it when the owner asks you to. It is used for this one test, is never stored by this route, and is never returned or written to the audit log. Rate-limited per workspace (`429`).
|
|
162155
|
+
*/
|
|
162156
|
+
post: {
|
|
162157
|
+
parameters: {
|
|
162158
|
+
query?: never;
|
|
162159
|
+
header?: {
|
|
162160
|
+
/** @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. */
|
|
162161
|
+
"Idempotency-Key"?: string;
|
|
162162
|
+
};
|
|
162163
|
+
path?: never;
|
|
162164
|
+
cookie?: never;
|
|
162165
|
+
};
|
|
162166
|
+
requestBody?: {
|
|
162167
|
+
content: {
|
|
162168
|
+
/**
|
|
162169
|
+
* @example {
|
|
162170
|
+
* "email": "contacto@automotora-ejemplo.cl",
|
|
162171
|
+
* "imap": {
|
|
162172
|
+
* "host": "mail.automotora-ejemplo.cl",
|
|
162173
|
+
* "port": 993,
|
|
162174
|
+
* "secure": true,
|
|
162175
|
+
* "password": "contraseña-del-buzón"
|
|
162176
|
+
* },
|
|
162177
|
+
* "smtp": {
|
|
162178
|
+
* "host": "mail.automotora-ejemplo.cl",
|
|
162179
|
+
* "port": 465,
|
|
162180
|
+
* "secure": true,
|
|
162181
|
+
* "password": "contraseña-del-buzón"
|
|
162182
|
+
* }
|
|
162183
|
+
* }
|
|
162184
|
+
*/
|
|
162185
|
+
"application/json": {
|
|
162186
|
+
/** Format: email */
|
|
162187
|
+
email: string;
|
|
162188
|
+
imap: {
|
|
162189
|
+
host: string;
|
|
162190
|
+
port: number;
|
|
162191
|
+
/** @default true */
|
|
162192
|
+
secure?: boolean;
|
|
162193
|
+
user?: string;
|
|
162194
|
+
password: string;
|
|
162195
|
+
};
|
|
162196
|
+
smtp: {
|
|
162197
|
+
host: string;
|
|
162198
|
+
port: number;
|
|
162199
|
+
/** @default true */
|
|
162200
|
+
secure?: boolean;
|
|
162201
|
+
user?: string;
|
|
162202
|
+
password: string;
|
|
162203
|
+
};
|
|
162204
|
+
};
|
|
162205
|
+
};
|
|
162206
|
+
};
|
|
162207
|
+
responses: {
|
|
162208
|
+
/** @description Per-leg connection results */
|
|
162209
|
+
200: {
|
|
162210
|
+
headers: {
|
|
162211
|
+
[name: string]: unknown;
|
|
162212
|
+
};
|
|
162213
|
+
content: {
|
|
162214
|
+
/**
|
|
162215
|
+
* @example {
|
|
162216
|
+
* "data": {
|
|
162217
|
+
* "ok": false,
|
|
162218
|
+
* "imap": {
|
|
162219
|
+
* "ok": true,
|
|
162220
|
+
* "error": null,
|
|
162221
|
+
* "error_kind": null
|
|
162222
|
+
* },
|
|
162223
|
+
* "smtp": {
|
|
162224
|
+
* "ok": false,
|
|
162225
|
+
* "error": "Invalid login: 535 Incorrect authentication data",
|
|
162226
|
+
* "error_kind": "auth"
|
|
162227
|
+
* }
|
|
162228
|
+
* }
|
|
162229
|
+
* }
|
|
162230
|
+
*/
|
|
162231
|
+
"application/json": {
|
|
162232
|
+
data: {
|
|
162233
|
+
/** @description true only when BOTH legs passed */
|
|
162234
|
+
ok: boolean;
|
|
162235
|
+
imap: {
|
|
162236
|
+
ok: boolean;
|
|
162237
|
+
error: string | null;
|
|
162238
|
+
/** @enum {string|null} */
|
|
162239
|
+
error_kind: "auth" | "unreachable" | "tls" | "timeout" | "other" | null;
|
|
162240
|
+
};
|
|
162241
|
+
smtp: {
|
|
162242
|
+
ok: boolean;
|
|
162243
|
+
error: string | null;
|
|
162244
|
+
/** @enum {string|null} */
|
|
162245
|
+
error_kind: "auth" | "unreachable" | "tls" | "timeout" | "other" | null;
|
|
162246
|
+
};
|
|
162247
|
+
};
|
|
162248
|
+
};
|
|
162249
|
+
};
|
|
162250
|
+
};
|
|
162251
|
+
/** @description Validation error */
|
|
162252
|
+
400: {
|
|
162253
|
+
headers: {
|
|
162254
|
+
[name: string]: unknown;
|
|
162255
|
+
};
|
|
162256
|
+
content: {
|
|
162257
|
+
"application/json": components["schemas"]["Error"];
|
|
162258
|
+
};
|
|
162259
|
+
};
|
|
162260
|
+
/** @description Unauthorized */
|
|
162261
|
+
401: {
|
|
162262
|
+
headers: {
|
|
162263
|
+
[name: string]: unknown;
|
|
162264
|
+
};
|
|
162265
|
+
content: {
|
|
162266
|
+
"application/json": components["schemas"]["Error"];
|
|
162267
|
+
};
|
|
162268
|
+
};
|
|
162269
|
+
/** @description Forbidden */
|
|
162270
|
+
403: {
|
|
162271
|
+
headers: {
|
|
162272
|
+
[name: string]: unknown;
|
|
162273
|
+
};
|
|
162274
|
+
content: {
|
|
162275
|
+
"application/json": components["schemas"]["Error"];
|
|
162276
|
+
};
|
|
162277
|
+
};
|
|
162278
|
+
/** @description Not found */
|
|
162279
|
+
404: {
|
|
162280
|
+
headers: {
|
|
162281
|
+
[name: string]: unknown;
|
|
162282
|
+
};
|
|
162283
|
+
content: {
|
|
162284
|
+
"application/json": components["schemas"]["Error"];
|
|
162285
|
+
};
|
|
162286
|
+
};
|
|
162287
|
+
/** @description Conflict (incl. Idempotency-Key reuse with different body) */
|
|
162288
|
+
409: {
|
|
162289
|
+
headers: {
|
|
162290
|
+
[name: string]: unknown;
|
|
162291
|
+
};
|
|
162292
|
+
content: {
|
|
162293
|
+
"application/json": components["schemas"]["Error"];
|
|
162294
|
+
};
|
|
162295
|
+
};
|
|
162296
|
+
/** @description Rate limited */
|
|
162297
|
+
429: {
|
|
162298
|
+
headers: {
|
|
162299
|
+
[name: string]: unknown;
|
|
162300
|
+
};
|
|
162301
|
+
content: {
|
|
162302
|
+
"application/json": components["schemas"]["Error"];
|
|
162303
|
+
};
|
|
162304
|
+
};
|
|
162305
|
+
};
|
|
162306
|
+
};
|
|
161327
162307
|
delete?: never;
|
|
161328
162308
|
options?: never;
|
|
161329
162309
|
head?: never;
|
|
161330
162310
|
patch?: never;
|
|
161331
162311
|
trace?: never;
|
|
161332
162312
|
};
|
|
161333
|
-
"/messaging-accounts/email
|
|
162313
|
+
"/messaging-accounts/email": {
|
|
161334
162314
|
parameters: {
|
|
161335
162315
|
query?: never;
|
|
161336
162316
|
header?: never;
|
|
@@ -161340,12 +162320,14 @@ interface paths {
|
|
|
161340
162320
|
get?: never;
|
|
161341
162321
|
put?: never;
|
|
161342
162322
|
/**
|
|
161343
|
-
*
|
|
161344
|
-
* @description
|
|
162323
|
+
* Connect a mailbox over IMAP/SMTP
|
|
162324
|
+
* @description Creates the `email_imap` account and stores the credentials encrypted. Same body as `/email/test` plus naming. The connection is re-tested server-side before anything is created, so **a failed connection answers 422 with the per-leg errors** (`imap` / `smtp`, each with `error_kind`) and creates nothing.
|
|
161345
162325
|
*
|
|
161346
|
-
*
|
|
162326
|
+
* Flow: `POST /messaging-accounts/email/discover` (finds the settings; with the password it also returns the `verified` candidate), optionally `POST /messaging-accounts/email/test`, then this route with the `verified` (or chosen) candidate’s `imap` / `smtp` and the password on both legs.
|
|
161347
162327
|
*
|
|
161348
|
-
*
|
|
162328
|
+
* This is the raw-credential path. **Prefer OAuth whenever discover returns `oauth`** (Gmail, Microsoft 365): connect those through the OAuth sign-in in the app (Conectar Gmail / Microsoft 365), which needs no password.
|
|
162329
|
+
*
|
|
162330
|
+
* **The password is the mailbox owner’s real password.** Sending it through an AI chat puts it in that chat’s transcript — only do it when the owner asks you to. It is stored encrypted, **never returned** (the account in the response carries no secrets, and later reads redact them) and never written to the audit log. Rate-limited per workspace (`429`).
|
|
161349
162331
|
*/
|
|
161350
162332
|
post: {
|
|
161351
162333
|
parameters: {
|
|
@@ -161362,19 +162344,55 @@ interface paths {
|
|
|
161362
162344
|
/**
|
|
161363
162345
|
* @example {
|
|
161364
162346
|
* "email": "contacto@automotora-ejemplo.cl",
|
|
161365
|
-
* "
|
|
162347
|
+
* "name": "Correo de contacto",
|
|
162348
|
+
* "imap": {
|
|
162349
|
+
* "host": "mail.automotora-ejemplo.cl",
|
|
162350
|
+
* "port": 993,
|
|
162351
|
+
* "secure": true,
|
|
162352
|
+
* "password": "contraseña-del-buzón"
|
|
162353
|
+
* },
|
|
162354
|
+
* "smtp": {
|
|
162355
|
+
* "host": "mail.automotora-ejemplo.cl",
|
|
162356
|
+
* "port": 465,
|
|
162357
|
+
* "secure": true,
|
|
162358
|
+
* "password": "contraseña-del-buzón"
|
|
162359
|
+
* }
|
|
161366
162360
|
* }
|
|
161367
162361
|
*/
|
|
161368
162362
|
"application/json": {
|
|
161369
162363
|
/** Format: email */
|
|
161370
162364
|
email: string;
|
|
161371
|
-
|
|
162365
|
+
imap: {
|
|
162366
|
+
host: string;
|
|
162367
|
+
port: number;
|
|
162368
|
+
/** @default true */
|
|
162369
|
+
secure?: boolean;
|
|
162370
|
+
user?: string;
|
|
162371
|
+
password: string;
|
|
162372
|
+
};
|
|
162373
|
+
smtp: {
|
|
162374
|
+
host: string;
|
|
162375
|
+
port: number;
|
|
162376
|
+
/** @default true */
|
|
162377
|
+
secure?: boolean;
|
|
162378
|
+
user?: string;
|
|
162379
|
+
password: string;
|
|
162380
|
+
};
|
|
162381
|
+
name?: string;
|
|
162382
|
+
from_name?: string | null;
|
|
162383
|
+
/** Format: uuid */
|
|
162384
|
+
assignee_ai_agent_id?: string | null;
|
|
162385
|
+
/**
|
|
162386
|
+
* @description What the channel is for. `bank_reconciliation` («Solo conciliación bancaria», email mailboxes only): bank transfer notifications feed the bank-movement ledger; every other message is dropped (no conversation, no notification), the channel never has an AI agent and never sends. Default `conversations`.
|
|
162387
|
+
* @enum {string}
|
|
162388
|
+
*/
|
|
162389
|
+
purpose?: "conversations" | "bank_reconciliation";
|
|
161372
162390
|
};
|
|
161373
162391
|
};
|
|
161374
162392
|
};
|
|
161375
162393
|
responses: {
|
|
161376
|
-
/** @description
|
|
161377
|
-
|
|
162394
|
+
/** @description The connected email account (no secrets) */
|
|
162395
|
+
201: {
|
|
161378
162396
|
headers: {
|
|
161379
162397
|
[name: string]: unknown;
|
|
161380
162398
|
};
|
|
@@ -161382,140 +162400,36 @@ interface paths {
|
|
|
161382
162400
|
/**
|
|
161383
162401
|
* @example {
|
|
161384
162402
|
* "data": {
|
|
161385
|
-
* "
|
|
161386
|
-
* "
|
|
161387
|
-
* "
|
|
161388
|
-
*
|
|
161389
|
-
*
|
|
161390
|
-
* "imap": {
|
|
161391
|
-
* "host": "mail.automotora-ejemplo.cl",
|
|
161392
|
-
* "port": 993,
|
|
161393
|
-
* "secure": true,
|
|
161394
|
-
* "user": "contacto@automotora-ejemplo.cl"
|
|
161395
|
-
* },
|
|
161396
|
-
* "smtp": {
|
|
161397
|
-
* "host": "mail.automotora-ejemplo.cl",
|
|
161398
|
-
* "port": 465,
|
|
161399
|
-
* "secure": true,
|
|
161400
|
-
* "user": "contacto@automotora-ejemplo.cl"
|
|
161401
|
-
* }
|
|
161402
|
-
* }
|
|
162403
|
+
* "id": "3f6d2c1e-8a4b-4d7e-9c10-5b2a7e9f0a11",
|
|
162404
|
+
* "name": "Correo de contacto",
|
|
162405
|
+
* "kind": "email_imap",
|
|
162406
|
+
* "channels": [
|
|
162407
|
+
* "email"
|
|
161403
162408
|
* ],
|
|
161404
|
-
* "
|
|
161405
|
-
* "
|
|
161406
|
-
*
|
|
161407
|
-
*
|
|
161408
|
-
*
|
|
161409
|
-
*
|
|
161410
|
-
*
|
|
161411
|
-
*
|
|
161412
|
-
*
|
|
161413
|
-
*
|
|
161414
|
-
*
|
|
161415
|
-
*
|
|
161416
|
-
*
|
|
161417
|
-
*
|
|
161418
|
-
*
|
|
161419
|
-
*
|
|
161420
|
-
* }
|
|
161421
|
-
* },
|
|
161422
|
-
* "ok": false,
|
|
161423
|
-
* "imap": {
|
|
161424
|
-
* "ok": false,
|
|
161425
|
-
* "error": "Command failed: Authentication failed.",
|
|
161426
|
-
* "error_kind": "auth"
|
|
161427
|
-
* },
|
|
161428
|
-
* "smtp": {
|
|
161429
|
-
* "ok": false,
|
|
161430
|
-
* "error": "Invalid login: 535 Incorrect authentication data",
|
|
161431
|
-
* "error_kind": "auth"
|
|
161432
|
-
* }
|
|
162409
|
+
* "enabled": true,
|
|
162410
|
+
* "config": {
|
|
162411
|
+
* "connected_via": "imap_smtp",
|
|
162412
|
+
* "email": "contacto@automotora-ejemplo.cl",
|
|
162413
|
+
* "from_name": null,
|
|
162414
|
+
* "imap": {
|
|
162415
|
+
* "host": "mail.automotora-ejemplo.cl",
|
|
162416
|
+
* "port": 993,
|
|
162417
|
+
* "secure": true,
|
|
162418
|
+
* "user": "contacto@automotora-ejemplo.cl"
|
|
162419
|
+
* },
|
|
162420
|
+
* "smtp": {
|
|
162421
|
+
* "host": "mail.automotora-ejemplo.cl",
|
|
162422
|
+
* "port": 465,
|
|
162423
|
+
* "secure": true,
|
|
162424
|
+
* "user": "contacto@automotora-ejemplo.cl"
|
|
161433
162425
|
* }
|
|
161434
|
-
*
|
|
162426
|
+
* },
|
|
162427
|
+
* "created_at": "2026-10-16T14:00:00.000Z"
|
|
161435
162428
|
* }
|
|
161436
162429
|
* }
|
|
161437
162430
|
*/
|
|
161438
162431
|
"application/json": {
|
|
161439
|
-
data
|
|
161440
|
-
domain: string;
|
|
161441
|
-
/** @enum {string|null} */
|
|
161442
|
-
oauth: "gmail" | "outlook" | null;
|
|
161443
|
-
candidates: {
|
|
161444
|
-
/** @enum {string} */
|
|
161445
|
-
source: "oauth_hint" | "autoconfig" | "ispdb" | "autodiscover" | "srv" | "guess";
|
|
161446
|
-
imap: {
|
|
161447
|
-
host: string;
|
|
161448
|
-
port: number;
|
|
161449
|
-
/** @description true = implicit TLS (993/465); false = STARTTLS (143/587) */
|
|
161450
|
-
secure: boolean;
|
|
161451
|
-
/** @description Login name, placeholders already expanded */
|
|
161452
|
-
user: string;
|
|
161453
|
-
};
|
|
161454
|
-
smtp: {
|
|
161455
|
-
host: string;
|
|
161456
|
-
port: number;
|
|
161457
|
-
/** @description true = implicit TLS (993/465); false = STARTTLS (143/587) */
|
|
161458
|
-
secure: boolean;
|
|
161459
|
-
/** @description Login name, placeholders already expanded */
|
|
161460
|
-
user: string;
|
|
161461
|
-
};
|
|
161462
|
-
}[];
|
|
161463
|
-
verified: {
|
|
161464
|
-
/** @enum {string} */
|
|
161465
|
-
source: "oauth_hint" | "autoconfig" | "ispdb" | "autodiscover" | "srv" | "guess";
|
|
161466
|
-
imap: {
|
|
161467
|
-
host: string;
|
|
161468
|
-
port: number;
|
|
161469
|
-
/** @description true = implicit TLS (993/465); false = STARTTLS (143/587) */
|
|
161470
|
-
secure: boolean;
|
|
161471
|
-
/** @description Login name, placeholders already expanded */
|
|
161472
|
-
user: string;
|
|
161473
|
-
};
|
|
161474
|
-
smtp: {
|
|
161475
|
-
host: string;
|
|
161476
|
-
port: number;
|
|
161477
|
-
/** @description true = implicit TLS (993/465); false = STARTTLS (143/587) */
|
|
161478
|
-
secure: boolean;
|
|
161479
|
-
/** @description Login name, placeholders already expanded */
|
|
161480
|
-
user: string;
|
|
161481
|
-
};
|
|
161482
|
-
} | null;
|
|
161483
|
-
attempts: {
|
|
161484
|
-
candidate: {
|
|
161485
|
-
/** @enum {string} */
|
|
161486
|
-
source: "oauth_hint" | "autoconfig" | "ispdb" | "autodiscover" | "srv" | "guess";
|
|
161487
|
-
imap: {
|
|
161488
|
-
host: string;
|
|
161489
|
-
port: number;
|
|
161490
|
-
/** @description true = implicit TLS (993/465); false = STARTTLS (143/587) */
|
|
161491
|
-
secure: boolean;
|
|
161492
|
-
/** @description Login name, placeholders already expanded */
|
|
161493
|
-
user: string;
|
|
161494
|
-
};
|
|
161495
|
-
smtp: {
|
|
161496
|
-
host: string;
|
|
161497
|
-
port: number;
|
|
161498
|
-
/** @description true = implicit TLS (993/465); false = STARTTLS (143/587) */
|
|
161499
|
-
secure: boolean;
|
|
161500
|
-
/** @description Login name, placeholders already expanded */
|
|
161501
|
-
user: string;
|
|
161502
|
-
};
|
|
161503
|
-
};
|
|
161504
|
-
ok: boolean;
|
|
161505
|
-
imap: {
|
|
161506
|
-
ok: boolean;
|
|
161507
|
-
error: string | null;
|
|
161508
|
-
/** @enum {string|null} */
|
|
161509
|
-
error_kind: "auth" | "unreachable" | "tls" | "timeout" | "other" | null;
|
|
161510
|
-
};
|
|
161511
|
-
smtp: {
|
|
161512
|
-
ok: boolean;
|
|
161513
|
-
error: string | null;
|
|
161514
|
-
/** @enum {string|null} */
|
|
161515
|
-
error_kind: "auth" | "unreachable" | "tls" | "timeout" | "other" | null;
|
|
161516
|
-
};
|
|
161517
|
-
}[];
|
|
161518
|
-
};
|
|
162432
|
+
data?: unknown;
|
|
161519
162433
|
};
|
|
161520
162434
|
};
|
|
161521
162435
|
};
|
|
@@ -161564,6 +162478,13 @@ interface paths {
|
|
|
161564
162478
|
"application/json": components["schemas"]["Error"];
|
|
161565
162479
|
};
|
|
161566
162480
|
};
|
|
162481
|
+
/** @description The IMAP and/or SMTP leg failed; nothing was created */
|
|
162482
|
+
422: {
|
|
162483
|
+
headers: {
|
|
162484
|
+
[name: string]: unknown;
|
|
162485
|
+
};
|
|
162486
|
+
content?: never;
|
|
162487
|
+
};
|
|
161567
162488
|
/** @description Rate limited */
|
|
161568
162489
|
429: {
|
|
161569
162490
|
headers: {
|
|
@@ -166180,46 +167101,420 @@ interface paths {
|
|
|
166180
167101
|
patch?: never;
|
|
166181
167102
|
trace?: never;
|
|
166182
167103
|
};
|
|
166183
|
-
"/orders/{id}/cancel": {
|
|
167104
|
+
"/orders/{id}/cancel": {
|
|
167105
|
+
parameters: {
|
|
167106
|
+
query?: never;
|
|
167107
|
+
header?: never;
|
|
167108
|
+
path?: never;
|
|
167109
|
+
cookie?: never;
|
|
167110
|
+
};
|
|
167111
|
+
get?: never;
|
|
167112
|
+
put?: never;
|
|
167113
|
+
/**
|
|
167114
|
+
* Cancel an unpaid order
|
|
167115
|
+
* @description Cancels a `draft` or `pending_payment` order: its obligations and its group are cancelled and its Mercado Pago link stops taking money (a payment already in flight is credited to the customer, applied to nothing). An order that already received money answers 409 `order_has_payments`, a paid one 409 `order_paid`: giving money back is a refund on the payments ledger. Cancelling twice returns the cancelled order. Fires `order.status_changed`. Requires `orders:write`.
|
|
167116
|
+
*/
|
|
167117
|
+
post: {
|
|
167118
|
+
parameters: {
|
|
167119
|
+
query?: never;
|
|
167120
|
+
header?: {
|
|
167121
|
+
/** @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. */
|
|
167122
|
+
"Idempotency-Key"?: string;
|
|
167123
|
+
};
|
|
167124
|
+
path: {
|
|
167125
|
+
id: string;
|
|
167126
|
+
};
|
|
167127
|
+
cookie?: never;
|
|
167128
|
+
};
|
|
167129
|
+
requestBody?: {
|
|
167130
|
+
content: {
|
|
167131
|
+
/**
|
|
167132
|
+
* @example {
|
|
167133
|
+
* "reason": "El cliente se arrepintió antes de pagar"
|
|
167134
|
+
* }
|
|
167135
|
+
*/
|
|
167136
|
+
"application/json": {
|
|
167137
|
+
/** @example El cliente se arrepintió antes de pagar */
|
|
167138
|
+
reason: string;
|
|
167139
|
+
};
|
|
167140
|
+
};
|
|
167141
|
+
};
|
|
167142
|
+
responses: {
|
|
167143
|
+
/** @description The cancelled order */
|
|
167144
|
+
200: {
|
|
167145
|
+
headers: {
|
|
167146
|
+
[name: string]: unknown;
|
|
167147
|
+
};
|
|
167148
|
+
content: {
|
|
167149
|
+
/**
|
|
167150
|
+
* @example {
|
|
167151
|
+
* "data": {
|
|
167152
|
+
* "id": "0199e3b0-0000-7000-8000-000000000001",
|
|
167153
|
+
* "tenant_id": "0199e3b0-0000-7000-8000-0000000000aa",
|
|
167154
|
+
* "display_id": "O-42",
|
|
167155
|
+
* "source": "native",
|
|
167156
|
+
* "external_id": null,
|
|
167157
|
+
* "status": "cancelled",
|
|
167158
|
+
* "contact_id": "0199e3b0-0000-7000-8000-0000000000c1",
|
|
167159
|
+
* "conversation_id": "0199e3b0-0000-7000-8000-0000000000c2",
|
|
167160
|
+
* "lead_id": "0199e3b0-0000-7000-8000-0000000000c3",
|
|
167161
|
+
* "obligation_group_id": "0199e3b0-0000-7000-8000-000000000002",
|
|
167162
|
+
* "currency": "CLP",
|
|
167163
|
+
* "delivery": {
|
|
167164
|
+
* "recipient_name": "Cliente de ejemplo",
|
|
167165
|
+
* "address": "Av. Ejemplo 123, depto 45",
|
|
167166
|
+
* "comuna": "Providencia",
|
|
167167
|
+
* "region": "Metropolitana"
|
|
167168
|
+
* },
|
|
167169
|
+
* "notes": null,
|
|
167170
|
+
* "total_clp": 39980,
|
|
167171
|
+
* "item_count": 2,
|
|
167172
|
+
* "stock_decremented_at": null,
|
|
167173
|
+
* "paid_at": null,
|
|
167174
|
+
* "shipped_at": null,
|
|
167175
|
+
* "delivered_at": null,
|
|
167176
|
+
* "cancelled_at": "2026-10-15T12:30:00.000Z",
|
|
167177
|
+
* "cancelled_reason": "El cliente se arrepintió antes de pagar",
|
|
167178
|
+
* "created_by": "0199e3b0-0000-7000-8000-0000000000bb",
|
|
167179
|
+
* "created_at": "2026-10-15T12:00:00.000Z",
|
|
167180
|
+
* "updated_at": "2026-10-15T12:00:00.000Z",
|
|
167181
|
+
* "lines": [
|
|
167182
|
+
* {
|
|
167183
|
+
* "id": "0199e3b0-0000-7000-8000-0000000000d1",
|
|
167184
|
+
* "position": 0,
|
|
167185
|
+
* "product_id": "0199e3b0-0000-7000-8000-0000000000e1",
|
|
167186
|
+
* "variant_id": "0199e3b0-0000-7000-8000-0000000000f1",
|
|
167187
|
+
* "title": "Polera básica",
|
|
167188
|
+
* "variant_title": "M / Negro",
|
|
167189
|
+
* "sku": "POL-M-NEG",
|
|
167190
|
+
* "unit_price_clp": 9990,
|
|
167191
|
+
* "quantity": 2,
|
|
167192
|
+
* "line_total_clp": 19980,
|
|
167193
|
+
* "obligation_id": "0199e3b0-0000-7000-8000-0000000000a1"
|
|
167194
|
+
* },
|
|
167195
|
+
* {
|
|
167196
|
+
* "id": "0199e3b0-0000-7000-8000-0000000000d2",
|
|
167197
|
+
* "position": 1,
|
|
167198
|
+
* "product_id": "0199e3b0-0000-7000-8000-0000000000e1",
|
|
167199
|
+
* "variant_id": "0199e3b0-0000-7000-8000-0000000000f2",
|
|
167200
|
+
* "title": "Polera básica",
|
|
167201
|
+
* "variant_title": "L / Blanco",
|
|
167202
|
+
* "sku": "POL-L-BLA",
|
|
167203
|
+
* "unit_price_clp": 20000,
|
|
167204
|
+
* "quantity": 1,
|
|
167205
|
+
* "line_total_clp": 20000,
|
|
167206
|
+
* "obligation_id": "0199e3b0-0000-7000-8000-0000000000a2"
|
|
167207
|
+
* }
|
|
167208
|
+
* ]
|
|
167209
|
+
* }
|
|
167210
|
+
* }
|
|
167211
|
+
*/
|
|
167212
|
+
"application/json": {
|
|
167213
|
+
data: components["schemas"]["CommerceOrder"];
|
|
167214
|
+
};
|
|
167215
|
+
};
|
|
167216
|
+
};
|
|
167217
|
+
/** @description Validation error */
|
|
167218
|
+
400: {
|
|
167219
|
+
headers: {
|
|
167220
|
+
[name: string]: unknown;
|
|
167221
|
+
};
|
|
167222
|
+
content: {
|
|
167223
|
+
"application/json": components["schemas"]["Error"];
|
|
167224
|
+
};
|
|
167225
|
+
};
|
|
167226
|
+
/** @description Unauthorized */
|
|
167227
|
+
401: {
|
|
167228
|
+
headers: {
|
|
167229
|
+
[name: string]: unknown;
|
|
167230
|
+
};
|
|
167231
|
+
content: {
|
|
167232
|
+
"application/json": components["schemas"]["Error"];
|
|
167233
|
+
};
|
|
167234
|
+
};
|
|
167235
|
+
/** @description Forbidden */
|
|
167236
|
+
403: {
|
|
167237
|
+
headers: {
|
|
167238
|
+
[name: string]: unknown;
|
|
167239
|
+
};
|
|
167240
|
+
content: {
|
|
167241
|
+
"application/json": components["schemas"]["Error"];
|
|
167242
|
+
};
|
|
167243
|
+
};
|
|
167244
|
+
/** @description Not found */
|
|
167245
|
+
404: {
|
|
167246
|
+
headers: {
|
|
167247
|
+
[name: string]: unknown;
|
|
167248
|
+
};
|
|
167249
|
+
content: {
|
|
167250
|
+
"application/json": components["schemas"]["Error"];
|
|
167251
|
+
};
|
|
167252
|
+
};
|
|
167253
|
+
/** @description Conflict (incl. Idempotency-Key reuse with different body) */
|
|
167254
|
+
409: {
|
|
167255
|
+
headers: {
|
|
167256
|
+
[name: string]: unknown;
|
|
167257
|
+
};
|
|
167258
|
+
content: {
|
|
167259
|
+
"application/json": components["schemas"]["Error"];
|
|
167260
|
+
};
|
|
167261
|
+
};
|
|
167262
|
+
/** @description Rate limited */
|
|
167263
|
+
429: {
|
|
167264
|
+
headers: {
|
|
167265
|
+
[name: string]: unknown;
|
|
167266
|
+
};
|
|
167267
|
+
content: {
|
|
167268
|
+
"application/json": components["schemas"]["Error"];
|
|
167269
|
+
};
|
|
167270
|
+
};
|
|
167271
|
+
};
|
|
167272
|
+
};
|
|
167273
|
+
delete?: never;
|
|
167274
|
+
options?: never;
|
|
167275
|
+
head?: never;
|
|
167276
|
+
patch?: never;
|
|
167277
|
+
trace?: never;
|
|
167278
|
+
};
|
|
167279
|
+
"/store-setup": {
|
|
166184
167280
|
parameters: {
|
|
166185
167281
|
query?: never;
|
|
166186
167282
|
header?: never;
|
|
166187
167283
|
path?: never;
|
|
166188
167284
|
cookie?: never;
|
|
166189
167285
|
};
|
|
166190
|
-
get?: never;
|
|
166191
|
-
put?: never;
|
|
166192
167286
|
/**
|
|
166193
|
-
*
|
|
166194
|
-
* @description
|
|
167287
|
+
* Get the store setup steps
|
|
167288
|
+
* @description The steps a store still has before its agent sells end to end, each computed from real data on every read: `store` «Conecta tu tienda» (a Shopify or WooCommerce store connected, or `sells_without_store`; `attention` when the store asks to be reconnected), `catalog` «Revisa tu catálogo» (at least one active product and the owner marked it reviewed), `mercadopago` «Conecta Mercado Pago» (present when native orders can be paid by link, i.e. `order_payment.mode` is not `transfer_only`) and `bank_account` «Agrega tu cuenta para transferencias» (present for `transfer_first` / `transfer_only`). `order_payment` is how a native order is paid (the `final` charging mode; change it with `PUT /payment-settings/charging`). `applies` is true for an ecommerce workspace, the one whose Home shows the steps; `complete` when every listed step is `done`. Requires `tenant:read`.
|
|
166195
167289
|
*/
|
|
166196
|
-
|
|
167290
|
+
get: {
|
|
166197
167291
|
parameters: {
|
|
166198
167292
|
query?: never;
|
|
166199
|
-
header?:
|
|
166200
|
-
|
|
166201
|
-
|
|
167293
|
+
header?: never;
|
|
167294
|
+
path?: never;
|
|
167295
|
+
cookie?: never;
|
|
167296
|
+
};
|
|
167297
|
+
requestBody?: never;
|
|
167298
|
+
responses: {
|
|
167299
|
+
/** @description The store setup */
|
|
167300
|
+
200: {
|
|
167301
|
+
headers: {
|
|
167302
|
+
[name: string]: unknown;
|
|
167303
|
+
};
|
|
167304
|
+
content: {
|
|
167305
|
+
/**
|
|
167306
|
+
* @example {
|
|
167307
|
+
* "data": {
|
|
167308
|
+
* "applies": true,
|
|
167309
|
+
* "complete": false,
|
|
167310
|
+
* "steps": [
|
|
167311
|
+
* {
|
|
167312
|
+
* "key": "store",
|
|
167313
|
+
* "status": "done"
|
|
167314
|
+
* },
|
|
167315
|
+
* {
|
|
167316
|
+
* "key": "catalog",
|
|
167317
|
+
* "status": "todo"
|
|
167318
|
+
* },
|
|
167319
|
+
* {
|
|
167320
|
+
* "key": "mercadopago",
|
|
167321
|
+
* "status": "todo"
|
|
167322
|
+
* }
|
|
167323
|
+
* ],
|
|
167324
|
+
* "order_payment": {
|
|
167325
|
+
* "mode": "mp_first",
|
|
167326
|
+
* "source": "tenant",
|
|
167327
|
+
* "default_mode": "mp_first"
|
|
167328
|
+
* },
|
|
167329
|
+
* "store": {
|
|
167330
|
+
* "connections": [
|
|
167331
|
+
* {
|
|
167332
|
+
* "provider": "shopify",
|
|
167333
|
+
* "status": "connected",
|
|
167334
|
+
* "account": "Tienda Ejemplo"
|
|
167335
|
+
* },
|
|
167336
|
+
* {
|
|
167337
|
+
* "provider": "woocommerce",
|
|
167338
|
+
* "status": "not_connected",
|
|
167339
|
+
* "account": null
|
|
167340
|
+
* }
|
|
167341
|
+
* ],
|
|
167342
|
+
* "sells_without_store": false
|
|
167343
|
+
* },
|
|
167344
|
+
* "catalog": {
|
|
167345
|
+
* "active": 42,
|
|
167346
|
+
* "native": 0,
|
|
167347
|
+
* "synced": 42,
|
|
167348
|
+
* "without_price": 1,
|
|
167349
|
+
* "without_photo": 3,
|
|
167350
|
+
* "reviewed_at": null
|
|
167351
|
+
* },
|
|
167352
|
+
* "mercadopago": {
|
|
167353
|
+
* "configured": true,
|
|
167354
|
+
* "connected": false,
|
|
167355
|
+
* "account": null
|
|
167356
|
+
* },
|
|
167357
|
+
* "bank_accounts": {
|
|
167358
|
+
* "active": 0
|
|
167359
|
+
* }
|
|
167360
|
+
* }
|
|
167361
|
+
* }
|
|
167362
|
+
*/
|
|
167363
|
+
"application/json": {
|
|
167364
|
+
data: {
|
|
167365
|
+
/** @description The workspace is an ecommerce one: Home shows the steps. */
|
|
167366
|
+
applies: boolean;
|
|
167367
|
+
/** @description Every step is `done`. */
|
|
167368
|
+
complete: boolean;
|
|
167369
|
+
steps: {
|
|
167370
|
+
/**
|
|
167371
|
+
* @description `store` «Conecta tu tienda» · `catalog` «Revisa tu catálogo» · `mercadopago` «Conecta Mercado Pago» (only when native orders can be paid by link) · `bank_account` «Agrega tu cuenta para transferencias» (only when they are paid by transfer first or only).
|
|
167372
|
+
* @enum {string}
|
|
167373
|
+
*/
|
|
167374
|
+
key: "store" | "catalog" | "mercadopago" | "bank_account";
|
|
167375
|
+
/**
|
|
167376
|
+
* @description `attention` = the step was done and broke (the store asks to be reconnected).
|
|
167377
|
+
* @enum {string}
|
|
167378
|
+
*/
|
|
167379
|
+
status: "todo" | "done" | "attention";
|
|
167380
|
+
}[];
|
|
167381
|
+
/** @description How a native order (built from the Vitrina catalog) is paid: the workspace’s `final` charging mode. Written with `PUT /payment-settings/charging` (`{ final }`). */
|
|
167382
|
+
order_payment: {
|
|
167383
|
+
/**
|
|
167384
|
+
* @description `mp_first` = Mercado Pago link first, transfer as the alternative; `transfer_first` = transfer first, link only if the customer asks; `mp_only` / `transfer_only` = only that method. A mode that needs Mercado Pago without a connection falls back to the transfer; an `*_only` mode with nothing to offer tells the customer the team will send the details.
|
|
167385
|
+
* @enum {string}
|
|
167386
|
+
*/
|
|
167387
|
+
mode: "mp_first" | "transfer_first" | "mp_only" | "transfer_only";
|
|
167388
|
+
/** @enum {string} */
|
|
167389
|
+
source: "tenant" | "default";
|
|
167390
|
+
/**
|
|
167391
|
+
* @description `mp_first` = Mercado Pago link first, transfer as the alternative; `transfer_first` = transfer first, link only if the customer asks; `mp_only` / `transfer_only` = only that method. A mode that needs Mercado Pago without a connection falls back to the transfer; an `*_only` mode with nothing to offer tells the customer the team will send the details.
|
|
167392
|
+
* @enum {string}
|
|
167393
|
+
*/
|
|
167394
|
+
default_mode: "mp_first" | "transfer_first" | "mp_only" | "transfer_only";
|
|
167395
|
+
};
|
|
167396
|
+
store: {
|
|
167397
|
+
connections: {
|
|
167398
|
+
/** @enum {string} */
|
|
167399
|
+
provider: "shopify" | "woocommerce";
|
|
167400
|
+
/** @enum {string} */
|
|
167401
|
+
status: "not_connected" | "pending" | "connected" | "needs_reconnect";
|
|
167402
|
+
/** @description The shop’s name (Shopify) or URL (WooCommerce). */
|
|
167403
|
+
account: string | null;
|
|
167404
|
+
}[];
|
|
167405
|
+
/** @description The owner said the business sells from the Vitrina catalog alone. */
|
|
167406
|
+
sells_without_store: boolean;
|
|
167407
|
+
};
|
|
167408
|
+
catalog: {
|
|
167409
|
+
active: number;
|
|
167410
|
+
native: number;
|
|
167411
|
+
synced: number;
|
|
167412
|
+
without_price: number;
|
|
167413
|
+
without_photo: number;
|
|
167414
|
+
reviewed_at: string | null;
|
|
167415
|
+
};
|
|
167416
|
+
mercadopago: {
|
|
167417
|
+
/** @description This deployment can connect Mercado Pago at all. */
|
|
167418
|
+
configured: boolean;
|
|
167419
|
+
connected: boolean;
|
|
167420
|
+
account: string | null;
|
|
167421
|
+
};
|
|
167422
|
+
bank_accounts: {
|
|
167423
|
+
active: number;
|
|
167424
|
+
};
|
|
167425
|
+
};
|
|
167426
|
+
};
|
|
167427
|
+
};
|
|
166202
167428
|
};
|
|
166203
|
-
|
|
166204
|
-
|
|
167429
|
+
/** @description Validation error */
|
|
167430
|
+
400: {
|
|
167431
|
+
headers: {
|
|
167432
|
+
[name: string]: unknown;
|
|
167433
|
+
};
|
|
167434
|
+
content: {
|
|
167435
|
+
"application/json": components["schemas"]["Error"];
|
|
167436
|
+
};
|
|
167437
|
+
};
|
|
167438
|
+
/** @description Unauthorized */
|
|
167439
|
+
401: {
|
|
167440
|
+
headers: {
|
|
167441
|
+
[name: string]: unknown;
|
|
167442
|
+
};
|
|
167443
|
+
content: {
|
|
167444
|
+
"application/json": components["schemas"]["Error"];
|
|
167445
|
+
};
|
|
167446
|
+
};
|
|
167447
|
+
/** @description Forbidden */
|
|
167448
|
+
403: {
|
|
167449
|
+
headers: {
|
|
167450
|
+
[name: string]: unknown;
|
|
167451
|
+
};
|
|
167452
|
+
content: {
|
|
167453
|
+
"application/json": components["schemas"]["Error"];
|
|
167454
|
+
};
|
|
167455
|
+
};
|
|
167456
|
+
/** @description Not found */
|
|
167457
|
+
404: {
|
|
167458
|
+
headers: {
|
|
167459
|
+
[name: string]: unknown;
|
|
167460
|
+
};
|
|
167461
|
+
content: {
|
|
167462
|
+
"application/json": components["schemas"]["Error"];
|
|
167463
|
+
};
|
|
167464
|
+
};
|
|
167465
|
+
/** @description Conflict (incl. Idempotency-Key reuse with different body) */
|
|
167466
|
+
409: {
|
|
167467
|
+
headers: {
|
|
167468
|
+
[name: string]: unknown;
|
|
167469
|
+
};
|
|
167470
|
+
content: {
|
|
167471
|
+
"application/json": components["schemas"]["Error"];
|
|
167472
|
+
};
|
|
167473
|
+
};
|
|
167474
|
+
/** @description Rate limited */
|
|
167475
|
+
429: {
|
|
167476
|
+
headers: {
|
|
167477
|
+
[name: string]: unknown;
|
|
167478
|
+
};
|
|
167479
|
+
content: {
|
|
167480
|
+
"application/json": components["schemas"]["Error"];
|
|
167481
|
+
};
|
|
166205
167482
|
};
|
|
167483
|
+
};
|
|
167484
|
+
};
|
|
167485
|
+
put?: never;
|
|
167486
|
+
post?: never;
|
|
167487
|
+
delete?: never;
|
|
167488
|
+
options?: never;
|
|
167489
|
+
head?: never;
|
|
167490
|
+
/**
|
|
167491
|
+
* Mark the catalog reviewed, or that the store sells without one
|
|
167492
|
+
* @description The owner’s two marks no table can know: `catalog_reviewed` (`true` stamps the review, `false` clears it) and `sells_without_store` (no Shopify / WooCommerce to connect; the Vitrina catalog is the store). Answers with the recomputed setup. Requires `tenant:write`.
|
|
167493
|
+
*/
|
|
167494
|
+
patch: {
|
|
167495
|
+
parameters: {
|
|
167496
|
+
query?: never;
|
|
167497
|
+
header?: never;
|
|
167498
|
+
path?: never;
|
|
166206
167499
|
cookie?: never;
|
|
166207
167500
|
};
|
|
166208
167501
|
requestBody?: {
|
|
166209
167502
|
content: {
|
|
166210
167503
|
/**
|
|
166211
167504
|
* @example {
|
|
166212
|
-
* "
|
|
167505
|
+
* "catalog_reviewed": true
|
|
166213
167506
|
* }
|
|
166214
167507
|
*/
|
|
166215
167508
|
"application/json": {
|
|
166216
|
-
/** @
|
|
166217
|
-
|
|
167509
|
+
/** @description `true` stamps the catalog as reviewed now (kept if already stamped); `false` clears it. */
|
|
167510
|
+
catalog_reviewed?: boolean;
|
|
167511
|
+
/** @description `true` = no Shopify / WooCommerce to connect: the business sells from the Vitrina catalog, and «Conecta tu tienda» is done. */
|
|
167512
|
+
sells_without_store?: boolean;
|
|
166218
167513
|
};
|
|
166219
167514
|
};
|
|
166220
167515
|
};
|
|
166221
167516
|
responses: {
|
|
166222
|
-
/** @description The
|
|
167517
|
+
/** @description The store setup after the change */
|
|
166223
167518
|
200: {
|
|
166224
167519
|
headers: {
|
|
166225
167520
|
[name: string]: unknown;
|
|
@@ -166228,68 +167523,124 @@ interface paths {
|
|
|
166228
167523
|
/**
|
|
166229
167524
|
* @example {
|
|
166230
167525
|
* "data": {
|
|
166231
|
-
* "
|
|
166232
|
-
* "
|
|
166233
|
-
* "
|
|
166234
|
-
* "source": "native",
|
|
166235
|
-
* "external_id": null,
|
|
166236
|
-
* "status": "cancelled",
|
|
166237
|
-
* "contact_id": "0199e3b0-0000-7000-8000-0000000000c1",
|
|
166238
|
-
* "conversation_id": "0199e3b0-0000-7000-8000-0000000000c2",
|
|
166239
|
-
* "lead_id": "0199e3b0-0000-7000-8000-0000000000c3",
|
|
166240
|
-
* "obligation_group_id": "0199e3b0-0000-7000-8000-000000000002",
|
|
166241
|
-
* "currency": "CLP",
|
|
166242
|
-
* "delivery": {
|
|
166243
|
-
* "recipient_name": "Cliente de ejemplo",
|
|
166244
|
-
* "address": "Av. Ejemplo 123, depto 45",
|
|
166245
|
-
* "comuna": "Providencia",
|
|
166246
|
-
* "region": "Metropolitana"
|
|
166247
|
-
* },
|
|
166248
|
-
* "notes": null,
|
|
166249
|
-
* "total_clp": 39980,
|
|
166250
|
-
* "item_count": 2,
|
|
166251
|
-
* "stock_decremented_at": null,
|
|
166252
|
-
* "paid_at": null,
|
|
166253
|
-
* "shipped_at": null,
|
|
166254
|
-
* "delivered_at": null,
|
|
166255
|
-
* "cancelled_at": "2026-10-15T12:30:00.000Z",
|
|
166256
|
-
* "cancelled_reason": "El cliente se arrepintió antes de pagar",
|
|
166257
|
-
* "created_by": "0199e3b0-0000-7000-8000-0000000000bb",
|
|
166258
|
-
* "created_at": "2026-10-15T12:00:00.000Z",
|
|
166259
|
-
* "updated_at": "2026-10-15T12:00:00.000Z",
|
|
166260
|
-
* "lines": [
|
|
167526
|
+
* "applies": true,
|
|
167527
|
+
* "complete": false,
|
|
167528
|
+
* "steps": [
|
|
166261
167529
|
* {
|
|
166262
|
-
* "
|
|
166263
|
-
* "
|
|
166264
|
-
* "product_id": "0199e3b0-0000-7000-8000-0000000000e1",
|
|
166265
|
-
* "variant_id": "0199e3b0-0000-7000-8000-0000000000f1",
|
|
166266
|
-
* "title": "Polera básica",
|
|
166267
|
-
* "variant_title": "M / Negro",
|
|
166268
|
-
* "sku": "POL-M-NEG",
|
|
166269
|
-
* "unit_price_clp": 9990,
|
|
166270
|
-
* "quantity": 2,
|
|
166271
|
-
* "line_total_clp": 19980,
|
|
166272
|
-
* "obligation_id": "0199e3b0-0000-7000-8000-0000000000a1"
|
|
167530
|
+
* "key": "store",
|
|
167531
|
+
* "status": "done"
|
|
166273
167532
|
* },
|
|
166274
167533
|
* {
|
|
166275
|
-
* "
|
|
166276
|
-
* "
|
|
166277
|
-
*
|
|
166278
|
-
*
|
|
166279
|
-
* "
|
|
166280
|
-
* "
|
|
166281
|
-
* "sku": "POL-L-BLA",
|
|
166282
|
-
* "unit_price_clp": 20000,
|
|
166283
|
-
* "quantity": 1,
|
|
166284
|
-
* "line_total_clp": 20000,
|
|
166285
|
-
* "obligation_id": "0199e3b0-0000-7000-8000-0000000000a2"
|
|
167534
|
+
* "key": "catalog",
|
|
167535
|
+
* "status": "todo"
|
|
167536
|
+
* },
|
|
167537
|
+
* {
|
|
167538
|
+
* "key": "mercadopago",
|
|
167539
|
+
* "status": "todo"
|
|
166286
167540
|
* }
|
|
166287
|
-
* ]
|
|
167541
|
+
* ],
|
|
167542
|
+
* "order_payment": {
|
|
167543
|
+
* "mode": "mp_first",
|
|
167544
|
+
* "source": "tenant",
|
|
167545
|
+
* "default_mode": "mp_first"
|
|
167546
|
+
* },
|
|
167547
|
+
* "store": {
|
|
167548
|
+
* "connections": [
|
|
167549
|
+
* {
|
|
167550
|
+
* "provider": "shopify",
|
|
167551
|
+
* "status": "connected",
|
|
167552
|
+
* "account": "Tienda Ejemplo"
|
|
167553
|
+
* },
|
|
167554
|
+
* {
|
|
167555
|
+
* "provider": "woocommerce",
|
|
167556
|
+
* "status": "not_connected",
|
|
167557
|
+
* "account": null
|
|
167558
|
+
* }
|
|
167559
|
+
* ],
|
|
167560
|
+
* "sells_without_store": false
|
|
167561
|
+
* },
|
|
167562
|
+
* "catalog": {
|
|
167563
|
+
* "active": 42,
|
|
167564
|
+
* "native": 0,
|
|
167565
|
+
* "synced": 42,
|
|
167566
|
+
* "without_price": 1,
|
|
167567
|
+
* "without_photo": 3,
|
|
167568
|
+
* "reviewed_at": null
|
|
167569
|
+
* },
|
|
167570
|
+
* "mercadopago": {
|
|
167571
|
+
* "configured": true,
|
|
167572
|
+
* "connected": false,
|
|
167573
|
+
* "account": null
|
|
167574
|
+
* },
|
|
167575
|
+
* "bank_accounts": {
|
|
167576
|
+
* "active": 0
|
|
167577
|
+
* }
|
|
166288
167578
|
* }
|
|
166289
167579
|
* }
|
|
166290
167580
|
*/
|
|
166291
167581
|
"application/json": {
|
|
166292
|
-
data:
|
|
167582
|
+
data: {
|
|
167583
|
+
/** @description The workspace is an ecommerce one: Home shows the steps. */
|
|
167584
|
+
applies: boolean;
|
|
167585
|
+
/** @description Every step is `done`. */
|
|
167586
|
+
complete: boolean;
|
|
167587
|
+
steps: {
|
|
167588
|
+
/**
|
|
167589
|
+
* @description `store` «Conecta tu tienda» · `catalog` «Revisa tu catálogo» · `mercadopago` «Conecta Mercado Pago» (only when native orders can be paid by link) · `bank_account` «Agrega tu cuenta para transferencias» (only when they are paid by transfer first or only).
|
|
167590
|
+
* @enum {string}
|
|
167591
|
+
*/
|
|
167592
|
+
key: "store" | "catalog" | "mercadopago" | "bank_account";
|
|
167593
|
+
/**
|
|
167594
|
+
* @description `attention` = the step was done and broke (the store asks to be reconnected).
|
|
167595
|
+
* @enum {string}
|
|
167596
|
+
*/
|
|
167597
|
+
status: "todo" | "done" | "attention";
|
|
167598
|
+
}[];
|
|
167599
|
+
/** @description How a native order (built from the Vitrina catalog) is paid: the workspace’s `final` charging mode. Written with `PUT /payment-settings/charging` (`{ final }`). */
|
|
167600
|
+
order_payment: {
|
|
167601
|
+
/**
|
|
167602
|
+
* @description `mp_first` = Mercado Pago link first, transfer as the alternative; `transfer_first` = transfer first, link only if the customer asks; `mp_only` / `transfer_only` = only that method. A mode that needs Mercado Pago without a connection falls back to the transfer; an `*_only` mode with nothing to offer tells the customer the team will send the details.
|
|
167603
|
+
* @enum {string}
|
|
167604
|
+
*/
|
|
167605
|
+
mode: "mp_first" | "transfer_first" | "mp_only" | "transfer_only";
|
|
167606
|
+
/** @enum {string} */
|
|
167607
|
+
source: "tenant" | "default";
|
|
167608
|
+
/**
|
|
167609
|
+
* @description `mp_first` = Mercado Pago link first, transfer as the alternative; `transfer_first` = transfer first, link only if the customer asks; `mp_only` / `transfer_only` = only that method. A mode that needs Mercado Pago without a connection falls back to the transfer; an `*_only` mode with nothing to offer tells the customer the team will send the details.
|
|
167610
|
+
* @enum {string}
|
|
167611
|
+
*/
|
|
167612
|
+
default_mode: "mp_first" | "transfer_first" | "mp_only" | "transfer_only";
|
|
167613
|
+
};
|
|
167614
|
+
store: {
|
|
167615
|
+
connections: {
|
|
167616
|
+
/** @enum {string} */
|
|
167617
|
+
provider: "shopify" | "woocommerce";
|
|
167618
|
+
/** @enum {string} */
|
|
167619
|
+
status: "not_connected" | "pending" | "connected" | "needs_reconnect";
|
|
167620
|
+
/** @description The shop’s name (Shopify) or URL (WooCommerce). */
|
|
167621
|
+
account: string | null;
|
|
167622
|
+
}[];
|
|
167623
|
+
/** @description The owner said the business sells from the Vitrina catalog alone. */
|
|
167624
|
+
sells_without_store: boolean;
|
|
167625
|
+
};
|
|
167626
|
+
catalog: {
|
|
167627
|
+
active: number;
|
|
167628
|
+
native: number;
|
|
167629
|
+
synced: number;
|
|
167630
|
+
without_price: number;
|
|
167631
|
+
without_photo: number;
|
|
167632
|
+
reviewed_at: string | null;
|
|
167633
|
+
};
|
|
167634
|
+
mercadopago: {
|
|
167635
|
+
/** @description This deployment can connect Mercado Pago at all. */
|
|
167636
|
+
configured: boolean;
|
|
167637
|
+
connected: boolean;
|
|
167638
|
+
account: string | null;
|
|
167639
|
+
};
|
|
167640
|
+
bank_accounts: {
|
|
167641
|
+
active: number;
|
|
167642
|
+
};
|
|
167643
|
+
};
|
|
166293
167644
|
};
|
|
166294
167645
|
};
|
|
166295
167646
|
};
|
|
@@ -166349,10 +167700,6 @@ interface paths {
|
|
|
166349
167700
|
};
|
|
166350
167701
|
};
|
|
166351
167702
|
};
|
|
166352
|
-
delete?: never;
|
|
166353
|
-
options?: never;
|
|
166354
|
-
head?: never;
|
|
166355
|
-
patch?: never;
|
|
166356
167703
|
trace?: never;
|
|
166357
167704
|
};
|
|
166358
167705
|
"/sandbox/clinic": {
|
|
@@ -186670,6 +188017,18 @@ interface components {
|
|
|
186670
188017
|
slack_webhook_url?: "••••";
|
|
186671
188018
|
/** @description Whether a Slack incoming webhook is configured for workspace alerts. */
|
|
186672
188019
|
slack_webhook_configured?: boolean;
|
|
188020
|
+
/** @description «Gestionar taller en Vitrina» (automotive). On: the workspace has the «Servicio de vehículos» workshop board next to Soporte. Never set → reads true exactly when that board already exists. Writing `true` creates the board (idempotent; refused with 400 outside the automotive vertical); `false` removes it only while no ticket was ever placed on it — a board in use is kept (see `workshop_board.in_use`). */
|
|
188021
|
+
manage_workshop?: boolean;
|
|
188022
|
+
/** @description Read-only: the workshop board `manage_workshop` governs. Ignored on write. */
|
|
188023
|
+
workshop_board?: {
|
|
188024
|
+
/**
|
|
188025
|
+
* Format: uuid
|
|
188026
|
+
* @description The «Servicio de vehículos» board; null when there is none.
|
|
188027
|
+
*/
|
|
188028
|
+
pipeline_id: string | null;
|
|
188029
|
+
/** @description A ticket was ever placed on the board; turning `manage_workshop` off keeps it. */
|
|
188030
|
+
in_use: boolean;
|
|
188031
|
+
};
|
|
186673
188032
|
};
|
|
186674
188033
|
TenantSettingsPublicWrite: {
|
|
186675
188034
|
/** @description Vitrina Ads workspace choices. `tag_choice`: how the «Instalar el tag» step was answered — `site` (the tag goes on the workspace's website, pasted or through Google Tag Manager) or `no_site` (no website; step skipped on purpose); `null` clears it. `goal`: the monthly goal the Ads hero measures pace against (`{kind, target, period:'month'}`; `null` clears it — `PUT /ads/goal` is the dedicated door). `dismissed_actions`: `{ [action id]: until ISO }` merged onto the stored map (`null` removes an id; expired entries are pruned). `specialty_map`: which specialty (and professionals, entry-visit length and price) each campaign / ad set / ad books — the agenda-capacity check behind «Pausar» / «Subir» reads it before the name match; replaces the stored list whole (`null` clears it). Merged into the stored `ads` object; the server stamps `tag_choice_at` / `goal_at` / `goal_by` on every write, and `GET /tenant/settings` returns them under `ads`. */
|
|
@@ -186740,6 +188099,8 @@ interface components {
|
|
|
186740
188099
|
change_template_name?: string;
|
|
186741
188100
|
};
|
|
186742
188101
|
};
|
|
188102
|
+
/** @description Turn the «Servicio de vehículos» workshop board on (creates it; automotive only) or off (removes it only while it never held a ticket). */
|
|
188103
|
+
manage_workshop?: boolean;
|
|
186743
188104
|
};
|
|
186744
188105
|
LiveUsage: {
|
|
186745
188106
|
as_of: string;
|