Skip to main content
This guide takes you from a blank project to an authorized electronic invoice against ARCA’s homologación (test) environment. You’ll install the package, point it at your credentials, issue a Factura C, and learn how to handle every possible outcome. Before you start, make sure you have a valid CUIT, a certificate registered in ARCA’s WSASS portal, and a sales point enabled for web services — if you haven’t done that yet, follow the ARCA Setup guide first and come back here.
1

Install facturas

Add the facturas package to your project. Node.js 20 or later is required, and the package is ESM-only.
If your project is not already ESM, add "type": "module" to your package.json.
2

Set environment variables

The client reads four required variables. Set them in your shell, .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.
Before writing any application code, confirm that every layer is working:
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 arca.issue(). The client reads the environment variables you set above — no constructor arguments required for a basic setup.
Amounts are always integer centavos (minor units). 150_000 represents ARS 1,500.00 — multiply your peso amount by 100. Use the numeric separator _ freely for readability.
For a responsable inscripto issuer, include the VAT rate on each item:
Before calling issue(), you can inspect the derived invoice type and amounts with preview(). It runs synchronously and makes no network calls:
Compare 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.
Do not discard an indeterminate or conflict result. The voucher number has been reserved with ARCA regardless of whether the authorization response was clear. Discarding it can create a gap in your sequence that ARCA will flag.

Next steps: safe retries with idempotency

The steps above are enough to issue invoices, but in production you should add a store and an idempotencyKey. Without them, a process crash between number reservation and authorization can cause a duplicate invoice on retry.
Adapters are available for Postgres, Redis, file, and memory (memory is for tests and does not survive process restarts). Use 1–255 characters for the key, without personal data like CUIT or DNI, and never generate a new key per attempt.

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 exact arca.issue() call it made:
This only works in test environment and is a real homologación document.