Odoo 19 Community - Argentina ARCA Electronic Invoicing (WSAA / WSFEv1)
This addon integrates Odoo Community Edition with ARCA (Agencia de Recaudación y Control Aduanero, formerly AFIP) web services for electronic invoicing in Argentina.
- Certificate Management: Generate RSA private keys and CSR (Certificate Signing Request) directly from Odoo Settings
- WSAA Integration: Automatic authentication with ARCA via CMS (PKCS#7) signed tickets
- WSFEv1 Integration: Electronic invoice authorization and CAE (Código de Autorización Electrónico) generation
- RG 5616 Compliant: Includes customer IVA condition reporting (mandatory since April 2025)
- Dual Environment: Support for both testing (homologación) and production environments
- Auto CAE on Post: Automatic CAE request when posting invoices
- Token Caching: WSAA tokens are cached and reused until expiration
- Certificate Expiration: Automatic monitoring via cron job
| Type | A | B | C | E (Export) |
|---|---|---|---|---|
| Factura | ✅ | ✅ | ✅ | ✅ |
| Nota de Débito | ✅ | ✅ | ✅ | ✅ |
| Nota de Crédito | ✅ | ✅ | ✅ | ✅ |
l10n_ar(Argentina Accounting Localization)account_edi(Electronic Data Interchange base)
All included in the official Odoo 19 Docker image:
cryptographyzeeplxml
- Copy the
l10n_ar_arca_edifolder to your Odoo addons path - Update the addons list: Settings > Apps > Update Apps List
- Search and install "Argentina - ARCA Electronic Invoicing"
Everything is configured from Settings > Invoicing > ARCA Electronic Invoicing (top of the page).
- Go to Settings > Invoicing
- In the ARCA Electronic Invoicing section, click "Create Certificate"
- Fill in the name (e.g.,
MyCompany-Testing), select company and environment - Click "Create Certificate"
- Click "Generate Key & CSR" — this generates your private key and CSR
Go to the ARCA portal to register your certificate:
Testing (Homologación):
- Login at https://auth.afip.gob.ar with your CUIT and clave fiscal
- In the search bar, type "WSASS"
- Select "WSASS - Autogestión Certificados Homologación"
- This takes you to: https://wsass-homo.afip.gob.ar/wsass/portal/main.aspx
Production:
- Login at https://auth.afip.gob.ar with your CUIT and clave fiscal
- Search for "Administración de Certificados Digitales"
Note: If it's your first time, you may need to enable the WSASS service from "Administrador de Relaciones" first.
Once inside the WSASS portal:
- In the left sidebar, click "Nuevo Certificado"
- You'll see the form "Crear DN y certificado" with 3 fields:
- Nombre simbólico del DN: Enter a name (e.g.,
MyCompanyTesting) - CUIT del contribuyente: Pre-filled with your CUIT
- Solicitud de certificado en formato PKCS#10: Go back to Odoo, copy the CSR content using the copy button, and paste it here
- Nombre simbólico del DN: Enter a name (e.g.,
- Click "Crear DN y obtener certificado"
- In the Resultado section below, the signed certificate will appear. It starts with
-----BEGIN CERTIFICATE-----and ends with-----END CERTIFICATE-----. Copy the entire content (including those lines) and save it as a.crtfile (e.g.,MyCompany-Testing.crt)
Still in the WSASS portal:
- In the left sidebar, click "Crear autorización a servicio"
- You'll see the form "Crear autorización" with 5 fields:
- Nombre simbólico del DN a autorizar: Select the DN you created in Step 2
- CUIT del DN a autorizar: Pre-filled with your CUIT
- CUIT representado: Enter your CUIT
- CUIT de quien genera la autorización: Pre-filled with your CUIT
- Servicio al que desea acceder: Select "wsfe - Facturación Electrónica"
- Click "Crear autorización de acceso"
Important: Without this step, the Test Connection will fail with "Computador no autorizado a acceder al servicio".
- Back in Odoo Settings, click "Upload Certificate"
- Upload the
.crtfile you saved from ARCA - Click "Upload"
- Click "Test Connection"
- You should see a green toast: "Connection Successful. WSAA authentication successful. Token valid until YYYY-MM-DD HH:MM."
- The token is typically valid for 12 hours (assigned by ARCA, may vary in production). It is cached and renewed automatically when expired — no manual action required.
That's it! Your Odoo is now connected to ARCA.
- Go to Invoicing > Configuration > Journals (in Odoo Community, the app is called "Invoicing", not "Accounting")
- Click on your sales journal (e.g., "Ventas Preimpreso")
- Make sure Use Documents and Is ARCA POS? are checked
- Set ARCA POS System to "Online Invoice" (this is the
RLI_RLMmode required for electronic invoicing) - The ARCA Electronic Invoicing checkbox will be automatically enabled
- Set your ARCA POS Number (the point of sale number registered in ARCA)
Once configured, CAE is automatically requested when posting invoices from Invoicing > Customers > Invoices. You can also manually request CAE using the "Request CAE" button on posted invoices.
┌──────────────┐ ┌──────────────┐ ┌──────────────┐
│ Odoo │ │ WSAA │ │ WSFEv1 │
│ (this addon)│────▶│ (Auth Token) │────▶│ (CAE Request)│
└──────────────┘ └──────────────┘ └──────────────┘
│ │ │
│ CMS/PKCS#7 │ Token + Sign │ CAE + Vto
│ signed TRA │ │
▼ ▼ ▼
Private Key + Login Ticket Invoice Data
Certificate Response + Authorization
- Build a TRA (Ticket de Requerimiento de Acceso) XML with timestamps in Argentina timezone (-03:00)
- Sign it with CMS/PKCS#7 using the private key and certificate
- Send the signed CMS to WSAA
loginCmsendpoint - Parse response to extract Token and Sign
- Cache token until expiration (typically 12 hours)
| Service | Testing (Homologación) | Production |
|---|---|---|
| WSAA | wsaahomo.afip.gov.ar | wsaa.afip.gov.ar |
| WSFEv1 | wswhomo.afip.gov.ar | servicios1.afip.gov.ar |
| WSASS Portal | wsass-homo.afip.gob.ar | (via clave fiscal portal) |
| Error | Cause | Solution |
|---|---|---|
| "No se ha podido interpretar el XML contra el SCHEMA" | Timezone format wrong in TRA XML | Fixed in v1.0 — uses ISO format with colon (-03:00) |
| "Computador no autorizado a acceder al servicio" | wsfe service not authorized | Go to ARCA portal > "Crear autorización a servicio" > select wsfe |
| "El CEE ya posee un TA válido" | Token already active | Not an error — token is cached and valid. Click Test Connection again |
| Upload certificate fails | not_valid_before_utc attribute error |
Fixed in v1.0 — uses not_valid_before (compatible with Odoo 19 cryptography version) |
LGPL-3 - See LICENSE file.
Contributions are welcome! Please submit pull requests to the GitHub repository.