arca-sdk 1.1.2 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/README.md +33 -2
- package/dist/index.cjs +28 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +30 -3
- package/dist/index.d.ts +30 -3
- package/dist/index.js +27 -9
- package/dist/index.js.map +1 -1
- package/package.json +59 -59
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,26 @@ Todos los cambios notables de este proyecto se documentan en este archivo.
|
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
+
## [1.2.1] — 2026-05-29
|
|
8
|
+
|
|
9
|
+
### 🌐 Normativas ARCA 2026 & Actualizaciones de Infraestructura
|
|
10
|
+
|
|
11
|
+
- **Migración a Dominios ARCA**: Se actualizaron todos los endpoints predeterminados SOAP del SDK (`WSAA`, `WSFE` y `Padrón A13`) reemplazando los antiguos servidores `*.afip.gov.ar` / `*.afip.gob.ar` por la infraestructura oficial y definitiva de ARCA (`*.arca.gob.ar`).
|
|
12
|
+
- **URL del Código QR Oficial**: Se actualizó la URL de validación del QR de comprobantes electrónicos a `https://www.arca.gob.ar/fe/qr/?p=...` según la normativa vigente en 2026.
|
|
13
|
+
- **Documentación de Normativas Recientes**:
|
|
14
|
+
- **Identificación de Comprador (RG 5824/2026)**: Se documentó en el `README.md` el nuevo tope legal de **$10.000.000** a partir del cual es obligatorio identificar al receptor en facturas de Consumidores Finales.
|
|
15
|
+
- **Facturación A con Leyenda (RG 5762/2025)**: Se documentó cómo utilizar el campo `optionals` del SDK para dar cumplimiento a la disolución de la Factura Clase "M" mediante la emisión de Facturas A tradicionales con leyendas de retención impositivas ("OPERACIÓN SUJETA A RETENCIÓN" o "PAGO EN CBU INFORMADA").
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## [1.2.0] — 2026-03-18
|
|
20
|
+
|
|
21
|
+
### ✨ Developer Experience (DX) y Normativas 2025
|
|
22
|
+
|
|
23
|
+
- **VatCondition Enum**: Se introdujo el enumerador fuertemente tipado `VatCondition` para facilitar el envío del parámetro `<ar:CondicionIVAReceptorId>` (obligatorio para ciertas Facturas C según la RG 5616/2024 efectiva desde 2025). Ahora la interfaz `Buyer` acepta este enum en su propiedad `vatCondition`, previniendo errores por el uso de números mágicos (ej. `VatCondition.CONSUMIDOR_FINAL` en lugar de `5`).
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
7
27
|
## [1.1.2] — 2026-03-04
|
|
8
28
|
|
|
9
29
|
### 🐛 Fixes en Nodos para Facturas de Servicios (RG 5616)
|
package/README.md
CHANGED
|
@@ -104,7 +104,7 @@ const result = await wsfe.issueSimpleReceipt({ total: 1500 });
|
|
|
104
104
|
|
|
105
105
|
console.log('CAE:', result.cae); // '75157992335329'
|
|
106
106
|
console.log('Vto:', result.caeExpiry); // '20260302'
|
|
107
|
-
console.log('QR:', result.qrUrl); // 'https://www.
|
|
107
|
+
console.log('QR:', result.qrUrl); // 'https://www.arca.gob.ar/fe/qr/?p=...'
|
|
108
108
|
```
|
|
109
109
|
|
|
110
110
|
> Los certificados se obtienen en el [portal de ARCA](https://auth.afip.gob.ar/contribuyente_/login.xhtml) (CLAVE FISCAL nivel 3+).
|
|
@@ -283,7 +283,38 @@ console.log(result.qrUrl); // listo para embeber en un generador de QR
|
|
|
283
283
|
const url = generateQRUrl(caeResponse, '20123456789', 1500.00);
|
|
284
284
|
```
|
|
285
285
|
|
|
286
|
-
> **Nota:** La URL usa base64 crudo sin `encodeURIComponent`. Es un quirk
|
|
286
|
+
> **Nota:** La URL usa base64 crudo sin `encodeURIComponent`. Es un quirk del spec oficial de ARCA — su scanner no acepta caracteres URL-encoded.
|
|
287
|
+
|
|
288
|
+
### 📋 Normativas ARCA 2026 & Buenas Prácticas
|
|
289
|
+
|
|
290
|
+
`arca-sdk` está completamente adaptada a las últimas directivas de la **Agencia de Recaudación y Control Aduanero (ARCA)**:
|
|
291
|
+
|
|
292
|
+
#### 1. Identificación del Comprador (RG 5824/2026)
|
|
293
|
+
* A partir de 2026, el monto límite para compras de **Consumidores Finales** sin identificar se elevó a **$10.000.000**.
|
|
294
|
+
* Si el importe acumulado del comprobante es **igual o mayor a $10.000.000**, es **obligatorio** identificar al comprador mediante su DNI, CUIT, CUIL o CDI en el objeto `buyer`.
|
|
295
|
+
* Si el cliente solicita el comprobante para deducir el gasto en el Impuesto a las Ganancias, es obligatorio identificarlo con su CUIT sin importar el monto.
|
|
296
|
+
|
|
297
|
+
#### 2. Emisión de Facturas Clase "A" con Leyenda (RG 5762/2025)
|
|
298
|
+
Con la eliminación total de la Factura Clase "M", ARCA instruyó el uso de Facturas Clase "A" tradicionales acompañadas de leyendas impositivas obligatorias. La SDK permite resolver este requerimiento utilizando el bloque de campos opcionales del protocolo SOAP:
|
|
299
|
+
|
|
300
|
+
* **Operación Sujeta a Retención (Reemplazo de Factura M):**
|
|
301
|
+
Para emitir una Factura A sujeta al régimen de retención, debés pasar en la propiedad `optionals` el identificador oficial provisto por ARCA:
|
|
302
|
+
```typescript
|
|
303
|
+
const result = await wsfe.issueInvoiceA({
|
|
304
|
+
items: [...],
|
|
305
|
+
buyer: { docType: TaxIdType.CUIT, docNumber: '30716024941' },
|
|
306
|
+
optionals: [
|
|
307
|
+
{
|
|
308
|
+
id: 5, // ID opcional para indicar la condicion
|
|
309
|
+
value: '1' // Valor segun catalogo de ARCA
|
|
310
|
+
}
|
|
311
|
+
]
|
|
312
|
+
});
|
|
313
|
+
```
|
|
314
|
+
* **Pago en CBU Informada:**
|
|
315
|
+
De igual modo, si te corresponde emitir con la leyenda de obligatoriedad de CBU, se adjunta el opcional correspondiente declarando tu cuenta bancaria asociada.
|
|
316
|
+
|
|
317
|
+
---
|
|
287
318
|
|
|
288
319
|
### Manejo de errores
|
|
289
320
|
|
package/dist/index.cjs
CHANGED
|
@@ -38,6 +38,7 @@ __export(index_exports, {
|
|
|
38
38
|
InvoiceType: () => InvoiceType,
|
|
39
39
|
PadronService: () => PadronService,
|
|
40
40
|
TaxIdType: () => TaxIdType,
|
|
41
|
+
VatCondition: () => VatCondition,
|
|
41
42
|
WsaaService: () => WsaaService,
|
|
42
43
|
WsfeService: () => WsfeService,
|
|
43
44
|
generateQRUrl: () => generateQRUrl
|
|
@@ -46,16 +47,16 @@ module.exports = __toCommonJS(index_exports);
|
|
|
46
47
|
|
|
47
48
|
// src/constants/endpoints.ts
|
|
48
49
|
var WSAA_ENDPOINTS = {
|
|
49
|
-
homologacion: "https://wsaahomo.
|
|
50
|
-
produccion: "https://wsaa.
|
|
50
|
+
homologacion: "https://wsaahomo.arca.gob.ar/ws/services/LoginCms",
|
|
51
|
+
produccion: "https://wsaa.arca.gob.ar/ws/services/LoginCms"
|
|
51
52
|
};
|
|
52
53
|
var WSFE_ENDPOINTS = {
|
|
53
|
-
homologacion: "https://wswhomo.
|
|
54
|
-
produccion: "https://servicios1.
|
|
54
|
+
homologacion: "https://wswhomo.arca.gob.ar/wsfev1/service.asmx",
|
|
55
|
+
produccion: "https://servicios1.arca.gob.ar/wsfev1/service.asmx"
|
|
55
56
|
};
|
|
56
57
|
var PADRON_A13_ENDPOINTS = {
|
|
57
|
-
homologacion: "https://awshomo.
|
|
58
|
-
produccion: "https://aws.
|
|
58
|
+
homologacion: "https://awshomo.arca.gob.ar/sr-padron/webservices/personaServiceA13",
|
|
59
|
+
produccion: "https://aws.arca.gob.ar/sr-padron/webservices/personaServiceA13"
|
|
59
60
|
};
|
|
60
61
|
function getWsaaEndpoint(environment) {
|
|
61
62
|
return WSAA_ENDPOINTS[environment];
|
|
@@ -543,6 +544,21 @@ var TaxIdType = /* @__PURE__ */ ((TaxIdType2) => {
|
|
|
543
544
|
TaxIdType2[TaxIdType2["FINAL_CONSUMER"] = 99] = "FINAL_CONSUMER";
|
|
544
545
|
return TaxIdType2;
|
|
545
546
|
})(TaxIdType || {});
|
|
547
|
+
var VatCondition = /* @__PURE__ */ ((VatCondition2) => {
|
|
548
|
+
VatCondition2[VatCondition2["IVA_RESPONSABLE_INSCRIPTO"] = 1] = "IVA_RESPONSABLE_INSCRIPTO";
|
|
549
|
+
VatCondition2[VatCondition2["IVA_RESPONSABLE_NO_INSCRIPTO"] = 2] = "IVA_RESPONSABLE_NO_INSCRIPTO";
|
|
550
|
+
VatCondition2[VatCondition2["IVA_NO_RESPONSABLE"] = 3] = "IVA_NO_RESPONSABLE";
|
|
551
|
+
VatCondition2[VatCondition2["IVA_SUJETO_EXENTO"] = 4] = "IVA_SUJETO_EXENTO";
|
|
552
|
+
VatCondition2[VatCondition2["CONSUMIDOR_FINAL"] = 5] = "CONSUMIDOR_FINAL";
|
|
553
|
+
VatCondition2[VatCondition2["RESPONSABLE_MONOTRIBUTO"] = 6] = "RESPONSABLE_MONOTRIBUTO";
|
|
554
|
+
VatCondition2[VatCondition2["SUJETO_NO_CATEGORIZADO"] = 7] = "SUJETO_NO_CATEGORIZADO";
|
|
555
|
+
VatCondition2[VatCondition2["PROVEEDOR_DEL_EXTERIOR"] = 8] = "PROVEEDOR_DEL_EXTERIOR";
|
|
556
|
+
VatCondition2[VatCondition2["CLIENTE_DEL_EXTERIOR"] = 9] = "CLIENTE_DEL_EXTERIOR";
|
|
557
|
+
VatCondition2[VatCondition2["IVA_LIBERADO_LEY_19640"] = 10] = "IVA_LIBERADO_LEY_19640";
|
|
558
|
+
VatCondition2[VatCondition2["IVA_RESPONSABLE_INSCRIPTO_AGENTE_PERCEPCION"] = 11] = "IVA_RESPONSABLE_INSCRIPTO_AGENTE_PERCEPCION";
|
|
559
|
+
VatCondition2[VatCondition2["MONOTRIBUTISTA_SOCIAL"] = 13] = "MONOTRIBUTISTA_SOCIAL";
|
|
560
|
+
return VatCondition2;
|
|
561
|
+
})(VatCondition || {});
|
|
546
562
|
|
|
547
563
|
// src/utils/calculations.ts
|
|
548
564
|
function calculateSubtotal(items, includesVAT = false) {
|
|
@@ -604,7 +620,7 @@ function generateQRUrl(caeResponse, issuerCUIT, total, buyer) {
|
|
|
604
620
|
qrData.codAut = Number(cleanCAE);
|
|
605
621
|
const jsonString = JSON.stringify(qrData);
|
|
606
622
|
const base64 = typeof Buffer !== "undefined" ? Buffer.from(jsonString).toString("base64") : btoa(jsonString);
|
|
607
|
-
return `https://www.
|
|
623
|
+
return `https://www.arca.gob.ar/fe/qr/?p=${base64}`;
|
|
608
624
|
}
|
|
609
625
|
|
|
610
626
|
// src/constants/errors.ts
|
|
@@ -725,7 +741,8 @@ var WsfeService = class _WsfeService {
|
|
|
725
741
|
docType: 99 /* FINAL_CONSUMER */,
|
|
726
742
|
docNumber: "0"
|
|
727
743
|
},
|
|
728
|
-
optionals: params.optionals
|
|
744
|
+
optionals: params.optionals,
|
|
745
|
+
serviceDates: params.serviceDates
|
|
729
746
|
});
|
|
730
747
|
}
|
|
731
748
|
/**
|
|
@@ -743,7 +760,8 @@ var WsfeService = class _WsfeService {
|
|
|
743
760
|
docType: 99 /* FINAL_CONSUMER */,
|
|
744
761
|
docNumber: "0"
|
|
745
762
|
},
|
|
746
|
-
optionals: params.optionals
|
|
763
|
+
optionals: params.optionals,
|
|
764
|
+
serviceDates: params.serviceDates
|
|
747
765
|
});
|
|
748
766
|
return { ...cae, items: params.items };
|
|
749
767
|
}
|
|
@@ -1500,6 +1518,7 @@ var PadronService = class {
|
|
|
1500
1518
|
InvoiceType,
|
|
1501
1519
|
PadronService,
|
|
1502
1520
|
TaxIdType,
|
|
1521
|
+
VatCondition,
|
|
1503
1522
|
WsaaService,
|
|
1504
1523
|
WsfeService,
|
|
1505
1524
|
generateQRUrl
|