diff --git a/examples/ejemplos-carta-porte-referencias.ts b/examples/ejemplos-carta-porte-referencias.ts new file mode 100644 index 0000000..4290eb2 --- /dev/null +++ b/examples/ejemplos-carta-porte-referencias.ts @@ -0,0 +1,3310 @@ +/** + * Ejemplos de facturas con complemento Carta Porte (CFDI 4.0) usando el SDK de FiscalAPI + * Todos los m�todos usan el modo "ByReference" + */ + +import { FiscalapiClient, FiscalapiSettings, Invoice } from '../src/index'; +import { inspect } from 'util'; + +// Configuración de la consola para mostrar objetos anidados +inspect.defaultOptions.depth = null; +inspect.defaultOptions.colors = true; + +// Configuración de FiscalAPI +const settings: FiscalapiSettings = { + apiUrl: 'https://test.fiscalapi.com', + apiKey: '', + tenant: '', + debug: true +}; + +// Sellos SAT de prueba +const escuelaKemperUrgateBase64Cer = "MIIFsDCCA5igAwIBAgIUMzAwMDEwMDAwMDA1MDAwMDM0MTYwDQYJKoZIhvcNAQELBQAwggErMQ8wDQYDVQQDDAZBQyBVQVQxLjAsBgNVBAoMJVNFUlZJQ0lPIERFIEFETUlOSVNUUkFDSU9OIFRSSUJVVEFSSUExGjAYBgNVBAsMEVNBVC1JRVMgQXV0aG9yaXR5MSgwJgYJKoZIhvcNAQkBFhlvc2Nhci5tYXJ0aW5lekBzYXQuZ29iLm14MR0wGwYDVQQJDBQzcmEgY2VycmFkYSBkZSBjYWxpejEOMAwGA1UEEQwFMDYzNzAxCzAJBgNVBAYTAk1YMRkwFwYDVQQIDBBDSVVEQUQgREUgTUVYSUNPMREwDwYDVQQHDAhDT1lPQUNBTjERMA8GA1UELRMIMi41LjQuNDUxJTAjBgkqhkiG9w0BCQITFnJlc3BvbnNhYmxlOiBBQ0RNQS1TQVQwHhcNMjMwNTE4MTE0MzUxWhcNMjcwNTE4MTE0MzUxWjCB1zEnMCUGA1UEAxMeRVNDVUVMQSBLRU1QRVIgVVJHQVRFIFNBIERFIENWMScwJQYDVQQpEx5FU0NVRUxBIEtFTVBFUiBVUkdBVEUgU0EgREUgQ1YxJzAlBgNVBAoTHkVTQ1VFTEEgS0VNUEVSIFVSR0FURSBTQSBERSBDVjElMCMGA1UELRMcRUtVOTAwMzE3M0M5IC8gVkFEQTgwMDkyN0RKMzEeMBwGA1UEBRMVIC8gVkFEQTgwMDkyN0hTUlNSTDA1MRMwEQYDVQQLEwpTdWN1cnNhbCAxMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtmecO6n2GS0zL025gbHGQVxznPDICoXzR2uUngz4DqxVUC/w9cE6FxSiXm2ap8Gcjg7wmcZfm85EBaxCx/0J2u5CqnhzIoGCdhBPuhWQnIh5TLgj/X6uNquwZkKChbNe9aeFirU/JbyN7Egia9oKH9KZUsodiM/pWAH00PCtoKJ9OBcSHMq8Rqa3KKoBcfkg1ZrgueffwRLws9yOcRWLb02sDOPzGIm/jEFicVYt2Hw1qdRE5xmTZ7AGG0UHs+unkGjpCVeJ+BEBn0JPLWVvDKHZAQMj6s5Bku35+d/MyATkpOPsGT/VTnsouxekDfikJD1f7A1ZpJbqDpkJnss3vQIDAQABox0wGzAMBgNVHRMBAf8EAjAAMAsGA1UdDwQEAwIGwDANBgkqhkiG9w0BAQsFAAOCAgEAFaUgj5PqgvJigNMgtrdXZnbPfVBbukAbW4OGnUhNrA7SRAAfv2BSGk16PI0nBOr7qF2mItmBnjgEwk+DTv8Zr7w5qp7vleC6dIsZFNJoa6ZndrE/f7KO1CYruLXr5gwEkIyGfJ9NwyIagvHHMszzyHiSZIA850fWtbqtythpAliJ2jF35M5pNS+YTkRB+T6L/c6m00ymN3q9lT1rB03YywxrLreRSFZOSrbwWfg34EJbHfbFXpCSVYdJRfiVdvHnewN0r5fUlPtR9stQHyuqewzdkyb5jTTw02D2cUfL57vlPStBj7SEi3uOWvLrsiDnnCIxRMYJ2UA2ktDKHk+zWnsDmaeleSzonv2CHW42yXYPCvWi88oE1DJNYLNkIjua7MxAnkNZbScNw01A6zbLsZ3y8G6eEYnxSTRfwjd8EP4kdiHNJftm7Z4iRU7HOVh79/lRWB+gd171s3d/mI9kte3MRy6V8MMEMCAnMboGpaooYwgAmwclI2XZCczNWXfhaWe0ZS5PmytD/GDpXzkX0oEgY9K/uYo5V77NdZbGAjmyi8cE2B2ogvyaN2XfIInrZPgEffJ4AB7kFA2mwesdLOCh0BLD9itmCve3A1FGR4+stO2ANUoiI3w3Tv2yQSg4bjeDlJ08lXaaFCLW2peEXMXjQUk7fmpb5MNuOUTW6BE="; +const escuelaKemperUrgateBase64Key = "MIIFDjBABgkqhkiG9w0BBQ0wMzAbBgkqhkiG9w0BBQwwDgQIAgEAAoIBAQACAggAMBQGCCqGSIb3DQMHBAgwggS/AgEAMASCBMh4EHl7aNSCaMDA1VlRoXCZ5UUmqErAbucoZQObOaLUEm+I+QZ7Y8Giupo+F1XWkLvAsdk/uZlJcTfKLJyJbJwsQYbSpLOCLataZ4O5MVnnmMbfG//NKJn9kSMvJQZhSwAwoGLYDm1ESGezrvZabgFJnoQv8Si1nAhVGTk9FkFBesxRzq07dmZYwFCnFSX4xt2fDHs1PMpQbeq83aL/PzLCce3kxbYSB5kQlzGtUYayiYXcu0cVRu228VwBLCD+2wTDDoCmRXtPesgrLKUR4WWWb5N2AqAU1mNDC+UEYsENAerOFXWnmwrcTAu5qyZ7GsBMTpipW4Dbou2yqQ0lpA/aB06n1kz1aL6mNqGPaJ+OqoFuc8Ugdhadd+MmjHfFzoI20SZ3b2geCsUMNCsAd6oXMsZdWm8lzjqCGWHFeol0ik/xHMQvuQkkeCsQ28PBxdnUgf7ZGer+TN+2ZLd2kvTBOk6pIVgy5yC6cZ+o1Tloql9hYGa6rT3xcMbXlW+9e5jM2MWXZliVW3ZhaPjptJFDbIfWxJPjz4QvKyJk0zok4muv13Iiwj2bCyefUTRz6psqI4cGaYm9JpscKO2RCJN8UluYGbbWmYQU+Int6LtZj/lv8p6xnVjWxYI+rBPdtkpfFYRp+MJiXjgPw5B6UGuoruv7+vHjOLHOotRo+RdjZt7NqL9dAJnl1Qb2jfW6+d7NYQSI/bAwxO0sk4taQIT6Gsu/8kfZOPC2xk9rphGqCSS/4q3Os0MMjA1bcJLyoWLp13pqhK6bmiiHw0BBXH4fbEp4xjSbpPx4tHXzbdn8oDsHKZkWh3pPC2J/nVl0k/yF1KDVowVtMDXE47k6TGVcBoqe8PDXCG9+vjRpzIidqNo5qebaUZu6riWMWzldz8x3Z/jLWXuDiM7/Yscn0Z2GIlfoeyz+GwP2eTdOw9EUedHjEQuJY32bq8LICimJ4Ht+zMJKUyhwVQyAER8byzQBwTYmYP5U0wdsyIFitphw+/IH8+v08Ia1iBLPQAeAvRfTTIFLCs8foyUrj5Zv2B/wTYIZy6ioUM+qADeXyo45uBLLqkN90Rf6kiTqDld78NxwsfyR5MxtJLVDFkmf2IMMJHTqSfhbi+7QJaC11OOUJTD0v9wo0X/oO5GvZhe0ZaGHnm9zqTopALuFEAxcaQlc4R81wjC4wrIrqWnbcl2dxiBtD73KW+wcC9ymsLf4I8BEmiN25lx/OUc1IHNyXZJYSFkEfaxCEZWKcnbiyf5sqFSSlEqZLc4lUPJFAoP6s1FHVcyO0odWqdadhRZLZC9RCzQgPlMRtji/OXy5phh7diOBZv5UYp5nb+MZ2NAB/eFXm2JLguxjvEstuvTDmZDUb6Uqv++RdhO5gvKf/AcwU38ifaHQ9uvRuDocYwVxZS2nr9rOwZ8nAh+P2o4e0tEXjxFKQGhxXYkn75H3hhfnFYjik/2qunHBBZfcdG148MaNP6DjX33M238T9Zw/GyGx00JMogr2pdP4JAErv9a5yt4YR41KGf8guSOUbOXVARw6+ybh7+meb7w4BeTlj3aZkv8tVGdfIt3lrwVnlbzhLjeQY6PplKp3/a5Kr5yM0T4wJoKQQ6v3vSNmrhpbuAtKxpMILe8CQoo="; +const password = "12345678a"; +const currentDate = '2026-03-20T10:04:06'; + +// ============================================================================ +// 1. FACTURA INGRESO - AUTOTRANSPORTE NACIONAL (ByReference) +// ============================================================================ +async function facturaIngresoAutotransporteNacional(client: FiscalapiClient): Promise { + console.log('\n=== Factura Ingreso Autotransporte Nacional (ByReference) ===\n'); + + const invoice: Invoice = { + versionCode: '4.0', + paymentFormCode: '01', + paymentMethodCode: 'PUE', + currencyCode: 'MXN', + typeCode: 'I', + expeditionZipCode: '42501', + series: 'SerieCCP31', + date: currentDate, + exchangeRate: 1, + exportCode: '01', + issuer: { + id: '0e82a655-5f0c-4e07-abab-8f322e4123ef' + }, + recipient: { + id: '37f7c342-d9a6-4881-9620-0da769b50ce5' + }, + items: [ + { + itemCode: '78101800', + itemSku: 'UT421511', + quantity: 1, + unitOfMeasurementCode: 'H87', + description: 'Transporte de carga por carretera', + unitPrice: 100.00, + discount: 0, + taxObjectCode: '01', + itemTaxes: [] + } + ], + complement: { + lading: { + transpInternacId: 'No', + totalDistRec: 1, + pesoNetoTotal: 1, + registroISTMOId: 'Sí', + ubicacionPoloOrigenId: '01', + ubicacionPoloDestinoId: '01', + unidadPesoId: 'XBX', + logisticaInversaRecoleccionDevolucionId: 'Sí', + ubicaciones: [ + { + tipoUbicacion: 'Origen', + idUbicacion: 'OR101010', + rfcRemitenteDestinatario: 'URE180429TM6', + nombreRemitenteDestinatario: 'NombreRemitenteDestinatario1', + fechaHoraSalidaLlegada: '2023-08-01T00:00:00', + domicilio: { + calle: 'Calle1', + numeroExterior: '211', + numeroInterior: '212', + coloniaId: '1957', + localidadId: '13', + referencia: 'casa blanca', + municipioId: '011', + estadoId: 'CMX', + paisId: 'MEX', + codigoPostalId: '13250' + } + }, + { + tipoUbicacion: 'Destino', + idUbicacion: 'DE202020', + rfcRemitenteDestinatario: 'URE180429TM6', + nombreRemitenteDestinatario: 'NombreRemitenteDestinatario2', + fechaHoraSalidaLlegada: '2023-08-01T00:00:01', + distanciaRecorrida: 1, + domicilio: { + calle: 'Calle2', + numeroExterior: '214', + numeroInterior: '215', + coloniaId: '0347', + localidadId: '23', + referencia: 'casa negra', + municipioId: '004', + estadoId: 'COA', + paisId: 'MEX', + codigoPostalId: '25350' + } + } + ], + mercancias: [ + { + bienesTranspId: '11121900', + descripcion: 'Accesorios de equipo de telefon�a', + cantidad: 1.0, + claveUnidadId: 'XBX', + materialPeligrosoId: 'No', + denominacionGenericaProd: 'DenominacionGenericaProd1', + denominacionDistintivaProd: 'DenominacionDistintivaProd1', + fabricante: 'Fabricante1', + fechaCaducidad: '2003-04-02T00:00:00', + loteMedicamento: 'LoteMedic1', + formaFarmaceuticaId: '01', + condicionesEspTranspId: '01', + registroSanitarioFolioAutorizacion: 'RegistroSanita1', + pesoEnKg: 1, + fraccionArancelariaId: '6309000100', + cantidadTransporta: [ + { cantidad: 1, idOrigen: 'OR101010', idDestino: 'DE202020' } + ] + } + ], + autotransporte: { + permSCTId: 'TPAF01', + numPermisoSCT: 'NumPermisoSCT1', + configVehicularId: 'VL', + pesoBrutoVehicular: 1, + placaVM: 'plac892', + anioModeloVM: 2020, + aseguraRespCivil: 'AseguraRespCivil', + polizaRespCivil: '123456789', + remolques: [ + { subTipoRemId: 'CTR004', placa: 'VL45K98' } + ] + }, + tiposFigura: [ + { + tipoFiguraId: '01', + rfcFigura: 'URE180429TM6', + numLicencia: 'NumLicencia1', + nombreFigura: 'NombreFigura1', + domicilio: { + calle: 'Calle1', + numeroExterior: 'NumeroExterior1', + numeroInterior: 'NumeroInterior1', + coloniaId: 'Colonia1', + localidadId: 'Localidad1', + referencia: 'Referencia1', + municipioId: 'Municipio1', + estadoId: 'Estado1', + paisId: 'AFG', + codigoPostalId: 'CodigoPosta1' + } + } + ] + } + } + }; + + const response = await client.invoices.create(invoice); + console.log('Response:', response); +} + +// ============================================================================ +// 2. FACTURA INGRESO - AUTOTRANSPORTE NACIONAL CON IMPUESTOS (ByReference) +// ============================================================================ +async function facturaIngresoAutotransporteNacionalConImpuestos(client: FiscalapiClient): Promise { + console.log('\n=== Factura Ingreso Autotransporte Nacional con Impuestos (ByReference) ===\n'); + + const invoice: Invoice = { + versionCode: '4.0', + paymentFormCode: '01', + paymentMethodCode: 'PUE', + currencyCode: 'MXN', + typeCode: 'I', + expeditionZipCode: '42501', + series: 'SerieCCP31', + date: currentDate, + exchangeRate: 1, + exportCode: '01', + issuer: { + id: '0e82a655-5f0c-4e07-abab-8f322e4123ef' + }, + recipient: { + id: '37f7c342-d9a6-4881-9620-0da769b50ce5' + }, + items: [ + { + itemCode: '78101800', + itemSku: 'UT421511', + quantity: 1, + unitOfMeasurementCode: 'H87', + description: 'Transporte de carga por carretera', + unitPrice: 26232.75, + discount: 0, + taxObjectCode: '02', + itemTaxes: [ + { taxCode: '002', taxTypeCode: 'Tasa', taxRate: 0.160000, taxFlagCode: 'T' }, + { taxCode: '002', taxTypeCode: 'Tasa', taxRate: 0.040000, taxFlagCode: 'R' } + ] + } + ], + complement: { + lading: { + transpInternacId: 'No', + totalDistRec: 1, + pesoNetoTotal: 1, + registroISTMOId: 'Sí', + ubicacionPoloOrigenId: '01', + ubicacionPoloDestinoId: '01', + unidadPesoId: 'XBX', + logisticaInversaRecoleccionDevolucionId: 'Sí', + ubicaciones: [ + { + tipoUbicacion: 'Origen', + idUbicacion: 'OR101010', + rfcRemitenteDestinatario: 'URE180429TM6', + nombreRemitenteDestinatario: 'NombreRemitenteDestinatario1', + fechaHoraSalidaLlegada: '2023-08-01T00:00:00', + domicilio: { + calle: 'Calle1', + numeroExterior: '211', + numeroInterior: '212', + coloniaId: '1957', + localidadId: '13', + referencia: 'casa blanca', + municipioId: '011', + estadoId: 'CMX', + paisId: 'MEX', + codigoPostalId: '13250' + } + }, + { + tipoUbicacion: 'Destino', + idUbicacion: 'DE202020', + rfcRemitenteDestinatario: 'URE180429TM6', + nombreRemitenteDestinatario: 'NombreRemitenteDestinatario2', + fechaHoraSalidaLlegada: '2023-08-01T00:00:01', + distanciaRecorrida: 1, + domicilio: { + calle: 'Calle2', + numeroExterior: '214', + numeroInterior: '215', + coloniaId: '0347', + localidadId: '23', + referencia: 'casa negra', + municipioId: '004', + estadoId: 'COA', + paisId: 'MEX', + codigoPostalId: '25350' + } + } + ], + mercancias: [ + { + bienesTranspId: '11121900', + descripcion: 'Accesorios de equipo de telefon�a', + cantidad: 1.0, + claveUnidadId: 'XBX', + materialPeligrosoId: 'No', + denominacionGenericaProd: 'DenominacionGenericaProd1', + denominacionDistintivaProd: 'DenominacionDistintivaProd1', + fabricante: 'Fabricante1', + fechaCaducidad: '2003-04-02T00:00:00', + loteMedicamento: 'LoteMedic1', + formaFarmaceuticaId: '01', + condicionesEspTranspId: '01', + registroSanitarioFolioAutorizacion: 'RegistroSanita1', + pesoEnKg: 1, + fraccionArancelariaId: '6309000100', + cantidadTransporta: [ + { cantidad: 1, idOrigen: 'OR101010', idDestino: 'DE202020' } + ] + } + ], + autotransporte: { + permSCTId: 'TPAF01', + numPermisoSCT: 'NumPermisoSCT1', + configVehicularId: 'VL', + pesoBrutoVehicular: 1, + placaVM: 'plac892', + anioModeloVM: 2020, + aseguraRespCivil: 'AseguraRespCivil', + polizaRespCivil: '123456789', + remolques: [ + { subTipoRemId: 'CTR004', placa: 'VL45K98' } + ] + }, + tiposFigura: [ + { + tipoFiguraId: '01', + rfcFigura: 'URE180429TM6', + numLicencia: 'NumLicencia1', + nombreFigura: 'NombreFigura1', + domicilio: { + calle: 'Calle1', + numeroExterior: 'NumeroExterior1', + numeroInterior: 'NumeroInterior1', + coloniaId: 'Colonia1', + localidadId: 'Localidad1', + referencia: 'Referencia1', + municipioId: 'Municipio1', + estadoId: 'Estado1', + paisId: 'AFG', + codigoPostalId: 'CodigoPosta1' + } + } + ] + } + } + }; + + const response = await client.invoices.create(invoice); + console.log('Response:', response); +} + +// ============================================================================ +// 3. FACTURA INGRESO - AUTOTRANSPORTE EXTRANJERO / EXPORTACI�N (ByReference) +// ============================================================================ +async function facturaIngresoAutotransporteExtranjero(client: FiscalapiClient): Promise { + console.log('\n=== Factura Ingreso Autotransporte Extranjero - Exportaci�n (ByReference) ===\n'); + + const invoice: Invoice = { + versionCode: '4.0', + paymentFormCode: '01', + paymentMethodCode: 'PUE', + currencyCode: 'MXN', + typeCode: 'I', + expeditionZipCode: '42501', + series: 'SerieCCP31', + date: currentDate, + exchangeRate: 1, + exportCode: '01', + issuer: { + id: '0e82a655-5f0c-4e07-abab-8f322e4123ef' + }, + recipient: { + id: '37f7c342-d9a6-4881-9620-0da769b50ce5' + }, + items: [ + { + itemCode: '78101800', + itemSku: 'UT421511', + quantity: 1, + unitOfMeasurementCode: 'H87', + description: 'Transporte de carga por carretera', + unitPrice: 100.00, + discount: 0, + taxObjectCode: '01', + itemTaxes: [] + } + ], + complement: { + lading: { + transpInternacId: 'Sí', + entradaSalidaMercId: 'Salida', + paisOrigenDestinoId: 'USA', + viaEntradaSalidaId: '01', + totalDistRec: 1, + pesoNetoTotal: 1, + registroISTMOId: 'Sí', + ubicacionPoloOrigenId: '01', + ubicacionPoloDestinoId: '01', + unidadPesoId: 'XBX', + logisticaInversaRecoleccionDevolucionId: 'Sí', + regimenAduaneros: [ + { regimenAduaneroId: 'EXD' } + ], + ubicaciones: [ + { + tipoUbicacion: 'Origen', + idUbicacion: 'OR101010', + rfcRemitenteDestinatario: 'XEXX010101000', + numRegIdTrib: '01010101', + residenciaFiscalId: 'USA', + fechaHoraSalidaLlegada: '2023-08-01T00:00:01', + domicilio: { + calle: 'ST', + numeroExterior: '214', + coloniaId: 'N/A', + referencia: 'WHITE HOUSE', + municipioId: 'N/A', + estadoId: 'TX', + paisId: 'USA', + codigoPostalId: 'N/A' + } + }, + { + tipoUbicacion: 'Destino', + idUbicacion: 'DE202020', + rfcRemitenteDestinatario: 'XEXX010101000', + numRegIdTrib: '01010101', + residenciaFiscalId: 'USA', + fechaHoraSalidaLlegada: '2023-08-01T00:00:01', + distanciaRecorrida: 1, + domicilio: { + calle: 'ST', + numeroExterior: '214', + coloniaId: 'N/A', + referencia: 'WHITE HOUSE', + municipioId: 'N/A', + estadoId: 'TX', + paisId: 'USA', + codigoPostalId: 'N/A' + } + } + ], + mercancias: [ + { + bienesTranspId: '11121900', + descripcion: 'Accesorios de equipo de telefon�a', + cantidad: 1.0, + claveUnidadId: 'XBX', + materialPeligrosoId: 'No', + denominacionGenericaProd: 'DenominacionGenericaProd1', + denominacionDistintivaProd: 'DenominacionDistintivaProd1', + fabricante: 'Fabricante1', + fechaCaducidad: '2003-04-02T00:00:00', + loteMedicamento: 'LoteMedic1', + formaFarmaceuticaId: '01', + condicionesEspTranspId: '01', + registroSanitarioFolioAutorizacion: 'RegistroSanita1', + pesoEnKg: 1, + fraccionArancelariaId: '6309000100', + tipoMateriaId: '05', + descripcionMateria: 'otramateria', + cantidadTransporta: [ + { cantidad: 1, idOrigen: 'OR101010', idDestino: 'DE202020' } + ] + } + ], + autotransporte: { + permSCTId: 'TPAF01', + numPermisoSCT: 'NumPermisoSCT1', + configVehicularId: 'VL', + pesoBrutoVehicular: 1, + placaVM: 'plac892', + anioModeloVM: 2020, + aseguraRespCivil: 'AseguraRespCivil', + polizaRespCivil: '123456789', + remolques: [ + { subTipoRemId: 'CTR004', placa: 'VL45K98' } + ] + }, + tiposFigura: [ + { + tipoFiguraId: '01', + rfcFigura: 'EKU9003173C9', + numLicencia: 'NumLicencia1', + nombreFigura: 'NombreFigura1', + domicilio: { + calle: 'ST', + numeroExterior: '214', + coloniaId: 'N/A', + referencia: 'WHITE HOUSE', + municipioId: 'N/A', + estadoId: 'TX', + paisId: 'USA', + codigoPostalId: 'N/A' + } + } + ] + } + } + }; + + const response = await client.invoices.create(invoice); + console.log('Response:', response); +} + +// ============================================================================ +// 4. FACTURA INGRESO - AUTOTRANSPORTE INTERNACIONAL ADUANERO / IMPORTACI�N (ByReference) +// ============================================================================ +async function facturaIngresoAutotransporteInternacionalAduanero(client: FiscalapiClient): Promise { + console.log('\n=== Factura Ingreso Autotransporte Internacional Aduanero - Importaci�n (ByReference) ===\n'); + + const invoice: Invoice = { + versionCode: '4.0', + paymentFormCode: '01', + paymentMethodCode: 'PUE', + currencyCode: 'MXN', + typeCode: 'I', + expeditionZipCode: '42501', + series: 'SerieCCP31', + date: currentDate, + exchangeRate: 1, + exportCode: '01', + issuer: { + id: '0e82a655-5f0c-4e07-abab-8f322e4123ef' + }, + recipient: { + id: '37f7c342-d9a6-4881-9620-0da769b50ce5' + }, + items: [ + { + itemCode: '78101800', + itemSku: 'UT421511', + quantity: 1, + unitOfMeasurementCode: 'H87', + description: 'Transporte de carga por carretera', + unitPrice: 100.00, + discount: 0, + taxObjectCode: '01', + itemTaxes: [] + } + ], + complement: { + lading: { + transpInternacId: 'Sí', + entradaSalidaMercId: 'Entrada', + paisOrigenDestinoId: 'USA', + viaEntradaSalidaId: '01', + totalDistRec: 1, + pesoNetoTotal: 1, + registroISTMOId: 'Sí', + ubicacionPoloOrigenId: '01', + ubicacionPoloDestinoId: '01', + unidadPesoId: 'XBX', + logisticaInversaRecoleccionDevolucionId: 'Sí', + regimenAduaneros: [ + { regimenAduaneroId: 'IMD' } + ], + ubicaciones: [ + { + tipoUbicacion: 'Origen', + idUbicacion: 'OR101010', + rfcRemitenteDestinatario: 'XEXX010101000', + numRegIdTrib: '01010101', + residenciaFiscalId: 'USA', + fechaHoraSalidaLlegada: '2023-08-01T00:00:01', + domicilio: { + calle: 'ST', + numeroExterior: '214', + coloniaId: 'N/A', + referencia: 'WHITE HOUSE', + municipioId: 'N/A', + estadoId: 'TX', + paisId: 'USA', + codigoPostalId: 'N/A' + } + }, + { + tipoUbicacion: 'Destino', + idUbicacion: 'DE202020', + rfcRemitenteDestinatario: 'XEXX010101000', + numRegIdTrib: '01010101', + residenciaFiscalId: 'USA', + fechaHoraSalidaLlegada: '2023-08-01T00:00:01', + distanciaRecorrida: 1, + domicilio: { + calle: 'ST', + numeroExterior: '214', + coloniaId: 'N/A', + referencia: 'WHITE HOUSE', + municipioId: 'N/A', + estadoId: 'TX', + paisId: 'USA', + codigoPostalId: 'N/A' + } + } + ], + mercancias: [ + { + bienesTranspId: '11121900', + descripcion: 'Accesorios de equipo de telefon�a', + cantidad: 1.0, + claveUnidadId: 'XBX', + materialPeligrosoId: 'No', + denominacionGenericaProd: 'DenominacionGenericaProd1', + denominacionDistintivaProd: 'DenominacionDistintivaProd1', + fabricante: 'Fabricante1', + fechaCaducidad: '2003-04-02T00:00:00', + loteMedicamento: 'LoteMedic1', + formaFarmaceuticaId: '01', + condicionesEspTranspId: '01', + registroSanitarioFolioAutorizacion: 'RegistroSanita1', + pesoEnKg: 1, + fraccionArancelariaId: '6309000100', + tipoMateriaId: '05', + descripcionMateria: 'otramateria', + documentacionAduanera: [ + { + tipoDocumentoId: '01', + numPedimento: '23 43 0472 8000448', + rfcImpo: 'EKU9003173C9' + } + ], + cantidadTransporta: [ + { cantidad: 1, idOrigen: 'OR101010', idDestino: 'DE202020' } + ] + } + ], + autotransporte: { + permSCTId: 'TPAF01', + numPermisoSCT: 'NumPermisoSCT1', + configVehicularId: 'VL', + pesoBrutoVehicular: 1, + placaVM: 'plac892', + anioModeloVM: 2020, + aseguraRespCivil: 'AseguraRespCivil', + polizaRespCivil: '123456789', + remolques: [ + { subTipoRemId: 'CTR004', placa: 'VL45K98' } + ] + }, + tiposFigura: [ + { + tipoFiguraId: '01', + rfcFigura: 'EKU9003173C9', + numLicencia: 'NumLicencia1', + nombreFigura: 'NombreFigura1', + domicilio: { + calle: 'ST', + numeroExterior: '214', + coloniaId: 'N/A', + referencia: 'WHITE HOUSE', + municipioId: 'N/A', + estadoId: 'TX', + paisId: 'USA', + codigoPostalId: 'N/A' + } + } + ] + } + } + }; + + const response = await client.invoices.create(invoice); + console.log('Response:', response); +} + +// ============================================================================ +// 5. FACTURA INGRESO - TRANSPORTE FERROVIARIO NACIONAL (ByReference) +// ============================================================================ +async function facturaIngresoTransporteFerroviarioNacional(client: FiscalapiClient): Promise { + console.log('\n=== Factura Ingreso Transporte Ferroviario Nacional (ByReference) ===\n'); + + const invoice: Invoice = { + versionCode: '4.0', + paymentFormCode: '01', + paymentMethodCode: 'PUE', + currencyCode: 'MXN', + typeCode: 'I', + expeditionZipCode: '42501', + series: 'Serie', + date: currentDate, + exchangeRate: 1, + exportCode: '01', + issuer: { + id: '0e82a655-5f0c-4e07-abab-8f322e4123ef' + }, + recipient: { + id: '37f7c342-d9a6-4881-9620-0da769b50ce5' + }, + items: [makeStandardItem()], + complement: { + lading: { + transpInternacId: 'No', + totalDistRec: 500, + pesoNetoTotal: 10, + registroISTMOId: 'Sí', + ubicacionPoloOrigenId: '01', + ubicacionPoloDestinoId: '01', + unidadPesoId: 'XBX', + ubicaciones: [ + ...makeRailLocationsBase(), + { + tipoUbicacion: 'Destino', + idUbicacion: 'DE202025', + rfcRemitenteDestinatario: 'EKU9003173C9', + nombreRemitenteDestinatario: 'NombreRemitenteDestinatario2', + numEstacionId: 'JM047', + nombreEstacion: 'HUEHUETOCA', + fechaHoraSalidaLlegada: '2023-08-01T05:00:01', + tipoEstacionId: '03', + distanciaRecorrida: 100.00, + domicilio: { + calle: 'Calle2', + numeroExterior: '214', + numeroInterior: '215', + coloniaId: '0347', + localidadId: '23', + referencia: 'casa negra', + municipioId: '004', + estadoId: 'COA', + paisId: 'MEX', + codigoPostalId: '25350' + } + } + ], + mercancias: [ + { + bienesTranspId: '11121900', + descripcion: 'Accesorios de equipo de telefon�a', + cantidad: 1.0, + claveUnidadId: 'XBX', + materialPeligrosoId: 'No', + denominacionGenericaProd: 'DenominacionGenericaProd1', + denominacionDistintivaProd: 'DenominacionDistintivaProd1', + fabricante: 'Fabricante1', + fechaCaducidad: '2028-01-01T00:00:00', + loteMedicamento: 'LoteMedic1', + registroSanitarioFolioAutorizacion: 'RegistroSanita1', + pesoEnKg: 1, + cantidadTransporta: [ + { cantidad: 1, idOrigen: 'OR101010', idDestino: 'DE202025' } + ] + } + ], + transporteFerroviario: makeRailwayTransport(), + tiposFigura: [makeRailwayFigure()] + } + } + }; + + const response = await client.invoices.create(invoice); + console.log('Response:', response); +} + +// ============================================================================ +// 6. FACTURA INGRESO - TRANSPORTE FERROVIARIO EXTRANJERO (ByReference) +// ============================================================================ +async function facturaIngresoTransporteFerroviarioExtranjero(client: FiscalapiClient): Promise { + console.log('\n=== Factura Ingreso Transporte Ferroviario Extranjero - Exportaci�n (ByReference) ===\n'); + + const invoice: Invoice = { + versionCode: '4.0', + paymentFormCode: '01', + paymentMethodCode: 'PUE', + currencyCode: 'MXN', + typeCode: 'I', + expeditionZipCode: '42501', + series: 'Serie', + date: currentDate, + exchangeRate: 1, + exportCode: '01', + issuer: { + id: '0e82a655-5f0c-4e07-abab-8f322e4123ef' + }, + recipient: { + id: '37f7c342-d9a6-4881-9620-0da769b50ce5' + }, + items: [makeStandardItem()], + complement: { + lading: { + transpInternacId: 'Sí', + entradaSalidaMercId: 'Salida', + paisOrigenDestinoId: 'USA', + viaEntradaSalidaId: '04', + totalDistRec: 500, + pesoNetoTotal: 10, + registroISTMOId: 'Sí', + ubicacionPoloOrigenId: '01', + ubicacionPoloDestinoId: '01', + unidadPesoId: 'XBX', + regimenAduaneros: [ + { regimenAduaneroId: 'EXD' } + ], + ubicaciones: [ + ...makeRailLocationsBase(), + { + tipoUbicacion: 'Destino', + idUbicacion: 'DE202025', + rfcRemitenteDestinatario: 'XEXX010101000', + nombreRemitenteDestinatario: 'NombreRemitenteDestinatario2', + numRegIdTrib: '01010101', + residenciaFiscalId: 'USA', + numEstacionId: 'EF0001', + nombreEstacion: 'NombreEstacion', + fechaHoraSalidaLlegada: '2023-08-01T05:00:01', + distanciaRecorrida: 100.00, + domicilio: { + calle: 'ST', + numeroExterior: '1234', + coloniaId: '1234', + referencia: 'WHITE HOUSE', + municipioId: '1234', + estadoId: 'TX', + paisId: 'USA', + codigoPostalId: '12345' + } + } + ], + mercancias: [ + { + bienesTranspId: '11121900', + descripcion: 'Accesorios de equipo de telefon�a', + cantidad: 1.0, + claveUnidadId: 'XBX', + materialPeligrosoId: 'No', + denominacionGenericaProd: 'DenominacionGenericaProd1', + denominacionDistintivaProd: 'DenominacionDistintivaProd1', + fabricante: 'Fabricante1', + fechaCaducidad: '2028-01-01T00:00:00', + loteMedicamento: 'LoteMedic1', + registroSanitarioFolioAutorizacion: 'RegistroSanita1', + pesoEnKg: 1, + tipoMateriaId: '05', + descripcionMateria: 'otramateria', + cantidadTransporta: [ + { cantidad: 1, idOrigen: 'OR101010', idDestino: 'DE202025' } + ] + } + ], + transporteFerroviario: makeRailwayTransport(), + tiposFigura: [makeRailwayFigure()] + } + } + }; + + const response = await client.invoices.create(invoice); + console.log('Response:', response); +} + +// ============================================================================ +// 7. FACTURA INGRESO - TRANSPORTE FERROVIARIO INTERNACIONAL ADUANERO (ByReference) +// ============================================================================ +async function facturaIngresoTransporteFerroviarioInternacionalAduanero(client: FiscalapiClient): Promise { + console.log('\n=== Factura Ingreso Transporte Ferroviario Internacional Aduanero - Importaci�n (ByReference) ===\n'); + + const invoice: Invoice = { + versionCode: '4.0', + paymentFormCode: '01', + paymentMethodCode: 'PUE', + currencyCode: 'MXN', + typeCode: 'I', + expeditionZipCode: '42501', + series: 'Serie', + date: currentDate, + exchangeRate: 1, + exportCode: '01', + issuer: { + id: '0e82a655-5f0c-4e07-abab-8f322e4123ef' + }, + recipient: { + id: '37f7c342-d9a6-4881-9620-0da769b50ce5' + }, + items: [makeStandardItem()], + complement: { + lading: { + transpInternacId: 'Sí', + entradaSalidaMercId: 'Entrada', + paisOrigenDestinoId: 'AFG', + viaEntradaSalidaId: '04', + totalDistRec: 500, + pesoNetoTotal: 10, + registroISTMOId: 'Sí', + ubicacionPoloOrigenId: '01', + ubicacionPoloDestinoId: '01', + unidadPesoId: 'XBX', + regimenAduaneros: [ + { regimenAduaneroId: 'IMD' } + ], + ubicaciones: [ + ...makeRailLocationsBase(), + { + tipoUbicacion: 'Destino', + idUbicacion: 'DE202025', + rfcRemitenteDestinatario: 'EKU9003173C9', + nombreRemitenteDestinatario: 'NombreRemitenteDestinatario2', + numEstacionId: 'JM047', + nombreEstacion: 'HUEHUETOCA', + fechaHoraSalidaLlegada: '2023-08-01T05:00:01', + tipoEstacionId: '03', + distanciaRecorrida: 100.00, + domicilio: { + calle: 'Calle2', + numeroExterior: '214', + numeroInterior: '215', + coloniaId: '0347', + localidadId: '23', + referencia: 'casa negra', + municipioId: '004', + estadoId: 'COA', + paisId: 'MEX', + codigoPostalId: '25350' + } + } + ], + mercancias: [ + { + bienesTranspId: '11121900', + descripcion: 'Accesorios de equipo de telefon�a', + cantidad: 1.0, + claveUnidadId: 'XBX', + materialPeligrosoId: 'No', + denominacionGenericaProd: 'DenominacionGenericaProd1', + denominacionDistintivaProd: 'DenominacionDistintivaProd1', + fabricante: 'Fabricante1', + fechaCaducidad: '2028-01-01T00:00:00', + loteMedicamento: 'LoteMedic1', + registroSanitarioFolioAutorizacion: 'RegistroSanita1', + pesoEnKg: 1, + tipoMateriaId: '05', + descripcionMateria: 'otramateria', + documentacionAduanera: [ + { + tipoDocumentoId: '01', + numPedimento: '23 43 0472 8000448', + rfcImpo: 'EKU9003173C9' + } + ], + cantidadTransporta: [ + { cantidad: 1, idOrigen: 'OR101010', idDestino: 'DE202025' } + ] + } + ], + transporteFerroviario: makeRailwayTransport(), + tiposFigura: [makeRailwayFigure()] + } + } + }; + + const response = await client.invoices.create(invoice); + console.log('Response:', response); +} + +// ============================================================================ +// 8. FACTURA INGRESO - TRANSPORTE A�REO NACIONAL (ByReference) +// ============================================================================ +async function facturaIngresoTransporteAereoNacional(client: FiscalapiClient): Promise { + console.log('\n=== Factura Ingreso Transporte A�reo Nacional (ByReference) ===\n'); + + const invoice: Invoice = { + versionCode: '4.0', + paymentFormCode: '01', + paymentMethodCode: 'PUE', + currencyCode: 'MXN', + typeCode: 'I', + expeditionZipCode: '42501', + series: 'Serie', + date: currentDate, + exchangeRate: 1, + exportCode: '01', + issuer: { + id: '0e82a655-5f0c-4e07-abab-8f322e4123ef' + }, + recipient: { + id: '37f7c342-d9a6-4881-9620-0da769b50ce5' + }, + items: [makeStandardItem()], + complement: { + lading: { + transpInternacId: 'No', + totalDistRec: 0, + pesoNetoTotal: 10, + unidadPesoId: 'XBX', + ubicaciones: [ + { + tipoUbicacion: 'Origen', + idUbicacion: 'OR101010', + rfcRemitenteDestinatario: 'EKU9003173C9', + nombreRemitenteDestinatario: 'NombreRemitenteDestinatario1', + numEstacionId: 'EA0417', + nombreEstacion: 'Loreto', + fechaHoraSalidaLlegada: '2023-08-01T00:00:00', + tipoEstacionId: '01', + domicilio: { + calle: 'Calle1', + numeroExterior: '211', + numeroInterior: '212', + coloniaId: '1957', + localidadId: '13', + referencia: 'casa blanca', + municipioId: '011', + estadoId: 'CMX', + paisId: 'MEX', + codigoPostalId: '13250' + } + }, + { + tipoUbicacion: 'Destino', + idUbicacion: 'DE202020', + rfcRemitenteDestinatario: 'EKU9003173C9', + nombreRemitenteDestinatario: 'NombreRemitenteDestinatario2', + numEstacionId: 'EA0418', + nombreEstacion: 'Los Cabos', + fechaHoraSalidaLlegada: '2023-08-01T00:00:01', + tipoEstacionId: '03', + domicilio: { + calle: 'Calle2', + numeroExterior: '214', + numeroInterior: '215', + coloniaId: '0347', + localidadId: '23', + referencia: 'casa negra', + municipioId: '004', + estadoId: 'COA', + paisId: 'MEX', + codigoPostalId: '25350' + } + } + ], + mercancias: [ + { + bienesTranspId: '11121900', + descripcion: 'Accesorios de equipo de telefon�a', + cantidad: 1.0, + claveUnidadId: 'XBX', + materialPeligrosoId: 'No', + denominacionGenericaProd: 'DenominacionGenericaProd1', + denominacionDistintivaProd: 'DenominacionDistintivaProd1', + fabricante: 'Fabricante1', + fechaCaducidad: '2028-01-01T00:00:00', + loteMedicamento: 'LoteMedic1', + registroSanitarioFolioAutorizacion: 'RegistroSanita1', + pesoEnKg: 1, + valorMercancia: 100, + monedaId: 'MXN', + cantidadTransporta: [ + { cantidad: 1, idOrigen: 'OR101010', idDestino: 'DE202020' } + ] + } + ], + transporteAereo: { + permSCTId: 'TPAF01', + numPermisoSCT: 'Demo', + matriculaAeronave: '61E5-WZ', + nombreAseg: 'NombreAseg', + numPolizaSeguro: 'NumPolizaSeguro', + numeroGuia: 'acUbYlBVTmlzx', + lugarContrato: 'LugarContrato', + codigoTransportistaId: 'CA001', + rfcEmbarcador: 'EKU9003173C9', + nombreEmbarcador: 'Embarcador' + }, + tiposFigura: [ + { + tipoFiguraId: '01', + rfcFigura: 'EKU9003173C9', + numLicencia: 'a234567890', + nombreFigura: 'NombreFigura' + } + ] + } + } + }; + + const response = await client.invoices.create(invoice); + console.log('Response:', response); +} + +// ============================================================================ +// 9. FACTURA INGRESO - TRANSPORTE A�REO EXTRANJERO (ByReference) +// ============================================================================ +async function facturaIngresoTransporteAereoExtranjero(client: FiscalapiClient): Promise { + console.log('\n=== Factura Ingreso Transporte A�reo Extranjero (ByReference) ===\n'); + + const invoice: Invoice = { + versionCode: '4.0', + paymentFormCode: '01', + paymentMethodCode: 'PUE', + currencyCode: 'MXN', + typeCode: 'I', + expeditionZipCode: '42501', + series: 'Serie', + date: currentDate, + exchangeRate: 1, + exportCode: '01', + issuer: { + id: '0e82a655-5f0c-4e07-abab-8f322e4123ef' + }, + recipient: { + id: '37f7c342-d9a6-4881-9620-0da769b50ce5' + }, + items: [makeStandardItem()], + complement: { + lading: { + transpInternacId: 'Sí', + entradaSalidaMercId: 'Salida', + paisOrigenDestinoId: 'USA', + viaEntradaSalidaId: '03', + totalDistRec: 0, + unidadPesoId: 'XBX', + pesoNetoTotal: 10, + regimenAduaneros: [ + { regimenAduaneroId: 'EXD' } + ], + ubicaciones: [ + { + tipoUbicacion: 'Origen', + idUbicacion: 'OR101010', + rfcRemitenteDestinatario: 'EKU9003173C9', + nombreRemitenteDestinatario: 'NombreRemitenteDestinatario1', + numEstacionId: 'EA0417', + nombreEstacion: 'Loreto', + fechaHoraSalidaLlegada: '2023-08-01T00:00:00', + tipoEstacionId: '01', + domicilio: { + calle: 'Calle2', + numeroExterior: '214', + numeroInterior: '215', + coloniaId: '0347', + localidadId: '23', + referencia: 'casa negra', + municipioId: '004', + estadoId: 'COA', + paisId: 'MEX', + codigoPostalId: '25350' + } + }, + { + tipoUbicacion: 'Destino', + idUbicacion: 'DE202020', + rfcRemitenteDestinatario: 'XEXX010101000', + nombreRemitenteDestinatario: 'NombreRemitenteDestinatario', + numRegIdTrib: '01010101', + residenciaFiscalId: 'USA', + numEstacionId: 'EA0143', + nombreEstacion: 'Phoenix-Mesa Gateway', + fechaHoraSalidaLlegada: '2023-08-01T00:00:01', + domicilio: { + calle: 'ST', + numeroExterior: '12344', + coloniaId: 'N/A', + referencia: 'WHITE HOUSE', + municipioId: 'N/A', + estadoId: 'TX', + paisId: 'USA', + codigoPostalId: '12345' + } + } + ], + mercancias: [ + { + bienesTranspId: '11121900', + descripcion: 'Accesorios de equipo de telefon�a', + cantidad: 1.0, + claveUnidadId: 'XBX', + materialPeligrosoId: 'No', + denominacionGenericaProd: 'DenominacionGenericaProd1', + denominacionDistintivaProd: 'DenominacionDistintivaProd1', + fabricante: 'Fabricante1', + fechaCaducidad: '2028-01-01T00:00:00', + loteMedicamento: 'LoteMedic1', + registroSanitarioFolioAutorizacion: 'RegistroSanita1', + pesoEnKg: 1, + valorMercancia: 100, + monedaId: 'MXN', + tipoMateriaId: '05', + descripcionMateria: 'otramateria', + cantidadTransporta: [ + { cantidad: 1, idOrigen: 'OR101010', idDestino: 'DE202020' } + ] + } + ], + transporteAereo: makeAirTransport(), + tiposFigura: [makeAirFigure()] + } + } + }; + + const response = await client.invoices.create(invoice); + console.log('Response:', response); +} + +// ============================================================================ +// 10. FACTURA INGRESO - TRANSPORTE A�REO INTERNACIONAL ADUANERO (ByReference) +// ============================================================================ +async function facturaIngresoTransporteAereoInternacionalAduanero(client: FiscalapiClient): Promise { + console.log('\n=== Factura Ingreso Transporte A�reo Internacional Aduanero (ByReference) ===\n'); + + const invoice: Invoice = { + versionCode: '4.0', + paymentFormCode: '01', + paymentMethodCode: 'PUE', + currencyCode: 'MXN', + typeCode: 'I', + expeditionZipCode: '42501', + series: 'Serie', + date: currentDate, + exchangeRate: 1, + exportCode: '01', + issuer: { + id: '0e82a655-5f0c-4e07-abab-8f322e4123ef' + }, + recipient: { + id: '37f7c342-d9a6-4881-9620-0da769b50ce5' + }, + items: [makeStandardItem()], + complement: { + lading: { + transpInternacId: 'Sí', + entradaSalidaMercId: 'Entrada', + paisOrigenDestinoId: 'AFG', + viaEntradaSalidaId: '03', + totalDistRec: 0, + unidadPesoId: 'XBX', + pesoNetoTotal: 10, + regimenAduaneros: [ + { regimenAduaneroId: 'IMD' } + ], + ubicaciones: [ + { + tipoUbicacion: 'Origen', + idUbicacion: 'OR101010', + rfcRemitenteDestinatario: 'EKU9003173C9', + nombreRemitenteDestinatario: 'NombreRemitenteDestinatario1', + numEstacionId: 'EA0417', + nombreEstacion: 'Loreto', + fechaHoraSalidaLlegada: '2023-08-01T00:00:00', + tipoEstacionId: '01', + domicilio: { + calle: 'Calle1', + numeroExterior: '211', + numeroInterior: '212', + coloniaId: '1957', + localidadId: '13', + referencia: 'casa blanca', + municipioId: '011', + estadoId: 'CMX', + paisId: 'MEX', + codigoPostalId: '13250' + } + }, + { + tipoUbicacion: 'Destino', + idUbicacion: 'DE202020', + rfcRemitenteDestinatario: 'EKU9003173C9', + nombreRemitenteDestinatario: 'NombreRemitenteDestinatario2', + numEstacionId: 'EA0418', + nombreEstacion: 'Los Cabos', + fechaHoraSalidaLlegada: '2023-08-01T00:00:01', + tipoEstacionId: '03', + domicilio: { + calle: 'Calle2', + numeroExterior: '214', + numeroInterior: '215', + coloniaId: '0347', + localidadId: '23', + referencia: 'casa negra', + municipioId: '004', + estadoId: 'COA', + paisId: 'MEX', + codigoPostalId: '25350' + } + } + ], + mercancias: [ + { + bienesTranspId: '11121900', + descripcion: 'Accesorios de equipo de telefon�a', + cantidad: 1.0, + claveUnidadId: 'XBX', + materialPeligrosoId: 'No', + denominacionGenericaProd: 'DenominacionGenericaProd1', + denominacionDistintivaProd: 'DenominacionDistintivaProd1', + fabricante: 'Fabricante1', + fechaCaducidad: '2028-01-01T00:00:00', + loteMedicamento: 'LoteMedic1', + registroSanitarioFolioAutorizacion: 'RegistroSanita1', + pesoEnKg: 1, + valorMercancia: 100, + monedaId: 'MXN', + tipoMateriaId: '05', + descripcionMateria: 'otramateria', + documentacionAduanera: [ + { tipoDocumentoId: '01', numPedimento: '23 43 0472 8000448', rfcImpo: 'EKU9003173C9' } + ], + cantidadTransporta: [ + { cantidad: 1, idOrigen: 'OR101010', idDestino: 'DE202020' } + ] + } + ], + transporteAereo: makeAirTransport(), + tiposFigura: [makeAirFigure()] + } + } + }; + + const response = await client.invoices.create(invoice); + console.log('Response:', response); +} + +// ============================================================================ +// 11. FACTURA INGRESO - TRANSPORTE MAR�TIMO NACIONAL (ByReference) +// ============================================================================ +async function facturaIngresoTransporteMAritimoNacional(client: FiscalapiClient): Promise { + console.log('\n=== Factura Ingreso Transporte Mar�timo Nacional (ByReference) ===\n'); + + const invoice: Invoice = { + versionCode: '4.0', + paymentFormCode: '01', + paymentMethodCode: 'PUE', + currencyCode: 'MXN', + typeCode: 'I', + expeditionZipCode: '42501', + series: 'Serie', + date: currentDate, + exchangeRate: 1, + exportCode: '01', + issuer: { + id: '0e82a655-5f0c-4e07-abab-8f322e4123ef' + }, + recipient: { + id: '37f7c342-d9a6-4881-9620-0da769b50ce5' + }, + items: [makeStandardItem()], + complement: { + lading: { + transpInternacId: 'No', + totalDistRec: 0, + unidadPesoId: 'XBX', + pesoNetoTotal: 1, + ubicaciones: [ + { + tipoUbicacion: 'Origen', + idUbicacion: 'OR101010', + rfcRemitenteDestinatario: 'EKU9003173C9', + nombreRemitenteDestinatario: 'NombreRemitenteDestinatario1', + numEstacionId: 'PM001', + nombreEstacion: 'Rosarito', + navegacionTraficoId: 'Altura', + fechaHoraSalidaLlegada: '2023-08-01T00:00:00', + tipoEstacionId: '01', + domicilio: { + calle: 'Calle1', + numeroExterior: '211', + numeroInterior: '212', + coloniaId: '1957', + localidadId: '13', + referencia: 'casa blanca', + municipioId: '011', + estadoId: 'CMX', + paisId: 'MEX', + codigoPostalId: '13250' + } + }, + { + tipoUbicacion: 'Destino', + idUbicacion: 'DE202020', + rfcRemitenteDestinatario: 'EKU9003173C9', + nombreRemitenteDestinatario: 'NombreRemitenteDestinatario2', + numEstacionId: 'PM001', + nombreEstacion: 'Rosarito', + navegacionTraficoId: 'Altura', + fechaHoraSalidaLlegada: '2023-08-01T00:00:01', + tipoEstacionId: '03', + domicilio: { + calle: 'Calle2', + numeroExterior: '214', + numeroInterior: '215', + coloniaId: '0347', + localidadId: '23', + referencia: 'casa negra', + municipioId: '004', + estadoId: 'COA', + paisId: 'MEX', + codigoPostalId: '25350' + } + } + ], + mercancias: [ + { + bienesTranspId: '11121900', + descripcion: 'Accesorios de equipo de telefon�a', + cantidad: 1.0, + claveUnidadId: 'XBX', + materialPeligrosoId: 'No', + denominacionGenericaProd: 'DenominacionGenericaProd1', + denominacionDistintivaProd: 'DenominacionDistintivaProd1', + fabricante: 'Fabricante1', + fechaCaducidad: '2028-01-01T00:00:00', + loteMedicamento: 'LoteMedic1', + registroSanitarioFolioAutorizacion: 'RegistroSanita1', + pesoEnKg: 1, + valorMercancia: 100, + monedaId: 'MXN', + cantidadTransporta: [ + { cantidad: 1, idOrigen: 'OR101010', idDestino: 'DE202020' } + ], + detalleMercancia: { + unidadPesoMercId: 'Tu', + pesoBruto: 1, + pesoNeto: 1, + pesoTara: 0.001, + numPiezas: 1 + } + } + ], + transporteMaritimo: makeMaritimeTransport(), + tiposFigura: [makeMaritimeFigure()] + } + } + }; + + const response = await client.invoices.create(invoice); + console.log('Response:', response); +} + +// ============================================================================ +// 12. FACTURA INGRESO - TRANSPORTE MAR�TIMO EXTRANJERO (ByReference) +// ============================================================================ +async function facturaIngresoTransporteMAritimoExtranjero(client: FiscalapiClient): Promise { + console.log('\n=== Factura Ingreso Transporte Mar�timo Extranjero (ByReference) ===\n'); + + const invoice: Invoice = { + versionCode: '4.0', + paymentFormCode: '01', + paymentMethodCode: 'PUE', + currencyCode: 'MXN', + typeCode: 'I', + expeditionZipCode: '42501', + series: 'Serie', + date: currentDate, + exchangeRate: 1, + exportCode: '01', + issuer: { + id: '0e82a655-5f0c-4e07-abab-8f322e4123ef' + }, + recipient: { + id: '37f7c342-d9a6-4881-9620-0da769b50ce5' + }, + items: [makeStandardItem()], + complement: { + lading: { + transpInternacId: 'Sí', + entradaSalidaMercId: 'Salida', + paisOrigenDestinoId: 'USA', + viaEntradaSalidaId: '02', + totalDistRec: 0, + unidadPesoId: 'XBX', + pesoNetoTotal: 1, + regimenAduaneros: [ + { regimenAduaneroId: 'EXD' } + ], + ubicaciones: [ + { + tipoUbicacion: 'Origen', + idUbicacion: 'OR101010', + rfcRemitenteDestinatario: 'EKU9003173C9', + nombreRemitenteDestinatario: 'NombreRemitenteDestinatario1', + numEstacionId: 'PM001', + nombreEstacion: 'Rosarito', + navegacionTraficoId: 'Altura', + fechaHoraSalidaLlegada: '2023-08-01T00:00:00', + tipoEstacionId: '01', + domicilio: { + calle: 'Calle1', + numeroExterior: '211', + numeroInterior: '212', + coloniaId: '1957', + localidadId: '13', + referencia: 'casa blanca', + municipioId: '011', + estadoId: 'CMX', + paisId: 'MEX', + codigoPostalId: '13250' + } + }, + { + tipoUbicacion: 'Destino', + idUbicacion: 'DE202020', + rfcRemitenteDestinatario: 'XEXX010101000', + nombreRemitenteDestinatario: 'NombreRemitenteDestinatario2', + numRegIdTrib: '01010101', + residenciaFiscalId: 'USA', + numEstacionId: 'PM120', + nombreEstacion: 'NombreEstacion', + navegacionTraficoId: 'Altura', + fechaHoraSalidaLlegada: '2023-08-01T00:00:01', + domicilio: { + calle: 'ST', + numeroExterior: '12345', + coloniaId: 'N/A', + referencia: 'N/A', + municipioId: 'N/A', + estadoId: 'TX', + paisId: 'USA', + codigoPostalId: '12345' + } + } + ], + mercancias: [ + { + bienesTranspId: '11121900', + descripcion: 'Accesorios de equipo de telefon�a', + cantidad: 1.0, + claveUnidadId: 'XBX', + materialPeligrosoId: 'No', + denominacionGenericaProd: 'DenominacionGenericaProd1', + denominacionDistintivaProd: 'DenominacionDistintivaProd1', + fabricante: 'Fabricante1', + fechaCaducidad: '2028-01-01T00:00:00', + loteMedicamento: 'LoteMedic1', + registroSanitarioFolioAutorizacion: 'RegistroSanita1', + pesoEnKg: 1, + valorMercancia: 100, + monedaId: 'MXN', + tipoMateriaId: '05', + descripcionMateria: 'otramateria', + cantidadTransporta: [ + { cantidad: 1, idOrigen: 'OR101010', idDestino: 'DE202020' } + ], + detalleMercancia: { + unidadPesoMercId: 'Tu', + pesoBruto: 1, + pesoNeto: 1, + pesoTara: 0.001, + numPiezas: 1 + } + } + ], + transporteMaritimo: makeMaritimeTransport(), + tiposFigura: [makeMaritimeFigure()] + } + } + }; + + const response = await client.invoices.create(invoice); + console.log('Response:', response); +} + +// ============================================================================ +// 13. FACTURA INGRESO - TRANSPORTE MAR�TIMO INTERNACIONAL ADUANERO (ByReference) +// ============================================================================ +async function facturaIngresoTransporteMAritimoInternacionalAduanero(client: FiscalapiClient): Promise { + console.log('\n=== Factura Ingreso Transporte Mar�timo Internacional Aduanero (ByReference) ===\n'); + + const invoice: Invoice = { + versionCode: '4.0', + paymentFormCode: '01', + paymentMethodCode: 'PUE', + currencyCode: 'MXN', + typeCode: 'I', + expeditionZipCode: '42501', + series: 'CP3.1', + date: currentDate, + exchangeRate: 1, + exportCode: '01', + issuer: { + id: '0e82a655-5f0c-4e07-abab-8f322e4123ef' + }, + recipient: { + id: '37f7c342-d9a6-4881-9620-0da769b50ce5' + }, + items: [makeStandardItem()], + complement: { + lading: { + transpInternacId: 'Sí', + entradaSalidaMercId: 'Entrada', + paisOrigenDestinoId: 'AFG', + viaEntradaSalidaId: '01', + totalDistRec: 0, + unidadPesoId: 'XBX', + pesoNetoTotal: 1, + registroISTMOId: 'Sí', + ubicacionPoloOrigenId: '01', + ubicacionPoloDestinoId: '01', + regimenAduaneros: [ + { regimenAduaneroId: 'IMD' }, + { regimenAduaneroId: 'IMD' } + ], + ubicaciones: [ + { + tipoUbicacion: 'Origen', + idUbicacion: 'OR101010', + rfcRemitenteDestinatario: 'EKU9003173C9', + nombreRemitenteDestinatario: 'NombreRemitenteDestinatario1', + numEstacionId: 'EA0417', + nombreEstacion: 'Loreto', + navegacionTraficoId: 'Altura', + fechaHoraSalidaLlegada: '2023-08-01T00:00:00', + tipoEstacionId: '01', + domicilio: { + calle: 'Calle1', + numeroExterior: '211', + numeroInterior: '212', + coloniaId: '1957', + localidadId: '13', + referencia: 'casa blanca', + municipioId: '011', + estadoId: 'CMX', + paisId: 'MEX', + codigoPostalId: '13250' + } + }, + { + tipoUbicacion: 'Destino', + idUbicacion: 'DE202020', + rfcRemitenteDestinatario: 'EKU9003173C9', + nombreRemitenteDestinatario: 'NombreRemitenteDestinatario2', + numEstacionId: 'PM001', + nombreEstacion: 'Rosarito', + navegacionTraficoId: 'Altura', + fechaHoraSalidaLlegada: '2023-08-01T04:00:01', + tipoEstacionId: '02', + domicilio: { + calle: 'Calle2', + numeroExterior: '214', + numeroInterior: '215', + coloniaId: '0347', + localidadId: '23', + referencia: 'casa negra', + municipioId: '004', + estadoId: 'COA', + paisId: 'MEX', + codigoPostalId: '25350' + } + } + ], + mercancias: [ + { + bienesTranspId: '11121900', + descripcion: 'Accesorios de equipo de telefon�a', + cantidad: 1.0, + claveUnidadId: 'XBX', + materialPeligrosoId: 'No', + denominacionGenericaProd: 'DenominacionGenericaProd1', + denominacionDistintivaProd: 'DenominacionDistintivaProd1', + fabricante: 'Fabricante1', + fechaCaducidad: '2003-04-02T00:00:00', + loteMedicamento: 'LoteMedic1', + formaFarmaceuticaId: '01', + condicionesEspTranspId: '01', + registroSanitarioFolioAutorizacion: 'RegistroSanita1', + pesoEnKg: 1.50, + valorMercancia: 100, + monedaId: 'MXN', + fraccionArancelariaId: '6309000100', + tipoMateriaId: '05', + descripcionMateria: 'otramateria', + documentacionAduanera: [ + { tipoDocumentoId: '01', numPedimento: '23 43 0472 8000448', rfcImpo: 'EKU9003173C9' } + ], + cantidadTransporta: [ + { cantidad: 1, idOrigen: 'OR101010', idDestino: 'DE202020', cvesTransporteId: '02' } + ], + detalleMercancia: { + unidadPesoMercId: 'X1A', + pesoBruto: 1.50, + pesoNeto: 1.00, + pesoTara: 0.50 + } + } + ], + transporteMaritimo: makeMaritimeTransport(), + transporteAereo: makeAirTransport(), + tiposFigura: [ + { + tipoFiguraId: '01', + rfcFigura: 'EKU9003173C9', + numLicencia: 'NumLicencia1', + nombreFigura: 'NombreFigura1', + domicilio: { + calle: 'Calle1', + numeroExterior: 'NumeroExterior1', + numeroInterior: 'NumeroInterior1', + coloniaId: 'Colonia1', + localidadId: 'Localidad1', + referencia: 'Referencia1', + municipioId: 'Municipio1', + estadoId: 'Estado1', + paisId: 'AFG', + codigoPostalId: 'CodigoPosta1' + } + } + ] + } + } + }; + + const response = await client.invoices.create(invoice); + console.log('Response:', response); +} + +// ============================================================================ +// 14. FACTURA TRASLADO - AUTOTRANSPORTE NACIONAL (ByReference) +// ============================================================================ +async function facturaTrasladoAutotransporteNacional(client: FiscalapiClient): Promise { + console.log('\n=== Factura Traslado Autotransporte Nacional (ByReference) ===\n'); + + const invoice: Invoice = { + versionCode: '4.0', + currencyCode: 'XXX', + typeCode: 'T', + expeditionZipCode: '42501', + series: 'Serie', + date: currentDate, + exchangeRate: 1, + exportCode: '01', + issuer: { + id: '0e82a655-5f0c-4e07-abab-8f322e4123ef' + }, + recipient: { + id: '37f7c342-d9a6-4881-9620-0da769b50ce5' + }, + items: [makeStandardItem()], + complement: { + lading: { + transpInternacId: 'No', + totalDistRec: 1, + pesoNetoTotal: 0, + registroISTMOId: 'Sí', + ubicacionPoloOrigenId: '01', + ubicacionPoloDestinoId: '01', + unidadPesoId: 'XBX', + logisticaInversaRecoleccionDevolucionId: 'Sí', + ubicaciones: [ + { + tipoUbicacion: 'Origen', + idUbicacion: 'OR101010', + rfcRemitenteDestinatario: 'EKU9003173C9', + nombreRemitenteDestinatario: 'NombreRemitenteDestinatario1', + fechaHoraSalidaLlegada: '2023-08-01T00:00:00', + domicilio: { + calle: 'Calle1', + numeroExterior: '211', + numeroInterior: '212', + coloniaId: '1957', + localidadId: '13', + referencia: 'casa blanca', + municipioId: '011', + estadoId: 'CMX', + paisId: 'MEX', + codigoPostalId: '13250' + } + }, + { + tipoUbicacion: 'Destino', + idUbicacion: 'DE202020', + rfcRemitenteDestinatario: 'EKU9003173C9', + nombreRemitenteDestinatario: 'NombreRemitenteDestinatario2', + fechaHoraSalidaLlegada: '2023-08-01T00:00:01', + distanciaRecorrida: 1, + domicilio: { + calle: 'Calle2', + numeroExterior: '214', + numeroInterior: '215', + coloniaId: '0347', + localidadId: '23', + referencia: 'casa negra', + municipioId: '004', + estadoId: 'COA', + paisId: 'MEX', + codigoPostalId: '25350' + } + } + ], + mercancias: [ + { + bienesTranspId: '11121900', + descripcion: 'Accesorios de equipo de telefon�a', + cantidad: 1.0, + claveUnidadId: 'XBX', + materialPeligrosoId: 'No', + denominacionGenericaProd: 'DenominacionGenericaProd1', + denominacionDistintivaProd: 'DenominacionDistintivaProd1', + fabricante: 'Fabricante1', + fechaCaducidad: '2028-01-01T00:00:00', + loteMedicamento: 'LoteMedic1', + registroSanitarioFolioAutorizacion: 'RegistroSanita1', + pesoEnKg: 1, + cantidadTransporta: [ + { cantidad: 1, idOrigen: 'OR101010', idDestino: 'DE202020' } + ] + } + ], + autotransporte: { + permSCTId: 'TPAF01', + numPermisoSCT: 'NumPermisoSCT1', + configVehicularId: 'VL', + pesoBrutoVehicular: 1, + placaVM: 'plac892', + anioModeloVM: 2020, + aseguraRespCivil: 'AseguraRespCivil', + polizaRespCivil: '123456789', + remolques: [ + { subTipoRemId: 'CTR004', placa: 'VL45K98' } + ] + }, + tiposFigura: [ + { + tipoFiguraId: '01', + rfcFigura: 'EKU9003173C9', + numLicencia: 'a234567890', + nombreFigura: 'NombreFigura' + } + ] + } + } + }; + + const response = await client.invoices.create(invoice); + console.log('Response:', response); +} + +// ============================================================================ +// 15. FACTURA TRASLADO - AUTOTRANSPORTE EXTRANJERO (ByReference) +// ============================================================================ +async function facturaTrasladoAutotransporteExtranjero(client: FiscalapiClient): Promise { + console.log('\n=== Factura Traslado Autotransporte Extranjero - Exportaci�n (ByReference) ===\n'); + + const invoice: Invoice = { + versionCode: '4.0', + currencyCode: 'XXX', + typeCode: 'T', + expeditionZipCode: '42501', + series: 'SerieCCP31', + date: currentDate, + exchangeRate: 1, + exportCode: '01', + issuer: { + id: '0e82a655-5f0c-4e07-abab-8f322e4123ef' + }, + recipient: { + id: '37f7c342-d9a6-4881-9620-0da769b50ce5' + }, + items: [makeStandardItem()], + complement: { + lading: { + transpInternacId: 'Sí', + entradaSalidaMercId: 'Salida', + paisOrigenDestinoId: 'USA', + viaEntradaSalidaId: '01', + totalDistRec: 1, + pesoNetoTotal: 0, + registroISTMOId: 'Sí', + ubicacionPoloOrigenId: '01', + ubicacionPoloDestinoId: '01', + unidadPesoId: 'XBX', + logisticaInversaRecoleccionDevolucionId: 'Sí', + regimenAduaneros: [ + { regimenAduaneroId: 'EXD' } + ], + ubicaciones: [ + { + tipoUbicacion: 'Origen', + idUbicacion: 'OR101010', + rfcRemitenteDestinatario: 'XEXX010101000', + numRegIdTrib: '01010101', + residenciaFiscalId: 'USA', + fechaHoraSalidaLlegada: '2023-08-01T00:00:01', + domicilio: { + calle: 'ST', + numeroExterior: '214', + coloniaId: 'N/A', + referencia: 'WHITE HOUSE', + municipioId: 'N/A', + estadoId: 'TX', + paisId: 'USA', + codigoPostalId: 'N/A' + } + }, + { + tipoUbicacion: 'Destino', + idUbicacion: 'DE202020', + rfcRemitenteDestinatario: 'XEXX010101000', + numRegIdTrib: '01010101', + residenciaFiscalId: 'USA', + fechaHoraSalidaLlegada: '2023-08-01T00:00:01', + distanciaRecorrida: 1, + domicilio: { + calle: 'ST', + numeroExterior: '214', + coloniaId: 'N/A', + referencia: 'WHITE HOUSE', + municipioId: 'N/A', + estadoId: 'TX', + paisId: 'USA', + codigoPostalId: 'N/A' + } + } + ], + mercancias: [ + { + bienesTranspId: '11121900', + descripcion: 'Accesorios de equipo de telefon�a', + cantidad: 1.0, + claveUnidadId: 'XBX', + materialPeligrosoId: 'No', + denominacionGenericaProd: 'DenominacionGenericaProd1', + denominacionDistintivaProd: 'DenominacionDistintivaProd1', + fabricante: 'Fabricante1', + fechaCaducidad: '2003-04-02T00:00:00', + loteMedicamento: 'LoteMedic1', + formaFarmaceuticaId: '01', + condicionesEspTranspId: '01', + registroSanitarioFolioAutorizacion: 'RegistroSanita1', + pesoEnKg: 1, + fraccionArancelariaId: '6309000100', + tipoMateriaId: '05', + descripcionMateria: 'otramateria', + cantidadTransporta: [ + { cantidad: 1, idOrigen: 'OR101010', idDestino: 'DE202020' } + ] + } + ], + autotransporte: { + permSCTId: 'TPAF01', + numPermisoSCT: 'NumPermisoSCT1', + configVehicularId: 'VL', + pesoBrutoVehicular: 1, + placaVM: 'plac892', + anioModeloVM: 2020, + aseguraRespCivil: 'AseguraRespCivil', + polizaRespCivil: '123456789', + remolques: [ + { subTipoRemId: 'CTR004', placa: 'VL45K98' } + ] + }, + tiposFigura: [ + { + tipoFiguraId: '01', + rfcFigura: 'EKU9003173C9', + numLicencia: 'NumLicencia1', + nombreFigura: 'NombreFigura1', + domicilio: { + calle: 'ST', + numeroExterior: '214', + coloniaId: 'N/A', + referencia: 'WHITE HOUSE', + municipioId: 'N/A', + estadoId: 'TX', + paisId: 'USA', + codigoPostalId: 'N/A' + } + } + ] + } + } + }; + + const response = await client.invoices.create(invoice); + console.log('Response:', response); +} + +// ============================================================================ +// 16. FACTURA TRASLADO - AUTOTRANSPORTE INTERNACIONAL ADUANERO (ByReference) +// ============================================================================ +async function facturaTrasladoAutotransporteInternacionalAduanero(client: FiscalapiClient): Promise { + console.log('\n=== Factura Traslado Autotransporte Internacional Aduanero - Importaci�n (ByReference) ===\n'); + + const invoice: Invoice = { + versionCode: '4.0', + currencyCode: 'XXX', + typeCode: 'T', + expeditionZipCode: '42501', + series: 'SerieCCP31', + date: currentDate, + exchangeRate: 1, + exportCode: '01', + issuer: { + id: '0e82a655-5f0c-4e07-abab-8f322e4123ef' + }, + recipient: { + id: '37f7c342-d9a6-4881-9620-0da769b50ce5' + }, + items: [makeStandardItem()], + complement: { + lading: { + transpInternacId: 'Sí', + entradaSalidaMercId: 'Entrada', + paisOrigenDestinoId: 'USA', + viaEntradaSalidaId: '01', + totalDistRec: 1, + pesoNetoTotal: 0, + registroISTMOId: 'Sí', + ubicacionPoloOrigenId: '01', + ubicacionPoloDestinoId: '01', + unidadPesoId: 'XBX', + logisticaInversaRecoleccionDevolucionId: 'Sí', + regimenAduaneros: [ + { regimenAduaneroId: 'IMD' } + ], + ubicaciones: [ + { + tipoUbicacion: 'Origen', + idUbicacion: 'OR101010', + rfcRemitenteDestinatario: 'XEXX010101000', + numRegIdTrib: '01010101', + residenciaFiscalId: 'USA', + fechaHoraSalidaLlegada: '2023-08-01T00:00:01', + domicilio: { + calle: 'ST', + numeroExterior: '214', + coloniaId: 'N/A', + referencia: 'WHITE HOUSE', + municipioId: 'N/A', + estadoId: 'TX', + paisId: 'USA', + codigoPostalId: 'N/A' + } + }, + { + tipoUbicacion: 'Destino', + idUbicacion: 'DE202020', + rfcRemitenteDestinatario: 'XEXX010101000', + numRegIdTrib: '01010101', + residenciaFiscalId: 'USA', + fechaHoraSalidaLlegada: '2023-08-01T00:00:01', + distanciaRecorrida: 1, + domicilio: { + calle: 'ST', + numeroExterior: '214', + coloniaId: 'N/A', + referencia: 'WHITE HOUSE', + municipioId: 'N/A', + estadoId: 'TX', + paisId: 'USA', + codigoPostalId: 'N/A' + } + } + ], + mercancias: [ + { + bienesTranspId: '11121900', + descripcion: 'Accesorios de equipo de telefon�a', + cantidad: 1.0, + claveUnidadId: 'XBX', + materialPeligrosoId: 'No', + denominacionGenericaProd: 'DenominacionGenericaProd1', + denominacionDistintivaProd: 'DenominacionDistintivaProd1', + fabricante: 'Fabricante1', + fechaCaducidad: '2003-04-02T00:00:00', + loteMedicamento: 'LoteMedic1', + formaFarmaceuticaId: '01', + condicionesEspTranspId: '01', + registroSanitarioFolioAutorizacion: 'RegistroSanita1', + pesoEnKg: 1, + fraccionArancelariaId: '6309000100', + tipoMateriaId: '05', + descripcionMateria: 'otramateria', + documentacionAduanera: [ + { tipoDocumentoId: '01', numPedimento: '23 43 0472 8000448', rfcImpo: 'EKU9003173C9' } + ], + cantidadTransporta: [ + { cantidad: 1, idOrigen: 'OR101010', idDestino: 'DE202020' } + ] + } + ], + autotransporte: { + permSCTId: 'TPAF01', + numPermisoSCT: 'NumPermisoSCT1', + configVehicularId: 'VL', + pesoBrutoVehicular: 1, + placaVM: 'plac892', + anioModeloVM: 2020, + aseguraRespCivil: 'AseguraRespCivil', + polizaRespCivil: '123456789', + remolques: [ + { subTipoRemId: 'CTR004', placa: 'VL45K98' } + ] + }, + tiposFigura: [ + { + tipoFiguraId: '01', + rfcFigura: 'EKU9003173C9', + numLicencia: 'NumLicencia1', + nombreFigura: 'NombreFigura1', + domicilio: { + calle: 'ST', + numeroExterior: '214', + coloniaId: 'N/A', + referencia: 'WHITE HOUSE', + municipioId: 'N/A', + estadoId: 'TX', + paisId: 'USA', + codigoPostalId: 'N/A' + } + } + ] + } + } + }; + + const response = await client.invoices.create(invoice); + console.log('Response:', response); +} + +// ============================================================================ +// 17. FACTURA TRASLADO - TRANSPORTE FERROVIARIO NACIONAL (ByReference) +// ============================================================================ +async function facturaTrasladoTransporteFerroviarioNacional(client: FiscalapiClient): Promise { + console.log('\n=== Factura Traslado Transporte Ferroviario Nacional (ByReference) ===\n'); + + const invoice: Invoice = { + versionCode: '4.0', + currencyCode: 'XXX', + typeCode: 'T', + expeditionZipCode: '42501', + series: 'Serie', + date: currentDate, + exchangeRate: 1, + exportCode: '01', + issuer: { + id: '0e82a655-5f0c-4e07-abab-8f322e4123ef' + }, + recipient: { + id: '37f7c342-d9a6-4881-9620-0da769b50ce5' + }, + items: [makeStandardItem()], + complement: { + lading: { + transpInternacId: 'No', + totalDistRec: 500, + pesoNetoTotal: 10, + registroISTMOId: 'Sí', + ubicacionPoloOrigenId: '01', + ubicacionPoloDestinoId: '01', + unidadPesoId: 'XBX', + ubicaciones: [ + ...makeRailLocationsBase(), + { + tipoUbicacion: 'Destino', + idUbicacion: 'DE202025', + rfcRemitenteDestinatario: 'EKU9003173C9', + nombreRemitenteDestinatario: 'NombreRemitenteDestinatario2', + numEstacionId: 'JM047', + nombreEstacion: 'HUEHUETOCA', + fechaHoraSalidaLlegada: '2023-08-01T05:00:01', + tipoEstacionId: '03', + distanciaRecorrida: 100.00, + domicilio: { + calle: 'Calle2', + numeroExterior: '214', + numeroInterior: '215', + coloniaId: '0347', + localidadId: '23', + referencia: 'casa negra', + municipioId: '004', + estadoId: 'COA', + paisId: 'MEX', + codigoPostalId: '25350' + } + } + ], + mercancias: [ + { + bienesTranspId: '11121900', + descripcion: 'Accesorios de equipo de telefon�a', + cantidad: 1.0, + claveUnidadId: 'XBX', + materialPeligrosoId: 'No', + denominacionGenericaProd: 'DenominacionGenericaProd1', + denominacionDistintivaProd: 'DenominacionDistintivaProd1', + fabricante: 'Fabricante1', + fechaCaducidad: '2028-01-01T00:00:00', + loteMedicamento: 'LoteMedic1', + registroSanitarioFolioAutorizacion: 'RegistroSanita1', + pesoEnKg: 1, + cantidadTransporta: [ + { cantidad: 1, idOrigen: 'OR101010', idDestino: 'DE202025' } + ] + } + ], + transporteFerroviario: makeRailwayTransport(), + tiposFigura: [makeRailwayFigure()] + } + } + }; + + const response = await client.invoices.create(invoice); + console.log('Response:', response); +} + +// ============================================================================ +// 18. FACTURA TRASLADO - TRANSPORTE FERROVIARIO EXTRANJERO (ByReference) +// ============================================================================ +async function facturaTrasladoTransporteFerroviarioExtranjero(client: FiscalapiClient): Promise { + console.log('\n=== Factura Traslado Transporte Ferroviario Extranjero - Exportaci�n (ByReference) ===\n'); + + const invoice: Invoice = { + versionCode: '4.0', + currencyCode: 'XXX', + typeCode: 'T', + expeditionZipCode: '42501', + series: 'Serie', + date: currentDate, + exchangeRate: 1, + exportCode: '01', + issuer: { + id: '0e82a655-5f0c-4e07-abab-8f322e4123ef' + }, + recipient: { + id: '37f7c342-d9a6-4881-9620-0da769b50ce5' + }, + items: [makeStandardItem()], + complement: { + lading: { + transpInternacId: 'Sí', + entradaSalidaMercId: 'Salida', + paisOrigenDestinoId: 'USA', + viaEntradaSalidaId: '04', + totalDistRec: 500, + pesoNetoTotal: 10, + registroISTMOId: 'Sí', + ubicacionPoloOrigenId: '01', + ubicacionPoloDestinoId: '01', + unidadPesoId: 'XBX', + regimenAduaneros: [ + { regimenAduaneroId: 'EXD' } + ], + ubicaciones: [ + ...makeRailLocationsBase(), + { + tipoUbicacion: 'Destino', + idUbicacion: 'DE202025', + rfcRemitenteDestinatario: 'XEXX010101000', + nombreRemitenteDestinatario: 'NombreRemitenteDestinatario2', + numRegIdTrib: '01010101', + residenciaFiscalId: 'USA', + numEstacionId: 'EF0001', + nombreEstacion: 'NombreEstacion', + fechaHoraSalidaLlegada: '2023-08-01T05:00:01', + distanciaRecorrida: 100.00, + domicilio: { + calle: 'ST', + numeroExterior: '1234', + coloniaId: '1234', + referencia: 'WHITE HOUSE', + municipioId: '1234', + estadoId: 'TX', + paisId: 'USA', + codigoPostalId: '12345' + } + } + ], + mercancias: [ + { + bienesTranspId: '11121900', + descripcion: 'Accesorios de equipo de telefon�a', + cantidad: 1.0, + claveUnidadId: 'XBX', + materialPeligrosoId: 'No', + denominacionGenericaProd: 'DenominacionGenericaProd1', + denominacionDistintivaProd: 'DenominacionDistintivaProd1', + fabricante: 'Fabricante1', + fechaCaducidad: '2028-01-01T00:00:00', + loteMedicamento: 'LoteMedic1', + registroSanitarioFolioAutorizacion: 'RegistroSanita1', + pesoEnKg: 1, + tipoMateriaId: '05', + descripcionMateria: 'otramateria', + cantidadTransporta: [ + { cantidad: 1, idOrigen: 'OR101010', idDestino: 'DE202025' } + ] + } + ], + transporteFerroviario: makeRailwayTransport(), + tiposFigura: [makeRailwayFigure()] + } + } + }; + + const response = await client.invoices.create(invoice); + console.log('Response:', response); +} + +// ============================================================================ +// 19. FACTURA TRASLADO - TRANSPORTE FERROVIARIO INTERNACIONAL ADUANERO (ByReference) +// ============================================================================ +async function facturaTrasladoTransporteFerroviarioInternacionalAduanero(client: FiscalapiClient): Promise { + console.log('\n=== Factura Traslado Transporte Ferroviario Internacional Aduanero - Importaci�n (ByReference) ===\n'); + + const invoice: Invoice = { + versionCode: '4.0', + currencyCode: 'XXX', + typeCode: 'T', + expeditionZipCode: '42501', + series: 'Serie', + date: currentDate, + exchangeRate: 1, + exportCode: '01', + issuer: { + id: '0e82a655-5f0c-4e07-abab-8f322e4123ef' + }, + recipient: { + id: '37f7c342-d9a6-4881-9620-0da769b50ce5' + }, + items: [makeStandardItem()], + complement: { + lading: { + transpInternacId: 'Sí', + entradaSalidaMercId: 'Entrada', + paisOrigenDestinoId: 'AFG', + viaEntradaSalidaId: '04', + totalDistRec: 500, + pesoNetoTotal: 10, + registroISTMOId: 'Sí', + ubicacionPoloOrigenId: '01', + ubicacionPoloDestinoId: '01', + unidadPesoId: 'XBX', + regimenAduaneros: [ + { regimenAduaneroId: 'IMD' } + ], + ubicaciones: [ + ...makeRailLocationsBase(), + { + tipoUbicacion: 'Destino', + idUbicacion: 'DE202025', + rfcRemitenteDestinatario: 'EKU9003173C9', + nombreRemitenteDestinatario: 'NombreRemitenteDestinatario2', + numEstacionId: 'JM047', + nombreEstacion: 'HUEHUETOCA', + fechaHoraSalidaLlegada: '2023-08-01T05:00:01', + tipoEstacionId: '03', + distanciaRecorrida: 100.00, + domicilio: { + calle: 'Calle2', + numeroExterior: '214', + numeroInterior: '215', + coloniaId: '0347', + localidadId: '23', + referencia: 'casa negra', + municipioId: '004', + estadoId: 'COA', + paisId: 'MEX', + codigoPostalId: '25350' + } + } + ], + mercancias: [ + { + bienesTranspId: '11121900', + descripcion: 'Accesorios de equipo de telefon�a', + cantidad: 1.0, + claveUnidadId: 'XBX', + materialPeligrosoId: 'No', + denominacionGenericaProd: 'DenominacionGenericaProd1', + denominacionDistintivaProd: 'DenominacionDistintivaProd1', + fabricante: 'Fabricante1', + fechaCaducidad: '2028-01-01T00:00:00', + loteMedicamento: 'LoteMedic1', + registroSanitarioFolioAutorizacion: 'RegistroSanita1', + pesoEnKg: 1, + tipoMateriaId: '05', + descripcionMateria: 'otramateria', + documentacionAduanera: [ + { tipoDocumentoId: '01', numPedimento: '23 43 0472 8000448', rfcImpo: 'EKU9003173C9' } + ], + cantidadTransporta: [ + { cantidad: 1, idOrigen: 'OR101010', idDestino: 'DE202025' } + ] + } + ], + transporteFerroviario: makeRailwayTransport(), + tiposFigura: [makeRailwayFigure()] + } + } + }; + + const response = await client.invoices.create(invoice); + console.log('Response:', response); +} + +// ============================================================================ +// 20. FACTURA TRASLADO - TRANSPORTE A�REO NACIONAL (ByReference) +// ============================================================================ +async function facturaTrasladoTransporteAereoNacional(client: FiscalapiClient): Promise { + console.log('\n=== Factura Traslado Transporte A�reo Nacional (ByReference) ===\n'); + + const invoice: Invoice = { + versionCode: '4.0', + currencyCode: 'XXX', + typeCode: 'T', + expeditionZipCode: '42501', + series: 'Serie', + date: currentDate, + exchangeRate: 1, + exportCode: '01', + issuer: { + id: '0e82a655-5f0c-4e07-abab-8f322e4123ef' + }, + recipient: { + id: '37f7c342-d9a6-4881-9620-0da769b50ce5' + }, + items: [makeStandardItem()], + complement: { + lading: { + transpInternacId: 'No', + totalDistRec: 0, + unidadPesoId: 'XBX', + pesoNetoTotal: 10, + ubicaciones: [ + { + tipoUbicacion: 'Origen', + idUbicacion: 'OR101010', + rfcRemitenteDestinatario: 'EKU9003173C9', + nombreRemitenteDestinatario: 'NombreRemitenteDestinatario1', + numEstacionId: 'EA0417', + nombreEstacion: 'Loreto', + fechaHoraSalidaLlegada: '2023-08-01T00:00:00', + tipoEstacionId: '01', + domicilio: { + calle: 'Calle1', + numeroExterior: '211', + numeroInterior: '212', + coloniaId: '1957', + localidadId: '13', + referencia: 'casa blanca', + municipioId: '011', + estadoId: 'CMX', + paisId: 'MEX', + codigoPostalId: '13250' + } + }, + { + tipoUbicacion: 'Destino', + idUbicacion: 'DE202020', + rfcRemitenteDestinatario: 'EKU9003173C9', + nombreRemitenteDestinatario: 'NombreRemitenteDestinatario2', + numEstacionId: 'EA0418', + nombreEstacion: 'Los Cabos', + fechaHoraSalidaLlegada: '2023-08-01T00:00:01', + tipoEstacionId: '03', + domicilio: { + calle: 'Calle2', + numeroExterior: '214', + numeroInterior: '215', + coloniaId: '0347', + localidadId: '23', + referencia: 'casa negra', + municipioId: '004', + estadoId: 'COA', + paisId: 'MEX', + codigoPostalId: '25350' + } + } + ], + mercancias: [ + { + bienesTranspId: '11121900', + descripcion: 'Accesorios de equipo de telefon�a', + cantidad: 1.0, + claveUnidadId: 'XBX', + materialPeligrosoId: 'No', + denominacionGenericaProd: 'DenominacionGenericaProd1', + denominacionDistintivaProd: 'DenominacionDistintivaProd1', + fabricante: 'Fabricante1', + fechaCaducidad: '2028-01-01T00:00:00', + loteMedicamento: 'LoteMedic1', + registroSanitarioFolioAutorizacion: 'RegistroSanita1', + pesoEnKg: 1, + valorMercancia: 100, + monedaId: 'MXN', + cantidadTransporta: [ + { cantidad: 1, idOrigen: 'OR101010', idDestino: 'DE202020' } + ] + } + ], + transporteAereo: makeAirTransport(), + tiposFigura: [makeAirFigure()] + } + } + }; + + const response = await client.invoices.create(invoice); + console.log('Response:', response); +} + +// ============================================================================ +// 21. FACTURA TRASLADO - TRANSPORTE A�REO EXTRANJERO (ByReference) +// ============================================================================ +async function facturaTrasladoTransporteAereoExtranjero(client: FiscalapiClient): Promise { + console.log('\n=== Factura Traslado Transporte A�reo Extranjero (ByReference) ===\n'); + + const invoice: Invoice = { + versionCode: '4.0', + currencyCode: 'XXX', + typeCode: 'T', + expeditionZipCode: '42501', + series: 'Serie', + date: currentDate, + exchangeRate: 1, + exportCode: '01', + issuer: { + id: '0e82a655-5f0c-4e07-abab-8f322e4123ef' + }, + recipient: { + id: '37f7c342-d9a6-4881-9620-0da769b50ce5' + }, + items: [makeStandardItem()], + complement: { + lading: { + transpInternacId: 'Sí', + entradaSalidaMercId: 'Salida', + paisOrigenDestinoId: 'USA', + viaEntradaSalidaId: '03', + totalDistRec: 0, + unidadPesoId: 'XBX', + pesoNetoTotal: 10, + regimenAduaneros: [ + { regimenAduaneroId: 'EXD' } + ], + ubicaciones: [ + { + tipoUbicacion: 'Origen', + idUbicacion: 'OR101010', + rfcRemitenteDestinatario: 'EKU9003173C9', + nombreRemitenteDestinatario: 'NombreRemitenteDestinatario1', + numEstacionId: 'EA0417', + nombreEstacion: 'Loreto', + fechaHoraSalidaLlegada: '2023-08-01T00:00:00', + tipoEstacionId: '01', + domicilio: { + calle: 'Calle2', + numeroExterior: '214', + numeroInterior: '215', + coloniaId: '0347', + localidadId: '23', + referencia: 'casa negra', + municipioId: '004', + estadoId: 'COA', + paisId: 'MEX', + codigoPostalId: '25350' + } + }, + { + tipoUbicacion: 'Destino', + idUbicacion: 'DE202020', + rfcRemitenteDestinatario: 'XEXX010101000', + nombreRemitenteDestinatario: 'NombreRemitenteDestinatario', + numRegIdTrib: '01010101', + residenciaFiscalId: 'USA', + numEstacionId: 'EA0143', + nombreEstacion: 'Phoenix-Mesa Gateway', + fechaHoraSalidaLlegada: '2023-08-01T00:00:01', + domicilio: { + calle: 'ST', + numeroExterior: '12344', + coloniaId: 'N/A', + referencia: 'WHITE HOUSE', + municipioId: 'N/A', + estadoId: 'TX', + paisId: 'USA', + codigoPostalId: '12345' + } + } + ], + mercancias: [ + { + bienesTranspId: '11121900', + descripcion: 'Accesorios de equipo de telefon�a', + cantidad: 1.0, + claveUnidadId: 'XBX', + materialPeligrosoId: 'No', + denominacionGenericaProd: 'DenominacionGenericaProd1', + denominacionDistintivaProd: 'DenominacionDistintivaProd1', + fabricante: 'Fabricante1', + fechaCaducidad: '2028-01-01T00:00:00', + loteMedicamento: 'LoteMedic1', + registroSanitarioFolioAutorizacion: 'RegistroSanita1', + pesoEnKg: 1, + valorMercancia: 100, + monedaId: 'MXN', + tipoMateriaId: '05', + descripcionMateria: 'otramateria', + cantidadTransporta: [ + { cantidad: 1, idOrigen: 'OR101010', idDestino: 'DE202020' } + ] + } + ], + transporteAereo: makeAirTransport(), + tiposFigura: [makeAirFigure()] + } + } + }; + + const response = await client.invoices.create(invoice); + console.log('Response:', response); +} + +// ============================================================================ +// 22. FACTURA TRASLADO - TRANSPORTE A�REO INTERNACIONAL ADUANERO (ByReference) +// ============================================================================ +async function facturaTrasladoTransporteAereoInternacionalAduanero(client: FiscalapiClient): Promise { + console.log('\n=== Factura Traslado Transporte A�reo Internacional Aduanero - Importaci�n (ByReference) ===\n'); + + const invoice: Invoice = { + versionCode: '4.0', + currencyCode: 'XXX', + typeCode: 'T', + expeditionZipCode: '42501', + series: 'Serie', + date: currentDate, + exchangeRate: 1, + exportCode: '01', + issuer: { + id: '0e82a655-5f0c-4e07-abab-8f322e4123ef' + }, + recipient: { + id: '37f7c342-d9a6-4881-9620-0da769b50ce5' + }, + items: [makeStandardItem()], + complement: { + lading: { + transpInternacId: 'Sí', + entradaSalidaMercId: 'Entrada', + paisOrigenDestinoId: 'AFG', + viaEntradaSalidaId: '03', + totalDistRec: 0, + unidadPesoId: 'XBX', + pesoNetoTotal: 10, + regimenAduaneros: [ + { regimenAduaneroId: 'IMD' } + ], + ubicaciones: [ + { + tipoUbicacion: 'Origen', + idUbicacion: 'OR101010', + rfcRemitenteDestinatario: 'EKU9003173C9', + nombreRemitenteDestinatario: 'NombreRemitenteDestinatario1', + numEstacionId: 'EA0417', + nombreEstacion: 'Loreto', + fechaHoraSalidaLlegada: '2023-08-01T00:00:00', + tipoEstacionId: '01', + domicilio: { + calle: 'Calle1', + numeroExterior: '211', + numeroInterior: '212', + coloniaId: '1957', + localidadId: '13', + referencia: 'casa blanca', + municipioId: '011', + estadoId: 'CMX', + paisId: 'MEX', + codigoPostalId: '13250' + } + }, + { + tipoUbicacion: 'Destino', + idUbicacion: 'DE202020', + rfcRemitenteDestinatario: 'EKU9003173C9', + nombreRemitenteDestinatario: 'NombreRemitenteDestinatario2', + numEstacionId: 'EA0418', + nombreEstacion: 'Los Cabos', + fechaHoraSalidaLlegada: '2023-08-01T00:00:01', + tipoEstacionId: '03', + domicilio: { + calle: 'Calle2', + numeroExterior: '214', + numeroInterior: '215', + coloniaId: '0347', + localidadId: '23', + referencia: 'casa negra', + municipioId: '004', + estadoId: 'COA', + paisId: 'MEX', + codigoPostalId: '25350' + } + } + ], + mercancias: [ + { + bienesTranspId: '11121900', + descripcion: 'Accesorios de equipo de telefon�a', + cantidad: 1.0, + claveUnidadId: 'XBX', + materialPeligrosoId: 'No', + denominacionGenericaProd: 'DenominacionGenericaProd1', + denominacionDistintivaProd: 'DenominacionDistintivaProd1', + fabricante: 'Fabricante1', + fechaCaducidad: '2028-01-01T00:00:00', + loteMedicamento: 'LoteMedic1', + registroSanitarioFolioAutorizacion: 'RegistroSanita1', + pesoEnKg: 1, + valorMercancia: 100, + monedaId: 'MXN', + tipoMateriaId: '05', + descripcionMateria: 'otramateria', + documentacionAduanera: [ + { tipoDocumentoId: '01', numPedimento: '23 43 0472 8000448', rfcImpo: 'EKU9003173C9' } + ], + cantidadTransporta: [ + { cantidad: 1, idOrigen: 'OR101010', idDestino: 'DE202020' } + ] + } + ], + transporteAereo: makeAirTransport(), + tiposFigura: [makeAirFigure()] + } + } + }; + + const response = await client.invoices.create(invoice); + console.log('Response:', response); +} + +// ============================================================================ +// 23. FACTURA TRASLADO - TRANSPORTE MAR�TIMO NACIONAL (ByReference) +// ============================================================================ +async function facturaTrasladoTransporteMAritimoNacional(client: FiscalapiClient): Promise { + console.log('\n=== Factura Traslado Transporte Mar�timo Nacional (ByReference) ===\n'); + + const invoice: Invoice = { + versionCode: '4.0', + currencyCode: 'XXX', + typeCode: 'T', + expeditionZipCode: '42501', + series: 'Serie', + date: currentDate, + exchangeRate: 1, + exportCode: '01', + issuer: { + id: '0e82a655-5f0c-4e07-abab-8f322e4123ef' + }, + recipient: { + id: '37f7c342-d9a6-4881-9620-0da769b50ce5' + }, + items: [makeStandardItem()], + complement: { + lading: { + transpInternacId: 'No', + totalDistRec: 0, + unidadPesoId: 'XBX', + pesoNetoTotal: 1, + ubicaciones: [ + { + tipoUbicacion: 'Origen', + idUbicacion: 'OR101010', + rfcRemitenteDestinatario: 'EKU9003173C9', + nombreRemitenteDestinatario: 'NombreRemitenteDestinatario1', + numEstacionId: 'PM001', + nombreEstacion: 'Rosarito', + navegacionTraficoId: 'Altura', + fechaHoraSalidaLlegada: '2023-08-01T00:00:00', + tipoEstacionId: '01', + domicilio: { + calle: 'Calle1', + numeroExterior: '211', + numeroInterior: '212', + coloniaId: '1957', + localidadId: '13', + referencia: 'casa blanca', + municipioId: '011', + estadoId: 'CMX', + paisId: 'MEX', + codigoPostalId: '13250' + } + }, + { + tipoUbicacion: 'Destino', + idUbicacion: 'DE202020', + rfcRemitenteDestinatario: 'EKU9003173C9', + nombreRemitenteDestinatario: 'NombreRemitenteDestinatario2', + numEstacionId: 'PM001', + nombreEstacion: 'Rosarito', + navegacionTraficoId: 'Altura', + fechaHoraSalidaLlegada: '2023-08-01T00:00:01', + tipoEstacionId: '03', + domicilio: { + calle: 'Calle2', + numeroExterior: '214', + numeroInterior: '215', + coloniaId: '0347', + localidadId: '23', + referencia: 'casa negra', + municipioId: '004', + estadoId: 'COA', + paisId: 'MEX', + codigoPostalId: '25350' + } + } + ], + mercancias: [ + { + bienesTranspId: '11121900', + descripcion: 'Accesorios de equipo de telefon�a', + cantidad: 1.0, + claveUnidadId: 'XBX', + materialPeligrosoId: 'No', + denominacionGenericaProd: 'DenominacionGenericaProd1', + denominacionDistintivaProd: 'DenominacionDistintivaProd1', + fabricante: 'Fabricante1', + fechaCaducidad: '2028-01-01T00:00:00', + loteMedicamento: 'LoteMedic1', + registroSanitarioFolioAutorizacion: 'RegistroSanita1', + pesoEnKg: 1, + valorMercancia: 100, + monedaId: 'MXN', + cantidadTransporta: [ + { cantidad: 1, idOrigen: 'OR101010', idDestino: 'DE202020' } + ], + detalleMercancia: { + unidadPesoMercId: 'Tu', + pesoBruto: 1, + pesoNeto: 1, + pesoTara: 0.001, + numPiezas: 1 + } + } + ], + transporteMaritimo: makeMaritimeTransport(), + tiposFigura: [makeMaritimeFigure()] + } + } + }; + + const response = await client.invoices.create(invoice); + console.log('Response:', response); +} + +// ============================================================================ +// 24. FACTURA TRASLADO - TRANSPORTE MAR�TIMO EXTRANJERO (ByReference) +// ============================================================================ +async function facturaTrasladoTransporteMAritimoExtranjero(client: FiscalapiClient): Promise { + console.log('\n=== Factura Traslado Transporte Mar�timo Extranjero (ByReference) ===\n'); + + const invoice: Invoice = { + versionCode: '4.0', + currencyCode: 'XXX', + typeCode: 'T', + expeditionZipCode: '42501', + series: 'Serie', + date: currentDate, + exchangeRate: 1, + exportCode: '01', + issuer: { + id: '0e82a655-5f0c-4e07-abab-8f322e4123ef' + }, + recipient: { + id: '37f7c342-d9a6-4881-9620-0da769b50ce5' + }, + items: [makeStandardItem()], + complement: { + lading: { + transpInternacId: 'Sí', + entradaSalidaMercId: 'Salida', + paisOrigenDestinoId: 'USA', + viaEntradaSalidaId: '02', + totalDistRec: 0, + unidadPesoId: 'XBX', + pesoNetoTotal: 1, + regimenAduaneros: [ + { regimenAduaneroId: 'EXD' } + ], + ubicaciones: [ + { + tipoUbicacion: 'Origen', + idUbicacion: 'OR101010', + rfcRemitenteDestinatario: 'EKU9003173C9', + nombreRemitenteDestinatario: 'NombreRemitenteDestinatario1', + numEstacionId: 'PM001', + nombreEstacion: 'Rosarito', + navegacionTraficoId: 'Altura', + fechaHoraSalidaLlegada: '2023-08-01T00:00:00', + tipoEstacionId: '01', + domicilio: { + calle: 'Calle1', + numeroExterior: '211', + numeroInterior: '212', + coloniaId: '1957', + localidadId: '13', + referencia: 'casa blanca', + municipioId: '011', + estadoId: 'CMX', + paisId: 'MEX', + codigoPostalId: '13250' + } + }, + { + tipoUbicacion: 'Destino', + idUbicacion: 'DE202020', + rfcRemitenteDestinatario: 'XEXX010101000', + nombreRemitenteDestinatario: 'NombreRemitenteDestinatario2', + numRegIdTrib: '01010101', + residenciaFiscalId: 'USA', + numEstacionId: 'PM120', + nombreEstacion: 'NombreEstacion', + navegacionTraficoId: 'Altura', + fechaHoraSalidaLlegada: '2023-08-01T00:00:01', + domicilio: { + calle: 'ST', + numeroExterior: '12345', + coloniaId: 'N/A', + referencia: 'N/A', + municipioId: 'N/A', + estadoId: 'TX', + paisId: 'USA', + codigoPostalId: '12345' + } + } + ], + mercancias: [ + { + bienesTranspId: '11121900', + descripcion: 'Accesorios de equipo de telefon�a', + cantidad: 1.0, + claveUnidadId: 'XBX', + materialPeligrosoId: 'No', + denominacionGenericaProd: 'DenominacionGenericaProd1', + denominacionDistintivaProd: 'DenominacionDistintivaProd1', + fabricante: 'Fabricante1', + fechaCaducidad: '2028-01-01T00:00:00', + loteMedicamento: 'LoteMedic1', + registroSanitarioFolioAutorizacion: 'RegistroSanita1', + pesoEnKg: 1, + valorMercancia: 100, + monedaId: 'MXN', + tipoMateriaId: '05', + descripcionMateria: 'otramateria', + cantidadTransporta: [ + { cantidad: 1, idOrigen: 'OR101010', idDestino: 'DE202020' } + ], + detalleMercancia: { + unidadPesoMercId: 'Tu', + pesoBruto: 1, + pesoNeto: 1, + pesoTara: 0.001, + numPiezas: 1 + } + } + ], + transporteMaritimo: makeMaritimeTransport(), + tiposFigura: [makeMaritimeFigure()] + } + } + }; + + const response = await client.invoices.create(invoice); + console.log('Response:', response); +} + +// ============================================================================ +// 25. FACTURA TRASLADO - TRANSPORTE MAR�TIMO INTERNACIONAL ADUANERO (ByReference) +// ============================================================================ +async function facturaTrasladoTransporteMAritimoInternacionalAduanero(client: FiscalapiClient): Promise { + console.log('\n=== Factura Traslado Transporte Mar�timo Internacional Aduanero - Importaci�n (ByReference) ===\n'); + + const invoice: Invoice = { + versionCode: '4.0', + currencyCode: 'XXX', + typeCode: 'T', + expeditionZipCode: '42501', + series: 'Serie', + date: currentDate, + exchangeRate: 1, + exportCode: '01', + issuer: { + id: '0e82a655-5f0c-4e07-abab-8f322e4123ef' + }, + recipient: { + id: '37f7c342-d9a6-4881-9620-0da769b50ce5' + }, + items: [makeStandardItem()], + complement: { + lading: { + transpInternacId: 'Sí', + entradaSalidaMercId: 'Entrada', + paisOrigenDestinoId: 'AFG', + viaEntradaSalidaId: '02', + totalDistRec: 0, + unidadPesoId: 'XBX', + pesoNetoTotal: 1, + regimenAduaneros: [ + { regimenAduaneroId: 'IMD' }, + { regimenAduaneroId: 'IMD' } + ], + ubicaciones: [ + { + tipoUbicacion: 'Origen', + idUbicacion: 'OR101010', + rfcRemitenteDestinatario: 'EKU9003173C9', + nombreRemitenteDestinatario: 'NombreRemitenteDestinatario1', + numEstacionId: 'PM001', + nombreEstacion: 'Rosarito', + navegacionTraficoId: 'Altura', + fechaHoraSalidaLlegada: '2023-08-01T00:00:00', + tipoEstacionId: '01', + domicilio: { + calle: 'Calle1', + numeroExterior: '211', + numeroInterior: '212', + coloniaId: '1957', + localidadId: '13', + referencia: 'casa blanca', + municipioId: '011', + estadoId: 'CMX', + paisId: 'MEX', + codigoPostalId: '13250' + } + }, + { + tipoUbicacion: 'Destino', + idUbicacion: 'DE202020', + rfcRemitenteDestinatario: 'EKU9003173C9', + nombreRemitenteDestinatario: 'NombreRemitenteDestinatario2', + numEstacionId: 'PM001', + nombreEstacion: 'Rosarito', + navegacionTraficoId: 'Altura', + fechaHoraSalidaLlegada: '2023-08-01T00:00:01', + tipoEstacionId: '03', + domicilio: { + calle: 'Calle2', + numeroExterior: '214', + numeroInterior: '215', + coloniaId: '0347', + localidadId: '23', + referencia: 'casa negra', + municipioId: '004', + estadoId: 'COA', + paisId: 'MEX', + codigoPostalId: '25350' + } + } + ], + mercancias: [ + { + bienesTranspId: '11121900', + descripcion: 'Accesorios de equipo de telefon�a', + cantidad: 1.0, + claveUnidadId: 'XBX', + materialPeligrosoId: 'No', + denominacionGenericaProd: 'DenominacionGenericaProd1', + denominacionDistintivaProd: 'DenominacionDistintivaProd1', + fabricante: 'Fabricante1', + fechaCaducidad: '2028-01-01T00:00:00', + loteMedicamento: 'LoteMedic1', + registroSanitarioFolioAutorizacion: 'RegistroSanita1', + pesoEnKg: 1, + valorMercancia: 100, + monedaId: 'MXN', + tipoMateriaId: '05', + descripcionMateria: 'otramateria', + documentacionAduanera: [ + { tipoDocumentoId: '01', numPedimento: '23 43 0472 8000448', rfcImpo: 'EKU9003173C9' } + ], + cantidadTransporta: [ + { cantidad: 1, idOrigen: 'OR101010', idDestino: 'DE202020' } + ], + detalleMercancia: { + unidadPesoMercId: 'Tu', + pesoBruto: 1, + pesoNeto: 1, + pesoTara: 0.001, + numPiezas: 1 + } + } + ], + transporteMaritimo: makeMaritimeTransport(), + tiposFigura: [makeMaritimeFigure()] + } + } + }; + + const response = await client.invoices.create(invoice); + console.log('Response:', response); +} + +// ============================================================================ +// HELPERS COMPARTIDOS (Ferroviario / A�reo) +// ============================================================================ + +function makeStandardItem() { + return { + itemCode: '78101800', + itemSku: 'UT421511', + quantity: 1, + unitOfMeasurementCode: 'H87', + description: 'Transporte de carga por carretera', + unitPrice: 100.00, + discount: 0, + taxObjectCode: '01', + itemTaxes: [] + }; +} + +function makeRailwayTransport() { + return { + tipoDeServicioId: 'TS01', + tipoDeTraficoId: 'TT01', + derechosDePaso: [ + { tipoDerechoDePasoId: 'CDP114', kilometrajePagado: 100 } + ], + carros: [ + { tipoCarroId: 'TC08', matriculaCarro: 'A00012', guiaCarro: '123ASD', toneladasNetasCarro: 10 } + ] + }; +} + +function makeRailwayFigure() { + return { + tipoFiguraId: '02', + rfcFigura: 'EKU9003173C9', + nombreFigura: 'NombreFigura', + partesTransporte: [ + { parteTransporteId: 'PT02' } + ], + domicilio: { + calle: 'calle', + numeroExterior: '211', + coloniaId: '0814', + localidadId: '01', + referencia: 'casa blanca', + municipioId: '010', + estadoId: 'ZAC', + paisId: 'MEX', + codigoPostalId: '99080' + } + }; +} + +/** Returns the first 5 shared rail locations (Origen + 4 intermediate Destinos) */ +function makeRailLocationsBase() { + return [ + { + tipoUbicacion: 'Origen', + idUbicacion: 'OR101010', + rfcRemitenteDestinatario: 'EKU9003173C9', + nombreRemitenteDestinatario: 'NombreRemitenteDestinatario1', + numEstacionId: 'Q0736', + nombreEstacion: 'SANTO NINO', + fechaHoraSalidaLlegada: '2023-08-01T00:00:00', + tipoEstacionId: '01', + domicilio: { + calle: 'Calle1', + numeroExterior: '211', + numeroInterior: '212', + coloniaId: '1957', + localidadId: '13', + referencia: 'casa blanca', + municipioId: '011', + estadoId: 'CMX', + paisId: 'MEX', + codigoPostalId: '13250' + } + }, + { + tipoUbicacion: 'Destino', + idUbicacion: 'DE202021', + rfcRemitenteDestinatario: 'EKU9003173C9', + nombreRemitenteDestinatario: 'NombreRemitenteDestinatario2', + numEstacionId: 'SC283', + nombreEstacion: 'HUAXTITLA', + fechaHoraSalidaLlegada: '2023-08-01T01:00:01', + tipoEstacionId: '02', + distanciaRecorrida: 100.00 + }, + { + tipoUbicacion: 'Destino', + idUbicacion: 'DE202022', + rfcRemitenteDestinatario: 'EKU9003173C9', + nombreRemitenteDestinatario: 'NombreRemitenteDestinatario2', + numEstacionId: 'TG0', + nombreEstacion: 'NAVOJOA', + fechaHoraSalidaLlegada: '2023-08-01T02:00:01', + tipoEstacionId: '02', + distanciaRecorrida: 100.00 + }, + { + tipoUbicacion: 'Destino', + idUbicacion: 'DE202023', + rfcRemitenteDestinatario: 'EKU9003173C9', + nombreRemitenteDestinatario: 'NombreRemitenteDestinatario2', + numEstacionId: 'E0029', + nombreEstacion: 'TRES JAGUEYES', + fechaHoraSalidaLlegada: '2023-08-01T03:00:01', + tipoEstacionId: '02', + distanciaRecorrida: 100.00 + }, + { + tipoUbicacion: 'Destino', + idUbicacion: 'DE202024', + rfcRemitenteDestinatario: 'EKU9003173C9', + nombreRemitenteDestinatario: 'NombreRemitenteDestinatario2', + numEstacionId: 'TI032', + nombreEstacion: 'NAVOLATO', + fechaHoraSalidaLlegada: '2023-08-01T04:00:01', + tipoEstacionId: '02', + distanciaRecorrida: 100.00 + } + ]; +} + +function makeAirTransport() { + return { + permSCTId: 'TPAF01', + numPermisoSCT: 'Demo', + matriculaAeronave: '61E5-WZ', + nombreAseg: 'NombreAseg', + numPolizaSeguro: 'NumPolizaSeguro', + numeroGuia: 'acUbYlBVTmlzx', + lugarContrato: 'LugarContrato', + codigoTransportistaId: 'CA001', + rfcEmbarcador: 'EKU9003173C9', + nombreEmbarcador: 'Embarcador' + }; +} + +function makeAirFigure() { + return { + tipoFiguraId: '01', + rfcFigura: 'EKU9003173C9', + numLicencia: 'a234567890', + nombreFigura: 'NombreFigura' + }; +} + +function makeMaritimeTransport() { + return { + permSCTId: 'TPAF01', + numPermisoSCT: 'NumPermisoSCT1', + nombreAseg: 'NombreAseg1', + numPolizaSeguro: 'NumPolizaSeguro1', + tipoEmbarcacionId: 'B01', + matricula: 'Matricula1', + numeroOMI: 'IMO1234567', + anioEmbarcacion: 2003, + nombreEmbarc: 'NombreEmbarc1', + nacionalidadEmbarcId: 'AFG', + unidadesDeArqBruto: 0.001, + tipoCargaId: 'CGS', + eslora: 0.01, + manga: 0.01, + calado: 0.01, + puntal: 0.01, + lineaNaviera: 'LineaNaviera1', + nombreAgenteNaviero: 'NombreAgenteNaviero1', + numAutorizacionNavieroId: 'ANC001/2022', + numViaje: 'NumViaje1', + numConocEmbarc: 'NumConocEmbarc1', + permisoTempNavegacion: 'PermisoTempNavegac1', + contenedores: [ + { + tipoContenedorId: 'CM011', + idCCPRelacionado: 'CCCBCD94-870A-4332-A52A-A52AA52AA52A', + placaVMCCP: 'JNG7683', + fechaCertificacionCCP: '2024-06-20T11:11:00', + pesoContenedorVacio: 0, + pesoNetoMercancia: 1, + remolquesCCP: [ + { subTipoRemCCPId: 'CTR001', placaCCP: 'JNG7636' } + ] + } + ] + }; +} + +function makeMaritimeFigure() { + return { + tipoFiguraId: '02', + rfcFigura: 'EKU9003173C9', + nombreFigura: 'NombreFigura', + partesTransporte: [ + { parteTransporteId: 'PT02' } + ], + domicilio: { + calle: 'calle', + numeroExterior: '211', + coloniaId: '0814', + localidadId: '01', + referencia: 'casa blanca', + municipioId: '010', + estadoId: 'ZAC', + paisId: 'MEX', + codigoPostalId: '99080' + } + }; +} + +// ============================================================================ +// FUNCION PRINCIPAL +// ============================================================================ +async function main(): Promise { + console.log('=== Ejemplos de Factura con Complemento Carta Porte FiscalAPI (ByReference) ===\n'); + + const client = FiscalapiClient.create(settings); + + try { + // Descomentar el caso de uso que se desea ejecutar + + await facturaIngresoAutotransporteNacional(client); + // await facturaIngresoAutotransporteNacionalConImpuestos(client); + // await facturaIngresoAutotransporteExtranjero(client); + // await facturaIngresoAutotransporteInternacionalAduanero(client); + // await facturaIngresoTransporteFerroviarioNacional(client); + // await facturaIngresoTransporteFerroviarioExtranjero(client); + // await facturaIngresoTransporteFerroviarioInternacionalAduanero(client); + // await facturaIngresoTransporteAereoNacional(client); + // await facturaIngresoTransporteAereoExtranjero(client); + // await facturaIngresoTransporteAereoInternacionalAduanero(client); + // await facturaIngresoTransporteMAritimoNacional(client); + // await facturaIngresoTransporteMAritimoExtranjero(client); + // await facturaIngresoTransporteMAritimoInternacionalAduanero(client); + // await facturaTrasladoAutotransporteNacional(client); + // await facturaTrasladoAutotransporteExtranjero(client); + // await facturaTrasladoAutotransporteInternacionalAduanero(client); + // await facturaTrasladoTransporteFerroviarioNacional(client); + // await facturaTrasladoTransporteFerroviarioExtranjero(client); + // await facturaTrasladoTransporteFerroviarioInternacionalAduanero(client); + // await facturaTrasladoTransporteAereoNacional(client); + // await facturaTrasladoTransporteAereoExtranjero(client); + // await facturaTrasladoTransporteAereoInternacionalAduanero(client); + // await facturaTrasladoTransporteMAritimoNacional(client); + // await facturaTrasladoTransporteMAritimoExtranjero(client); + // await facturaTrasladoTransporteMAritimoInternacionalAduanero(client); + + console.log('\nEjecuci�n completada.'); + } catch (error) { + console.error('Error:', error); + } +} + +// Ejecutar funci�n principal +main(); + diff --git a/examples/ejemplos-carta-porte-valores.ts b/examples/ejemplos-carta-porte-valores.ts new file mode 100644 index 0000000..51d2e50 --- /dev/null +++ b/examples/ejemplos-carta-porte-valores.ts @@ -0,0 +1,3235 @@ +/** + * Ejemplos de facturas con complemento Carta Porte (CFDI 4.0) usando el SDK de FiscalAPI + * Todos los métodos usan el modo "ByValues" - los datos se pasan directamente en la petición HTTP + */ + +import { FiscalapiClient, FiscalapiSettings, Invoice } from '../src/index'; +import { inspect } from 'util'; + +// Configuración de la consola para mostrar objetos anidados +inspect.defaultOptions.depth = null; +inspect.defaultOptions.colors = true; + +// Configuración de FiscalAPI +const settings: FiscalapiSettings = { + apiUrl: 'https://test.fiscalapi.com', + apiKey: '', + tenant: '', + debug: true +}; + +// Sellos SAT de prueba +const currentDate = '2026-03-20T10:04:06'; + +// ============================================================================ +// 1. FACTURA INGRESO - AUTOTRANSPORTE NACIONAL (ByValues) +// ============================================================================ +async function facturaIngresoAutotransporteNacional(client: FiscalapiClient): Promise { + console.log('\n=== Factura Ingreso Autotransporte Nacional (ByValues) ===\n'); + + const invoice: Invoice = { + versionCode: '4.0', + paymentFormCode: '01', + paymentMethodCode: 'PUE', + currencyCode: 'MXN', + typeCode: 'I', + expeditionZipCode: '42501', + series: 'SerieCCP31', + date: currentDate, + exchangeRate: 1, + exportCode: '01', + issuer: { + id: '0e82a655-5f0c-4e07-abab-8f322e4123ef' + }, + recipient: { + id: '37f7c342-d9a6-4881-9620-0da769b50ce5' + }, + items: [ + { + itemCode: '78101800', + itemSku: 'UT421511', + quantity: 1, + unitOfMeasurementCode: 'H87', + description: 'Transporte de carga por carretera', + unitPrice: 100.00, + discount: 0, + taxObjectCode: '01', + itemTaxes: [] + } + ], + complement: { + lading: { + transpInternacId: 'No', + totalDistRec: 1, + pesoNetoTotal: 1, + registroISTMOId: 'Sí', + ubicacionPoloOrigenId: '01', + ubicacionPoloDestinoId: '01', + unidadPesoId: 'XBX', + logisticaInversaRecoleccionDevolucionId: 'Sí', + ubicaciones: [ + { + tipoUbicacion: 'Origen', + idUbicacion: 'OR101010', + rfcRemitenteDestinatario: 'URE180429TM6', + nombreRemitenteDestinatario: 'NombreRemitenteDestinatario1', + fechaHoraSalidaLlegada: '2023-08-01T00:00:00', + domicilio: { + calle: 'Calle1', + numeroExterior: '211', + numeroInterior: '212', + coloniaId: '1957', + localidadId: '13', + referencia: 'casa blanca', + municipioId: '011', + estadoId: 'CMX', + paisId: 'MEX', + codigoPostalId: '13250' + } + }, + { + tipoUbicacion: 'Destino', + idUbicacion: 'DE202020', + rfcRemitenteDestinatario: 'URE180429TM6', + nombreRemitenteDestinatario: 'NombreRemitenteDestinatario2', + fechaHoraSalidaLlegada: '2023-08-01T00:00:01', + distanciaRecorrida: 1, + domicilio: { + calle: 'Calle2', + numeroExterior: '214', + numeroInterior: '215', + coloniaId: '0347', + localidadId: '23', + referencia: 'casa negra', + municipioId: '004', + estadoId: 'COA', + paisId: 'MEX', + codigoPostalId: '25350' + } + } + ], + mercancias: [ + { + bienesTranspId: '11121900', + descripcion: 'Accesorios de equipo de telefonía', + cantidad: 1.0, + claveUnidadId: 'XBX', + materialPeligrosoId: 'No', + denominacionGenericaProd: 'DenominacionGenericaProd1', + denominacionDistintivaProd: 'DenominacionDistintivaProd1', + fabricante: 'Fabricante1', + fechaCaducidad: '2003-04-02T00:00:00', + loteMedicamento: 'LoteMedic1', + formaFarmaceuticaId: '01', + condicionesEspTranspId: '01', + registroSanitarioFolioAutorizacion: 'RegistroSanita1', + pesoEnKg: 1, + fraccionArancelariaId: '6309000100', + cantidadTransporta: [ + { cantidad: 1, idOrigen: 'OR101010', idDestino: 'DE202020' } + ] + } + ], + autotransporte: { + permSCTId: 'TPAF01', + numPermisoSCT: 'NumPermisoSCT1', + configVehicularId: 'VL', + pesoBrutoVehicular: 1, + placaVM: 'plac892', + anioModeloVM: 2020, + aseguraRespCivil: 'AseguraRespCivil', + polizaRespCivil: '123456789', + remolques: [ + { subTipoRemId: 'CTR004', placa: 'VL45K98' } + ] + }, + tiposFigura: [ + { + tipoFiguraId: '01', + rfcFigura: 'URE180429TM6', + numLicencia: 'NumLicencia1', + nombreFigura: 'NombreFigura1', + domicilio: { + calle: 'Calle1', + numeroExterior: 'NumeroExterior1', + numeroInterior: 'NumeroInterior1', + coloniaId: 'Colonia1', + localidadId: 'Localidad1', + referencia: 'Referencia1', + municipioId: 'Municipio1', + estadoId: 'Estado1', + paisId: 'AFG', + codigoPostalId: 'CodigoPosta1' + } + } + ] + } + } + }; + + const response = await client.invoices.create(invoice); + console.log('Response:', response); +} + +// ============================================================================ +// 2. FACTURA INGRESO - AUTOTRANSPORTE NACIONAL CON IMPUESTOS (ByValues) +// ============================================================================ +async function facturaIngresoAutotransporteNacionalConImpuestos(client: FiscalapiClient): Promise { + console.log('\n=== Factura Ingreso Autotransporte Nacional con Impuestos (ByValues) ===\n'); + + const invoice: Invoice = { + versionCode: '4.0', + paymentFormCode: '01', + paymentMethodCode: 'PUE', + currencyCode: 'MXN', + typeCode: 'I', + expeditionZipCode: '42501', + series: 'SerieCCP31', + date: currentDate, + exchangeRate: 1, + exportCode: '01', + issuer: { + id: '0e82a655-5f0c-4e07-abab-8f322e4123ef' + }, + recipient: { + id: '37f7c342-d9a6-4881-9620-0da769b50ce5' + }, + items: [ + { + itemCode: '78101800', + itemSku: 'UT421511', + quantity: 1, + unitOfMeasurementCode: 'H87', + description: 'Transporte de carga por carretera', + unitPrice: 26232.75, + discount: 0, + taxObjectCode: '02', + itemTaxes: [ + { taxCode: '002', taxTypeCode: 'Tasa', taxRate: 0.160000, taxFlagCode: 'T' }, + { taxCode: '002', taxTypeCode: 'Tasa', taxRate: 0.040000, taxFlagCode: 'R' } + ] + } + ], + complement: { + lading: { + transpInternacId: 'No', + totalDistRec: 1, + pesoNetoTotal: 1, + registroISTMOId: 'Sí', + ubicacionPoloOrigenId: '01', + ubicacionPoloDestinoId: '01', + unidadPesoId: 'XBX', + logisticaInversaRecoleccionDevolucionId: 'Sí', + ubicaciones: [ + { + tipoUbicacion: 'Origen', + idUbicacion: 'OR101010', + rfcRemitenteDestinatario: 'URE180429TM6', + nombreRemitenteDestinatario: 'NombreRemitenteDestinatario1', + fechaHoraSalidaLlegada: '2023-08-01T00:00:00', + domicilio: { + calle: 'Calle1', + numeroExterior: '211', + numeroInterior: '212', + coloniaId: '1957', + localidadId: '13', + referencia: 'casa blanca', + municipioId: '011', + estadoId: 'CMX', + paisId: 'MEX', + codigoPostalId: '13250' + } + }, + { + tipoUbicacion: 'Destino', + idUbicacion: 'DE202020', + rfcRemitenteDestinatario: 'URE180429TM6', + nombreRemitenteDestinatario: 'NombreRemitenteDestinatario2', + fechaHoraSalidaLlegada: '2023-08-01T00:00:01', + distanciaRecorrida: 1, + domicilio: { + calle: 'Calle2', + numeroExterior: '214', + numeroInterior: '215', + coloniaId: '0347', + localidadId: '23', + referencia: 'casa negra', + municipioId: '004', + estadoId: 'COA', + paisId: 'MEX', + codigoPostalId: '25350' + } + } + ], + mercancias: [ + { + bienesTranspId: '11121900', + descripcion: 'Accesorios de equipo de telefonía', + cantidad: 1.0, + claveUnidadId: 'XBX', + materialPeligrosoId: 'No', + denominacionGenericaProd: 'DenominacionGenericaProd1', + denominacionDistintivaProd: 'DenominacionDistintivaProd1', + fabricante: 'Fabricante1', + fechaCaducidad: '2003-04-02T00:00:00', + loteMedicamento: 'LoteMedic1', + formaFarmaceuticaId: '01', + condicionesEspTranspId: '01', + registroSanitarioFolioAutorizacion: 'RegistroSanita1', + pesoEnKg: 1, + fraccionArancelariaId: '6309000100', + cantidadTransporta: [ + { cantidad: 1, idOrigen: 'OR101010', idDestino: 'DE202020' } + ] + } + ], + autotransporte: { + permSCTId: 'TPAF01', + numPermisoSCT: 'NumPermisoSCT1', + configVehicularId: 'VL', + pesoBrutoVehicular: 1, + placaVM: 'plac892', + anioModeloVM: 2020, + aseguraRespCivil: 'AseguraRespCivil', + polizaRespCivil: '123456789', + remolques: [ + { subTipoRemId: 'CTR004', placa: 'VL45K98' } + ] + }, + tiposFigura: [ + { + tipoFiguraId: '01', + rfcFigura: 'URE180429TM6', + numLicencia: 'NumLicencia1', + nombreFigura: 'NombreFigura1', + domicilio: { + calle: 'Calle1', + numeroExterior: 'NumeroExterior1', + numeroInterior: 'NumeroInterior1', + coloniaId: 'Colonia1', + localidadId: 'Localidad1', + referencia: 'Referencia1', + municipioId: 'Municipio1', + estadoId: 'Estado1', + paisId: 'AFG', + codigoPostalId: 'CodigoPosta1' + } + } + ] + } + } + }; + + const response = await client.invoices.create(invoice); + console.log('Response:', response); +} + +// ============================================================================ +// 3. FACTURA INGRESO - AUTOTRANSPORTE EXTRANJERO / EXPORTACIÓN (ByValues) +// ============================================================================ +async function facturaIngresoAutotransporteExtranjero(client: FiscalapiClient): Promise { + console.log('\n=== Factura Ingreso Autotransporte Extranjero - Exportación (ByValues) ===\n'); + + const invoice: Invoice = { + versionCode: '4.0', + paymentFormCode: '01', + paymentMethodCode: 'PUE', + currencyCode: 'MXN', + typeCode: 'I', + expeditionZipCode: '42501', + series: 'SerieCCP31', + date: currentDate, + exchangeRate: 1, + exportCode: '01', + issuer: { + id: '0e82a655-5f0c-4e07-abab-8f322e4123ef' + }, + recipient: { + id: '37f7c342-d9a6-4881-9620-0da769b50ce5' + }, + items: [ + { + itemCode: '78101800', + itemSku: 'UT421511', + quantity: 1, + unitOfMeasurementCode: 'H87', + description: 'Transporte de carga por carretera', + unitPrice: 100.00, + discount: 0, + taxObjectCode: '01', + itemTaxes: [] + } + ], + complement: { + lading: { + transpInternacId: 'Sí', + entradaSalidaMercId: 'Salida', + paisOrigenDestinoId: 'USA', + viaEntradaSalidaId: '01', + totalDistRec: 1, + pesoNetoTotal: 1, + registroISTMOId: 'Sí', + ubicacionPoloOrigenId: '01', + ubicacionPoloDestinoId: '01', + unidadPesoId: 'XBX', + logisticaInversaRecoleccionDevolucionId: 'Sí', + regimenAduaneros: [ + { regimenAduaneroId: 'EXD' } + ], + ubicaciones: [ + { + tipoUbicacion: 'Origen', + idUbicacion: 'OR101010', + rfcRemitenteDestinatario: 'XEXX010101000', + numRegIdTrib: '01010101', + residenciaFiscalId: 'USA', + fechaHoraSalidaLlegada: '2023-08-01T00:00:01', + domicilio: { + calle: 'ST', + numeroExterior: '214', + coloniaId: 'N/A', + referencia: 'WHITE HOUSE', + municipioId: 'N/A', + estadoId: 'TX', + paisId: 'USA', + codigoPostalId: 'N/A' + } + }, + { + tipoUbicacion: 'Destino', + idUbicacion: 'DE202020', + rfcRemitenteDestinatario: 'XEXX010101000', + numRegIdTrib: '01010101', + residenciaFiscalId: 'USA', + fechaHoraSalidaLlegada: '2023-08-01T00:00:01', + distanciaRecorrida: 1, + domicilio: { + calle: 'ST', + numeroExterior: '214', + coloniaId: 'N/A', + referencia: 'WHITE HOUSE', + municipioId: 'N/A', + estadoId: 'TX', + paisId: 'USA', + codigoPostalId: 'N/A' + } + } + ], + mercancias: [ + { + bienesTranspId: '11121900', + descripcion: 'Accesorios de equipo de telefonía', + cantidad: 1.0, + claveUnidadId: 'XBX', + materialPeligrosoId: 'No', + denominacionGenericaProd: 'DenominacionGenericaProd1', + denominacionDistintivaProd: 'DenominacionDistintivaProd1', + fabricante: 'Fabricante1', + fechaCaducidad: '2003-04-02T00:00:00', + loteMedicamento: 'LoteMedic1', + formaFarmaceuticaId: '01', + condicionesEspTranspId: '01', + registroSanitarioFolioAutorizacion: 'RegistroSanita1', + pesoEnKg: 1, + fraccionArancelariaId: '6309000100', + tipoMateriaId: '05', + descripcionMateria: 'otramateria', + cantidadTransporta: [ + { cantidad: 1, idOrigen: 'OR101010', idDestino: 'DE202020' } + ] + } + ], + autotransporte: { + permSCTId: 'TPAF01', + numPermisoSCT: 'NumPermisoSCT1', + configVehicularId: 'VL', + pesoBrutoVehicular: 1, + placaVM: 'plac892', + anioModeloVM: 2020, + aseguraRespCivil: 'AseguraRespCivil', + polizaRespCivil: '123456789', + remolques: [ + { subTipoRemId: 'CTR004', placa: 'VL45K98' } + ] + }, + tiposFigura: [ + { + tipoFiguraId: '01', + rfcFigura: 'EKU9003173C9', + numLicencia: 'NumLicencia1', + nombreFigura: 'NombreFigura1', + domicilio: { + calle: 'ST', + numeroExterior: '214', + coloniaId: 'N/A', + referencia: 'WHITE HOUSE', + municipioId: 'N/A', + estadoId: 'TX', + paisId: 'USA', + codigoPostalId: 'N/A' + } + } + ] + } + } + }; + + const response = await client.invoices.create(invoice); + console.log('Response:', response); +} + +// ============================================================================ +// 4. FACTURA INGRESO - AUTOTRANSPORTE INTERNACIONAL ADUANERO / IMPORTACIÓN (ByValues) +// ============================================================================ +async function facturaIngresoAutotransporteInternacionalAduanero(client: FiscalapiClient): Promise { + console.log('\n=== Factura Ingreso Autotransporte Internacional Aduanero - Importación (ByValues) ===\n'); + + const invoice: Invoice = { + versionCode: '4.0', + paymentFormCode: '01', + paymentMethodCode: 'PUE', + currencyCode: 'MXN', + typeCode: 'I', + expeditionZipCode: '42501', + series: 'SerieCCP31', + date: currentDate, + exchangeRate: 1, + exportCode: '01', + issuer: { + id: '0e82a655-5f0c-4e07-abab-8f322e4123ef' + }, + recipient: { + id: '37f7c342-d9a6-4881-9620-0da769b50ce5' + }, + items: [ + { + itemCode: '78101800', + itemSku: 'UT421511', + quantity: 1, + unitOfMeasurementCode: 'H87', + description: 'Transporte de carga por carretera', + unitPrice: 100.00, + discount: 0, + taxObjectCode: '01', + itemTaxes: [] + } + ], + complement: { + lading: { + transpInternacId: 'Sí', + entradaSalidaMercId: 'Entrada', + paisOrigenDestinoId: 'USA', + viaEntradaSalidaId: '01', + totalDistRec: 1, + pesoNetoTotal: 1, + registroISTMOId: 'Sí', + ubicacionPoloOrigenId: '01', + ubicacionPoloDestinoId: '01', + unidadPesoId: 'XBX', + logisticaInversaRecoleccionDevolucionId: 'Sí', + regimenAduaneros: [ + { regimenAduaneroId: 'IMD' } + ], + ubicaciones: [ + { + tipoUbicacion: 'Origen', + idUbicacion: 'OR101010', + rfcRemitenteDestinatario: 'XEXX010101000', + numRegIdTrib: '01010101', + residenciaFiscalId: 'USA', + fechaHoraSalidaLlegada: '2023-08-01T00:00:01', + domicilio: { + calle: 'ST', + numeroExterior: '214', + coloniaId: 'N/A', + referencia: 'WHITE HOUSE', + municipioId: 'N/A', + estadoId: 'TX', + paisId: 'USA', + codigoPostalId: 'N/A' + } + }, + { + tipoUbicacion: 'Destino', + idUbicacion: 'DE202020', + rfcRemitenteDestinatario: 'XEXX010101000', + numRegIdTrib: '01010101', + residenciaFiscalId: 'USA', + fechaHoraSalidaLlegada: '2023-08-01T00:00:01', + distanciaRecorrida: 1, + domicilio: { + calle: 'ST', + numeroExterior: '214', + coloniaId: 'N/A', + referencia: 'WHITE HOUSE', + municipioId: 'N/A', + estadoId: 'TX', + paisId: 'USA', + codigoPostalId: 'N/A' + } + } + ], + mercancias: [ + { + bienesTranspId: '11121900', + descripcion: 'Accesorios de equipo de telefonía', + cantidad: 1.0, + claveUnidadId: 'XBX', + materialPeligrosoId: 'No', + denominacionGenericaProd: 'DenominacionGenericaProd1', + denominacionDistintivaProd: 'DenominacionDistintivaProd1', + fabricante: 'Fabricante1', + fechaCaducidad: '2003-04-02T00:00:00', + loteMedicamento: 'LoteMedic1', + formaFarmaceuticaId: '01', + condicionesEspTranspId: '01', + registroSanitarioFolioAutorizacion: 'RegistroSanita1', + pesoEnKg: 1, + fraccionArancelariaId: '6309000100', + tipoMateriaId: '05', + descripcionMateria: 'otramateria', + documentacionAduanera: [ + { + tipoDocumentoId: '01', + numPedimento: '23 43 0472 8000448', + rfcImpo: 'EKU9003173C9' + } + ], + cantidadTransporta: [ + { cantidad: 1, idOrigen: 'OR101010', idDestino: 'DE202020' } + ] + } + ], + autotransporte: { + permSCTId: 'TPAF01', + numPermisoSCT: 'NumPermisoSCT1', + configVehicularId: 'VL', + pesoBrutoVehicular: 1, + placaVM: 'plac892', + anioModeloVM: 2020, + aseguraRespCivil: 'AseguraRespCivil', + polizaRespCivil: '123456789', + remolques: [ + { subTipoRemId: 'CTR004', placa: 'VL45K98' } + ] + }, + tiposFigura: [ + { + tipoFiguraId: '01', + rfcFigura: 'EKU9003173C9', + numLicencia: 'NumLicencia1', + nombreFigura: 'NombreFigura1', + domicilio: { + calle: 'ST', + numeroExterior: '214', + coloniaId: 'N/A', + referencia: 'WHITE HOUSE', + municipioId: 'N/A', + estadoId: 'TX', + paisId: 'USA', + codigoPostalId: 'N/A' + } + } + ] + } + } + }; + + const response = await client.invoices.create(invoice); + console.log('Response:', response); +} + +// ============================================================================ +// 5. FACTURA INGRESO - TRANSPORTE FERROVIARIO NACIONAL (ByValues) +// ============================================================================ +async function facturaIngresoTransporteFerroviarioNacional(client: FiscalapiClient): Promise { + console.log('\n=== Factura Ingreso Transporte Ferroviario Nacional (ByValues) ===\n'); + + const invoice: Invoice = { + versionCode: '4.0', + paymentFormCode: '01', + paymentMethodCode: 'PUE', + currencyCode: 'MXN', + typeCode: 'I', + expeditionZipCode: '42501', + series: 'Serie', + date: currentDate, + exchangeRate: 1, + exportCode: '01', + issuer: makeIssuer(), + recipient: makeSelfRecipient(), + items: [makeStandardItem()], + complement: { + lading: { + transpInternacId: 'No', + totalDistRec: 500, + pesoNetoTotal: 10, + registroISTMOId: 'Sí', + ubicacionPoloOrigenId: '01', + ubicacionPoloDestinoId: '01', + unidadPesoId: 'XBX', + ubicaciones: [ + ...makeRailLocationsBase(), + { + tipoUbicacion: 'Destino', + idUbicacion: 'DE202025', + rfcRemitenteDestinatario: 'EKU9003173C9', + nombreRemitenteDestinatario: 'NombreRemitenteDestinatario2', + numEstacionId: 'JM047', + nombreEstacion: 'HUEHUETOCA', + fechaHoraSalidaLlegada: '2023-08-01T05:00:01', + tipoEstacionId: '03', + distanciaRecorrida: 100.00, + domicilio: { + calle: 'Calle2', + numeroExterior: '214', + numeroInterior: '215', + coloniaId: '0347', + localidadId: '23', + referencia: 'casa negra', + municipioId: '004', + estadoId: 'COA', + paisId: 'MEX', + codigoPostalId: '25350' + } + } + ], + mercancias: [ + { + bienesTranspId: '11121900', + descripcion: 'Accesorios de equipo de telefonía', + cantidad: 1.0, + claveUnidadId: 'XBX', + materialPeligrosoId: 'No', + denominacionGenericaProd: 'DenominacionGenericaProd1', + denominacionDistintivaProd: 'DenominacionDistintivaProd1', + fabricante: 'Fabricante1', + fechaCaducidad: '2028-01-01T00:00:00', + loteMedicamento: 'LoteMedic1', + registroSanitarioFolioAutorizacion: 'RegistroSanita1', + pesoEnKg: 1, + cantidadTransporta: [ + { cantidad: 1, idOrigen: 'OR101010', idDestino: 'DE202025' } + ] + } + ], + transporteFerroviario: makeRailwayTransport(), + tiposFigura: [makeRailwayFigure()] + } + } + }; + + const response = await client.invoices.create(invoice); + console.log('Response:', response); +} + +// ============================================================================ +// 6. FACTURA INGRESO - TRANSPORTE FERROVIARIO EXTRANJERO (ByValues) +// ============================================================================ +async function facturaIngresoTransporteFerroviarioExtranjero(client: FiscalapiClient): Promise { + console.log('\n=== Factura Ingreso Transporte Ferroviario Extranjero - Exportación (ByValues) ===\n'); + + const invoice: Invoice = { + versionCode: '4.0', + paymentFormCode: '01', + paymentMethodCode: 'PUE', + currencyCode: 'MXN', + typeCode: 'I', + expeditionZipCode: '42501', + series: 'Serie', + date: currentDate, + exchangeRate: 1, + exportCode: '01', + issuer: makeIssuer(), + recipient: makeSelfRecipient(), + items: [makeStandardItem()], + complement: { + lading: { + transpInternacId: 'Sí', + entradaSalidaMercId: 'Salida', + paisOrigenDestinoId: 'USA', + viaEntradaSalidaId: '04', + totalDistRec: 500, + pesoNetoTotal: 10, + registroISTMOId: 'Sí', + ubicacionPoloOrigenId: '01', + ubicacionPoloDestinoId: '01', + unidadPesoId: 'XBX', + regimenAduaneros: [ + { regimenAduaneroId: 'EXD' } + ], + ubicaciones: [ + ...makeRailLocationsBase(), + { + tipoUbicacion: 'Destino', + idUbicacion: 'DE202025', + rfcRemitenteDestinatario: 'XEXX010101000', + nombreRemitenteDestinatario: 'NombreRemitenteDestinatario2', + numRegIdTrib: '01010101', + residenciaFiscalId: 'USA', + numEstacionId: 'EF0001', + nombreEstacion: 'NombreEstacion', + fechaHoraSalidaLlegada: '2023-08-01T05:00:01', + distanciaRecorrida: 100.00, + domicilio: { + calle: 'ST', + numeroExterior: '1234', + coloniaId: '1234', + referencia: 'WHITE HOUSE', + municipioId: '1234', + estadoId: 'TX', + paisId: 'USA', + codigoPostalId: '12345' + } + } + ], + mercancias: [ + { + bienesTranspId: '11121900', + descripcion: 'Accesorios de equipo de telefonía', + cantidad: 1.0, + claveUnidadId: 'XBX', + materialPeligrosoId: 'No', + denominacionGenericaProd: 'DenominacionGenericaProd1', + denominacionDistintivaProd: 'DenominacionDistintivaProd1', + fabricante: 'Fabricante1', + fechaCaducidad: '2028-01-01T00:00:00', + loteMedicamento: 'LoteMedic1', + registroSanitarioFolioAutorizacion: 'RegistroSanita1', + pesoEnKg: 1, + tipoMateriaId: '05', + descripcionMateria: 'otramateria', + cantidadTransporta: [ + { cantidad: 1, idOrigen: 'OR101010', idDestino: 'DE202025' } + ] + } + ], + transporteFerroviario: makeRailwayTransport(), + tiposFigura: [makeRailwayFigure()] + } + } + }; + + const response = await client.invoices.create(invoice); + console.log('Response:', response); +} + +// ============================================================================ +// 7. FACTURA INGRESO - TRANSPORTE FERROVIARIO INTERNACIONAL ADUANERO (ByValues) +// ============================================================================ +async function facturaIngresoTransporteFerroviarioInternacionalAduanero(client: FiscalapiClient): Promise { + console.log('\n=== Factura Ingreso Transporte Ferroviario Internacional Aduanero - Importación (ByValues) ===\n'); + + const invoice: Invoice = { + versionCode: '4.0', + paymentFormCode: '01', + paymentMethodCode: 'PUE', + currencyCode: 'MXN', + typeCode: 'I', + expeditionZipCode: '42501', + series: 'Serie', + date: currentDate, + exchangeRate: 1, + exportCode: '01', + issuer: makeIssuer(), + recipient: makeSelfRecipient(), + items: [makeStandardItem()], + complement: { + lading: { + transpInternacId: 'Sí', + entradaSalidaMercId: 'Entrada', + paisOrigenDestinoId: 'AFG', + viaEntradaSalidaId: '04', + totalDistRec: 500, + pesoNetoTotal: 10, + registroISTMOId: 'Sí', + ubicacionPoloOrigenId: '01', + ubicacionPoloDestinoId: '01', + unidadPesoId: 'XBX', + regimenAduaneros: [ + { regimenAduaneroId: 'IMD' } + ], + ubicaciones: [ + ...makeRailLocationsBase(), + { + tipoUbicacion: 'Destino', + idUbicacion: 'DE202025', + rfcRemitenteDestinatario: 'EKU9003173C9', + nombreRemitenteDestinatario: 'NombreRemitenteDestinatario2', + numEstacionId: 'JM047', + nombreEstacion: 'HUEHUETOCA', + fechaHoraSalidaLlegada: '2023-08-01T05:00:01', + tipoEstacionId: '03', + distanciaRecorrida: 100.00, + domicilio: { + calle: 'Calle2', + numeroExterior: '214', + numeroInterior: '215', + coloniaId: '0347', + localidadId: '23', + referencia: 'casa negra', + municipioId: '004', + estadoId: 'COA', + paisId: 'MEX', + codigoPostalId: '25350' + } + } + ], + mercancias: [ + { + bienesTranspId: '11121900', + descripcion: 'Accesorios de equipo de telefonía', + cantidad: 1.0, + claveUnidadId: 'XBX', + materialPeligrosoId: 'No', + denominacionGenericaProd: 'DenominacionGenericaProd1', + denominacionDistintivaProd: 'DenominacionDistintivaProd1', + fabricante: 'Fabricante1', + fechaCaducidad: '2028-01-01T00:00:00', + loteMedicamento: 'LoteMedic1', + registroSanitarioFolioAutorizacion: 'RegistroSanita1', + pesoEnKg: 1, + tipoMateriaId: '05', + descripcionMateria: 'otramateria', + documentacionAduanera: [ + { + tipoDocumentoId: '01', + numPedimento: '23 43 0472 8000448', + rfcImpo: 'EKU9003173C9' + } + ], + cantidadTransporta: [ + { cantidad: 1, idOrigen: 'OR101010', idDestino: 'DE202025' } + ] + } + ], + transporteFerroviario: makeRailwayTransport(), + tiposFigura: [makeRailwayFigure()] + } + } + }; + + const response = await client.invoices.create(invoice); + console.log('Response:', response); +} + +// ============================================================================ +// 8. FACTURA INGRESO - TRANSPORTE AÉREO NACIONAL (ByValues) +// ============================================================================ +async function facturaIngresoTransporteAereoNacional(client: FiscalapiClient): Promise { + console.log('\n=== Factura Ingreso Transporte Aéreo Nacional (ByValues) ===\n'); + + const invoice: Invoice = { + versionCode: '4.0', + paymentFormCode: '01', + paymentMethodCode: 'PUE', + currencyCode: 'MXN', + typeCode: 'I', + expeditionZipCode: '42501', + series: 'Serie', + date: currentDate, + exchangeRate: 1, + exportCode: '01', + issuer: makeIssuer(), + recipient: makeSelfRecipient(), + items: [makeStandardItem()], + complement: { + lading: { + transpInternacId: 'No', + totalDistRec: 0, + pesoNetoTotal: 10, + unidadPesoId: 'XBX', + ubicaciones: [ + { + tipoUbicacion: 'Origen', + idUbicacion: 'OR101010', + rfcRemitenteDestinatario: 'EKU9003173C9', + nombreRemitenteDestinatario: 'NombreRemitenteDestinatario1', + numEstacionId: 'EA0417', + nombreEstacion: 'Loreto', + fechaHoraSalidaLlegada: '2023-08-01T00:00:00', + tipoEstacionId: '01', + domicilio: { + calle: 'Calle1', + numeroExterior: '211', + numeroInterior: '212', + coloniaId: '1957', + localidadId: '13', + referencia: 'casa blanca', + municipioId: '011', + estadoId: 'CMX', + paisId: 'MEX', + codigoPostalId: '13250' + } + }, + { + tipoUbicacion: 'Destino', + idUbicacion: 'DE202020', + rfcRemitenteDestinatario: 'EKU9003173C9', + nombreRemitenteDestinatario: 'NombreRemitenteDestinatario2', + numEstacionId: 'EA0418', + nombreEstacion: 'Los Cabos', + fechaHoraSalidaLlegada: '2023-08-01T00:00:01', + tipoEstacionId: '03', + domicilio: { + calle: 'Calle2', + numeroExterior: '214', + numeroInterior: '215', + coloniaId: '0347', + localidadId: '23', + referencia: 'casa negra', + municipioId: '004', + estadoId: 'COA', + paisId: 'MEX', + codigoPostalId: '25350' + } + } + ], + mercancias: [ + { + bienesTranspId: '11121900', + descripcion: 'Accesorios de equipo de telefonía', + cantidad: 1.0, + claveUnidadId: 'XBX', + materialPeligrosoId: 'No', + denominacionGenericaProd: 'DenominacionGenericaProd1', + denominacionDistintivaProd: 'DenominacionDistintivaProd1', + fabricante: 'Fabricante1', + fechaCaducidad: '2028-01-01T00:00:00', + loteMedicamento: 'LoteMedic1', + registroSanitarioFolioAutorizacion: 'RegistroSanita1', + pesoEnKg: 1, + valorMercancia: 100, + monedaId: 'MXN', + cantidadTransporta: [ + { cantidad: 1, idOrigen: 'OR101010', idDestino: 'DE202020' } + ] + } + ], + transporteAereo: { + permSCTId: 'TPAF01', + numPermisoSCT: 'Demo', + matriculaAeronave: '61E5-WZ', + nombreAseg: 'NombreAseg', + numPolizaSeguro: 'NumPolizaSeguro', + numeroGuia: 'acUbYlBVTmlzx', + lugarContrato: 'LugarContrato', + codigoTransportistaId: 'CA001', + rfcEmbarcador: 'EKU9003173C9', + nombreEmbarcador: 'Embarcador' + }, + tiposFigura: [ + { + tipoFiguraId: '01', + rfcFigura: 'EKU9003173C9', + numLicencia: 'a234567890', + nombreFigura: 'NombreFigura' + } + ] + } + } + }; + + const response = await client.invoices.create(invoice); + console.log('Response:', response); +} + +// ============================================================================ +// 9. FACTURA INGRESO - TRANSPORTE AÉREO EXTRANJERO (ByValues) +// ============================================================================ +async function facturaIngresoTransporteAereoExtranjero(client: FiscalapiClient): Promise { + console.log('\n=== Factura Ingreso Transporte Aéreo Extranjero (ByValues) ===\n'); + + const invoice: Invoice = { + versionCode: '4.0', + paymentFormCode: '01', + paymentMethodCode: 'PUE', + currencyCode: 'MXN', + typeCode: 'I', + expeditionZipCode: '42501', + series: 'Serie', + date: currentDate, + exchangeRate: 1, + exportCode: '01', + issuer: makeIssuer(), + recipient: makeSelfRecipient(), + items: [makeStandardItem()], + complement: { + lading: { + transpInternacId: 'Sí', + entradaSalidaMercId: 'Salida', + paisOrigenDestinoId: 'USA', + viaEntradaSalidaId: '03', + totalDistRec: 0, + unidadPesoId: 'XBX', + pesoNetoTotal: 10, + regimenAduaneros: [ + { regimenAduaneroId: 'EXD' } + ], + ubicaciones: [ + { + tipoUbicacion: 'Origen', + idUbicacion: 'OR101010', + rfcRemitenteDestinatario: 'EKU9003173C9', + nombreRemitenteDestinatario: 'NombreRemitenteDestinatario1', + numEstacionId: 'EA0417', + nombreEstacion: 'Loreto', + fechaHoraSalidaLlegada: '2023-08-01T00:00:00', + tipoEstacionId: '01', + domicilio: { + calle: 'Calle2', + numeroExterior: '214', + numeroInterior: '215', + coloniaId: '0347', + localidadId: '23', + referencia: 'casa negra', + municipioId: '004', + estadoId: 'COA', + paisId: 'MEX', + codigoPostalId: '25350' + } + }, + { + tipoUbicacion: 'Destino', + idUbicacion: 'DE202020', + rfcRemitenteDestinatario: 'XEXX010101000', + nombreRemitenteDestinatario: 'NombreRemitenteDestinatario', + numRegIdTrib: '01010101', + residenciaFiscalId: 'USA', + numEstacionId: 'EA0143', + nombreEstacion: 'Phoenix-Mesa Gateway', + fechaHoraSalidaLlegada: '2023-08-01T00:00:01', + domicilio: { + calle: 'ST', + numeroExterior: '12344', + coloniaId: 'N/A', + referencia: 'WHITE HOUSE', + municipioId: 'N/A', + estadoId: 'TX', + paisId: 'USA', + codigoPostalId: '12345' + } + } + ], + mercancias: [ + { + bienesTranspId: '11121900', + descripcion: 'Accesorios de equipo de telefonía', + cantidad: 1.0, + claveUnidadId: 'XBX', + materialPeligrosoId: 'No', + denominacionGenericaProd: 'DenominacionGenericaProd1', + denominacionDistintivaProd: 'DenominacionDistintivaProd1', + fabricante: 'Fabricante1', + fechaCaducidad: '2028-01-01T00:00:00', + loteMedicamento: 'LoteMedic1', + registroSanitarioFolioAutorizacion: 'RegistroSanita1', + pesoEnKg: 1, + valorMercancia: 100, + monedaId: 'MXN', + tipoMateriaId: '05', + descripcionMateria: 'otramateria', + cantidadTransporta: [ + { cantidad: 1, idOrigen: 'OR101010', idDestino: 'DE202020' } + ] + } + ], + transporteAereo: makeAirTransport(), + tiposFigura: [makeAirFigure()] + } + } + }; + + const response = await client.invoices.create(invoice); + console.log('Response:', response); +} + +// ============================================================================ +// 10. FACTURA INGRESO - TRANSPORTE AÉREO INTERNACIONAL ADUANERO (ByValues) +// ============================================================================ +async function facturaIngresoTransporteAereoInternacionalAduanero(client: FiscalapiClient): Promise { + console.log('\n=== Factura Ingreso Transporte Aéreo Internacional Aduanero (ByValues) ===\n'); + + const invoice: Invoice = { + versionCode: '4.0', + paymentFormCode: '01', + paymentMethodCode: 'PUE', + currencyCode: 'MXN', + typeCode: 'I', + expeditionZipCode: '42501', + series: 'Serie', + date: currentDate, + exchangeRate: 1, + exportCode: '01', + issuer: makeIssuer(), + recipient: makeSelfRecipient(), + items: [makeStandardItem()], + complement: { + lading: { + transpInternacId: 'Sí', + entradaSalidaMercId: 'Entrada', + paisOrigenDestinoId: 'AFG', + viaEntradaSalidaId: '03', + totalDistRec: 0, + unidadPesoId: 'XBX', + pesoNetoTotal: 10, + regimenAduaneros: [ + { regimenAduaneroId: 'IMD' } + ], + ubicaciones: [ + { + tipoUbicacion: 'Origen', + idUbicacion: 'OR101010', + rfcRemitenteDestinatario: 'EKU9003173C9', + nombreRemitenteDestinatario: 'NombreRemitenteDestinatario1', + numEstacionId: 'EA0417', + nombreEstacion: 'Loreto', + fechaHoraSalidaLlegada: '2023-08-01T00:00:00', + tipoEstacionId: '01', + domicilio: { + calle: 'Calle1', + numeroExterior: '211', + numeroInterior: '212', + coloniaId: '1957', + localidadId: '13', + referencia: 'casa blanca', + municipioId: '011', + estadoId: 'CMX', + paisId: 'MEX', + codigoPostalId: '13250' + } + }, + { + tipoUbicacion: 'Destino', + idUbicacion: 'DE202020', + rfcRemitenteDestinatario: 'EKU9003173C9', + nombreRemitenteDestinatario: 'NombreRemitenteDestinatario2', + numEstacionId: 'EA0418', + nombreEstacion: 'Los Cabos', + fechaHoraSalidaLlegada: '2023-08-01T00:00:01', + tipoEstacionId: '03', + domicilio: { + calle: 'Calle2', + numeroExterior: '214', + numeroInterior: '215', + coloniaId: '0347', + localidadId: '23', + referencia: 'casa negra', + municipioId: '004', + estadoId: 'COA', + paisId: 'MEX', + codigoPostalId: '25350' + } + } + ], + mercancias: [ + { + bienesTranspId: '11121900', + descripcion: 'Accesorios de equipo de telefonía', + cantidad: 1.0, + claveUnidadId: 'XBX', + materialPeligrosoId: 'No', + denominacionGenericaProd: 'DenominacionGenericaProd1', + denominacionDistintivaProd: 'DenominacionDistintivaProd1', + fabricante: 'Fabricante1', + fechaCaducidad: '2028-01-01T00:00:00', + loteMedicamento: 'LoteMedic1', + registroSanitarioFolioAutorizacion: 'RegistroSanita1', + pesoEnKg: 1, + valorMercancia: 100, + monedaId: 'MXN', + tipoMateriaId: '05', + descripcionMateria: 'otramateria', + documentacionAduanera: [ + { tipoDocumentoId: '01', numPedimento: '23 43 0472 8000448', rfcImpo: 'EKU9003173C9' } + ], + cantidadTransporta: [ + { cantidad: 1, idOrigen: 'OR101010', idDestino: 'DE202020' } + ] + } + ], + transporteAereo: makeAirTransport(), + tiposFigura: [makeAirFigure()] + } + } + }; + + const response = await client.invoices.create(invoice); + console.log('Response:', response); +} + +// ============================================================================ +// 11. FACTURA INGRESO - TRANSPORTE MARÍTIMO NACIONAL (ByValues) +// ============================================================================ +async function facturaIngresoTransporteMAritimoNacional(client: FiscalapiClient): Promise { + console.log('\n=== Factura Ingreso Transporte Marítimo Nacional (ByValues) ===\n'); + + const invoice: Invoice = { + versionCode: '4.0', + paymentFormCode: '01', + paymentMethodCode: 'PUE', + currencyCode: 'MXN', + typeCode: 'I', + expeditionZipCode: '42501', + series: 'Serie', + date: currentDate, + exchangeRate: 1, + exportCode: '01', + issuer: makeIssuer(), + recipient: makeSelfRecipient(), + items: [makeStandardItem()], + complement: { + lading: { + transpInternacId: 'No', + totalDistRec: 0, + unidadPesoId: 'XBX', + pesoNetoTotal: 1, + ubicaciones: [ + { + tipoUbicacion: 'Origen', + idUbicacion: 'OR101010', + rfcRemitenteDestinatario: 'EKU9003173C9', + nombreRemitenteDestinatario: 'NombreRemitenteDestinatario1', + numEstacionId: 'PM001', + nombreEstacion: 'Rosarito', + navegacionTraficoId: 'Altura', + fechaHoraSalidaLlegada: '2023-08-01T00:00:00', + tipoEstacionId: '01', + domicilio: { + calle: 'Calle1', + numeroExterior: '211', + numeroInterior: '212', + coloniaId: '1957', + localidadId: '13', + referencia: 'casa blanca', + municipioId: '011', + estadoId: 'CMX', + paisId: 'MEX', + codigoPostalId: '13250' + } + }, + { + tipoUbicacion: 'Destino', + idUbicacion: 'DE202020', + rfcRemitenteDestinatario: 'EKU9003173C9', + nombreRemitenteDestinatario: 'NombreRemitenteDestinatario2', + numEstacionId: 'PM001', + nombreEstacion: 'Rosarito', + navegacionTraficoId: 'Altura', + fechaHoraSalidaLlegada: '2023-08-01T00:00:01', + tipoEstacionId: '03', + domicilio: { + calle: 'Calle2', + numeroExterior: '214', + numeroInterior: '215', + coloniaId: '0347', + localidadId: '23', + referencia: 'casa negra', + municipioId: '004', + estadoId: 'COA', + paisId: 'MEX', + codigoPostalId: '25350' + } + } + ], + mercancias: [ + { + bienesTranspId: '11121900', + descripcion: 'Accesorios de equipo de telefonía', + cantidad: 1.0, + claveUnidadId: 'XBX', + materialPeligrosoId: 'No', + denominacionGenericaProd: 'DenominacionGenericaProd1', + denominacionDistintivaProd: 'DenominacionDistintivaProd1', + fabricante: 'Fabricante1', + fechaCaducidad: '2028-01-01T00:00:00', + loteMedicamento: 'LoteMedic1', + registroSanitarioFolioAutorizacion: 'RegistroSanita1', + pesoEnKg: 1, + valorMercancia: 100, + monedaId: 'MXN', + cantidadTransporta: [ + { cantidad: 1, idOrigen: 'OR101010', idDestino: 'DE202020' } + ], + detalleMercancia: { + unidadPesoMercId: 'Tu', + pesoBruto: 1, + pesoNeto: 1, + pesoTara: 0.001, + numPiezas: 1 + } + } + ], + transporteMaritimo: makeMaritimeTransport(), + tiposFigura: [makeMaritimeFigure()] + } + } + }; + + const response = await client.invoices.create(invoice); + console.log('Response:', response); +} + +// ============================================================================ +// 12. FACTURA INGRESO - TRANSPORTE MARÍTIMO EXTRANJERO (ByValues) +// ============================================================================ +async function facturaIngresoTransporteMAritimoExtranjero(client: FiscalapiClient): Promise { + console.log('\n=== Factura Ingreso Transporte Marítimo Extranjero (ByValues) ===\n'); + + const invoice: Invoice = { + versionCode: '4.0', + paymentFormCode: '01', + paymentMethodCode: 'PUE', + currencyCode: 'MXN', + typeCode: 'I', + expeditionZipCode: '42501', + series: 'Serie', + date: currentDate, + exchangeRate: 1, + exportCode: '01', + issuer: makeIssuer(), + recipient: makeSelfRecipient(), + items: [makeStandardItem()], + complement: { + lading: { + transpInternacId: 'Sí', + entradaSalidaMercId: 'Salida', + paisOrigenDestinoId: 'USA', + viaEntradaSalidaId: '02', + totalDistRec: 0, + unidadPesoId: 'XBX', + pesoNetoTotal: 1, + regimenAduaneros: [ + { regimenAduaneroId: 'EXD' } + ], + ubicaciones: [ + { + tipoUbicacion: 'Origen', + idUbicacion: 'OR101010', + rfcRemitenteDestinatario: 'EKU9003173C9', + nombreRemitenteDestinatario: 'NombreRemitenteDestinatario1', + numEstacionId: 'PM001', + nombreEstacion: 'Rosarito', + navegacionTraficoId: 'Altura', + fechaHoraSalidaLlegada: '2023-08-01T00:00:00', + tipoEstacionId: '01', + domicilio: { + calle: 'Calle1', + numeroExterior: '211', + numeroInterior: '212', + coloniaId: '1957', + localidadId: '13', + referencia: 'casa blanca', + municipioId: '011', + estadoId: 'CMX', + paisId: 'MEX', + codigoPostalId: '13250' + } + }, + { + tipoUbicacion: 'Destino', + idUbicacion: 'DE202020', + rfcRemitenteDestinatario: 'XEXX010101000', + nombreRemitenteDestinatario: 'NombreRemitenteDestinatario2', + numRegIdTrib: '01010101', + residenciaFiscalId: 'USA', + numEstacionId: 'PM120', + nombreEstacion: 'NombreEstacion', + navegacionTraficoId: 'Altura', + fechaHoraSalidaLlegada: '2023-08-01T00:00:01', + domicilio: { + calle: 'ST', + numeroExterior: '12345', + coloniaId: 'N/A', + referencia: 'N/A', + municipioId: 'N/A', + estadoId: 'TX', + paisId: 'USA', + codigoPostalId: '12345' + } + } + ], + mercancias: [ + { + bienesTranspId: '11121900', + descripcion: 'Accesorios de equipo de telefonía', + cantidad: 1.0, + claveUnidadId: 'XBX', + materialPeligrosoId: 'No', + denominacionGenericaProd: 'DenominacionGenericaProd1', + denominacionDistintivaProd: 'DenominacionDistintivaProd1', + fabricante: 'Fabricante1', + fechaCaducidad: '2028-01-01T00:00:00', + loteMedicamento: 'LoteMedic1', + registroSanitarioFolioAutorizacion: 'RegistroSanita1', + pesoEnKg: 1, + valorMercancia: 100, + monedaId: 'MXN', + tipoMateriaId: '05', + descripcionMateria: 'otramateria', + cantidadTransporta: [ + { cantidad: 1, idOrigen: 'OR101010', idDestino: 'DE202020' } + ], + detalleMercancia: { + unidadPesoMercId: 'Tu', + pesoBruto: 1, + pesoNeto: 1, + pesoTara: 0.001, + numPiezas: 1 + } + } + ], + transporteMaritimo: makeMaritimeTransport(), + tiposFigura: [makeMaritimeFigure()] + } + } + }; + + const response = await client.invoices.create(invoice); + console.log('Response:', response); +} + +// ============================================================================ +// 13. FACTURA INGRESO - TRANSPORTE MARÍTIMO INTERNACIONAL ADUANERO (ByValues) +// ============================================================================ +async function facturaIngresoTransporteMAritimoInternacionalAduanero(client: FiscalapiClient): Promise { + console.log('\n=== Factura Ingreso Transporte Marítimo Internacional Aduanero (ByValues) ===\n'); + + const invoice: Invoice = { + versionCode: '4.0', + paymentFormCode: '01', + paymentMethodCode: 'PUE', + currencyCode: 'MXN', + typeCode: 'I', + expeditionZipCode: '42501', + series: 'CP3.1', + date: currentDate, + exchangeRate: 1, + exportCode: '01', + issuer: makeIssuer(), + recipient: makeSelfRecipient(), + items: [makeStandardItem()], + complement: { + lading: { + transpInternacId: 'Sí', + entradaSalidaMercId: 'Entrada', + paisOrigenDestinoId: 'AFG', + viaEntradaSalidaId: '01', + totalDistRec: 0, + unidadPesoId: 'XBX', + pesoNetoTotal: 1, + registroISTMOId: 'Sí', + ubicacionPoloOrigenId: '01', + ubicacionPoloDestinoId: '01', + regimenAduaneros: [ + { regimenAduaneroId: 'IMD' }, + { regimenAduaneroId: 'IMD' } + ], + ubicaciones: [ + { + tipoUbicacion: 'Origen', + idUbicacion: 'OR101010', + rfcRemitenteDestinatario: 'EKU9003173C9', + nombreRemitenteDestinatario: 'NombreRemitenteDestinatario1', + numEstacionId: 'EA0417', + nombreEstacion: 'Loreto', + navegacionTraficoId: 'Altura', + fechaHoraSalidaLlegada: '2023-08-01T00:00:00', + tipoEstacionId: '01', + domicilio: { + calle: 'Calle1', + numeroExterior: '211', + numeroInterior: '212', + coloniaId: '1957', + localidadId: '13', + referencia: 'casa blanca', + municipioId: '011', + estadoId: 'CMX', + paisId: 'MEX', + codigoPostalId: '13250' + } + }, + { + tipoUbicacion: 'Destino', + idUbicacion: 'DE202020', + rfcRemitenteDestinatario: 'EKU9003173C9', + nombreRemitenteDestinatario: 'NombreRemitenteDestinatario2', + numEstacionId: 'PM001', + nombreEstacion: 'Rosarito', + navegacionTraficoId: 'Altura', + fechaHoraSalidaLlegada: '2023-08-01T04:00:01', + tipoEstacionId: '02', + domicilio: { + calle: 'Calle2', + numeroExterior: '214', + numeroInterior: '215', + coloniaId: '0347', + localidadId: '23', + referencia: 'casa negra', + municipioId: '004', + estadoId: 'COA', + paisId: 'MEX', + codigoPostalId: '25350' + } + } + ], + mercancias: [ + { + bienesTranspId: '11121900', + descripcion: 'Accesorios de equipo de telefonía', + cantidad: 1.0, + claveUnidadId: 'XBX', + materialPeligrosoId: 'No', + denominacionGenericaProd: 'DenominacionGenericaProd1', + denominacionDistintivaProd: 'DenominacionDistintivaProd1', + fabricante: 'Fabricante1', + fechaCaducidad: '2003-04-02T00:00:00', + loteMedicamento: 'LoteMedic1', + formaFarmaceuticaId: '01', + condicionesEspTranspId: '01', + registroSanitarioFolioAutorizacion: 'RegistroSanita1', + pesoEnKg: 1.50, + valorMercancia: 100, + monedaId: 'MXN', + fraccionArancelariaId: '6309000100', + tipoMateriaId: '05', + descripcionMateria: 'otramateria', + documentacionAduanera: [ + { tipoDocumentoId: '01', numPedimento: '23 43 0472 8000448', rfcImpo: 'EKU9003173C9' } + ], + cantidadTransporta: [ + { cantidad: 1, idOrigen: 'OR101010', idDestino: 'DE202020', cvesTransporteId: '02' } + ], + detalleMercancia: { + unidadPesoMercId: 'X1A', + pesoBruto: 1.50, + pesoNeto: 1.00, + pesoTara: 0.50 + } + } + ], + transporteMaritimo: makeMaritimeTransport(), + transporteAereo: makeAirTransport(), + tiposFigura: [ + { + tipoFiguraId: '01', + rfcFigura: 'EKU9003173C9', + numLicencia: 'NumLicencia1', + nombreFigura: 'NombreFigura1', + domicilio: { + calle: 'Calle1', + numeroExterior: 'NumeroExterior1', + numeroInterior: 'NumeroInterior1', + coloniaId: 'Colonia1', + localidadId: 'Localidad1', + referencia: 'Referencia1', + municipioId: 'Municipio1', + estadoId: 'Estado1', + paisId: 'AFG', + codigoPostalId: 'CodigoPosta1' + } + } + ] + } + } + }; + + const response = await client.invoices.create(invoice); + console.log('Response:', response); +} + +// ============================================================================ +// 14. FACTURA TRASLADO - AUTOTRANSPORTE NACIONAL (ByValues) +// ============================================================================ +async function facturaTrasladoAutotransporteNacional(client: FiscalapiClient): Promise { + console.log('\n=== Factura Traslado Autotransporte Nacional (ByValues) ===\n'); + + const invoice: Invoice = { + versionCode: '4.0', + currencyCode: 'XXX', + typeCode: 'T', + expeditionZipCode: '42501', + series: 'Serie', + date: currentDate, + exchangeRate: 1, + exportCode: '01', + issuer: makeIssuer(), + recipient: makeSelfRecipient(), + items: [makeStandardItem()], + complement: { + lading: { + transpInternacId: 'No', + totalDistRec: 1, + pesoNetoTotal: 0, + registroISTMOId: 'Sí', + ubicacionPoloOrigenId: '01', + ubicacionPoloDestinoId: '01', + unidadPesoId: 'XBX', + logisticaInversaRecoleccionDevolucionId: 'Sí', + ubicaciones: [ + { + tipoUbicacion: 'Origen', + idUbicacion: 'OR101010', + rfcRemitenteDestinatario: 'EKU9003173C9', + nombreRemitenteDestinatario: 'NombreRemitenteDestinatario1', + fechaHoraSalidaLlegada: '2023-08-01T00:00:00', + domicilio: { + calle: 'Calle1', + numeroExterior: '211', + numeroInterior: '212', + coloniaId: '1957', + localidadId: '13', + referencia: 'casa blanca', + municipioId: '011', + estadoId: 'CMX', + paisId: 'MEX', + codigoPostalId: '13250' + } + }, + { + tipoUbicacion: 'Destino', + idUbicacion: 'DE202020', + rfcRemitenteDestinatario: 'EKU9003173C9', + nombreRemitenteDestinatario: 'NombreRemitenteDestinatario2', + fechaHoraSalidaLlegada: '2023-08-01T00:00:01', + distanciaRecorrida: 1, + domicilio: { + calle: 'Calle2', + numeroExterior: '214', + numeroInterior: '215', + coloniaId: '0347', + localidadId: '23', + referencia: 'casa negra', + municipioId: '004', + estadoId: 'COA', + paisId: 'MEX', + codigoPostalId: '25350' + } + } + ], + mercancias: [ + { + bienesTranspId: '11121900', + descripcion: 'Accesorios de equipo de telefonía', + cantidad: 1.0, + claveUnidadId: 'XBX', + materialPeligrosoId: 'No', + denominacionGenericaProd: 'DenominacionGenericaProd1', + denominacionDistintivaProd: 'DenominacionDistintivaProd1', + fabricante: 'Fabricante1', + fechaCaducidad: '2028-01-01T00:00:00', + loteMedicamento: 'LoteMedic1', + registroSanitarioFolioAutorizacion: 'RegistroSanita1', + pesoEnKg: 1, + cantidadTransporta: [ + { cantidad: 1, idOrigen: 'OR101010', idDestino: 'DE202020' } + ] + } + ], + autotransporte: { + permSCTId: 'TPAF01', + numPermisoSCT: 'NumPermisoSCT1', + configVehicularId: 'VL', + pesoBrutoVehicular: 1, + placaVM: 'plac892', + anioModeloVM: 2020, + aseguraRespCivil: 'AseguraRespCivil', + polizaRespCivil: '123456789', + remolques: [ + { subTipoRemId: 'CTR004', placa: 'VL45K98' } + ] + }, + tiposFigura: [ + { + tipoFiguraId: '01', + rfcFigura: 'EKU9003173C9', + numLicencia: 'a234567890', + nombreFigura: 'NombreFigura' + } + ] + } + } + }; + + const response = await client.invoices.create(invoice); + console.log('Response:', response); +} + +// ============================================================================ +// 15. FACTURA TRASLADO - AUTOTRANSPORTE EXTRANJERO (ByValues) +// ============================================================================ +async function facturaTrasladoAutotransporteExtranjero(client: FiscalapiClient): Promise { + console.log('\n=== Factura Traslado Autotransporte Extranjero - Exportación (ByValues) ===\n'); + + const invoice: Invoice = { + versionCode: '4.0', + currencyCode: 'XXX', + typeCode: 'T', + expeditionZipCode: '42501', + series: 'SerieCCP31', + date: currentDate, + exchangeRate: 1, + exportCode: '01', + issuer: makeIssuer(), + recipient: makeSelfRecipient(), + items: [makeStandardItem()], + complement: { + lading: { + transpInternacId: 'Sí', + entradaSalidaMercId: 'Salida', + paisOrigenDestinoId: 'USA', + viaEntradaSalidaId: '01', + totalDistRec: 1, + pesoNetoTotal: 0, + registroISTMOId: 'Sí', + ubicacionPoloOrigenId: '01', + ubicacionPoloDestinoId: '01', + unidadPesoId: 'XBX', + logisticaInversaRecoleccionDevolucionId: 'Sí', + regimenAduaneros: [ + { regimenAduaneroId: 'EXD' } + ], + ubicaciones: [ + { + tipoUbicacion: 'Origen', + idUbicacion: 'OR101010', + rfcRemitenteDestinatario: 'XEXX010101000', + numRegIdTrib: '01010101', + residenciaFiscalId: 'USA', + fechaHoraSalidaLlegada: '2023-08-01T00:00:01', + domicilio: { + calle: 'ST', + numeroExterior: '214', + coloniaId: 'N/A', + referencia: 'WHITE HOUSE', + municipioId: 'N/A', + estadoId: 'TX', + paisId: 'USA', + codigoPostalId: 'N/A' + } + }, + { + tipoUbicacion: 'Destino', + idUbicacion: 'DE202020', + rfcRemitenteDestinatario: 'XEXX010101000', + numRegIdTrib: '01010101', + residenciaFiscalId: 'USA', + fechaHoraSalidaLlegada: '2023-08-01T00:00:01', + distanciaRecorrida: 1, + domicilio: { + calle: 'ST', + numeroExterior: '214', + coloniaId: 'N/A', + referencia: 'WHITE HOUSE', + municipioId: 'N/A', + estadoId: 'TX', + paisId: 'USA', + codigoPostalId: 'N/A' + } + } + ], + mercancias: [ + { + bienesTranspId: '11121900', + descripcion: 'Accesorios de equipo de telefonía', + cantidad: 1.0, + claveUnidadId: 'XBX', + materialPeligrosoId: 'No', + denominacionGenericaProd: 'DenominacionGenericaProd1', + denominacionDistintivaProd: 'DenominacionDistintivaProd1', + fabricante: 'Fabricante1', + fechaCaducidad: '2003-04-02T00:00:00', + loteMedicamento: 'LoteMedic1', + formaFarmaceuticaId: '01', + condicionesEspTranspId: '01', + registroSanitarioFolioAutorizacion: 'RegistroSanita1', + pesoEnKg: 1, + fraccionArancelariaId: '6309000100', + tipoMateriaId: '05', + descripcionMateria: 'otramateria', + cantidadTransporta: [ + { cantidad: 1, idOrigen: 'OR101010', idDestino: 'DE202020' } + ] + } + ], + autotransporte: { + permSCTId: 'TPAF01', + numPermisoSCT: 'NumPermisoSCT1', + configVehicularId: 'VL', + pesoBrutoVehicular: 1, + placaVM: 'plac892', + anioModeloVM: 2020, + aseguraRespCivil: 'AseguraRespCivil', + polizaRespCivil: '123456789', + remolques: [ + { subTipoRemId: 'CTR004', placa: 'VL45K98' } + ] + }, + tiposFigura: [ + { + tipoFiguraId: '01', + rfcFigura: 'EKU9003173C9', + numLicencia: 'NumLicencia1', + nombreFigura: 'NombreFigura1', + domicilio: { + calle: 'ST', + numeroExterior: '214', + coloniaId: 'N/A', + referencia: 'WHITE HOUSE', + municipioId: 'N/A', + estadoId: 'TX', + paisId: 'USA', + codigoPostalId: 'N/A' + } + } + ] + } + } + }; + + const response = await client.invoices.create(invoice); + console.log('Response:', response); +} + +// ============================================================================ +// 16. FACTURA TRASLADO - AUTOTRANSPORTE INTERNACIONAL ADUANERO (ByValues) +// ============================================================================ +async function facturaTrasladoAutotransporteInternacionalAduanero(client: FiscalapiClient): Promise { + console.log('\n=== Factura Traslado Autotransporte Internacional Aduanero - Importación (ByValues) ===\n'); + + const invoice: Invoice = { + versionCode: '4.0', + currencyCode: 'XXX', + typeCode: 'T', + expeditionZipCode: '42501', + series: 'SerieCCP31', + date: currentDate, + exchangeRate: 1, + exportCode: '01', + issuer: makeIssuer(), + recipient: makeSelfRecipient(), + items: [makeStandardItem()], + complement: { + lading: { + transpInternacId: 'Sí', + entradaSalidaMercId: 'Entrada', + paisOrigenDestinoId: 'USA', + viaEntradaSalidaId: '01', + totalDistRec: 1, + pesoNetoTotal: 0, + registroISTMOId: 'Sí', + ubicacionPoloOrigenId: '01', + ubicacionPoloDestinoId: '01', + unidadPesoId: 'XBX', + logisticaInversaRecoleccionDevolucionId: 'Sí', + regimenAduaneros: [ + { regimenAduaneroId: 'IMD' } + ], + ubicaciones: [ + { + tipoUbicacion: 'Origen', + idUbicacion: 'OR101010', + rfcRemitenteDestinatario: 'XEXX010101000', + numRegIdTrib: '01010101', + residenciaFiscalId: 'USA', + fechaHoraSalidaLlegada: '2023-08-01T00:00:01', + domicilio: { + calle: 'ST', + numeroExterior: '214', + coloniaId: 'N/A', + referencia: 'WHITE HOUSE', + municipioId: 'N/A', + estadoId: 'TX', + paisId: 'USA', + codigoPostalId: 'N/A' + } + }, + { + tipoUbicacion: 'Destino', + idUbicacion: 'DE202020', + rfcRemitenteDestinatario: 'XEXX010101000', + numRegIdTrib: '01010101', + residenciaFiscalId: 'USA', + fechaHoraSalidaLlegada: '2023-08-01T00:00:01', + distanciaRecorrida: 1, + domicilio: { + calle: 'ST', + numeroExterior: '214', + coloniaId: 'N/A', + referencia: 'WHITE HOUSE', + municipioId: 'N/A', + estadoId: 'TX', + paisId: 'USA', + codigoPostalId: 'N/A' + } + } + ], + mercancias: [ + { + bienesTranspId: '11121900', + descripcion: 'Accesorios de equipo de telefonía', + cantidad: 1.0, + claveUnidadId: 'XBX', + materialPeligrosoId: 'No', + denominacionGenericaProd: 'DenominacionGenericaProd1', + denominacionDistintivaProd: 'DenominacionDistintivaProd1', + fabricante: 'Fabricante1', + fechaCaducidad: '2003-04-02T00:00:00', + loteMedicamento: 'LoteMedic1', + formaFarmaceuticaId: '01', + condicionesEspTranspId: '01', + registroSanitarioFolioAutorizacion: 'RegistroSanita1', + pesoEnKg: 1, + fraccionArancelariaId: '6309000100', + tipoMateriaId: '05', + descripcionMateria: 'otramateria', + documentacionAduanera: [ + { tipoDocumentoId: '01', numPedimento: '23 43 0472 8000448', rfcImpo: 'EKU9003173C9' } + ], + cantidadTransporta: [ + { cantidad: 1, idOrigen: 'OR101010', idDestino: 'DE202020' } + ] + } + ], + autotransporte: { + permSCTId: 'TPAF01', + numPermisoSCT: 'NumPermisoSCT1', + configVehicularId: 'VL', + pesoBrutoVehicular: 1, + placaVM: 'plac892', + anioModeloVM: 2020, + aseguraRespCivil: 'AseguraRespCivil', + polizaRespCivil: '123456789', + remolques: [ + { subTipoRemId: 'CTR004', placa: 'VL45K98' } + ] + }, + tiposFigura: [ + { + tipoFiguraId: '01', + rfcFigura: 'EKU9003173C9', + numLicencia: 'NumLicencia1', + nombreFigura: 'NombreFigura1', + domicilio: { + calle: 'ST', + numeroExterior: '214', + coloniaId: 'N/A', + referencia: 'WHITE HOUSE', + municipioId: 'N/A', + estadoId: 'TX', + paisId: 'USA', + codigoPostalId: 'N/A' + } + } + ] + } + } + }; + + const response = await client.invoices.create(invoice); + console.log('Response:', response); +} + +// ============================================================================ +// 17. FACTURA TRASLADO - TRANSPORTE FERROVIARIO NACIONAL (ByValues) +// ============================================================================ +async function facturaTrasladoTransporteFerroviarioNacional(client: FiscalapiClient): Promise { + console.log('\n=== Factura Traslado Transporte Ferroviario Nacional (ByValues) ===\n'); + + const invoice: Invoice = { + versionCode: '4.0', + currencyCode: 'XXX', + typeCode: 'T', + expeditionZipCode: '42501', + series: 'Serie', + date: currentDate, + exchangeRate: 1, + exportCode: '01', + issuer: makeIssuer(), + recipient: makeSelfRecipient(), + items: [makeStandardItem()], + complement: { + lading: { + transpInternacId: 'No', + totalDistRec: 500, + pesoNetoTotal: 10, + registroISTMOId: 'Sí', + ubicacionPoloOrigenId: '01', + ubicacionPoloDestinoId: '01', + unidadPesoId: 'XBX', + ubicaciones: [ + ...makeRailLocationsBase(), + { + tipoUbicacion: 'Destino', + idUbicacion: 'DE202025', + rfcRemitenteDestinatario: 'EKU9003173C9', + nombreRemitenteDestinatario: 'NombreRemitenteDestinatario2', + numEstacionId: 'JM047', + nombreEstacion: 'HUEHUETOCA', + fechaHoraSalidaLlegada: '2023-08-01T05:00:01', + tipoEstacionId: '03', + distanciaRecorrida: 100.00, + domicilio: { + calle: 'Calle2', + numeroExterior: '214', + numeroInterior: '215', + coloniaId: '0347', + localidadId: '23', + referencia: 'casa negra', + municipioId: '004', + estadoId: 'COA', + paisId: 'MEX', + codigoPostalId: '25350' + } + } + ], + mercancias: [ + { + bienesTranspId: '11121900', + descripcion: 'Accesorios de equipo de telefonía', + cantidad: 1.0, + claveUnidadId: 'XBX', + materialPeligrosoId: 'No', + denominacionGenericaProd: 'DenominacionGenericaProd1', + denominacionDistintivaProd: 'DenominacionDistintivaProd1', + fabricante: 'Fabricante1', + fechaCaducidad: '2028-01-01T00:00:00', + loteMedicamento: 'LoteMedic1', + registroSanitarioFolioAutorizacion: 'RegistroSanita1', + pesoEnKg: 1, + cantidadTransporta: [ + { cantidad: 1, idOrigen: 'OR101010', idDestino: 'DE202025' } + ] + } + ], + transporteFerroviario: makeRailwayTransport(), + tiposFigura: [makeRailwayFigure()] + } + } + }; + + const response = await client.invoices.create(invoice); + console.log('Response:', response); +} + +// ============================================================================ +// 18. FACTURA TRASLADO - TRANSPORTE FERROVIARIO EXTRANJERO (ByValues) +// ============================================================================ +async function facturaTrasladoTransporteFerroviarioExtranjero(client: FiscalapiClient): Promise { + console.log('\n=== Factura Traslado Transporte Ferroviario Extranjero - Exportación (ByValues) ===\n'); + + const invoice: Invoice = { + versionCode: '4.0', + currencyCode: 'XXX', + typeCode: 'T', + expeditionZipCode: '42501', + series: 'Serie', + date: currentDate, + exchangeRate: 1, + exportCode: '01', + issuer: makeIssuer(), + recipient: makeSelfRecipient(), + items: [makeStandardItem()], + complement: { + lading: { + transpInternacId: 'Sí', + entradaSalidaMercId: 'Salida', + paisOrigenDestinoId: 'USA', + viaEntradaSalidaId: '04', + totalDistRec: 500, + pesoNetoTotal: 10, + registroISTMOId: 'Sí', + ubicacionPoloOrigenId: '01', + ubicacionPoloDestinoId: '01', + unidadPesoId: 'XBX', + regimenAduaneros: [ + { regimenAduaneroId: 'EXD' } + ], + ubicaciones: [ + ...makeRailLocationsBase(), + { + tipoUbicacion: 'Destino', + idUbicacion: 'DE202025', + rfcRemitenteDestinatario: 'XEXX010101000', + nombreRemitenteDestinatario: 'NombreRemitenteDestinatario2', + numRegIdTrib: '01010101', + residenciaFiscalId: 'USA', + numEstacionId: 'EF0001', + nombreEstacion: 'NombreEstacion', + fechaHoraSalidaLlegada: '2023-08-01T05:00:01', + distanciaRecorrida: 100.00, + domicilio: { + calle: 'ST', + numeroExterior: '1234', + coloniaId: '1234', + referencia: 'WHITE HOUSE', + municipioId: '1234', + estadoId: 'TX', + paisId: 'USA', + codigoPostalId: '12345' + } + } + ], + mercancias: [ + { + bienesTranspId: '11121900', + descripcion: 'Accesorios de equipo de telefonía', + cantidad: 1.0, + claveUnidadId: 'XBX', + materialPeligrosoId: 'No', + denominacionGenericaProd: 'DenominacionGenericaProd1', + denominacionDistintivaProd: 'DenominacionDistintivaProd1', + fabricante: 'Fabricante1', + fechaCaducidad: '2028-01-01T00:00:00', + loteMedicamento: 'LoteMedic1', + registroSanitarioFolioAutorizacion: 'RegistroSanita1', + pesoEnKg: 1, + tipoMateriaId: '05', + descripcionMateria: 'otramateria', + cantidadTransporta: [ + { cantidad: 1, idOrigen: 'OR101010', idDestino: 'DE202025' } + ] + } + ], + transporteFerroviario: makeRailwayTransport(), + tiposFigura: [makeRailwayFigure()] + } + } + }; + + const response = await client.invoices.create(invoice); + console.log('Response:', response); +} + +// ============================================================================ +// 19. FACTURA TRASLADO - TRANSPORTE FERROVIARIO INTERNACIONAL ADUANERO (ByValues) +// ============================================================================ +async function facturaTrasladoTransporteFerroviarioInternacionalAduanero(client: FiscalapiClient): Promise { + console.log('\n=== Factura Traslado Transporte Ferroviario Internacional Aduanero - Importación (ByValues) ===\n'); + + const invoice: Invoice = { + versionCode: '4.0', + currencyCode: 'XXX', + typeCode: 'T', + expeditionZipCode: '42501', + series: 'Serie', + date: currentDate, + exchangeRate: 1, + exportCode: '01', + issuer: makeIssuer(), + recipient: makeSelfRecipient(), + items: [makeStandardItem()], + complement: { + lading: { + transpInternacId: 'Sí', + entradaSalidaMercId: 'Entrada', + paisOrigenDestinoId: 'AFG', + viaEntradaSalidaId: '04', + totalDistRec: 500, + pesoNetoTotal: 10, + registroISTMOId: 'Sí', + ubicacionPoloOrigenId: '01', + ubicacionPoloDestinoId: '01', + unidadPesoId: 'XBX', + regimenAduaneros: [ + { regimenAduaneroId: 'IMD' } + ], + ubicaciones: [ + ...makeRailLocationsBase(), + { + tipoUbicacion: 'Destino', + idUbicacion: 'DE202025', + rfcRemitenteDestinatario: 'EKU9003173C9', + nombreRemitenteDestinatario: 'NombreRemitenteDestinatario2', + numEstacionId: 'JM047', + nombreEstacion: 'HUEHUETOCA', + fechaHoraSalidaLlegada: '2023-08-01T05:00:01', + tipoEstacionId: '03', + distanciaRecorrida: 100.00, + domicilio: { + calle: 'Calle2', + numeroExterior: '214', + numeroInterior: '215', + coloniaId: '0347', + localidadId: '23', + referencia: 'casa negra', + municipioId: '004', + estadoId: 'COA', + paisId: 'MEX', + codigoPostalId: '25350' + } + } + ], + mercancias: [ + { + bienesTranspId: '11121900', + descripcion: 'Accesorios de equipo de telefonía', + cantidad: 1.0, + claveUnidadId: 'XBX', + materialPeligrosoId: 'No', + denominacionGenericaProd: 'DenominacionGenericaProd1', + denominacionDistintivaProd: 'DenominacionDistintivaProd1', + fabricante: 'Fabricante1', + fechaCaducidad: '2028-01-01T00:00:00', + loteMedicamento: 'LoteMedic1', + registroSanitarioFolioAutorizacion: 'RegistroSanita1', + pesoEnKg: 1, + tipoMateriaId: '05', + descripcionMateria: 'otramateria', + documentacionAduanera: [ + { tipoDocumentoId: '01', numPedimento: '23 43 0472 8000448', rfcImpo: 'EKU9003173C9' } + ], + cantidadTransporta: [ + { cantidad: 1, idOrigen: 'OR101010', idDestino: 'DE202025' } + ] + } + ], + transporteFerroviario: makeRailwayTransport(), + tiposFigura: [makeRailwayFigure()] + } + } + }; + + const response = await client.invoices.create(invoice); + console.log('Response:', response); +} + +// ============================================================================ +// 20. FACTURA TRASLADO - TRANSPORTE AÉREO NACIONAL (ByValues) +// ============================================================================ +async function facturaTrasladoTransporteAereoNacional(client: FiscalapiClient): Promise { + console.log('\n=== Factura Traslado Transporte Aéreo Nacional (ByValues) ===\n'); + + const invoice: Invoice = { + versionCode: '4.0', + currencyCode: 'XXX', + typeCode: 'T', + expeditionZipCode: '42501', + series: 'Serie', + date: currentDate, + exchangeRate: 1, + exportCode: '01', + issuer: makeIssuer(), + recipient: makeSelfRecipient(), + items: [makeStandardItem()], + complement: { + lading: { + transpInternacId: 'No', + totalDistRec: 0, + unidadPesoId: 'XBX', + pesoNetoTotal: 10, + ubicaciones: [ + { + tipoUbicacion: 'Origen', + idUbicacion: 'OR101010', + rfcRemitenteDestinatario: 'EKU9003173C9', + nombreRemitenteDestinatario: 'NombreRemitenteDestinatario1', + numEstacionId: 'EA0417', + nombreEstacion: 'Loreto', + fechaHoraSalidaLlegada: '2023-08-01T00:00:00', + tipoEstacionId: '01', + domicilio: { + calle: 'Calle1', + numeroExterior: '211', + numeroInterior: '212', + coloniaId: '1957', + localidadId: '13', + referencia: 'casa blanca', + municipioId: '011', + estadoId: 'CMX', + paisId: 'MEX', + codigoPostalId: '13250' + } + }, + { + tipoUbicacion: 'Destino', + idUbicacion: 'DE202020', + rfcRemitenteDestinatario: 'EKU9003173C9', + nombreRemitenteDestinatario: 'NombreRemitenteDestinatario2', + numEstacionId: 'EA0418', + nombreEstacion: 'Los Cabos', + fechaHoraSalidaLlegada: '2023-08-01T00:00:01', + tipoEstacionId: '03', + domicilio: { + calle: 'Calle2', + numeroExterior: '214', + numeroInterior: '215', + coloniaId: '0347', + localidadId: '23', + referencia: 'casa negra', + municipioId: '004', + estadoId: 'COA', + paisId: 'MEX', + codigoPostalId: '25350' + } + } + ], + mercancias: [ + { + bienesTranspId: '11121900', + descripcion: 'Accesorios de equipo de telefonía', + cantidad: 1.0, + claveUnidadId: 'XBX', + materialPeligrosoId: 'No', + denominacionGenericaProd: 'DenominacionGenericaProd1', + denominacionDistintivaProd: 'DenominacionDistintivaProd1', + fabricante: 'Fabricante1', + fechaCaducidad: '2028-01-01T00:00:00', + loteMedicamento: 'LoteMedic1', + registroSanitarioFolioAutorizacion: 'RegistroSanita1', + pesoEnKg: 1, + valorMercancia: 100, + monedaId: 'MXN', + cantidadTransporta: [ + { cantidad: 1, idOrigen: 'OR101010', idDestino: 'DE202020' } + ] + } + ], + transporteAereo: makeAirTransport(), + tiposFigura: [makeAirFigure()] + } + } + }; + + const response = await client.invoices.create(invoice); + console.log('Response:', response); +} + +// ============================================================================ +// 21. FACTURA TRASLADO - TRANSPORTE AÉREO EXTRANJERO (ByValues) +// ============================================================================ +async function facturaTrasladoTransporteAereoExtranjero(client: FiscalapiClient): Promise { + console.log('\n=== Factura Traslado Transporte Aéreo Extranjero (ByValues) ===\n'); + + const invoice: Invoice = { + versionCode: '4.0', + currencyCode: 'XXX', + typeCode: 'T', + expeditionZipCode: '42501', + series: 'Serie', + date: currentDate, + exchangeRate: 1, + exportCode: '01', + issuer: makeIssuer(), + recipient: makeSelfRecipient(), + items: [makeStandardItem()], + complement: { + lading: { + transpInternacId: 'Sí', + entradaSalidaMercId: 'Salida', + paisOrigenDestinoId: 'USA', + viaEntradaSalidaId: '03', + totalDistRec: 0, + unidadPesoId: 'XBX', + pesoNetoTotal: 10, + regimenAduaneros: [ + { regimenAduaneroId: 'EXD' } + ], + ubicaciones: [ + { + tipoUbicacion: 'Origen', + idUbicacion: 'OR101010', + rfcRemitenteDestinatario: 'EKU9003173C9', + nombreRemitenteDestinatario: 'NombreRemitenteDestinatario1', + numEstacionId: 'EA0417', + nombreEstacion: 'Loreto', + fechaHoraSalidaLlegada: '2023-08-01T00:00:00', + tipoEstacionId: '01', + domicilio: { + calle: 'Calle2', + numeroExterior: '214', + numeroInterior: '215', + coloniaId: '0347', + localidadId: '23', + referencia: 'casa negra', + municipioId: '004', + estadoId: 'COA', + paisId: 'MEX', + codigoPostalId: '25350' + } + }, + { + tipoUbicacion: 'Destino', + idUbicacion: 'DE202020', + rfcRemitenteDestinatario: 'XEXX010101000', + nombreRemitenteDestinatario: 'NombreRemitenteDestinatario', + numRegIdTrib: '01010101', + residenciaFiscalId: 'USA', + numEstacionId: 'EA0143', + nombreEstacion: 'Phoenix-Mesa Gateway', + fechaHoraSalidaLlegada: '2023-08-01T00:00:01', + domicilio: { + calle: 'ST', + numeroExterior: '12344', + coloniaId: 'N/A', + referencia: 'WHITE HOUSE', + municipioId: 'N/A', + estadoId: 'TX', + paisId: 'USA', + codigoPostalId: '12345' + } + } + ], + mercancias: [ + { + bienesTranspId: '11121900', + descripcion: 'Accesorios de equipo de telefonía', + cantidad: 1.0, + claveUnidadId: 'XBX', + materialPeligrosoId: 'No', + denominacionGenericaProd: 'DenominacionGenericaProd1', + denominacionDistintivaProd: 'DenominacionDistintivaProd1', + fabricante: 'Fabricante1', + fechaCaducidad: '2028-01-01T00:00:00', + loteMedicamento: 'LoteMedic1', + registroSanitarioFolioAutorizacion: 'RegistroSanita1', + pesoEnKg: 1, + valorMercancia: 100, + monedaId: 'MXN', + tipoMateriaId: '05', + descripcionMateria: 'otramateria', + cantidadTransporta: [ + { cantidad: 1, idOrigen: 'OR101010', idDestino: 'DE202020' } + ] + } + ], + transporteAereo: makeAirTransport(), + tiposFigura: [makeAirFigure()] + } + } + }; + + const response = await client.invoices.create(invoice); + console.log('Response:', response); +} + +// ============================================================================ +// 22. FACTURA TRASLADO - TRANSPORTE AÉREO INTERNACIONAL ADUANERO (ByValues) +// ============================================================================ +async function facturaTrasladoTransporteAereoInternacionalAduanero(client: FiscalapiClient): Promise { + console.log('\n=== Factura Traslado Transporte Aéreo Internacional Aduanero - Importación (ByValues) ===\n'); + + const invoice: Invoice = { + versionCode: '4.0', + currencyCode: 'XXX', + typeCode: 'T', + expeditionZipCode: '42501', + series: 'Serie', + date: currentDate, + exchangeRate: 1, + exportCode: '01', + issuer: makeIssuer(), + recipient: makeSelfRecipient(), + items: [makeStandardItem()], + complement: { + lading: { + transpInternacId: 'Sí', + entradaSalidaMercId: 'Entrada', + paisOrigenDestinoId: 'AFG', + viaEntradaSalidaId: '03', + totalDistRec: 0, + unidadPesoId: 'XBX', + pesoNetoTotal: 10, + regimenAduaneros: [ + { regimenAduaneroId: 'IMD' } + ], + ubicaciones: [ + { + tipoUbicacion: 'Origen', + idUbicacion: 'OR101010', + rfcRemitenteDestinatario: 'EKU9003173C9', + nombreRemitenteDestinatario: 'NombreRemitenteDestinatario1', + numEstacionId: 'EA0417', + nombreEstacion: 'Loreto', + fechaHoraSalidaLlegada: '2023-08-01T00:00:00', + tipoEstacionId: '01', + domicilio: { + calle: 'Calle1', + numeroExterior: '211', + numeroInterior: '212', + coloniaId: '1957', + localidadId: '13', + referencia: 'casa blanca', + municipioId: '011', + estadoId: 'CMX', + paisId: 'MEX', + codigoPostalId: '13250' + } + }, + { + tipoUbicacion: 'Destino', + idUbicacion: 'DE202020', + rfcRemitenteDestinatario: 'EKU9003173C9', + nombreRemitenteDestinatario: 'NombreRemitenteDestinatario2', + numEstacionId: 'EA0418', + nombreEstacion: 'Los Cabos', + fechaHoraSalidaLlegada: '2023-08-01T00:00:01', + tipoEstacionId: '03', + domicilio: { + calle: 'Calle2', + numeroExterior: '214', + numeroInterior: '215', + coloniaId: '0347', + localidadId: '23', + referencia: 'casa negra', + municipioId: '004', + estadoId: 'COA', + paisId: 'MEX', + codigoPostalId: '25350' + } + } + ], + mercancias: [ + { + bienesTranspId: '11121900', + descripcion: 'Accesorios de equipo de telefonía', + cantidad: 1.0, + claveUnidadId: 'XBX', + materialPeligrosoId: 'No', + denominacionGenericaProd: 'DenominacionGenericaProd1', + denominacionDistintivaProd: 'DenominacionDistintivaProd1', + fabricante: 'Fabricante1', + fechaCaducidad: '2028-01-01T00:00:00', + loteMedicamento: 'LoteMedic1', + registroSanitarioFolioAutorizacion: 'RegistroSanita1', + pesoEnKg: 1, + valorMercancia: 100, + monedaId: 'MXN', + tipoMateriaId: '05', + descripcionMateria: 'otramateria', + documentacionAduanera: [ + { tipoDocumentoId: '01', numPedimento: '23 43 0472 8000448', rfcImpo: 'EKU9003173C9' } + ], + cantidadTransporta: [ + { cantidad: 1, idOrigen: 'OR101010', idDestino: 'DE202020' } + ] + } + ], + transporteAereo: makeAirTransport(), + tiposFigura: [makeAirFigure()] + } + } + }; + + const response = await client.invoices.create(invoice); + console.log('Response:', response); +} + +// ============================================================================ +// 23. FACTURA TRASLADO - TRANSPORTE MARÍTIMO NACIONAL (ByValues) +// ============================================================================ +async function facturaTrasladoTransporteMAritimoNacional(client: FiscalapiClient): Promise { + console.log('\n=== Factura Traslado Transporte Marítimo Nacional (ByValues) ===\n'); + + const invoice: Invoice = { + versionCode: '4.0', + currencyCode: 'XXX', + typeCode: 'T', + expeditionZipCode: '42501', + series: 'Serie', + date: currentDate, + exchangeRate: 1, + exportCode: '01', + issuer: makeIssuer(), + recipient: makeSelfRecipient(), + items: [makeStandardItem()], + complement: { + lading: { + transpInternacId: 'No', + totalDistRec: 0, + unidadPesoId: 'XBX', + pesoNetoTotal: 1, + ubicaciones: [ + { + tipoUbicacion: 'Origen', + idUbicacion: 'OR101010', + rfcRemitenteDestinatario: 'EKU9003173C9', + nombreRemitenteDestinatario: 'NombreRemitenteDestinatario1', + numEstacionId: 'PM001', + nombreEstacion: 'Rosarito', + navegacionTraficoId: 'Altura', + fechaHoraSalidaLlegada: '2023-08-01T00:00:00', + tipoEstacionId: '01', + domicilio: { + calle: 'Calle1', + numeroExterior: '211', + numeroInterior: '212', + coloniaId: '1957', + localidadId: '13', + referencia: 'casa blanca', + municipioId: '011', + estadoId: 'CMX', + paisId: 'MEX', + codigoPostalId: '13250' + } + }, + { + tipoUbicacion: 'Destino', + idUbicacion: 'DE202020', + rfcRemitenteDestinatario: 'EKU9003173C9', + nombreRemitenteDestinatario: 'NombreRemitenteDestinatario2', + numEstacionId: 'PM001', + nombreEstacion: 'Rosarito', + navegacionTraficoId: 'Altura', + fechaHoraSalidaLlegada: '2023-08-01T00:00:01', + tipoEstacionId: '03', + domicilio: { + calle: 'Calle2', + numeroExterior: '214', + numeroInterior: '215', + coloniaId: '0347', + localidadId: '23', + referencia: 'casa negra', + municipioId: '004', + estadoId: 'COA', + paisId: 'MEX', + codigoPostalId: '25350' + } + } + ], + mercancias: [ + { + bienesTranspId: '11121900', + descripcion: 'Accesorios de equipo de telefonía', + cantidad: 1.0, + claveUnidadId: 'XBX', + materialPeligrosoId: 'No', + denominacionGenericaProd: 'DenominacionGenericaProd1', + denominacionDistintivaProd: 'DenominacionDistintivaProd1', + fabricante: 'Fabricante1', + fechaCaducidad: '2028-01-01T00:00:00', + loteMedicamento: 'LoteMedic1', + registroSanitarioFolioAutorizacion: 'RegistroSanita1', + pesoEnKg: 1, + valorMercancia: 100, + monedaId: 'MXN', + cantidadTransporta: [ + { cantidad: 1, idOrigen: 'OR101010', idDestino: 'DE202020' } + ], + detalleMercancia: { + unidadPesoMercId: 'Tu', + pesoBruto: 1, + pesoNeto: 1, + pesoTara: 0.001, + numPiezas: 1 + } + } + ], + transporteMaritimo: makeMaritimeTransport(), + tiposFigura: [makeMaritimeFigure()] + } + } + }; + + const response = await client.invoices.create(invoice); + console.log('Response:', response); +} + +// ============================================================================ +// 24. FACTURA TRASLADO - TRANSPORTE MARÍTIMO EXTRANJERO (ByValues) +// ============================================================================ +async function facturaTrasladoTransporteMAritimoExtranjero(client: FiscalapiClient): Promise { + console.log('\n=== Factura Traslado Transporte Marítimo Extranjero (ByValues) ===\n'); + + const invoice: Invoice = { + versionCode: '4.0', + currencyCode: 'XXX', + typeCode: 'T', + expeditionZipCode: '42501', + series: 'Serie', + date: currentDate, + exchangeRate: 1, + exportCode: '01', + issuer: makeIssuer(), + recipient: makeSelfRecipient(), + items: [makeStandardItem()], + complement: { + lading: { + transpInternacId: 'Sí', + entradaSalidaMercId: 'Salida', + paisOrigenDestinoId: 'USA', + viaEntradaSalidaId: '02', + totalDistRec: 0, + unidadPesoId: 'XBX', + pesoNetoTotal: 1, + regimenAduaneros: [ + { regimenAduaneroId: 'EXD' } + ], + ubicaciones: [ + { + tipoUbicacion: 'Origen', + idUbicacion: 'OR101010', + rfcRemitenteDestinatario: 'EKU9003173C9', + nombreRemitenteDestinatario: 'NombreRemitenteDestinatario1', + numEstacionId: 'PM001', + nombreEstacion: 'Rosarito', + navegacionTraficoId: 'Altura', + fechaHoraSalidaLlegada: '2023-08-01T00:00:00', + tipoEstacionId: '01', + domicilio: { + calle: 'Calle1', + numeroExterior: '211', + numeroInterior: '212', + coloniaId: '1957', + localidadId: '13', + referencia: 'casa blanca', + municipioId: '011', + estadoId: 'CMX', + paisId: 'MEX', + codigoPostalId: '13250' + } + }, + { + tipoUbicacion: 'Destino', + idUbicacion: 'DE202020', + rfcRemitenteDestinatario: 'XEXX010101000', + nombreRemitenteDestinatario: 'NombreRemitenteDestinatario2', + numRegIdTrib: '01010101', + residenciaFiscalId: 'USA', + numEstacionId: 'PM120', + nombreEstacion: 'NombreEstacion', + navegacionTraficoId: 'Altura', + fechaHoraSalidaLlegada: '2023-08-01T00:00:01', + domicilio: { + calle: 'ST', + numeroExterior: '12345', + coloniaId: 'N/A', + referencia: 'N/A', + municipioId: 'N/A', + estadoId: 'TX', + paisId: 'USA', + codigoPostalId: '12345' + } + } + ], + mercancias: [ + { + bienesTranspId: '11121900', + descripcion: 'Accesorios de equipo de telefonía', + cantidad: 1.0, + claveUnidadId: 'XBX', + materialPeligrosoId: 'No', + denominacionGenericaProd: 'DenominacionGenericaProd1', + denominacionDistintivaProd: 'DenominacionDistintivaProd1', + fabricante: 'Fabricante1', + fechaCaducidad: '2028-01-01T00:00:00', + loteMedicamento: 'LoteMedic1', + registroSanitarioFolioAutorizacion: 'RegistroSanita1', + pesoEnKg: 1, + valorMercancia: 100, + monedaId: 'MXN', + tipoMateriaId: '05', + descripcionMateria: 'otramateria', + cantidadTransporta: [ + { cantidad: 1, idOrigen: 'OR101010', idDestino: 'DE202020' } + ], + detalleMercancia: { + unidadPesoMercId: 'Tu', + pesoBruto: 1, + pesoNeto: 1, + pesoTara: 0.001, + numPiezas: 1 + } + } + ], + transporteMaritimo: makeMaritimeTransport(), + tiposFigura: [makeMaritimeFigure()] + } + } + }; + + const response = await client.invoices.create(invoice); + console.log('Response:', response); +} + +// ============================================================================ +// 25. FACTURA TRASLADO - TRANSPORTE MARÍTIMO INTERNACIONAL ADUANERO (ByValues) +// ============================================================================ +async function facturaTrasladoTransporteMAritimoInternacionalAduanero(client: FiscalapiClient): Promise { + console.log('\n=== Factura Traslado Transporte Marítimo Internacional Aduanero - Importación (ByValues) ===\n'); + + const invoice: Invoice = { + versionCode: '4.0', + currencyCode: 'XXX', + typeCode: 'T', + expeditionZipCode: '42501', + series: 'Serie', + date: currentDate, + exchangeRate: 1, + exportCode: '01', + issuer: makeIssuer(), + recipient: makeSelfRecipient(), + items: [makeStandardItem()], + complement: { + lading: { + transpInternacId: 'Sí', + entradaSalidaMercId: 'Entrada', + paisOrigenDestinoId: 'AFG', + viaEntradaSalidaId: '02', + totalDistRec: 0, + unidadPesoId: 'XBX', + pesoNetoTotal: 1, + regimenAduaneros: [ + { regimenAduaneroId: 'IMD' }, + { regimenAduaneroId: 'IMD' } + ], + ubicaciones: [ + { + tipoUbicacion: 'Origen', + idUbicacion: 'OR101010', + rfcRemitenteDestinatario: 'EKU9003173C9', + nombreRemitenteDestinatario: 'NombreRemitenteDestinatario1', + numEstacionId: 'PM001', + nombreEstacion: 'Rosarito', + navegacionTraficoId: 'Altura', + fechaHoraSalidaLlegada: '2023-08-01T00:00:00', + tipoEstacionId: '01', + domicilio: { + calle: 'Calle1', + numeroExterior: '211', + numeroInterior: '212', + coloniaId: '1957', + localidadId: '13', + referencia: 'casa blanca', + municipioId: '011', + estadoId: 'CMX', + paisId: 'MEX', + codigoPostalId: '13250' + } + }, + { + tipoUbicacion: 'Destino', + idUbicacion: 'DE202020', + rfcRemitenteDestinatario: 'EKU9003173C9', + nombreRemitenteDestinatario: 'NombreRemitenteDestinatario2', + numEstacionId: 'PM001', + nombreEstacion: 'Rosarito', + navegacionTraficoId: 'Altura', + fechaHoraSalidaLlegada: '2023-08-01T00:00:01', + tipoEstacionId: '03', + domicilio: { + calle: 'Calle2', + numeroExterior: '214', + numeroInterior: '215', + coloniaId: '0347', + localidadId: '23', + referencia: 'casa negra', + municipioId: '004', + estadoId: 'COA', + paisId: 'MEX', + codigoPostalId: '25350' + } + } + ], + mercancias: [ + { + bienesTranspId: '11121900', + descripcion: 'Accesorios de equipo de telefonía', + cantidad: 1.0, + claveUnidadId: 'XBX', + materialPeligrosoId: 'No', + denominacionGenericaProd: 'DenominacionGenericaProd1', + denominacionDistintivaProd: 'DenominacionDistintivaProd1', + fabricante: 'Fabricante1', + fechaCaducidad: '2028-01-01T00:00:00', + loteMedicamento: 'LoteMedic1', + registroSanitarioFolioAutorizacion: 'RegistroSanita1', + pesoEnKg: 1, + valorMercancia: 100, + monedaId: 'MXN', + tipoMateriaId: '05', + descripcionMateria: 'otramateria', + documentacionAduanera: [ + { tipoDocumentoId: '01', numPedimento: '23 43 0472 8000448', rfcImpo: 'EKU9003173C9' } + ], + cantidadTransporta: [ + { cantidad: 1, idOrigen: 'OR101010', idDestino: 'DE202020' } + ], + detalleMercancia: { + unidadPesoMercId: 'Tu', + pesoBruto: 1, + pesoNeto: 1, + pesoTara: 0.001, + numPiezas: 1 + } + } + ], + transporteMaritimo: makeMaritimeTransport(), + tiposFigura: [makeMaritimeFigure()] + } + } + }; + + const response = await client.invoices.create(invoice); + console.log('Response:', response); +} + +// ============================================================================ +// HELPERS COMPARTIDOS (Ferroviario / Aéreo) +// ============================================================================ + +function makeIssuer() { + return { + id: '0e82a655-5f0c-4e07-abab-8f322e4123ef' + }; +} + +function makeSelfRecipient() { + return { + id: '37f7c342-d9a6-4881-9620-0da769b50ce5' + }; +} + +function makeStandardItem() { + return { + itemCode: '78101800', + itemSku: 'UT421511', + quantity: 1, + unitOfMeasurementCode: 'H87', + description: 'Transporte de carga por carretera', + unitPrice: 100.00, + discount: 0, + taxObjectCode: '01', + itemTaxes: [] + }; +} + +function makeRailwayTransport() { + return { + tipoDeServicioId: 'TS01', + tipoDeTraficoId: 'TT01', + derechosDePaso: [ + { tipoDerechoDePasoId: 'CDP114', kilometrajePagado: 100 } + ], + carros: [ + { tipoCarroId: 'TC08', matriculaCarro: 'A00012', guiaCarro: '123ASD', toneladasNetasCarro: 10 } + ] + }; +} + +function makeRailwayFigure() { + return { + tipoFiguraId: '02', + rfcFigura: 'EKU9003173C9', + nombreFigura: 'NombreFigura', + partesTransporte: [ + { parteTransporteId: 'PT02' } + ], + domicilio: { + calle: 'calle', + numeroExterior: '211', + coloniaId: '0814', + localidadId: '01', + referencia: 'casa blanca', + municipioId: '010', + estadoId: 'ZAC', + paisId: 'MEX', + codigoPostalId: '99080' + } + }; +} + +/** Returns the first 5 shared rail locations (Origen + 4 intermediate Destinos) */ +function makeRailLocationsBase() { + return [ + { + tipoUbicacion: 'Origen', + idUbicacion: 'OR101010', + rfcRemitenteDestinatario: 'EKU9003173C9', + nombreRemitenteDestinatario: 'NombreRemitenteDestinatario1', + numEstacionId: 'Q0736', + nombreEstacion: 'SANTO NINO', + fechaHoraSalidaLlegada: '2023-08-01T00:00:00', + tipoEstacionId: '01', + domicilio: { + calle: 'Calle1', + numeroExterior: '211', + numeroInterior: '212', + coloniaId: '1957', + localidadId: '13', + referencia: 'casa blanca', + municipioId: '011', + estadoId: 'CMX', + paisId: 'MEX', + codigoPostalId: '13250' + } + }, + { + tipoUbicacion: 'Destino', + idUbicacion: 'DE202021', + rfcRemitenteDestinatario: 'EKU9003173C9', + nombreRemitenteDestinatario: 'NombreRemitenteDestinatario2', + numEstacionId: 'SC283', + nombreEstacion: 'HUAXTITLA', + fechaHoraSalidaLlegada: '2023-08-01T01:00:01', + tipoEstacionId: '02', + distanciaRecorrida: 100.00 + }, + { + tipoUbicacion: 'Destino', + idUbicacion: 'DE202022', + rfcRemitenteDestinatario: 'EKU9003173C9', + nombreRemitenteDestinatario: 'NombreRemitenteDestinatario2', + numEstacionId: 'TG0', + nombreEstacion: 'NAVOJOA', + fechaHoraSalidaLlegada: '2023-08-01T02:00:01', + tipoEstacionId: '02', + distanciaRecorrida: 100.00 + }, + { + tipoUbicacion: 'Destino', + idUbicacion: 'DE202023', + rfcRemitenteDestinatario: 'EKU9003173C9', + nombreRemitenteDestinatario: 'NombreRemitenteDestinatario2', + numEstacionId: 'E0029', + nombreEstacion: 'TRES JAGUEYES', + fechaHoraSalidaLlegada: '2023-08-01T03:00:01', + tipoEstacionId: '02', + distanciaRecorrida: 100.00 + }, + { + tipoUbicacion: 'Destino', + idUbicacion: 'DE202024', + rfcRemitenteDestinatario: 'EKU9003173C9', + nombreRemitenteDestinatario: 'NombreRemitenteDestinatario2', + numEstacionId: 'TI032', + nombreEstacion: 'NAVOLATO', + fechaHoraSalidaLlegada: '2023-08-01T04:00:01', + tipoEstacionId: '02', + distanciaRecorrida: 100.00 + } + ]; +} + +function makeAirTransport() { + return { + permSCTId: 'TPAF01', + numPermisoSCT: 'Demo', + matriculaAeronave: '61E5-WZ', + nombreAseg: 'NombreAseg', + numPolizaSeguro: 'NumPolizaSeguro', + numeroGuia: 'acUbYlBVTmlzx', + lugarContrato: 'LugarContrato', + codigoTransportistaId: 'CA001', + rfcEmbarcador: 'EKU9003173C9', + nombreEmbarcador: 'Embarcador' + }; +} + +function makeAirFigure() { + return { + tipoFiguraId: '01', + rfcFigura: 'EKU9003173C9', + numLicencia: 'a234567890', + nombreFigura: 'NombreFigura' + }; +} + +function makeMaritimeTransport() { + return { + permSCTId: 'TPAF01', + numPermisoSCT: 'NumPermisoSCT1', + nombreAseg: 'NombreAseg1', + numPolizaSeguro: 'NumPolizaSeguro1', + tipoEmbarcacionId: 'B01', + matricula: 'Matricula1', + numeroOMI: 'IMO1234567', + anioEmbarcacion: 2003, + nombreEmbarc: 'NombreEmbarc1', + nacionalidadEmbarcId: 'AFG', + unidadesDeArqBruto: 0.001, + tipoCargaId: 'CGS', + eslora: 0.01, + manga: 0.01, + calado: 0.01, + puntal: 0.01, + lineaNaviera: 'LineaNaviera1', + nombreAgenteNaviero: 'NombreAgenteNaviero1', + numAutorizacionNavieroId: 'ANC001/2022', + numViaje: 'NumViaje1', + numConocEmbarc: 'NumConocEmbarc1', + permisoTempNavegacion: 'PermisoTempNavegac1', + contenedores: [ + { + tipoContenedorId: 'CM011', + idCCPRelacionado: 'CCCBCD94-870A-4332-A52A-A52AA52AA52A', + placaVMCCP: 'JNG7683', + fechaCertificacionCCP: '2024-06-20T11:11:00', + pesoContenedorVacio: 0, + pesoNetoMercancia: 1, + remolquesCCP: [ + { subTipoRemCCPId: 'CTR001', placaCCP: 'JNG7636' } + ] + } + ] + }; +} + +function makeMaritimeFigure() { + return { + tipoFiguraId: '02', + rfcFigura: 'EKU9003173C9', + nombreFigura: 'NombreFigura', + partesTransporte: [ + { parteTransporteId: 'PT02' } + ], + domicilio: { + calle: 'calle', + numeroExterior: '211', + coloniaId: '0814', + localidadId: '01', + referencia: 'casa blanca', + municipioId: '010', + estadoId: 'ZAC', + paisId: 'MEX', + codigoPostalId: '99080' + } + }; +} + +// ============================================================================ +// FUNCION PRINCIPAL +// ============================================================================ +async function main(): Promise { + console.log('=== Ejemplos de Factura con Complemento Carta Porte FiscalAPI (ByValues) ===\n'); + + const client = FiscalapiClient.create(settings); + + try { + // Descomentar el caso de uso que se desea ejecutar + + await facturaIngresoAutotransporteNacional(client); + // await facturaIngresoAutotransporteNacionalConImpuestos(client); + // await facturaIngresoAutotransporteExtranjero(client); + // await facturaIngresoAutotransporteInternacionalAduanero(client); + // await facturaIngresoTransporteFerroviarioNacional(client); + // await facturaIngresoTransporteFerroviarioExtranjero(client); + // await facturaIngresoTransporteFerroviarioInternacionalAduanero(client); + // await facturaIngresoTransporteAereoNacional(client); + // await facturaIngresoTransporteAereoExtranjero(client); + // await facturaIngresoTransporteAereoInternacionalAduanero(client); + // await facturaIngresoTransporteMAritimoNacional(client); + // await facturaIngresoTransporteMAritimoExtranjero(client); + // await facturaIngresoTransporteMAritimoInternacionalAduanero(client); + // await facturaTrasladoAutotransporteNacional(client); + // await facturaTrasladoAutotransporteExtranjero(client); + // await facturaTrasladoAutotransporteInternacionalAduanero(client); + // await facturaTrasladoTransporteFerroviarioNacional(client); + // await facturaTrasladoTransporteFerroviarioExtranjero(client); + // await facturaTrasladoTransporteFerroviarioInternacionalAduanero(client); + // await facturaTrasladoTransporteAereoNacional(client); + // await facturaTrasladoTransporteAereoExtranjero(client); + // await facturaTrasladoTransporteAereoInternacionalAduanero(client); + // await facturaTrasladoTransporteMAritimoNacional(client); + // await facturaTrasladoTransporteMAritimoExtranjero(client); + // await facturaTrasladoTransporteMAritimoInternacionalAduanero(client); + + console.log('\nEjecución completada.'); + } catch (error) { + console.error('Error:', error); + } +} + +// Ejecutar función principal +main(); + diff --git a/package-lock.json b/package-lock.json index 336f31a..d265e6a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "fiscalapi", - "version": "4.0.270", + "version": "4.0.372", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "fiscalapi", - "version": "4.0.270", + "version": "4.0.372", "license": "MPL-2.0", "dependencies": { "axios": "^1.8.4", @@ -29,49 +29,9 @@ "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", "dev": true, - "dependencies": { - "@jridgewell/trace-mapping": "0.3.9" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/@isaacs/balanced-match": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@isaacs/balanced-match/-/balanced-match-4.0.1.tgz", - "integrity": "sha512-yzMTt9lEb8Gv7zRioUilSglI0c0smZ9k5D65677DLWLtWJaXIS3CqcGyUFByYKlnUj6TkjLVs54fBl6+TiGQDQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": "20 || >=22" - } - }, - "node_modules/@isaacs/brace-expansion": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/@isaacs/brace-expansion/-/brace-expansion-5.0.0.tgz", - "integrity": "sha512-ZT55BDLV0yv0RBm2czMiZ+SqCGO7AvmOM3G/w2xhVPH+te0aKgFjmBvGlL1dH+ql2tgGO3MVrbb3jCKyvpgnxA==", - "dev": true, "license": "MIT", "dependencies": { - "@isaacs/balanced-match": "^4.0.1" - }, - "engines": { - "node": "20 || >=22" - } - }, - "node_modules/@isaacs/cliui": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", - "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", - "dev": true, - "license": "ISC", - "dependencies": { - "string-width": "^5.1.2", - "string-width-cjs": "npm:string-width@^4.2.0", - "strip-ansi": "^7.0.1", - "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", - "wrap-ansi": "^8.1.0", - "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + "@jridgewell/trace-mapping": "0.3.9" }, "engines": { "node": ">=12" @@ -82,71 +42,80 @@ "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", "dev": true, + "license": "MIT", "engines": { "node": ">=6.0.0" } }, "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", - "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==", - "dev": true + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", + "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", + "dev": true, + "license": "MIT" }, "node_modules/@jridgewell/trace-mapping": { "version": "0.3.9", "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", "dev": true, + "license": "MIT", "dependencies": { "@jridgewell/resolve-uri": "^3.0.3", "@jridgewell/sourcemap-codec": "^1.4.10" } }, "node_modules/@tsconfig/node10": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.11.tgz", - "integrity": "sha512-DcRjDCujK/kCk/cUe8Xz8ZSpm8mS3mNNpta+jGCA6USEDfktlNvm1+IuZ9eTcDbNk41BHwpHHeW+N1lKCz4zOw==", - "dev": true + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.12.tgz", + "integrity": "sha512-UCYBaeFvM11aU2y3YPZ//O5Rhj+xKyzy7mvcIoAjASbigy8mHMryP5cK7dgjlz2hWxh1g5pLw084E0a/wlUSFQ==", + "dev": true, + "license": "MIT" }, "node_modules/@tsconfig/node12": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@tsconfig/node14": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@tsconfig/node16": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz", "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@types/luxon": { - "version": "3.4.2", - "resolved": "https://registry.npmjs.org/@types/luxon/-/luxon-3.4.2.tgz", - "integrity": "sha512-TifLZlFudklWlMBfhubvgqTXRzLDI5pCbGa4P8a3wPyUQSW+1xQ5eDsreP9DWHX3tjq1ke96uYG/nwundroWcA==", - "dev": true + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/@types/luxon/-/luxon-3.7.1.tgz", + "integrity": "sha512-H3iskjFIAn5SlJU7OuxUmTEpebK6TKB8rxZShDslBMZJ5u9S//KM1sbdAisiSrqwLQncVjnpi2OK2J51h+4lsg==", + "dev": true, + "license": "MIT" }, "node_modules/@types/node": { - "version": "22.13.14", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.13.14.tgz", - "integrity": "sha512-Zs/Ollc1SJ8nKUAgc7ivOEdIBM8JAKgrqqUYi2J997JuKO7/tpQC+WCetQ1sypiKCQWHdvdg9wBNpUPEWZae7w==", + "version": "22.19.15", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.19.15.tgz", + "integrity": "sha512-F0R/h2+dsy5wJAUe3tAU6oqa2qbWY5TpNfL/RGmo1y38hiyO1w3x2jPtt76wmuaJI4DQnOBu21cNXQ2STIUUWg==", "dev": true, - "peer": true, + "license": "MIT", "dependencies": { - "undici-types": "~6.20.0" + "undici-types": "~6.21.0" } }, "node_modules/acorn": { - "version": "8.14.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.1.tgz", - "integrity": "sha512-OvQ/2pUDKmgfCg++xsTX1wGxfTaszcHVcTctW4UJB4hibJx2HXxxO5UmVgyjMa+ZDsiaf5wWLXYpRWMmBI0QHg==", + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.16.0.tgz", + "integrity": "sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw==", "dev": true, + "license": "MIT", "bin": { "acorn": "bin/acorn" }, @@ -155,10 +124,11 @@ } }, "node_modules/acorn-walk": { - "version": "8.3.4", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.4.tgz", - "integrity": "sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g==", + "version": "8.3.5", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.5.tgz", + "integrity": "sha512-HEHNfbars9v4pgpW6SO1KSPkfoS0xVOM/9UzkJltjlsHZmJasxg8aXkuZa7SMf8vKGIBhpUsPluQSqhJFCqebw==", "dev": true, + "license": "MIT", "dependencies": { "acorn": "^8.11.0" }, @@ -166,58 +136,58 @@ "node": ">=0.4.0" } }, - "node_modules/ansi-regex": { - "version": "6.2.2", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", - "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" - } - }, - "node_modules/ansi-styles": { - "version": "6.2.3", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz", - "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, "node_modules/arg": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "license": "MIT" }, "node_modules/axios": { - "version": "1.13.4", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.13.4.tgz", - "integrity": "sha512-1wVkUaAO6WyaYtCkcYCOx12ZgpGf9Zif+qXa4n+oYzK558YryKqiL6UWwd5DqiH3VRW0GYhTZQ/vlgJrCoNQlg==", + "version": "1.13.6", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.13.6.tgz", + "integrity": "sha512-ChTCHMouEe2kn713WHbQGcuYrr6fXTBiu460OTwWrWob16g1bXn4vtz07Ope7ewMozJAnEquLk5lWQWtBig9DQ==", "license": "MIT", "dependencies": { - "follow-redirects": "^1.15.6", - "form-data": "^4.0.4", + "follow-redirects": "^1.15.11", + "form-data": "^4.0.5", "proxy-from-env": "^1.1.0" } }, + "node_modules/balanced-match": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", + "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "18 || 20 || >=22" + } + }, + "node_modules/brace-expansion": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.4.tgz", + "integrity": "sha512-h+DEnpVvxmfVefa4jFbCf5HdH5YMDXRsmKflpf1pILZWRFlTbJpxeU55nJl4Smt5HQaGzg1o6RHFPJaOqnmBDg==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^4.0.2" + }, + "engines": { + "node": "18 || 20 || >=22" + } + }, "node_modules/call-bind-apply-helpers": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "license": "MIT", "dependencies": { "es-errors": "^1.3.0", "function-bind": "^1.1.2" @@ -226,30 +196,11 @@ "node": ">= 0.4" } }, - "node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true, - "license": "MIT" - }, "node_modules/combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "license": "MIT", "dependencies": { "delayed-stream": "~1.0.0" }, @@ -261,26 +212,14 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", - "dev": true - }, - "node_modules/cross-spawn": { - "version": "7.0.6", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", - "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", "dev": true, - "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - }, - "engines": { - "node": ">= 8" - } + "license": "MIT" }, "node_modules/delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "license": "MIT", "engines": { "node": ">=0.4.0" } @@ -299,6 +238,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "license": "MIT", "dependencies": { "call-bind-apply-helpers": "^1.0.1", "es-errors": "^1.3.0", @@ -308,24 +248,11 @@ "node": ">= 0.4" } }, - "node_modules/eastasianwidth": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", - "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", - "dev": true, - "license": "MIT" - }, - "node_modules/emoji-regex": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", - "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", - "dev": true, - "license": "MIT" - }, "node_modules/es-define-property": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "license": "MIT", "engines": { "node": ">= 0.4" } @@ -334,6 +261,7 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "license": "MIT", "engines": { "node": ">= 0.4" } @@ -342,6 +270,7 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", + "license": "MIT", "dependencies": { "es-errors": "^1.3.0" }, @@ -353,6 +282,7 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", + "license": "MIT", "dependencies": { "es-errors": "^1.3.0", "get-intrinsic": "^1.2.6", @@ -364,15 +294,16 @@ } }, "node_modules/follow-redirects": { - "version": "1.15.9", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz", - "integrity": "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==", + "version": "1.15.11", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.11.tgz", + "integrity": "sha512-deG2P0JfjrTxl50XGCDyfI97ZGVCxIpfKYmfyrQ54n5FO/0gfIES8C/Psl6kWVDolizcaaxZJnTS0QSMxvnsBQ==", "funding": [ { "type": "individual", "url": "https://github.com/sponsors/RubenVerborgh" } ], + "license": "MIT", "engines": { "node": ">=4.0" }, @@ -382,22 +313,6 @@ } } }, - "node_modules/foreground-child": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.1.tgz", - "integrity": "sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==", - "dev": true, - "dependencies": { - "cross-spawn": "^7.0.6", - "signal-exit": "^4.0.1" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/form-data": { "version": "4.0.5", "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.5.tgz", @@ -418,6 +333,7 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -426,6 +342,7 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "license": "MIT", "dependencies": { "call-bind-apply-helpers": "^1.0.2", "es-define-property": "^1.0.1", @@ -449,6 +366,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "license": "MIT", "dependencies": { "dunder-proto": "^1.0.1", "es-object-atoms": "^1.0.0" @@ -458,24 +376,18 @@ } }, "node_modules/glob": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-11.1.0.tgz", - "integrity": "sha512-vuNwKSaKiqm7g0THUBu2x7ckSs3XJLXE+2ssL7/MfTGPLLcrJQ/4Uq1CjPTtO5cCIiRxqvN6Twy1qOwhL0Xjcw==", + "version": "13.0.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-13.0.6.tgz", + "integrity": "sha512-Wjlyrolmm8uDpm/ogGyXZXb1Z+Ca2B8NbJwqBVg0axK9GbBeoS7yGV6vjXnYdGm6X53iehEuxxbyiKp8QmN4Vw==", "dev": true, "license": "BlueOak-1.0.0", "dependencies": { - "foreground-child": "^3.3.1", - "jackspeak": "^4.1.1", - "minimatch": "^10.1.1", - "minipass": "^7.1.2", - "package-json-from-dist": "^1.0.0", - "path-scurry": "^2.0.0" - }, - "bin": { - "glob": "dist/esm/bin.mjs" + "minimatch": "^10.2.2", + "minipass": "^7.1.3", + "path-scurry": "^2.0.2" }, "engines": { - "node": "20 || >=22" + "node": "18 || 20 || >=22" }, "funding": { "url": "https://github.com/sponsors/isaacs" @@ -485,6 +397,7 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -496,6 +409,7 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -507,6 +421,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "license": "MIT", "dependencies": { "has-symbols": "^1.0.3" }, @@ -521,6 +436,7 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "license": "MIT", "dependencies": { "function-bind": "^1.1.2" }, @@ -528,51 +444,21 @@ "node": ">= 0.4" } }, - "node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true - }, - "node_modules/jackspeak": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-4.1.1.tgz", - "integrity": "sha512-zptv57P3GpL+O0I7VdMJNBZCu+BPHVQUk55Ft8/QCJjTVxrnJHuVuX/0Bl2A6/+2oyR/ZMEuFKwmzqqZ/U5nPQ==", - "dev": true, - "license": "BlueOak-1.0.0", - "dependencies": { - "@isaacs/cliui": "^8.0.2" - }, - "engines": { - "node": "20 || >=22" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/lru-cache": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.1.0.tgz", - "integrity": "sha512-QIXZUBJUx+2zHUdQujWejBkcD9+cs94tLn0+YL8UrCh+D5sCXZ4c7LaEH48pNwRY3MLDgqUFyhlCyjJPf1WP0A==", + "version": "11.2.7", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.2.7.tgz", + "integrity": "sha512-aY/R+aEsRelme17KGQa/1ZSIpLpNYYrhcrepKTZgE+W3WM16YMCaPwOHLHsmopZHELU0Ojin1lPVxKR0MihncA==", "dev": true, + "license": "BlueOak-1.0.0", "engines": { "node": "20 || >=22" } }, "node_modules/luxon": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/luxon/-/luxon-3.6.0.tgz", - "integrity": "sha512-WE7p0p7W1xji9qxkLYsvcIxZyfP48GuFrWIBQZIsbjCyf65dG1rv4n83HcOyEyhvzxJCrUoObCRNFgRNIQ5KNA==", + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/luxon/-/luxon-3.7.2.tgz", + "integrity": "sha512-vtEhXh/gNjI9Yg1u4jX/0YVPMvxzHuGgCm6tC5kZyb08yjGWGnqAjGJvcXbqQR2P3MyMEFnRbpcdFS6PBcLqew==", + "license": "MIT", "engines": { "node": ">=12" } @@ -581,12 +467,14 @@ "version": "1.3.6", "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", - "dev": true + "dev": true, + "license": "ISC" }, "node_modules/math-intrinsics": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "license": "MIT", "engines": { "node": ">= 0.4" } @@ -595,6 +483,7 @@ "version": "1.52.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "license": "MIT", "engines": { "node": ">= 0.6" } @@ -603,6 +492,7 @@ "version": "2.1.35", "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "license": "MIT", "dependencies": { "mime-db": "1.52.0" }, @@ -611,26 +501,27 @@ } }, "node_modules/minimatch": { - "version": "10.1.1", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.1.1.tgz", - "integrity": "sha512-enIvLvRAFZYXJzkCYG5RKmPfrFArdLv+R+lbQ53BmIMLIry74bjKzX6iHAm8WYamJkhSSEabrWN5D97XnKObjQ==", + "version": "10.2.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.4.tgz", + "integrity": "sha512-oRjTw/97aTBN0RHbYCdtF1MQfvusSIBQM0IZEgzl6426+8jSC0nF1a/GmnVLpfB9yyr6g6FTqWqiZVbxrtaCIg==", "dev": true, "license": "BlueOak-1.0.0", "dependencies": { - "@isaacs/brace-expansion": "^5.0.0" + "brace-expansion": "^5.0.2" }, "engines": { - "node": "20 || >=22" + "node": "18 || 20 || >=22" }, "funding": { "url": "https://github.com/sponsors/isaacs" } }, "node_modules/minipass": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", - "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.3.tgz", + "integrity": "sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==", "dev": true, + "license": "BlueOak-1.0.0", "engines": { "node": ">=16 || 14 >=14.17" } @@ -639,28 +530,21 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==", - "dev": true - }, - "node_modules/path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", "dev": true, - "engines": { - "node": ">=8" - } + "license": "BlueOak-1.0.0" }, "node_modules/path-scurry": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.0.tgz", - "integrity": "sha512-ypGJsmGtdXUOeM5u93TyeIEfEhM6s+ljAhrk5vAvSx8uyY/02OvrZnA0YNGUrPXfpJMgI1ODd3nwz8Npx4O4cg==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.2.tgz", + "integrity": "sha512-3O/iVVsJAPsOnpwWIeD+d6z/7PmqApyQePUtCndjatj/9I5LylHvt5qluFaBT3I5h3r1ejfR056c+FCv+NnNXg==", "dev": true, + "license": "BlueOak-1.0.0", "dependencies": { "lru-cache": "^11.0.0", "minipass": "^7.1.2" }, "engines": { - "node": "20 || >=22" + "node": "18 || 20 || >=22" }, "funding": { "url": "https://github.com/sponsors/isaacs" @@ -669,16 +553,18 @@ "node_modules/proxy-from-env": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", - "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", + "license": "MIT" }, "node_modules/rimraf": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-6.0.1.tgz", - "integrity": "sha512-9dkvaxAsk/xNXSJzMgFqqMCuFgt2+KsOFek3TMLfo8NCPfWpBmqwyNn5Y+NX56QUYfCtsyhF3ayiboEoUmJk/A==", + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-6.1.3.tgz", + "integrity": "sha512-LKg+Cr2ZF61fkcaK1UdkH2yEBBKnYjTyWzTJT6KNPcSPaiT7HSdhtMXQuN5wkTX0Xu72KQ1l8S42rlmexS2hSA==", "dev": true, + "license": "BlueOak-1.0.0", "dependencies": { - "glob": "^11.0.0", - "package-json-from-dist": "^1.0.0" + "glob": "^13.0.3", + "package-json-from-dist": "^1.0.1" }, "bin": { "rimraf": "dist/esm/bin.mjs" @@ -690,148 +576,12 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, - "dependencies": { - "shebang-regex": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/signal-exit": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", - "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", - "dev": true, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/string-width": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", - "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", - "dev": true, - "license": "MIT", - "dependencies": { - "eastasianwidth": "^0.2.0", - "emoji-regex": "^9.2.2", - "strip-ansi": "^7.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/string-width-cjs": { - "name": "string-width", - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "license": "MIT", - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/string-width-cjs/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/string-width-cjs/node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true, - "license": "MIT" - }, - "node_modules/string-width-cjs/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-ansi": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.2.tgz", - "integrity": "sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-regex": "^6.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/strip-ansi?sponsor=1" - } - }, - "node_modules/strip-ansi-cjs": { - "name": "strip-ansi", - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-ansi-cjs/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/ts-node": { "version": "10.9.2", "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz", "integrity": "sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==", "dev": true, + "license": "MIT", "dependencies": { "@cspotcode/source-map-support": "^0.8.0", "@tsconfig/node10": "^1.0.7", @@ -871,11 +621,11 @@ } }, "node_modules/typescript": { - "version": "5.8.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz", - "integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==", + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", "dev": true, - "peer": true, + "license": "Apache-2.0", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -885,135 +635,25 @@ } }, "node_modules/undici-types": { - "version": "6.20.0", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz", - "integrity": "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==", - "dev": true + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", + "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", + "dev": true, + "license": "MIT" }, "node_modules/v8-compile-cache-lib": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", - "dev": true - }, - "node_modules/which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/wrap-ansi": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", - "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^6.1.0", - "string-width": "^5.0.1", - "strip-ansi": "^7.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, - "node_modules/wrap-ansi-cjs": { - "name": "wrap-ansi", - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, - "node_modules/wrap-ansi-cjs/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/wrap-ansi-cjs/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/wrap-ansi-cjs/node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "dev": true, "license": "MIT" }, - "node_modules/wrap-ansi-cjs/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "license": "MIT", - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/wrap-ansi-cjs/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/yn": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", "dev": true, + "license": "MIT", "engines": { "node": ">=6" } diff --git a/package.json b/package.json index be274d3..cd572c1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fiscalapi", - "version": "4.0.360", + "version": "4.0.372", "description": "SDK de Node.js para Fiscalapi", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", diff --git a/src/index.ts b/src/index.ts index 3588073..b64db0f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -69,6 +69,25 @@ export type { PayrollDeduction, PayrollDisability, LadingComplement, + LadingCustomsRegime, + LadingDomicilio, + LadingLocation, + LadingMerchandiseDetail, + LadingCustomsDocument, + LadingQuantityTransported, + LadingMerchandise, + LadingTrailer, + LadingAutoTransport, + LadingSeaTrailerCCP, + LadingSeaContainer, + LadingSeaTransport, + LadingAirTransport, + LadingRailContainer, + LadingRailcar, + LadingRailRightOfWay, + LadingRailTransport, + LadingTransportPart, + LadingFigure, } from './models/invoice'; export type { diff --git a/src/models/invoice.ts b/src/models/invoice.ts index fffd497..f1bddda 100644 --- a/src/models/invoice.ts +++ b/src/models/invoice.ts @@ -456,10 +456,583 @@ export interface PayrollDisability { // ============================================================================ /** - * Complemento de carta porte (placeholder para futura implementación) + * Régimen aduanero en carta porte + */ +export interface LadingCustomsRegime { + /** Clave del régimen aduanero. Catálogo SAT c_RegimenAduanero */ + regimenAduaneroId: string; +} + +/** + * Domicilio de una ubicación o figura de transporte + */ +export interface LadingDomicilio { + /** Calle */ + calle?: string; + + /** Número exterior */ + numeroExterior?: string; + + /** Número interior */ + numeroInterior?: string; + + /** Clave de colonia. Catálogo SAT c_Colonia */ + coloniaId?: string; + + /** Clave de localidad. Catálogo SAT c_Localidad */ + localidadId?: string; + + /** Referencia adicional */ + referencia?: string; + + /** Clave de municipio. Catálogo SAT c_Municipio */ + municipioId?: string; + + /** Clave de estado. Catálogo SAT c_Estado */ + estadoId?: string; + + /** Clave de país. Catálogo SAT c_Pais */ + paisId?: string; + + /** Código postal. Catálogo SAT c_CodigoPostal */ + codigoPostalId?: string; +} + +/** + * Ubicación de origen o destino en carta porte + */ +export interface LadingLocation { + /** Tipo de ubicación (Origen / Destino) */ + tipoUbicacion: string; + + /** Identificador de la ubicación */ + idUbicacion?: string; + + /** RFC del remitente o destinatario */ + rfcRemitenteDestinatario?: string; + + /** Número de registro de identificación tributaria (extranjeros) */ + numRegIdTrib?: string; + + /** Clave de residencia fiscal. Catálogo SAT c_Pais */ + residenciaFiscalId?: string; + + /** Nombre del remitente o destinatario */ + nombreRemitenteDestinatario?: string; + + /** Número de estación. Catálogo SAT c_Estaciones */ + numEstacionId?: string; + + /** Nombre de la estación */ + nombreEstacion?: string; + + /** Clave de navegación/tráfico. Catálogo SAT c_NavegacionTrafico */ + navegacionTraficoId?: string; + + /** Tipo de estación. Catálogo SAT c_TipoEstacion */ + tipoEstacionId?: string; + + /** Fecha y hora de salida o llegada (formato SAT: yyyy-MM-ddTHH:mm:ss) */ + fechaHoraSalidaLlegada: string; + + /** Distancia recorrida en km */ + distanciaRecorrida?: number; + + /** Domicilio de la ubicación */ + domicilio?: LadingDomicilio; +} + +/** + * Detalle de la mercancía + */ +export interface LadingMerchandiseDetail { + /** Clave de unidad de peso. Catálogo SAT c_UnidadPeso */ + unidadPesoMercId: string; + + /** Peso bruto en kg */ + pesoBruto: number; + + /** Peso neto en kg */ + pesoNeto: number; + + /** Peso tara en kg */ + pesoTara: number; + + /** Número de piezas */ + numPiezas?: number; +} + +/** + * Documento aduanero asociado a una mercancía + */ +export interface LadingCustomsDocument { + /** Clave del tipo de documento. Catálogo SAT c_DocumentoAduanero */ + tipoDocumentoId?: string; + + /** Número de pedimento */ + numPedimento?: string; + + /** RFC del importador */ + rfcImpo?: string; +} + +/** + * Cantidad transportada de una mercancía entre ubicaciones + */ +export interface LadingQuantityTransported { + /** Cantidad transportada */ + cantidad: number; + + /** Identificador de ubicación de origen */ + idOrigen: string; + + /** Identificador de ubicación de destino */ + idDestino: string; + + /** Clave de transporte. Catálogo SAT c_CvesTransporte */ + cvesTransporteId?: string; +} + +/** + * Mercancía en carta porte + */ +export interface LadingMerchandise { + /** Clave de bienes transportados. Catálogo SAT c_BienesTransp */ + bienesTranspId: string; + + /** Descripción de la mercancía */ + descripcion: string; + + /** Cantidad */ + cantidad: number; + + /** Clave de unidad. Catálogo SAT c_ClaveUnidad */ + claveUnidadId: string; + + /** Clave de material peligroso. Catálogo SAT c_MaterialPeligroso */ + materialPeligrosoId?: string; + + /** Denominación genérica del producto */ + denominacionGenericaProd?: string; + + /** Denominación distintiva del producto */ + denominacionDistintivaProd?: string; + + /** Fabricante */ + fabricante?: string; + + /** Fecha de caducidad (formato SAT: yyyy-MM-ddTHH:mm:ss) */ + fechaCaducidad?: string; + + /** Lote del medicamento */ + loteMedicamento?: string; + + /** Clave de forma farmacéutica. Catálogo SAT c_FormaFarmaceutica */ + formaFarmaceuticaId?: string; + + /** Clave de condiciones especiales de transporte. Catálogo SAT c_CondicionesEspTransp */ + condicionesEspTranspId?: string; + + /** Registro sanitario o folio de autorización */ + registroSanitarioFolioAutorizacion?: string; + + /** Peso en kilogramos */ + pesoEnKg: number; + + /** Clave de fracción arancelaria. Catálogo SAT c_FraccionArancelaria */ + fraccionArancelariaId?: string; + + /** Clave del tipo de materia. Catálogo SAT c_TipoMateria */ + tipoMateriaId?: string; + + /** Descripción de la materia */ + descripcionMateria?: string; + + /** Valor de la mercancía */ + valorMercancia?: number; + + /** Clave de moneda. Catálogo SAT c_Moneda */ + monedaId?: string; + + /** Documentación aduanera */ + documentacionAduanera?: LadingCustomsDocument[]; + + /** Cantidades transportadas entre ubicaciones */ + cantidadTransporta?: LadingQuantityTransported[]; + + /** Detalle de la mercancía */ + detalleMercancia?: LadingMerchandiseDetail; +} + +/** + * Remolque en autotransporte + */ +export interface LadingTrailer { + /** Clave del sub-tipo de remolque. Catálogo SAT c_SubTipoRem */ + subTipoRemId: string; + + /** Placa del remolque */ + placa: string; +} + +/** + * Autotransporte federal en carta porte + */ +export interface LadingAutoTransport { + /** Clave del permiso SCT. Catálogo SAT c_TipoPermiso */ + permSCTId: string; + + /** Número de permiso SCT */ + numPermisoSCT: string; + + /** Clave de configuración vehicular. Catálogo SAT c_ConfigAutotransporte */ + configVehicularId: string; + + /** Peso bruto vehicular en toneladas */ + pesoBrutoVehicular: number; + + /** Placa del vehículo/motriz */ + placaVM: string; + + /** Año modelo del vehículo */ + anioModeloVM: number; + + /** Nombre de la aseguradora de responsabilidad civil */ + aseguraRespCivil: string; + + /** Número de póliza de responsabilidad civil */ + polizaRespCivil: string; + + /** Remolques */ + remolques?: LadingTrailer[]; +} + +/** + * Remolque CCP en transporte marítimo + */ +export interface LadingSeaTrailerCCP { + /** Clave del sub-tipo de remolque CCP. Catálogo SAT c_SubTipoRem */ + subTipoRemCCPId: string; + + /** Placa del remolque CCP */ + placaCCP: string; +} + +/** + * Contenedor marítimo + */ +export interface LadingSeaContainer { + /** Matrícula del contenedor */ + matriculaContenedor?: string; + + /** Clave del tipo de contenedor. Catálogo SAT c_TipoContenedor */ + tipoContenedorId?: string; + + /** Número de precinto */ + numPrecinto?: string; + + /** Peso del contenedor vacío en toneladas */ + pesoContenedorVacio: number; + + /** Peso neto de la mercancía en toneladas */ + pesoNetoMercancia: number; + + /** Identificador de CCP relacionado */ + idCCPRelacionado?: string; + + /** Placa del vehículo/motriz CCP */ + placaVMCCP?: string; + + /** Fecha de certificación CCP */ + fechaCertificacionCCP?: string; + + /** Remolques CCP */ + remolquesCCP?: LadingSeaTrailerCCP[]; +} + +/** + * Transporte marítimo en carta porte + */ +export interface LadingSeaTransport { + /** Clave del permiso SCT. Catálogo SAT c_TipoPermiso */ + permSCTId?: string; + + /** Número de permiso SCT */ + numPermisoSCT?: string; + + /** Clave de configuración marítima. Catálogo SAT c_ConfigMaritima */ + configMaritimaId?: string; + + /** Nombre de la aseguradora */ + nombreAseg?: string; + + /** Número de póliza de seguro */ + numPolizaSeguro?: string; + + /** Clave del tipo de embarcación. Catálogo SAT c_TipoEmbarcacion */ + tipoEmbarcacionId?: string; + + /** Matrícula de la embarcación */ + matricula?: string; + + /** Número OMI */ + numeroOMI?: string; + + /** Año de la embarcación */ + anioEmbarcacion?: number; + + /** Nombre de la embarcación */ + nombreEmbarc?: string; + + /** Clave de nacionalidad de la embarcación. Catálogo SAT c_Pais */ + nacionalidadEmbarcId?: string; + + /** Unidades de arqueo bruto */ + unidadesDeArqBruto?: number; + + /** Clave del tipo de carga. Catálogo SAT c_TipoCarga */ + tipoCargaId?: string; + + /** Eslora en metros */ + eslora?: number; + + /** Manga en metros */ + manga?: number; + + /** Calado en metros */ + calado?: number; + + /** Puntal en metros */ + puntal?: number; + + /** Línea naviera */ + lineaNaviera?: string; + + /** Nombre del agente naviero */ + nombreAgenteNaviero?: string; + + /** Número de certificado ITC */ + numCertITC?: string; + + /** Nombre del embarcador/cargador */ + nombreEmbarCargador?: string; + + /** Nombre del agente aduanal */ + nombreAgente?: string; + + /** Número de autorización naviero */ + numAutorizacionNavieroId?: string; + + /** Número de viaje */ + numViaje?: string; + + /** Número de conocimiento de embarque */ + numConocEmbarc?: string; + + /** Permiso temporal de navegación */ + permisoTempNavegacion?: string; + + /** Contenedores */ + contenedores?: LadingSeaContainer[]; +} + +/** + * Transporte aéreo en carta porte + */ +export interface LadingAirTransport { + /** Clave del permiso SCT. Catálogo SAT c_TipoPermiso */ + permSCTId?: string; + + /** Número de permiso SCT */ + numPermisoSCT?: string; + + /** Matrícula de la aeronave */ + matriculaAeronave?: string; + + /** Nombre de la aseguradora */ + nombreAseg?: string; + + /** Número de póliza de seguro */ + numPolizaSeguro?: string; + + /** Número de guía aérea */ + numeroGuia?: string; + + /** Lugar del contrato */ + lugarContrato?: string; + + /** Clave del código del transportista. Catálogo SAT c_CodigoTransportista */ + codigoTransportistaId?: string; + + /** RFC del embarcador */ + rfcEmbarcador?: string; + + /** Nombre del embarcador */ + nombreEmbarcador?: string; + + /** RFC del transportista */ + rfcTransportista?: string; +} + +/** + * Contenedor ferroviario + */ +export interface LadingRailContainer { + /** Clave del tipo de contenedor. Catálogo SAT c_TipoContenedor */ + tipoContenedorId?: string; + + /** Peso del contenedor vacío en toneladas */ + pesoContenedorVacio: number; + + /** Peso neto de la mercancía en toneladas */ + pesoNetoMercancia: number; +} + +/** + * Carro ferroviario + */ +export interface LadingRailcar { + /** Clave del tipo de carro. Catálogo SAT c_TipoCarro */ + tipoCarroId: string; + + /** Matrícula del carro */ + matriculaCarro?: string; + + /** Número de guía del carro */ + guiaCarro?: string; + + /** Toneladas netas del carro */ + toneladasNetasCarro: number; + + /** Contenedores ferroviarios */ + contenedores?: LadingRailContainer[]; +} + +/** + * Derecho de paso en transporte ferroviario + */ +export interface LadingRailRightOfWay { + /** Clave del tipo de derecho de paso. Catálogo SAT c_TipoDerechoDePaso */ + tipoDerechoDePasoId: string; + + /** Kilometraje pagado */ + kilometrajePagado: number; +} + +/** + * Transporte ferroviario en carta porte + */ +export interface LadingRailTransport { + /** Clave del tipo de servicio. Catálogo SAT c_TipoServicioFerroviario */ + tipoDeServicioId?: string; + + /** Clave del tipo de tráfico. Catálogo SAT c_TipoTráfico */ + tipoDeTraficoId?: string; + + /** Nombre de la aseguradora */ + nombreAseg?: string; + + /** Número de póliza de seguro */ + numPolizaSeguro?: string; + + /** Derechos de paso */ + derechosDePaso?: LadingRailRightOfWay[]; + + /** Carros ferroviarios */ + carros?: LadingRailcar[]; +} + +/** + * Parte de transporte asociada a una figura + */ +export interface LadingTransportPart { + /** Clave de la parte del transporte. Catálogo SAT c_ParteTransporte */ + parteTransporteId: string; +} + +/** + * Figura del transporte (operador, propietario, arrendador, notificado) + */ +export interface LadingFigure { + /** Clave del tipo de figura. Catálogo SAT c_TipoFigura */ + tipoFiguraId: string; + + /** RFC de la figura */ + rfcFigura?: string; + + /** Número de licencia */ + numLicencia?: string; + + /** Nombre de la figura */ + nombreFigura?: string; + + /** Partes del transporte */ + partesTransporte?: LadingTransportPart[]; + + /** Domicilio de la figura */ + domicilio?: LadingDomicilio; +} + +/** + * Complemento de carta porte (Complemento de Traslado de Mercancías) */ export interface LadingComplement { - // Carta Porte complement - to be implemented + /** Indica si el transporte es internacional (Sí/No) */ + transpInternacId: string; + + /** Clave de entrada/salida de mercancía. Catálogo SAT c_EntradaSalidaMerc */ + entradaSalidaMercId?: string; + + /** Clave del país de origen o destino. Catálogo SAT c_Pais */ + paisOrigenDestinoId?: string; + + /** Clave de vía de entrada/salida. Catálogo SAT c_ViaEntradaSalida */ + viaEntradaSalidaId?: string; + + /** Total de distancia recorrida en km */ + totalDistRec: number; + + /** Peso neto total en kg */ + pesoNetoTotal: number; + + /** Clave del registro ISTMO. Catálogo SAT c_RegistroISTMO */ + registroISTMOId?: string; + + /** Clave de ubicación polo origen. Catálogo SAT c_UbicacionPolo */ + ubicacionPoloOrigenId?: string; + + /** Clave de ubicación polo destino. Catálogo SAT c_UbicacionPolo */ + ubicacionPoloDestinoId?: string; + + /** Clave de unidad de peso. Catálogo SAT c_UnidadPeso */ + unidadPesoId: string; + + /** Clave de logística inversa/recolección/devolución. Catálogo SAT c_LogisticaInversa */ + logisticaInversaRecoleccionDevolucionId?: string; + + /** Regímenes aduaneros */ + regimenAduaneros?: LadingCustomsRegime[]; + + /** Ubicaciones de origen y destino */ + ubicaciones: LadingLocation[]; + + /** Mercancías transportadas */ + mercancias: LadingMerchandise[]; + + /** Autotransporte federal */ + autotransporte?: LadingAutoTransport; + + /** Transporte marítimo */ + transporteMaritimo?: LadingSeaTransport; + + /** Transporte aéreo */ + transporteAereo?: LadingAirTransport; + + /** Transporte ferroviario */ + transporteFerroviario?: LadingRailTransport; + + /** Figuras del transporte */ + tiposFigura?: LadingFigure[]; } /**