intifact 1.1.1 → 1.2.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.ts CHANGED
@@ -3,10 +3,32 @@ import type { paths } from "./types.js";
3
3
  export type { paths, components } from "./types.js";
4
4
  /** Body de POST /api/v1/invoice/send */
5
5
  export type SendInvoiceInput = paths["/api/v1/invoice/send"]["post"]["requestBody"]["content"]["application/json"];
6
+ /** Body de POST /api/v1/invoice/compute */
7
+ export type ComputeInvoiceInput = paths["/api/v1/invoice/compute"]["post"]["requestBody"]["content"]["application/json"];
6
8
  /** Body de POST /api/v1/note/send */
7
9
  export type SendNoteInput = paths["/api/v1/note/send"]["post"]["requestBody"]["content"]["application/json"];
8
- /** Body de POST /api/v1/despatch/send */
10
+ /** Body de POST /api/v1/note/compute */
11
+ export type ComputeNoteInput = paths["/api/v1/note/compute"]["post"]["requestBody"]["content"]["application/json"];
12
+ /** Body de POST /api/v1/despatch/send (Guía Remitente 09) */
9
13
  export type SendDespatchInput = paths["/api/v1/despatch/send"]["post"]["requestBody"]["content"]["application/json"];
14
+ /** Body de POST /api/v1/despatch/send-multi */
15
+ export type SendDespatchMultiInput = paths["/api/v1/despatch/send-multi"]["post"]["requestBody"]["content"]["application/json"];
16
+ /** Body de POST /api/v1/despatch-transportista/send (Guía Transportista 31) */
17
+ export type SendDespatchTransportistaInput = paths["/api/v1/despatch-transportista/send"]["post"]["requestBody"]["content"]["application/json"];
18
+ /** Body de POST /api/v1/summary/send (Resumen Diario) */
19
+ export type SendSummaryInput = paths["/api/v1/summary/send"]["post"]["requestBody"]["content"]["application/json"];
20
+ /** Body de POST /api/v1/voided/send (Comunicación de Baja) */
21
+ export type SendVoidedInput = paths["/api/v1/voided/send"]["post"]["requestBody"]["content"]["application/json"];
22
+ /** Body de POST /api/v1/invoice/cancel (anular factura) */
23
+ export type CancelInvoiceInput = paths["/api/v1/invoice/cancel"]["post"]["requestBody"]["content"]["application/json"];
24
+ /** Body de POST /api/v1/boleta/cancel (anular boleta) */
25
+ export type CancelBoletaInput = paths["/api/v1/boleta/cancel"]["post"]["requestBody"]["content"]["application/json"];
26
+ /** Body de POST /api/v1/webhooks */
27
+ export type CreateWebhookInput = paths["/api/v1/webhooks"]["post"]["requestBody"]["content"]["application/json"];
28
+ /** Body de PUT /api/v1/webhooks/{id} */
29
+ export type UpdateWebhookInput = paths["/api/v1/webhooks/{id}"]["put"]["requestBody"]["content"]["application/json"];
30
+ /** Body de POST /api/v1/cdr/consultar (consulta de CDR en SUNAT por referencia) */
31
+ export type ConsultarCdrInput = paths["/api/v1/cdr/consultar"]["post"]["requestBody"]["content"]["application/json"];
10
32
  /** Respuesta 202 de cualquier /send (documento encolado) */
11
33
  export type EnqueueResponse = paths["/api/v1/invoice/send"]["post"]["responses"]["202"]["content"]["application/json"];
12
34
  /** Respuesta de GET /api/v1/queues/stats */
