1
Install facturas
Add the If your project is not already ESM, add
facturas package to your project. Node.js 20 or later is required, and the package is ESM-only."type": "module" to your package.json.2
Set environment variables
The client reads four required variables. Set them in your shell, Before writing any application code, confirm that every layer is working:
.env file, or deployment platform before running your code.Never commit PEM values to your repository. Use your platform’s secret management (Vercel environment variables, AWS Secrets Manager, etc.) to inject them at runtime. See the ARCA Setup guide for how to generate and register these credentials.
check tests your configuration, certificate, WSAA authentication, WSFE connectivity, and sales points in that order, and names the exact layer that fails if something is wrong — without writing anything to ARCA.3
Issue your first invoice
Create a client and call For a responsable inscripto issuer, include the VAT rate on each item:Before calling Compare
arca.issue(). The client reads the environment variables you set above — no constructor arguments required for a basic setup.issue(), you can inspect the derived invoice type and amounts with preview(). It runs synchronously and makes no network calls:preview.amounts.sentTotal against the total on your sale record before calling issue().4
Handle every outcome
arca.issue() returns one of four typed outcomes. Always handle all four — don’t assume success.Next steps: safe retries with idempotency
The steps above are enough to issue invoices, but in production you should add astore and an idempotencyKey. Without them, a process crash between number reservation and authorization can cause a duplicate invoice on retry.
Try it with the CLI
To test the full circuit before writing code, the CLI can issue a real ARS 1.00 invoice in homologación and print the exactarca.issue() call it made:
test environment and is a real homologación document.