@@ -22,7 +44,7 @@ export interface FacturacionClientOptions extends ClientOptions {
22
44
  *
23
45
  * @example
24
46
  * ```ts
25
- * const fact = new FacturacionClient({ baseUrl: "http://localhost:3000" });
47
+ * const fact = new FacturacionClient({ baseUrl: "http://localhost:3000", apiKey: "fact_test_..." });
26
48
  * const { data, error } = await fact.sendInvoice({ ...payload });
27
49
  * if (data) console.log("encolado:", data.data.id);
28
50
  * ```
@@ -30,7 +52,7 @@ export interface FacturacionClientOptions extends ClientOptions {
30
52
  export declare class FacturacionClient {
31
53
  private readonly api;
32
54
  constructor(opts: FacturacionClientOptions);
33
- /** Envía factura o boleta. Encolada para procesamiento asíncrono. */
55
+ /** Envía factura (01) o boleta (03). Encolada para procesamiento asíncrono → 202. */
34
56
  sendInvoice(body: SendInvoiceInput): Promise<import("openapi-fetch").FetchResponse<{
35
57
  parameters: {
36
58
  query?: never;
@@ -72,17 +94,21 @@ export declare class FacturacionClient {
72
94
  cantidad: number;
73
95
  codProducto: string;
74
96
  descripcion: string;
75
- marca?: string;
97
+ marca? /** Envía guía de remisión transportista (31). */: string;
76
98
  montoValorUnitario: number;
77
99
  montoBaseIgv: number;
78
- porcentajeIgv?: number;
100
+ porcentajeIgv
101
+ /** Anula una factura (comunicación de baja). */
102
+ ?: number;
79
103
  igv: number;
80
104
  tipAfeIgv?: string;
81
105
  totalImpuestos: number;
82
106
  montoPrecioUnitario: number;
83
107
  montoValorVenta: number;
84
108
  descuento?: number;
85
- descuentoItem?: number;
109
+ descuentoItem
110
+ /** Envía un Resumen Diario (RC). */
111
+ ? /** Envía un Resumen Diario (RC). */: number;
86
112
  factorIcbper?: number;
87
113
  codProdSunat?: string;
88
114
  }[];
@@ -96,6 +122,12 @@ export declare class FacturacionClient {
96
122
  legendCode: string;
97
123
  legendValue: string;
98
124
  }[];
125
+ observacion?: string;
126
+ vendedor?: string;
127
+ pagos?: {
128
+ metodoPago: string;
129
+ monto: number;
130
+ }[];
99
131
  detraccion?: {
100
132
  codBienServicio: string;
101
133
  cuentaBanco: string;
@@ -103,6 +135,10 @@ export declare class FacturacionClient {
103
135
  monto: number;
104
136
  medioPago?: string;
105
137
  };
138
+ guiaRemision?: {
139
+ tipoDoc?: "31" | "09";
140
+ nroDoc: string;
141
+ }[];
106
142
  };
107
143
  };
108
144
  };
@@ -191,17 +227,21 @@ export declare class FacturacionClient {
191
227
  cantidad: number;
192
228
  codProducto: string;
193
229
  descripcion: string;
194
- marca?: string;
230
+ marca? /** Envía guía de remisión transportista (31). */: string;
195
231
  montoValorUnitario: number;
196
232
  montoBaseIgv: number;
197
- porcentajeIgv?: number;
233
+ porcentajeIgv
234
+ /** Anula una factura (comunicación de baja). */
235
+ ?: number;
198
236
  igv: number;
199
237
  tipAfeIgv?: string;
200
238
  totalImpuestos: number;
201
239
  montoPrecioUnitario: number;
202
240
  montoValorVenta: number;
203
241
  descuento?: number;
204
- descuentoItem?: number;
242
+ descuentoItem
243
+ /** Envía un Resumen Diario (RC). */
244
+ ? /** Envía un Resumen Diario (RC). */: number;
205
245
  factorIcbper?: number;
206
246
  codProdSunat?: string;
207
247
  }[];
@@ -215,6 +255,12 @@ export declare class FacturacionClient {
215
255
  legendCode: string;
216
256
  legendValue: string;
217
257
  }[];
258
+ observacion?: string;
259
+ vendedor?: string;
260
+ pagos?: {
261
+ metodoPago: string;
262
+ monto: number;
263
+ }[];
218
264
  detraccion?: {
219
265
  codBienServicio: string;
220
266
  cuentaBanco: string;
@@ -222,6 +268,124 @@ export declare class FacturacionClient {
222
268
  monto: number;
223
269
  medioPago?: string;
224
270
  };
271
+ guiaRemision?: {
272
+ tipoDoc?: "31" | "09";
273
+ nroDoc: string;
274
+ }[];
275
+ };
276
+ }, `${string}/${string}`>>;
277
+ /** Calcula importes (Modelo B) de una factura/boleta SIN emitir. */
278
+ computeInvoice(body: ComputeInvoiceInput): Promise<import("openapi-fetch").FetchResponse<{
279
+ parameters: {
280
+ query?: never;
281
+ header?: never;
282
+ path?: never;
283
+ cookie?: never;
284
+ };
285
+ requestBody: {
286
+ content: {
287
+ "application/json": {
288
+ tipoMoneda?: string;
289
+ items: {
290
+ descripcion: string;
291
+ cantidad: number;
292
+ valorUnitario: number;
293
+ unidad?: string;
294
+ codProducto?: string;
295
+ afectacion?: string;
296
+ igvPorcentaje?: number;
297
+ descuento?: {
298
+ porcentaje?: number;
299
+ monto?: number;
300
+ };
301
+ factorIcbper?: number;
302
+ marca?: string;
303
+ codProdSunat? /** Lista los intentos de entrega de un webhook. */: string;
304
+ }[];
305
+ descuentoGlobal?: {
306
+ porcentaje?: number;
307
+ monto?: number;
308
+ };
309
+ preciosIncluyenIgv?: boolean;
310
+ };
311
+ };
312
+ };
313
+ responses: {
314
+ 200: {
315
+ headers: {
316
+ [name: string]: unknown;
317
+ };
318
+ content: {
319
+ "application/json": {
320
+ success: boolean;
321
+ message: string;
322
+ data: {
323
+ tipoMoneda: string;
324
+ items: {
325
+ unidad: string;
326
+ cantidad: number;
327
+ codProducto: string;
328
+ descripcion: string;
329
+ marca?: string;
330
+ tipAfeIgv: string;
331
+ porcentajeIgv: number;
332
+ montoValorUnitario: number;
333
+ descuento: number;
334
+ descuentoItem: number;
335
+ descuentoGlobalLinea: number;
336
+ montoBruto: number;
337
+ montoValorVenta: number;
338
+ montoBaseIgv: number;
339
+ igv: number;
340
+ totalImpuestos: number;
341
+ montoPrecioUnitario: number;
342
+ factorIcbper: number;
343
+ codProdSunat?: string;
344
+ }[];
345
+ montoOperGravadas: number;
346
+ montoOperExoneradas: number;
347
+ montoOperInafectas: number;
348
+ montoOperGratuitas: number;
349
+ montoOperExportacion: number;
350
+ montoIgv: number;
351
+ montoIcbper: number;
352
+ descuentoGlobal: number;
353
+ descuentoGlobalBase: number;
354
+ totalDescuentos: number;
355
+ totalImpuestos: number;
356
+ valorVenta: number;
357
+ subTotal: number;
358
+ montoImpVenta: number;
359
+ montoEnLetras: string;
360
+ };
361
+ };
362
+ };
363
+ };
364
+ };
365
+ }, {
366
+ body: {
367
+ tipoMoneda?: string;
368
+ items: {
369
+ descripcion: string;
370
+ cantidad: number;
371
+ valorUnitario: number;
372
+ unidad?: string;
373
+ codProducto?: string;
374
+ afectacion?: string;
375
+ igvPorcentaje?: number;
376
+ descuento?: {
377
+ porcentaje?: number;
378
+ monto?: number;
379
+ };
380
+ factorIcbper?: number;
381
+ marca?: string;
382
+ codProdSunat? /** Lista los intentos de entrega de un webhook. */: string;
383
+ }[];
384
+ descuentoGlobal?: {
385
+ porcentaje?: number;
386
+ monto?: number;
387
+ };
388
+ preciosIncluyenIgv?: boolean;
225
389
  };
226
390
  }, `${string}/${string}`>>;
227
391
  /** Envía nota de crédito (07) o débito (08). */
@@ -400,7 +564,121 @@ export declare class FacturacionClient {
400
564
  observacion?: string;
401
565
  };
402
566
  }, `${string}/${string}`>>;
403
- /** Envía guía de remisión (GRE REST). */
567
+ /** Calcula importes (Modelo B) de una nota SIN emitir. */
568
+ computeNote(body: ComputeNoteInput): Promise<import("openapi-fetch").FetchResponse<{
569
+ parameters: {
570
+ query?: never;
571
+ header?: never;
572
+ path?: never;
573
+ cookie?: never;
574
+ };
575
+ requestBody: {
576
+ content: {
577
+ "application/json": {
578
+ tipoMoneda?: string;
579
+ items: {
580
+ descripcion: string;
581
+ cantidad: number;
582
+ valorUnitario: number;
583
+ unidad?: string;
584
+ codProducto?: string;
585
+ afectacion?: string;
586
+ igvPorcentaje?: number;
587
+ descuento?: {
588
+ porcentaje?: number;
589
+ monto?: number;
590
+ };
591
+ factorIcbper?: number;
592
+ marca?: string;
593
+ codProdSunat?: string;
594
+ }[];
595
+ descuentoGlobal?: {
596
+ porcentaje?: number;
597
+ monto?: number;
598
+ };
599
+ preciosIncluyenIgv?: boolean;
600
+ };
601
+ };
602
+ };
603
+ responses: {
604
+ 200: {
605
+ headers: {
606
+ [name: string]: unknown;
607
+ };
608
+ content: {
609
+ "application/json": {
610
+ success: boolean;
611
+ message: string;
612
+ data: {
613
+ tipoMoneda: string;
614
+ items: {
615
+ unidad: string;
616
+ cantidad: number;
617
+ codProducto: string;
618
+ descripcion: string;
619
+ marca?: string;
620
+ tipAfeIgv: string;
621
+ porcentajeIgv: number;
622
+ montoValorUnitario: number;
623
+ descuento: number;
624
+ descuentoItem: number;
625
+ descuentoGlobalLinea: number;
626
+ montoBruto: number;
627
+ montoValorVenta: number;
628
+ montoBaseIgv: number;
629
+ igv: number;
630
+ totalImpuestos: number;
631
+ montoPrecioUnitario: number;
632
+ factorIcbper: number;
633
+ codProdSunat?: string;
634
+ }[];
635
+ montoOperGravadas: number;
636
+ montoOperExoneradas: number;
637
+ montoOperInafectas: number;
638
+ montoOperGratuitas: number;
639
+ montoOperExportacion: number;
640
+ montoIgv: number;
641
+ montoIcbper: number;
642
+ descuentoGlobal: number;
643
+ descuentoGlobalBase: number;
644
+ totalDescuentos: number;
645
+ totalImpuestos: number;
646
+ valorVenta: number;
647
+ subTotal: number;
648
+ montoImpVenta: number;
649
+ montoEnLetras: string;
650
+ };
651
+ };
652
+ };
653
+ };
654
+ };
655
+ }, {
656
+ body: {
657
+ tipoMoneda?: string;
658
+ items: {
659
+ descripcion: string;
660
+ cantidad: number;
661
+ valorUnitario: number;
662
+ unidad?: string;
663
+ codProducto?: string;
664
+ afectacion?: string;
665
+ igvPorcentaje?: number;
666
+ descuento?: {
667
+ porcentaje?: number;
668
+ monto?: number;
669
+ };
670
+ factorIcbper?: number;
671
+ marca?: string;
672
+ codProdSunat?: string;
673
+ }[];
674
+ descuentoGlobal?: {
675
+ porcentaje?: number;
676
+ monto?: number;
677
+ };
678
+ preciosIncluyenIgv?: boolean;
679
+ };
680
+ }, `${string}/${string}`>>;
681
+ /** Envía guía de remisión remitente (09). */
404
682
  sendDespatch(body: SendDespatchInput): Promise<import("openapi-fetch").FetchResponse<{
405
683
  parameters: {
406
684
  query?: never;
@@ -429,6 +707,9 @@ export declare class FacturacionClient {
429
707
  destinatarioTelefono?: string;
430
708
  destinatarioEmail?: string;
431
709
  entregaReferencia?: string;
710
+ modalidadEntrega?: "DOMICILIO" | "AGENCIA";
711
+ agenciaNombre?: string;
712
+ agenciaSede?: string;
432
713
  guiaCodTraslado: string;
433
714
  guiaModTraslado: "01" | "02";
434
715
  guiaPesoTotal: number;
@@ -441,8 +722,10 @@ export declare class FacturacionClient {
441
722
  transportistaNroMtc?: string;
442
723
  guiaPartidaUbigeo: string;
443
724
  guiaPartidaDireccion: string;
725
+ guiaPartidaCiudad?: string;
444
726
  guiaLlegadaUbigeo: string;
445
727
  guiaLlegadaDireccion: string;
728
+ guiaLlegadaCiudad?: string;
446
729
  chofer?: {
447
730
  tipo: "Principal" | "Secundario";
448
731
  tipoDoc: string;
@@ -590,6 +873,9 @@ export declare class FacturacionClient {
590
873
  destinatarioTelefono?: string;
591
874
  destinatarioEmail?: string;
592
875
  entregaReferencia?: string;
876
+ modalidadEntrega?: "DOMICILIO" | "AGENCIA";
877
+ agenciaNombre?: string;
878
+ agenciaSede?: string;
593
879
  guiaCodTraslado: string;
594
880
  guiaModTraslado: "01" | "02";
595
881
  guiaPesoTotal: number;
@@ -602,8 +888,10 @@ export declare class FacturacionClient {
602
888
  transportistaNroMtc?: string;
603
889
  guiaPartidaUbigeo: string;
604
890
  guiaPartidaDireccion: string;
891
+ guiaPartidaCiudad?: string;
605
892
  guiaLlegadaUbigeo: string;
606
893
  guiaLlegadaDireccion: string;
894
+ guiaLlegadaCiudad?: string;
607
895
  chofer?: {
608
896
  tipo: "Principal" | "Secundario";
609
897
  tipoDoc: string;
@@ -678,87 +966,1367 @@ export declare class FacturacionClient {
678
966
  }[];
679
967
  };
680
968
  }, `${string}/${string}`>>;
681
- /** Lista documentos con filtros y paginación. */
682
- listDocuments(query?: paths["/api/v1/documents"]["get"]["parameters"]["query"]): Promise<import("openapi-fetch").FetchResponse<{
969
+ /** Envía varias guías de remisión en un solo request. */
970
+ sendDespatchMulti(body: SendDespatchMultiInput): Promise<import("openapi-fetch").FetchResponse<{
683
971
  parameters: {
684
- query?: {
685
- ruc?: string;
686
- tipoDoc?: string;
687
- serie?: string;
688
- estado?: string;
689
- env?: "live" | "test";
690
- fechaDesde?: string;
691
- fechaHasta?: string;
692
- clienteNumDoc?: string;
693
- page?: number;
694
- limit?: number;
695
- };
972
+ query?: never;
696
973
  header?: never;
697
974
  path?: never;
698
975
  cookie?: never;
699
976
  };
700
- requestBody?: never;
977
+ requestBody: {
978
+ content: {
979
+ "application/json": {
980
+ tipoDoc: "09";
981
+ serie: string;
982
+ observacion?: string;
983
+ fechaEmision: string;
984
+ empresaRuc: string;
985
+ establecimientoCodigo?: string;
986
+ guiaCodTraslado: string;
987
+ guiaModTraslado: "01" | "02";
988
+ guiaFecTraslado: string;
989
+ guiaVehiculoPlaca?: string;
990
+ transportistaTipoDoc?: string;
991
+ transportistaNumDoc?: string;
992
+ transportistaRazonSocial?: string;
993
+ transportistaNroMtc?: string;
994
+ guiaPartidaUbigeo: string;
995
+ guiaPartidaDireccion: string;
996
+ chofer?: {
997
+ tipo: "Principal" | "Secundario";
998
+ tipoDoc: string;
999
+ nroDoc: string;
1000
+ licencia: string;
1001
+ nombres: string;
1002
+ apellidos: string;
1003
+ }[];
1004
+ guiaFecEntrega?: string;
1005
+ guiaDesTraslado?: string;
1006
+ guiaPesoNeto?: number;
1007
+ guiaSustentoPeso?: string;
1008
+ guiaNumBultos?: number;
1009
+ indicadores?: {
1010
+ transbordoProgramado?: boolean;
1011
+ vehiculoM1L?: boolean;
1012
+ retornoVehiculoEnvaseVacio?: boolean;
1013
+ retornoVehiculoVacio?: boolean;
1014
+ trasladoTotalDamDs?: boolean;
1015
+ registroTransportista?: boolean;
1016
+ trasladoContenedorManifiesto?: boolean;
1017
+ };
1018
+ contenedores?: {
1019
+ numero: string;
1020
+ precinto?: string;
1021
+ }[];
1022
+ guiaVehiculoTuc?: string;
1023
+ guiaVehiculoAutorizacion?: string;
1024
+ guiaVehiculoAutorizacionEntidad?: string;
1025
+ vehiculosSecundarios?: {
1026
+ placa: string;
1027
+ tuc?: string;
1028
+ autorizacion?: string;
1029
+ autorizacionEntidad?: string;
1030
+ }[];
1031
+ transportistaAutorizacion?: string;
1032
+ transportistaAutorizacionEntidad?: string;
1033
+ guiaPartidaRuc?: string;
1034
+ guiaPartidaCodLocal?: string;
1035
+ guiaPartidaGeo?: {
1036
+ lat: string;
1037
+ lon: string;
1038
+ };
1039
+ guiaLlegadaRuc?: string;
1040
+ guiaLlegadaCodLocal?: string;
1041
+ guiaLlegadaGeo?: {
1042
+ lat: string;
1043
+ lon: string;
1044
+ };
1045
+ documentosRelacionados?: {
1046
+ codTipo: string;
1047
+ numero: string;
1048
+ tipoDesc?: string;
1049
+ emisorRuc?: string;
1050
+ }[];
1051
+ remitenteAutorizacion?: string;
1052
+ remitenteAutorizacionEntidad?: string;
1053
+ proveedorTipoDoc?: string;
1054
+ proveedorNumDoc?: string;
1055
+ proveedorRazonSocial?: string;
1056
+ compradorTipoDoc?: string;
1057
+ compradorNumDoc?: string;
1058
+ compradorRazonSocial?: string;
1059
+ puertoCodigo?: string;
1060
+ puertoNombre?: string;
1061
+ puertoTipo?: string;
1062
+ destinos: {
1063
+ clienteTipoDoc: string;
1064
+ clienteNumDoc: string;
1065
+ clienteRazonSocial: string;
1066
+ clienteDireccion?: string;
1067
+ clienteDistrito?: string;
1068
+ clienteProvincia?: string;
1069
+ clienteDepartamento?: string;
1070
+ destinatarioContacto?: string;
1071
+ destinatarioTelefono?: string;
1072
+ destinatarioEmail?: string;
1073
+ entregaReferencia?: string;
1074
+ modalidadEntrega?: "DOMICILIO" | "AGENCIA";
1075
+ agenciaNombre?: string;
1076
+ agenciaSede?: string;
1077
+ guiaLlegadaUbigeo: string;
1078
+ guiaLlegadaDireccion: string;
1079
+ guiaPesoTotal: number;
1080
+ guiaUndPesoTotal?: string;
1081
+ detalle: {
1082
+ unidad: string;
1083
+ cantidad: number;
1084
+ codProducto: string;
1085
+ descripcion: string;
1086
+ }[];
1087
+ }[];
1088
+ };
1089
+ };
1090
+ };
701
1091
  responses: {
702
- 200: {
1092
+ 202: {
703
1093
  headers: {
704
1094
  [name: string]: unknown;
705
1095
  };
706
1096
  content: {
707
1097
  "application/json": {
708
1098
  success: boolean;
709
- data: {
710
- id: string;
711
- env: "live" | "test";
712
- tipoDoc: string;
713
- serie: string;
714
- correlativo: string;
715
- fechaEmision: string;
716
- tipoMoneda: string;
717
- clienteNumDoc: string;
718
- clienteRazonSocial: string;
719
- montoImpVenta: string;
720
- estadoSunat: string;
721
- codigoRespuesta: string | null;
722
- hashCdr: string | null;
723
- createdAt: string;
724
- company: {
725
- ruc: string;
726
- razonSocial: string;
727
- };
728
- }[];
729
- pagination: {
730
- page: number;
731
- limit: number;
1099
+ message: string;
1100
+ data?: {
732
1101
  total: number;
733
- totalPages: number;
1102
+ emitidas: number;
1103
+ fallidas: number;
1104
+ guias: {
1105
+ success: boolean;
1106
+ message: string;
1107
+ code?: string;
1108
+ destino: number;
1109
+ data?: {
1110
+ id: string;
1111
+ estado: string;
1112
+ hash: string | null;
1113
+ signatureValue: string | null;
1114
+ jobId?: string;
1115
+ };
1116
+ }[];
734
1117
  };
735
1118
  };
736
1119
  };
737
1120
  };
738
- };
739
- }, {
1121
+ 400: {
1122
+ headers: {
1123
+ [name: string]: unknown;
1124
+ };
1125
+ content: {
1126
+ "application/json": {
1127
+ success: false;
1128
+ message: string;
1129
+ code?: string;
1130
+ errors?: {
1131
+ path: string;
1132
+ message: string;
1133
+ }[];
1134
+ };
1135
+ };
1136
+ };
1137
+ };
1138
+ }, {
1139
+ body: {
1140
+ tipoDoc: "09";
1141
+ serie: string;
1142
+ observacion?: string;
1143
+ fechaEmision: string;
1144
+ empresaRuc: string;
1145
+ establecimientoCodigo?: string;
1146
+ guiaCodTraslado: string;
1147
+ guiaModTraslado: "01" | "02";
1148
+ guiaFecTraslado: string;
1149
+ guiaVehiculoPlaca?: string;
1150
+ transportistaTipoDoc?: string;
1151
+ transportistaNumDoc?: string;
1152
+ transportistaRazonSocial?: string;
1153
+ transportistaNroMtc?: string;
1154
+ guiaPartidaUbigeo: string;
1155
+ guiaPartidaDireccion: string;
1156
+ chofer?: {
1157
+ tipo: "Principal" | "Secundario";
1158
+ tipoDoc: string;
1159
+ nroDoc: string;
1160
+ licencia: string;
1161
+ nombres: string;
1162
+ apellidos: string;
1163
+ }[];
1164
+ guiaFecEntrega?: string;
1165
+ guiaDesTraslado?: string;
1166
+ guiaPesoNeto?: number;
1167
+ guiaSustentoPeso?: string;
1168
+ guiaNumBultos?: number;
1169
+ indicadores?: {
1170
+ transbordoProgramado?: boolean;
1171
+ vehiculoM1L?: boolean;
1172
+ retornoVehiculoEnvaseVacio?: boolean;
1173
+ retornoVehiculoVacio?: boolean;
1174
+ trasladoTotalDamDs?: boolean;
1175
+ registroTransportista?: boolean;
1176
+ trasladoContenedorManifiesto?: boolean;
1177
+ };
1178
+ contenedores?: {
1179
+ numero: string;
1180
+ precinto?: string;
1181
+ }[];
1182
+ guiaVehiculoTuc?: string;
1183
+ guiaVehiculoAutorizacion?: string;
1184
+ guiaVehiculoAutorizacionEntidad?: string;
1185
+ vehiculosSecundarios?: {
1186
+ placa: string;
1187
+ tuc?: string;
1188
+ autorizacion?: string;
1189
+ autorizacionEntidad?: string;
1190
+ }[];
1191
+ transportistaAutorizacion?: string;
1192
+ transportistaAutorizacionEntidad?: string;
1193
+ guiaPartidaRuc?: string;
1194
+ guiaPartidaCodLocal?: string;
1195
+ guiaPartidaGeo?: {
1196
+ lat: string;
1197
+ lon: string;
1198
+ };
1199
+ guiaLlegadaRuc?: string;
1200
+ guiaLlegadaCodLocal?: string;
1201
+ guiaLlegadaGeo?: {
1202
+ lat: string;
1203
+ lon: string;
1204
+ };
1205
+ documentosRelacionados?: {
1206
+ codTipo: string;
1207
+ numero: string;
1208
+ tipoDesc?: string;
1209
+ emisorRuc?: string;
1210
+ }[];
1211
+ remitenteAutorizacion?: string;
1212
+ remitenteAutorizacionEntidad?: string;
1213
+ proveedorTipoDoc?: string;
1214
+ proveedorNumDoc?: string;
1215
+ proveedorRazonSocial?: string;
1216
+ compradorTipoDoc?: string;
1217
+ compradorNumDoc?: string;
1218
+ compradorRazonSocial?: string;
1219
+ puertoCodigo?: string;
1220
+ puertoNombre?: string;
1221
+ puertoTipo?: string;
1222
+ destinos: {
1223
+ clienteTipoDoc: string;
1224
+ clienteNumDoc: string;
1225
+ clienteRazonSocial: string;
1226
+ clienteDireccion?: string;
1227
+ clienteDistrito?: string;
1228
+ clienteProvincia?: string;
1229
+ clienteDepartamento?: string;
1230
+ destinatarioContacto?: string;
1231
+ destinatarioTelefono?: string;
1232
+ destinatarioEmail?: string;
1233
+ entregaReferencia?: string;
1234
+ modalidadEntrega?: "DOMICILIO" | "AGENCIA";
1235
+ agenciaNombre?: string;
1236
+ agenciaSede?: string;
1237
+ guiaLlegadaUbigeo: string;
1238
+ guiaLlegadaDireccion: string;
1239
+ guiaPesoTotal: number;
1240
+ guiaUndPesoTotal?: string;
1241
+ detalle: {
1242
+ unidad: string;
1243
+ cantidad: number;
1244
+ codProducto: string;
1245
+ descripcion: string;
1246
+ }[];
1247
+ }[];
1248
+ };
1249
+ }, `${string}/${string}`>>;
1250
+ /** Envía guía de remisión transportista (31). */
1251
+ sendDespatchTransportista(body: SendDespatchTransportistaInput): Promise<import("openapi-fetch").FetchResponse<{
1252
+ parameters: {
1253
+ query?: never;
1254
+ header?: never;
1255
+ path?: never;
1256
+ cookie?: never;
1257
+ };
1258
+ requestBody: {
1259
+ content: {
1260
+ "application/json": {
1261
+ tipoDoc: "31";
1262
+ serie: string;
1263
+ correlativo: string;
1264
+ observacion?: string;
1265
+ fechaEmision: string;
1266
+ empresaRuc: string;
1267
+ establecimientoCodigo?: string;
1268
+ transportistaNroMtc?: string;
1269
+ destinatarioTipoDoc: string;
1270
+ destinatarioNumDoc: string;
1271
+ destinatarioRazonSocial: string;
1272
+ destinatarioDireccion?: string;
1273
+ destinatarioDistrito?: string;
1274
+ destinatarioProvincia?: string;
1275
+ destinatarioDepartamento?: string;
1276
+ destinatarioContacto?: string;
1277
+ destinatarioTelefono?: string;
1278
+ destinatarioEmail?: string;
1279
+ entregaReferencia?: string;
1280
+ modalidadEntrega?: "DOMICILIO" | "AGENCIA";
1281
+ agenciaNombre?: string;
1282
+ agenciaSede?: string;
1283
+ remitenteTipoDoc: string;
1284
+ remitenteNumDoc: string;
1285
+ remitenteRazonSocial: string;
1286
+ guiaCodTraslado: string;
1287
+ guiaDesTraslado?: string;
1288
+ guiaPesoTotal: number;
1289
+ guiaUndPesoTotal?: string;
1290
+ guiaNumBultos?: number;
1291
+ guiaFecTraslado: string;
1292
+ chofer: {
1293
+ tipo: "Principal" | "Secundario";
1294
+ tipoDoc: string;
1295
+ nroDoc: string;
1296
+ licencia: string;
1297
+ nombres: string;
1298
+ apellidos: string;
1299
+ }[];
1300
+ guiaVehiculoPlaca: string;
1301
+ guiaVehiculoTuc?: string;
1302
+ vehiculosSecundarios?: {
1303
+ placa: string;
1304
+ tuc?: string;
1305
+ }[];
1306
+ guiaPartidaUbigeo: string;
1307
+ guiaPartidaDireccion: string;
1308
+ guiaLlegadaUbigeo: string;
1309
+ guiaLlegadaDireccion: string;
1310
+ documentosRelacionados?: {
1311
+ codTipo: string;
1312
+ numero: string;
1313
+ tipoDesc?: string;
1314
+ emisorRuc?: string;
1315
+ }[];
1316
+ detalle: {
1317
+ unidad: string;
1318
+ cantidad: number;
1319
+ codProducto: string;
1320
+ descripcion: string;
1321
+ }[];
1322
+ };
1323
+ };
1324
+ };
1325
+ responses: {
1326
+ 202: {
1327
+ headers: {
1328
+ [name: string]: unknown;
1329
+ };
1330
+ content: {
1331
+ "application/json": {
1332
+ success: boolean;
1333
+ message: string;
1334
+ data?: {
1335
+ id: string;
1336
+ estado: string;
1337
+ hash: string | null;
1338
+ signatureValue: string | null;
1339
+ jobId?: string;
1340
+ };
1341
+ };
1342
+ };
1343
+ };
1344
+ 400: {
1345
+ headers: {
1346
+ [name: string]: unknown;
1347
+ };
1348
+ content: {
1349
+ "application/json": {
1350
+ success: false;
1351
+ message: string;
1352
+ code?: string;
1353
+ errors?: {
1354
+ path: string;
1355
+ message: string;
1356
+ }[];
1357
+ };
1358
+ };
1359
+ };
1360
+ 409: {
1361
+ headers: {
1362
+ [name: string]: unknown;
1363
+ };
1364
+ content: {
1365
+ "application/json": {
1366
+ success: false;
1367
+ message: string;
1368
+ code?: string;
1369
+ errors?: {
1370
+ path: string;
1371
+ message: string;
1372
+ }[];
1373
+ };
1374
+ };
1375
+ };
1376
+ };
1377
+ }, {
1378
+ body: {
1379
+ tipoDoc: "31";
1380
+ serie: string;
1381
+ correlativo: string;
1382
+ observacion?: string;
1383
+ fechaEmision: string;
1384
+ empresaRuc: string;
1385
+ establecimientoCodigo?: string;
1386
+ transportistaNroMtc?: string;
1387
+ destinatarioTipoDoc: string;
1388
+ destinatarioNumDoc: string;
1389
+ destinatarioRazonSocial: string;
1390
+ destinatarioDireccion?: string;
1391
+ destinatarioDistrito?: string;
1392
+ destinatarioProvincia?: string;
1393
+ destinatarioDepartamento?: string;
1394
+ destinatarioContacto?: string;
1395
+ destinatarioTelefono?: string;
1396
+ destinatarioEmail?: string;
1397
+ entregaReferencia?: string;
1398
+ modalidadEntrega?: "DOMICILIO" | "AGENCIA";
1399
+ agenciaNombre?: string;
1400
+ agenciaSede?: string;
1401
+ remitenteTipoDoc: string;
1402
+ remitenteNumDoc: string;
1403
+ remitenteRazonSocial: string;
1404
+ guiaCodTraslado: string;
1405
+ guiaDesTraslado?: string;
1406
+ guiaPesoTotal: number;
1407
+ guiaUndPesoTotal?: string;
1408
+ guiaNumBultos?: number;
1409
+ guiaFecTraslado: string;
1410
+ chofer: {
1411
+ tipo: "Principal" | "Secundario";
1412
+ tipoDoc: string;
1413
+ nroDoc: string;
1414
+ licencia: string;
1415
+ nombres: string;
1416
+ apellidos: string;
1417
+ }[];
1418
+ guiaVehiculoPlaca: string;
1419
+ guiaVehiculoTuc?: string;
1420
+ vehiculosSecundarios?: {
1421
+ placa: string;
1422
+ tuc?: string;
1423
+ }[];
1424
+ guiaPartidaUbigeo: string;
1425
+ guiaPartidaDireccion: string;
1426
+ guiaLlegadaUbigeo: string;
1427
+ guiaLlegadaDireccion: string;
1428
+ documentosRelacionados?: {
1429
+ codTipo: string;
1430
+ numero: string;
1431
+ tipoDesc?: string;
1432
+ emisorRuc?: string;
1433
+ }[];
1434
+ detalle: {
1435
+ unidad: string;
1436
+ cantidad: number;
1437
+ codProducto: string;
1438
+ descripcion: string;
1439
+ }[];
1440
+ };
1441
+ }, `${string}/${string}`>>;
1442
+ /** Anula una factura (comunicación de baja). */
1443
+ cancelInvoice(body: CancelInvoiceInput): Promise<import("openapi-fetch").FetchResponse<{
1444
+ parameters: {
1445
+ query?: never;
1446
+ header?: never;
1447
+ path?: never;
1448
+ cookie?: never;
1449
+ };
1450
+ requestBody: {
1451
+ content: {
1452
+ "application/json": {
1453
+ empresaRuc: string;
1454
+ tipoDoc: "01" | "07" | "08";
1455
+ serie: string;
1456
+ correlativo: string;
1457
+ motivoBaja: string;
1458
+ raCorrelativo?: string;
1459
+ };
1460
+ };
1461
+ };
1462
+ responses: {
1463
+ 202: {
1464
+ headers: {
1465
+ [name: string]: unknown;
1466
+ };
1467
+ content: {
1468
+ "application/json": {
1469
+ success: boolean;
1470
+ message: string;
1471
+ data?: {
1472
+ id?: string;
1473
+ estado?: string;
1474
+ ticket?: string;
1475
+ hash?: string | null;
1476
+ };
1477
+ };
1478
+ };
1479
+ };
1480
+ 400: {
1481
+ headers: {
1482
+ [name: string]: unknown;
1483
+ };
1484
+ content: {
1485
+ "application/json": {
1486
+ success: false;
1487
+ message: string;
1488
+ code?: string;
1489
+ errors?: {
1490
+ path: string;
1491
+ message: string;
1492
+ }[];
1493
+ };
1494
+ };
1495
+ };
1496
+ };
1497
+ }, {
1498
+ body: {
1499
+ empresaRuc: string;
1500
+ tipoDoc: "01" | "07" | "08";
1501
+ serie: string;
1502
+ correlativo: string;
1503
+ motivoBaja: string;
1504
+ raCorrelativo?: string;
1505
+ };
1506
+ }, `${string}/${string}`>>;
1507
+ /** Anula una boleta (resumen diario de baja). */
1508
+ cancelBoleta(body: CancelBoletaInput): Promise<import("openapi-fetch").FetchResponse<{
1509
+ parameters: {
1510
+ query?: never;
1511
+ header?: never;
1512
+ path?: never;
1513
+ cookie?: never;
1514
+ };
1515
+ requestBody: {
1516
+ content: {
1517
+ "application/json": {
1518
+ empresaRuc: string;
1519
+ serie: string;
1520
+ correlativo: string;
1521
+ motivoBaja: string;
1522
+ rcCorrelativo?: string;
1523
+ };
1524
+ };
1525
+ };
1526
+ responses: {
1527
+ 202: {
1528
+ headers: {
1529
+ [name: string]: unknown;
1530
+ };
1531
+ content: {
1532
+ "application/json": {
1533
+ success: boolean;
1534
+ message: string;
1535
+ data?: {
1536
+ id?: string;
1537
+ estado?: string;
1538
+ ticket?: string;
1539
+ hash?: string | null;
1540
+ };
1541
+ };
1542
+ };
1543
+ };
1544
+ 400: {
1545
+ headers: {
1546
+ [name: string]: unknown;
1547
+ };
1548
+ content: {
1549
+ "application/json": {
1550
+ success: false;
1551
+ message: string;
1552
+ code?: string;
1553
+ errors?: {
1554
+ path: string;
1555
+ message: string;
1556
+ }[];
1557
+ };
1558
+ };
1559
+ };
1560
+ };
1561
+ }, {
1562
+ body: {
1563
+ empresaRuc: string;
1564
+ serie: string;
1565
+ correlativo: string;
1566
+ motivoBaja: string;
1567
+ rcCorrelativo?: string;
1568
+ };
1569
+ }, `${string}/${string}`>>;
1570
+ /** Envía un Resumen Diario (RC). */
1571
+ sendSummary(body: SendSummaryInput): Promise<import("openapi-fetch").FetchResponse<{
1572
+ parameters: {
1573
+ query?: never;
1574
+ header?: never;
1575
+ path?: never;
1576
+ cookie?: never;
1577
+ };
1578
+ requestBody: {
1579
+ content: {
1580
+ "application/json": {
1581
+ empresaRuc: string;
1582
+ correlativo: string;
1583
+ fechaEmision: string;
1584
+ fechaReferencia: string;
1585
+ items: {
1586
+ tipoDoc: string;
1587
+ serie: string;
1588
+ correlativo: string;
1589
+ clienteTipoDoc: string;
1590
+ clienteNumDoc: string;
1591
+ estadoItem: "1" | "2" | "3";
1592
+ tipoMoneda?: string;
1593
+ montoOperGravadas?: number;
1594
+ montoOperExoneradas?: number;
1595
+ montoOperInafectas?: number;
1596
+ montoOperGratuitas?: number;
1597
+ montoIgv?: number;
1598
+ montoIsc?: number;
1599
+ montoOtrosCargos?: number;
1600
+ montoTotal: number;
1601
+ }[];
1602
+ };
1603
+ };
1604
+ };
1605
+ responses: {
1606
+ 202: {
1607
+ headers: {
1608
+ [name: string]: unknown;
1609
+ };
1610
+ content: {
1611
+ "application/json": {
1612
+ success: boolean;
1613
+ message: string;
1614
+ data?: {
1615
+ id?: string;
1616
+ estado?: string;
1617
+ ticket?: string;
1618
+ hash?: string | null;
1619
+ };
1620
+ };
1621
+ };
1622
+ };
1623
+ 400: {
1624
+ headers: {
1625
+ [name: string]: unknown;
1626
+ };
1627
+ content: {
1628
+ "application/json": {
1629
+ success: false;
1630
+ message: string;
1631
+ code?: string;
1632
+ errors?: {
1633
+ path: string;
1634
+ message: string;
1635
+ }[];
1636
+ };
1637
+ };
1638
+ };
1639
+ };
1640
+ }, {
1641
+ body: {
1642
+ empresaRuc: string;
1643
+ correlativo: string;
1644
+ fechaEmision: string;
1645
+ fechaReferencia: string;
1646
+ items: {
1647
+ tipoDoc: string;
1648
+ serie: string;
1649
+ correlativo: string;
1650
+ clienteTipoDoc: string;
1651
+ clienteNumDoc: string;
1652
+ estadoItem: "1" | "2" | "3";
1653
+ tipoMoneda?: string;
1654
+ montoOperGravadas?: number;
1655
+ montoOperExoneradas?: number;
1656
+ montoOperInafectas?: number;
1657
+ montoOperGratuitas?: number;
1658
+ montoIgv?: number;
1659
+ montoIsc?: number;
1660
+ montoOtrosCargos?: number;
1661
+ montoTotal: number;
1662
+ }[];
1663
+ };
1664
+ }, `${string}/${string}`>>;
1665
+ /** Envía una Comunicación de Baja (RA). */
1666
+ sendVoided(body: SendVoidedInput): Promise<import("openapi-fetch").FetchResponse<{
1667
+ parameters: {
1668
+ query?: never;
1669
+ header?: never;
1670
+ path?: never;
1671
+ cookie?: never;
1672
+ };
1673
+ requestBody: {
1674
+ content: {
1675
+ "application/json": {
1676
+ empresaRuc: string;
1677
+ correlativo: string;
1678
+ fechaEmision: string;
1679
+ fechaReferencia: string;
1680
+ items: {
1681
+ tipoDoc: string;
1682
+ serie: string;
1683
+ correlativo: string;
1684
+ motivoBaja: string;
1685
+ }[];
1686
+ };
1687
+ };
1688
+ };
1689
+ responses: {
1690
+ 202: {
1691
+ headers: {
1692
+ [name: string]: unknown;
1693
+ };
1694
+ content: {
1695
+ "application/json": {
1696
+ success: boolean;
1697
+ message: string;
1698
+ data?: {
1699
+ id?: string;
1700
+ estado?: string;
1701
+ ticket?: string;
1702
+ hash?: string | null;
1703
+ };
1704
+ };
1705
+ };
1706
+ };
1707
+ 400: {
1708
+ headers: {
1709
+ [name: string]: unknown;
1710
+ };
1711
+ content: {
1712
+ "application/json": {
1713
+ success: false;
1714
+ message: string;
1715
+ code?: string;
1716
+ errors?: {
1717
+ path: string;
1718
+ message: string;
1719
+ }[];
1720
+ };
1721
+ };
1722
+ };
1723
+ };
1724
+ }, {
1725
+ body: {
1726
+ empresaRuc: string;
1727
+ correlativo: string;
1728
+ fechaEmision: string;
1729
+ fechaReferencia: string;
1730
+ items: {
1731
+ tipoDoc: string;
1732
+ serie: string;
1733
+ correlativo: string;
1734
+ motivoBaja: string;
1735
+ }[];
1736
+ };
1737
+ }, `${string}/${string}`>>;
1738
+ /** Consulta el estado de un ticket asíncrono (sendSummary). */
1739
+ getTicketStatus(ticket: string, ruc: string): Promise<import("openapi-fetch").FetchResponse<{
1740
+ parameters: {
1741
+ query: {
1742
+ ruc: string;
1743
+ };
1744
+ header?: never;
1745
+ path: {
1746
+ ticket: string;
1747
+ };
1748
+ cookie?: never;
1749
+ };
1750
+ requestBody?: never;
1751
+ responses: {
1752
+ 200: {
1753
+ headers: {
1754
+ [name: string]: unknown;
1755
+ };
1756
+ content: {
1757
+ "application/json": {
1758
+ success: boolean;
1759
+ message: string;
1760
+ statusCode: string;
1761
+ cdrResponse?: {
1762
+ id: string;
1763
+ code: string;
1764
+ description: string;
1765
+ notes: string[];
1766
+ };
1767
+ };
1768
+ };
1769
+ };
1770
+ 202: {
1771
+ headers: {
1772
+ [name: string]: unknown;
1773
+ };
1774
+ content: {
1775
+ "application/json": {
1776
+ success: boolean;
1777
+ message: string;
1778
+ statusCode: string;
1779
+ cdrResponse?: {
1780
+ id: string;
1781
+ code: string;
1782
+ description: string;
1783
+ notes: string[];
1784
+ };
1785
+ };
1786
+ };
1787
+ };
1788
+ };
1789
+ }, {
1790
+ params: {
1791
+ path: {
1792
+ ticket: string;
1793
+ };
1794
+ query: {
1795
+ ruc: string;
1796
+ };
1797
+ };
1798
+ }, `${string}/${string}`>>;
1799
+ /** Lista documentos con filtros y paginación. */
1800
+ listDocuments(query?: paths["/api/v1/documents"]["get"]["parameters"]["query"]): Promise<import("openapi-fetch").FetchResponse<{
1801
+ parameters: {
1802
+ query?: {
1803
+ ruc?: string;
1804
+ tipoDoc?: string;
1805
+ serie?: string;
1806
+ estado?: string;
1807
+ env?: "live" | "test";
1808
+ fechaDesde?: string;
1809
+ fechaHasta?: string;
1810
+ clienteNumDoc?: string;
1811
+ page?: number;
1812
+ limit?: number;
1813
+ };
1814
+ header?: never;
1815
+ path?: never;
1816
+ cookie?: never;
1817
+ };
1818
+ requestBody?: never;
1819
+ responses: {
1820
+ 200: {
1821
+ headers: {
1822
+ [name: string]: unknown;
1823
+ };
1824
+ content: {
1825
+ "application/json": {
1826
+ success: boolean;
1827
+ data: {
1828
+ id: string;
1829
+ env: "live" | "test";
1830
+ tipoDoc: string;
1831
+ serie: string;
1832
+ correlativo: string;
1833
+ fechaEmision: string;
1834
+ tipoMoneda: string;
1835
+ clienteNumDoc: string;
1836
+ clienteRazonSocial: string;
1837
+ montoImpVenta: string;
1838
+ estadoSunat: string;
1839
+ codigoRespuesta: string | null;
1840
+ hashCdr: string | null;
1841
+ createdAt: string;
1842
+ company: {
1843
+ ruc: string;
1844
+ razonSocial: string;
1845
+ };
1846
+ }[];
1847
+ pagination: {
1848
+ page: number;
1849
+ limit: number;
1850
+ total: number;
1851
+ totalPages: number;
1852
+ };
1853
+ };
1854
+ };
1855
+ };
1856
+ };
1857
+ }, {
1858
+ params: {
1859
+ query: {
1860
+ ruc?: string;
1861
+ tipoDoc?: string;
1862
+ serie?: string;
1863
+ estado?: string;
1864
+ env?: "live" | "test";
1865
+ fechaDesde?: string;
1866
+ fechaHasta?: string;
1867
+ clienteNumDoc?: string;
1868
+ page?: number;
1869
+ limit?: number;
1870
+ } | undefined;
1871
+ };
1872
+ }, `${string}/${string}`>>;
1873
+ /** Detalle de un documento por ID. */
1874
+ getDocument(id: string): Promise<import("openapi-fetch").FetchResponse<{
1875
+ parameters: {
1876
+ query?: never;
1877
+ header?: never;
1878
+ path: {
1879
+ id: string;
1880
+ };
1881
+ cookie?: never;
1882
+ };
1883
+ requestBody?: never;
1884
+ responses: {
1885
+ 200: {
1886
+ headers: {
1887
+ [name: string]: unknown;
1888
+ };
1889
+ content?: never;
1890
+ };
1891
+ };
1892
+ }, {
1893
+ params: {
1894
+ path: {
1895
+ id: string;
1896
+ };
1897
+ };
1898
+ }, `${string}/${string}`>>;
1899
+ /** Re-encola un documento fallido (COLA_FALLIDA). */
1900
+ retryDocument(id: string): Promise<import("openapi-fetch").FetchResponse<{
1901
+ parameters: {
1902
+ query?: never;
1903
+ header?: never;
1904
+ path: {
1905
+ id: string;
1906
+ };
1907
+ cookie?: never;
1908
+ };
1909
+ requestBody?: never;
1910
+ responses: {
1911
+ 202: {
1912
+ headers: {
1913
+ [name: string]: unknown;
1914
+ };
1915
+ content: {
1916
+ "application/json": {
1917
+ success: boolean;
1918
+ message: string;
1919
+ jobId?: string;
1920
+ };
1921
+ };
1922
+ };
1923
+ 400: {
1924
+ headers: {
1925
+ [name: string]: unknown;
1926
+ };
1927
+ content: {
1928
+ "application/json": {
1929
+ success: false;
1930
+ message: string;
1931
+ code?: string;
1932
+ errors?: {
1933
+ path: string;
1934
+ message: string;
1935
+ }[];
1936
+ };
1937
+ };
1938
+ };
1939
+ };
1940
+ }, {
1941
+ params: {
1942
+ path: {
1943
+ id: string;
1944
+ };
1945
+ };
1946
+ }, `${string}/${string}`>>;
1947
+ /** Siguiente correlativo disponible para una serie (por ambiente). */
1948
+ getNextCorrelativo(query: paths["/api/v1/documents/next-correlativo"]["get"]["parameters"]["query"]): Promise<import("openapi-fetch").FetchResponse<{
1949
+ parameters: {
1950
+ query: {
1951
+ companyRuc: string;
1952
+ tipoDoc: string;
1953
+ serie: string;
1954
+ };
1955
+ header?: never;
1956
+ path?: never;
1957
+ cookie?: never;
1958
+ };
1959
+ requestBody?: never;
1960
+ responses: {
1961
+ 200: {
1962
+ headers: {
1963
+ [name: string]: unknown;
1964
+ };
1965
+ content: {
1966
+ "application/json": {
1967
+ success: true;
1968
+ data: {
1969
+ next: string;
1970
+ };
1971
+ };
1972
+ };
1973
+ };
1974
+ 404: {
1975
+ headers: {
1976
+ [name: string]: unknown;
1977
+ };
1978
+ content: {
1979
+ "application/json": {
1980
+ success: false;
1981
+ message: string;
1982
+ code?: string;
1983
+ errors?: {
1984
+ path: string;
1985
+ message: string;
1986
+ }[];
1987
+ };
1988
+ };
1989
+ };
1990
+ };
1991
+ }, {
1992
+ params: {
1993
+ query: {
1994
+ companyRuc: string;
1995
+ tipoDoc: string;
1996
+ serie: string;
1997
+ };
1998
+ };
1999
+ }, `${string}/${string}`>>;
2000
+ /**
2001
+ * Consulta el CDR de un comprobante directamente en SUNAT, por referencia
2002
+ * (ruc/tipo/serie/número). Sirve cuando el documento no está en la API o su
2003
+ * estado local quedó desincronizado.
2004
+ */
2005
+ consultarCdr(body: ConsultarCdrInput): Promise<import("openapi-fetch").FetchResponse<{
2006
+ parameters: {
2007
+ query?: never;
2008
+ header?: never;
2009
+ path?: never;
2010
+ cookie?: never;
2011
+ };
2012
+ requestBody: {
2013
+ content: {
2014
+ "application/json": {
2015
+ ruc: string;
2016
+ tipoDoc: "01" | "03" | "07" | "08";
2017
+ serie: string;
2018
+ numero: string;
2019
+ };
2020
+ };
2021
+ };
2022
+ responses: {
2023
+ 200: {
2024
+ headers: {
2025
+ [name: string]: unknown;
2026
+ };
2027
+ content: {
2028
+ "application/json": {
2029
+ success: boolean;
2030
+ available: boolean;
2031
+ message: string;
2032
+ statusCode?: string;
2033
+ codigo?: string;
2034
+ descripcion?: string;
2035
+ cdrZipBase64?: string;
2036
+ };
2037
+ };
2038
+ };
2039
+ 400: {
2040
+ headers: {
2041
+ [name: string]: unknown;
2042
+ };
2043
+ content: {
2044
+ "application/json": {
2045
+ success: false;
2046
+ message: string;
2047
+ code?: string;
2048
+ errors?: {
2049
+ path: string;
2050
+ message: string;
2051
+ }[];
2052
+ };
2053
+ };
2054
+ };
2055
+ 404: {
2056
+ headers: {
2057
+ [name: string]: unknown;
2058
+ };
2059
+ content: {
2060
+ "application/json": {
2061
+ success: false;
2062
+ message: string;
2063
+ code?: string;
2064
+ errors?: {
2065
+ path: string;
2066
+ message: string;
2067
+ }[];
2068
+ };
2069
+ };
2070
+ };
2071
+ };
2072
+ }, {
2073
+ body: {
2074
+ ruc: string;
2075
+ tipoDoc: "01" | "03" | "07" | "08";
2076
+ serie: string;
2077
+ numero: string;
2078
+ };
2079
+ }, `${string}/${string}`>>;
2080
+ /** XML firmado de una factura/boleta. */
2081
+ getInvoiceXml(id: string): Promise<ArrayBuffer>;
2082
+ /** CDR (constancia SUNAT) de una factura/boleta. */
2083
+ getInvoiceCdr(id: string): Promise<ArrayBuffer>;
2084
+ /** PDF de una factura/boleta. */
2085
+ getInvoicePdf(id: string): Promise<ArrayBuffer>;
2086
+ /** XML firmado de una nota (07/08). */
2087
+ getNoteXml(id: string): Promise<ArrayBuffer>;
2088
+ /** PDF de una nota (07/08). */
2089
+ getNotePdf(id: string): Promise<ArrayBuffer>;
2090
+ /** CDR (constancia SUNAT) de una nota (07/08). */
2091
+ getNoteCdr(id: string): Promise<ArrayBuffer>;
2092
+ /** XML firmado de una guía de remisión (09/31). */
2093
+ getDespatchXml(id: string): Promise<ArrayBuffer>;
2094
+ /** CDR (constancia SUNAT) de una guía de remisión (09/31). */
2095
+ getDespatchCdr(id: string): Promise<ArrayBuffer>;
2096
+ /** PDF de una guía de remisión (09/31). `format`: a4 | ticket80 | ticket58. */
2097
+ getDespatchPdf(id: string, format?: NonNullable<paths["/api/v1/despatch/{id}/pdf"]["get"]["parameters"]["query"]>["format"]): Promise<ArrayBuffer>;
2098
+ /** Lista las empresas accesibles por la key. */
2099
+ listCompanies(): Promise<import("openapi-fetch").FetchResponse<{
2100
+ parameters: {
2101
+ query?: never;
2102
+ header?: never;
2103
+ path?: never;
2104
+ cookie?: never;
2105
+ };
2106
+ requestBody?: never;
2107
+ responses: {
2108
+ 200: {
2109
+ headers: {
2110
+ [name: string]: unknown;
2111
+ };
2112
+ content?: never;
2113
+ };
2114
+ };
2115
+ }, {}, `${string}/${string}`>>;
2116
+ /** Detalle de una empresa por ID. */
2117
+ getCompany(id: string): Promise<import("openapi-fetch").FetchResponse<{
2118
+ parameters: {
2119
+ query?: never;
2120
+ header?: never;
2121
+ path: {
2122
+ id: string;
2123
+ };
2124
+ cookie?: never;
2125
+ };
2126
+ requestBody?: never;
2127
+ responses: {
2128
+ 200: {
2129
+ headers: {
2130
+ [name: string]: unknown;
2131
+ };
2132
+ content?: never;
2133
+ };
2134
+ };
2135
+ }, {
740
2136
  params: {
741
- query: {
2137
+ path: {
2138
+ id: string;
2139
+ };
2140
+ };
2141
+ }, `${string}/${string}`>>;
2142
+ /** Logo de la empresa (imagen). */
2143
+ getCompanyLogo(id: string): Promise<ArrayBuffer>;
2144
+ /** Crea una suscripción a webhooks. El secret se devuelve UNA sola vez. */
2145
+ createWebhook(body: CreateWebhookInput): Promise<import("openapi-fetch").FetchResponse<{
2146
+ parameters: {
2147
+ query?: never;
2148
+ header?: never;
2149
+ path?: never;
2150
+ cookie?: never;
2151
+ };
2152
+ requestBody: {
2153
+ content: {
2154
+ "application/json": {
2155
+ empresaRuc: string;
2156
+ url: string;
2157
+ events: ("document.accepted" | "document.rejected" | "document.queue_failed" | "document.retried" | "ticket.resolved")[];
2158
+ description?: string;
2159
+ secret?: string;
2160
+ };
2161
+ };
2162
+ };
2163
+ responses: {
2164
+ 200: {
2165
+ headers: {
2166
+ [name: string]: unknown;
2167
+ };
2168
+ content?: never;
2169
+ };
2170
+ };
2171
+ }, {
2172
+ body: {
2173
+ empresaRuc: string;
2174
+ url: string;
2175
+ events: ("document.accepted" | "document.rejected" | "document.queue_failed" | "document.retried" | "ticket.resolved")[];
2176
+ description?: string;
2177
+ secret?: string;
2178
+ };
2179
+ }, `${string}/${string}`>>;
2180
+ /** Lista las suscripciones de webhooks. */
2181
+ listWebhooks(): Promise<import("openapi-fetch").FetchResponse<{
2182
+ parameters: {
2183
+ query?: {
742
2184
  ruc?: string;
743
- tipoDoc?: string;
744
- serie?: string;
745
- estado?: string;
746
- env?: "live" | "test";
747
- fechaDesde?: string;
748
- fechaHasta?: string;
749
- clienteNumDoc?: string;
750
- page?: number;
2185
+ };
2186
+ header?: never;
2187
+ path?: never;
2188
+ cookie?: never;
2189
+ };
2190
+ requestBody?: never;
2191
+ responses: {
2192
+ 200: {
2193
+ headers: {
2194
+ [name: string]: unknown;
2195
+ };
2196
+ content?: never;
2197
+ };
2198
+ };
2199
+ }, {}, `${string}/${string}`>>;
2200
+ /** Detalle de una suscripción de webhook. */
2201
+ getWebhook(id: string): Promise<import("openapi-fetch").FetchResponse<{
2202
+ parameters: {
2203
+ query?: never;
2204
+ header?: never;
2205
+ path: {
2206
+ id: string;
2207
+ };
2208
+ cookie?: never;
2209
+ };
2210
+ requestBody?: never;
2211
+ responses: {
2212
+ 200: {
2213
+ headers: {
2214
+ [name: string]: unknown;
2215
+ };
2216
+ content?: never;
2217
+ };
2218
+ };
2219
+ }, {
2220
+ params: {
2221
+ path: {
2222
+ id: string;
2223
+ };
2224
+ };
2225
+ }, `${string}/${string}`>>;
2226
+ /** Actualiza una suscripción de webhook (url, eventos, isActive). */
2227
+ updateWebhook(id: string, body: UpdateWebhookInput): Promise<import("openapi-fetch").FetchResponse<{
2228
+ parameters: {
2229
+ query?: never;
2230
+ header?: never;
2231
+ path: {
2232
+ id: string;
2233
+ };
2234
+ cookie?: never;
2235
+ };
2236
+ requestBody: {
2237
+ content: {
2238
+ "application/json": {
2239
+ url?: string;
2240
+ events?: ("document.accepted" | "document.rejected" | "document.queue_failed" | "document.retried" | "ticket.resolved")[];
2241
+ description?: string;
2242
+ isActive?: boolean;
2243
+ };
2244
+ };
2245
+ };
2246
+ responses: {
2247
+ 200: {
2248
+ headers: {
2249
+ [name: string]: unknown;
2250
+ };
2251
+ content?: never;
2252
+ };
2253
+ };
2254
+ }, {
2255
+ params: {
2256
+ path: {
2257
+ id: string;
2258
+ };
2259
+ };
2260
+ body: {
2261
+ url?: string;
2262
+ events?: ("document.accepted" | "document.rejected" | "document.queue_failed" | "document.retried" | "ticket.resolved")[];
2263
+ description?: string;
2264
+ isActive?: boolean;
2265
+ };
2266
+ }, `${string}/${string}`>>;
2267
+ /** Elimina una suscripción de webhook. */
2268
+ deleteWebhook(id: string): Promise<import("openapi-fetch").FetchResponse<{
2269
+ parameters: {
2270
+ query?: never;
2271
+ header?: never;
2272
+ path: {
2273
+ id: string;
2274
+ };
2275
+ cookie?: never;
2276
+ };
2277
+ requestBody?: never;
2278
+ responses: {
2279
+ 200: {
2280
+ headers: {
2281
+ [name: string]: unknown;
2282
+ };
2283
+ content?: never;
2284
+ };
2285
+ };
2286
+ }, {
2287
+ params: {
2288
+ path: {
2289
+ id: string;
2290
+ };
2291
+ };
2292
+ }, `${string}/${string}`>>;
2293
+ /** Lista los intentos de entrega de un webhook. */
2294
+ listWebhookDeliveries(id: string): Promise<import("openapi-fetch").FetchResponse<{
2295
+ parameters: {
2296
+ query?: {
751
2297
  limit?: number;
752
- } | undefined;
2298
+ success?: "true" | "false";
2299
+ };
2300
+ header?: never;
2301
+ path: {
2302
+ id: string;
2303
+ };
2304
+ cookie?: never;
2305
+ };
2306
+ requestBody?: never;
2307
+ responses: {
2308
+ 200: {
2309
+ headers: {
2310
+ [name: string]: unknown;
2311
+ };
2312
+ content?: never;
2313
+ };
2314
+ };
2315
+ }, {
2316
+ params: {
2317
+ path: {
2318
+ id: string;
2319
+ };
753
2320
  };
754
2321
  }, `${string}/${string}`>>;
755
- /** Detalle de un documento por ID. */
756
- getDocument(id: string): Promise<import("openapi-fetch").FetchResponse<{
2322
+ /** Reintenta manualmente una entrega de webhook. */
2323
+ redeliverWebhook(id: string, deliveryId: string): Promise<import("openapi-fetch").FetchResponse<{
757
2324
  parameters: {
758
2325
  query?: never;
759
2326
  header?: never;
760
2327
  path: {
761
2328
  id: string;
2329
+ deliveryId: string;
762
2330
  };
763
2331
  cookie?: never;
764
2332
  };
@@ -775,11 +2343,12 @@ export declare class FacturacionClient {
775
2343
  params: {
776
2344
  path: {
777
2345
  id: string;
2346
+ deliveryId: string;
778
2347
  };
779
2348
  };
780
2349
  }, `${string}/${string}`>>;
781
- /** Re-encola un documento fallido (COLA_FALLIDA). */
782
- retryDocument(id: string): Promise<import("openapi-fetch").FetchResponse<{
2350
+ /** Dispara un evento de prueba (webhook.test) para verificar conectividad. */
2351
+ testWebhook(id: string): Promise<import("openapi-fetch").FetchResponse<{
783
2352
  parameters: {
784
2353
  query?: never;
785
2354
  header?: never;
@@ -790,33 +2359,11 @@ export declare class FacturacionClient {
790
2359
  };
791
2360
  requestBody?: never;
792
2361
  responses: {
793
- 202: {
794
- headers: {
795
- [name: string]: unknown;
796
- };
797
- content: {
798
- "application/json": {
799
- success: boolean;
800
- message: string;
801
- jobId?: string;
802
- };
803
- };
804
- };
805
- 400: {
2362
+ 200: {
806
2363
  headers: {
807
2364
  [name: string]: unknown;
808
2365
  };
809
- content: {
810
- "application/json": {
811
- success: false;
812
- message: string;
813
- code?: string;
814
- errors?: {
815
- path: string;
816
- message: string;
817
- }[];
818
- };
819
- };
2366
+ content?: never;
820
2367
  };
821
2368
  };
822
2369
  }, {
@@ -826,186 +2373,69 @@ export declare class FacturacionClient {
826
2373
  };
827
2374
  };
828
2375
  }, `${string}/${string}`>>;
829
- /** Descarga el XML firmado. Retorna ArrayBuffer. */
830
- getInvoiceXml(id: string): Promise<ArrayBuffer>;
831
- /** Descarga el CDR (constancia SUNAT). */
832
- getInvoiceCdr(id: string): Promise<ArrayBuffer>;
833
- /** Descarga el PDF generado. */
834
- getInvoicePdf(id: string): Promise<ArrayBuffer>;
835
- sendSummary(body: paths["/api/v1/summary/send"]["post"]["requestBody"]["content"]["application/json"]): Promise<import("openapi-fetch").FetchResponse<{
2376
+ /** Rota el secret HMAC de un webhook. El nuevo secret se devuelve una sola vez. */
2377
+ rotateWebhookSecret(id: string): Promise<import("openapi-fetch").FetchResponse<{
836
2378
  parameters: {
837
2379
  query?: never;
838
2380
  header?: never;
839
- path?: never;
840
- cookie?: never;
841
- };
842
- requestBody: {
843
- content: {
844
- "application/json": {
845
- empresaRuc: string;
846
- correlativo: string;
847
- fechaEmision: string;
848
- fechaReferencia: string;
849
- items: {
850
- tipoDoc: string;
851
- serie: string;
852
- correlativo: string;
853
- clienteTipoDoc: string;
854
- clienteNumDoc: string;
855
- estadoItem: "1" | "2" | "3";
856
- tipoMoneda?: string;
857
- montoOperGravadas?: number;
858
- montoOperExoneradas?: number;
859
- montoOperInafectas?: number;
860
- montoOperGratuitas?: number;
861
- montoIgv?: number;
862
- montoIsc?: number;
863
- montoOtrosCargos?: number;
864
- montoTotal: number;
865
- }[];
866
- };
2381
+ path: {
2382
+ id: string;
867
2383
  };
2384
+ cookie?: never;
868
2385
  };
2386
+ requestBody?: never;
869
2387
  responses: {
870
- 202: {
871
- headers: {
872
- [name: string]: unknown;
873
- };
874
- content: {
875
- "application/json": {
876
- success: boolean;
877
- message: string;
878
- data?: {
879
- id?: string;
880
- estado?: string;
881
- ticket?: string;
882
- hash?: string | null;
883
- };
884
- };
885
- };
886
- };
887
- 400: {
2388
+ 200: {
888
2389
  headers: {
889
2390
  [name: string]: unknown;
890
2391
  };
891
- content: {
892
- "application/json": {
893
- success: false;
894
- message: string;
895
- code?: string;
896
- errors?: {
897
- path: string;
898
- message: string;
899
- }[];
900
- };
901
- };
2392
+ content?: never;
902
2393
  };
903
2394
  };
904
2395
  }, {
905
- body: {
906
- empresaRuc: string;
907
- correlativo: string;
908
- fechaEmision: string;
909
- fechaReferencia: string;
910
- items: {
911
- tipoDoc: string;
912
- serie: string;
913
- correlativo: string;
914
- clienteTipoDoc: string;
915
- clienteNumDoc: string;
916
- estadoItem: "1" | "2" | "3";
917
- tipoMoneda?: string;
918
- montoOperGravadas?: number;
919
- montoOperExoneradas?: number;
920
- montoOperInafectas?: number;
921
- montoOperGratuitas?: number;
922
- montoIgv?: number;
923
- montoIsc?: number;
924
- montoOtrosCargos?: number;
925
- montoTotal: number;
926
- }[];
2396
+ params: {
2397
+ path: {
2398
+ id: string;
2399
+ };
927
2400
  };
928
2401
  }, `${string}/${string}`>>;
929
- sendVoided(body: paths["/api/v1/voided/send"]["post"]["requestBody"]["content"]["application/json"]): Promise<import("openapi-fetch").FetchResponse<{
2402
+ /** Lista los catálogos SUNAT disponibles. */
2403
+ getCatalogs(): Promise<import("openapi-fetch").FetchResponse<{
930
2404
  parameters: {
931
2405
  query?: never;
932
2406
  header?: never;
933
2407
  path?: never;
934
2408
  cookie?: never;
935
2409
  };
936
- requestBody: {
937
- content: {
938
- "application/json": {
939
- empresaRuc: string;
940
- correlativo: string;
941
- fechaEmision: string;
942
- fechaReferencia: string;
943
- items: {
944
- tipoDoc: string;
945
- serie: string;
946
- correlativo: string;
947
- motivoBaja: string;
948
- }[];
949
- };
950
- };
951
- };
2410
+ requestBody?: never;
952
2411
  responses: {
953
- 202: {
2412
+ 200: {
954
2413
  headers: {
955
2414
  [name: string]: unknown;
956
2415
  };
957
2416
  content: {
958
2417
  "application/json": {
959
2418
  success: boolean;
960
- message: string;
961
- data?: {
962
- id?: string;
963
- estado?: string;
964
- ticket?: string;
965
- hash?: string | null;
966
- };
967
- };
968
- };
969
- };
970
- 400: {
971
- headers: {
972
- [name: string]: unknown;
973
- };
974
- content: {
975
- "application/json": {
976
- success: false;
977
- message: string;
978
- code?: string;
979
- errors?: {
980
- path: string;
981
- message: string;
2419
+ data: {
2420
+ key: string;
2421
+ name: string;
2422
+ items: {
2423
+ code: string;
2424
+ label: string;
2425
+ }[];
982
2426
  }[];
983
2427
  };
984
2428
  };
985
2429
  };
986
2430
  };
987
- }, {
988
- body: {
989
- empresaRuc: string;
990
- correlativo: string;
991
- fechaEmision: string;
992
- fechaReferencia: string;
993
- items: {
994
- tipoDoc: string;
995
- serie: string;
996
- correlativo: string;
997
- motivoBaja: string;
998
- }[];
999
- };
1000
- }, `${string}/${string}`>>;
1001
- getTicketStatus(ticket: string, ruc: string): Promise<import("openapi-fetch").FetchResponse<{
2431
+ }, {}, `${string}/${string}`>>;
2432
+ /** Obtiene un catálogo SUNAT por clave (ej: "07", "61"). */
2433
+ getCatalog(key: string): Promise<import("openapi-fetch").FetchResponse<{
1002
2434
  parameters: {
1003
- query: {
1004
- ruc: string;
1005
- };
2435
+ query?: never;
1006
2436
  header?: never;
1007
2437
  path: {
1008
- ticket: string;
2438
+ key: string;
1009
2439
  };
1010
2440
  cookie?: never;
1011
2441
  };
@@ -1015,72 +2445,30 @@ export declare class FacturacionClient {
1015
2445
  headers: {
1016
2446
  [name: string]: unknown;
1017
2447
  };
1018
- content: {
1019
- "application/json": {
1020
- success: boolean;
1021
- message: string;
1022
- statusCode: string;
1023
- cdrResponse?: {
1024
- id: string;
1025
- code: string;
1026
- description: string;
1027
- notes: string[];
1028
- };
1029
- };
1030
- };
1031
- };
1032
- 202: {
1033
- headers: {
1034
- [name: string]: unknown;
1035
- };
1036
- content: {
1037
- "application/json": {
1038
- success: boolean;
1039
- message: string;
1040
- statusCode: string;
1041
- cdrResponse?: {
1042
- id: string;
1043
- code: string;
1044
- description: string;
1045
- notes: string[];
1046
- };
1047
- };
1048
- };
2448
+ content?: never;
1049
2449
  };
1050
2450
  };
1051
2451
  }, {
1052
2452
  params: {
1053
2453
  path: {
1054
- ticket: string;
1055
- };
1056
- query: {
1057
- ruc: string;
2454
+ key: string;
1058
2455
  };
1059
2456
  };
1060
2457
  }, `${string}/${string}`>>;
1061
- listCompanies(): Promise<import("openapi-fetch").FetchResponse<{
2458
+ /** Consulta pública de un comprobante por RUC/tipo/serie/número (JSON). */
2459
+ consultarComprobante(ruc: string, tipoDoc: string, serie: string, numero: string): Promise<import("openapi-fetch").FetchResponse<{
1062
2460
  parameters: {
1063
- query?: never;
1064
- header?: never;
1065
- path?: never;
1066
- cookie?: never;
1067
- };
1068
- requestBody?: never;
1069
- responses: {
1070
- 200: {
1071
- headers: {
1072
- [name: string]: unknown;
1073
- };
1074
- content?: never;
2461
+ query?: {
2462
+ total?: number;
2463
+ fecha?: string;
2464
+ receptor?: string;
1075
2465
  };
1076
- };
1077
- }, {}, `${string}/${string}`>>;
1078
- getCompany(id: string): Promise<import("openapi-fetch").FetchResponse<{
1079
- parameters: {
1080
- query?: never;
1081
2466
  header?: never;
1082
2467
  path: {
1083
- id: string;
2468
+ ruc: string;
2469
+ tipoDoc: string;
2470
+ serie: string;
2471
+ numero: string;
1084
2472
  };
1085
2473
  cookie?: never;
1086
2474
  };
@@ -1096,14 +2484,29 @@ export declare class FacturacionClient {
1096
2484
  }, {
1097
2485
  params: {
1098
2486
  path: {
1099
- id: string;
2487
+ ruc: string;
2488
+ tipoDoc: string;
2489
+ serie: string;
2490
+ numero: string;
1100
2491
  };
1101
2492
  };
1102
2493
  }, `${string}/${string}`>>;
2494
+ /** PDF público de un comprobante. */
2495
+ consultarComprobantePdf(ruc: string, tipoDoc: string, serie: string, numero: string): Promise<ArrayBuffer>;
2496
+ /** XML público de un comprobante. */
2497
+ consultarComprobanteXml(ruc: string, tipoDoc: string, serie: string, numero: string): Promise<ArrayBuffer>;
1103
2498
  /** Estado de las colas BullMQ (jobs en cada estado). */
1104
2499
  getQueueStats(): Promise<QueueStats>;
1105
2500
  /**
1106
- * Espera a que un documento llegue a estado final (ACEPTADO/RECHAZADO/COLA_FALLIDA).
2501
+ * Descarga binaria genérica para endpoints de archivo `{id}`.
2502
+ *
2503
+ * openapi-fetch no infiere bien una unión de rutas, y estos endpoints declaran
2504
+ * el cuerpo como binario (sin schema JSON), así que el cast es inevitable. Se
2505
+ * mantiene acotado a `BinaryPath` para no perder el chequeo de la ruta.
2506
+ */
2507
+ private fetchBinary;
2508
+ /**
2509
+ * Espera a que un documento llegue a estado final (ACEPTADO/RECHAZADO/COLA_FALLIDA/ANULADO).
1107
2510
  * Hace polling cada `intervalMs`. Timeout en `timeoutMs`.
1108
2511
  */
1109
2512
  waitForDocument(id: string, options?: {