Peru SUNAT Electronic Invoicing
Factura, boleta, nota de credito and nota de debito in UBL 2.1, signed with your certificate and sent to SUNAT or your OSE - plus the GRE guia de remision electronica remitente from your deliveries, the Guia de Remision Transportista for carriers,, one establecimiento anexo per invoice series and warehouse, and the accounting of detraccion, retencion, percepcion and anticipos.
What it does
Validate an invoice in Odoo and the module builds the SUNAT XML (UBL 2.1, CustomizationID 2.0), signs it with your PKCS#12 digital certificate, zips it and sends it with sendBill. The answer of SUNAT, the CDR, is read and stored on the invoice: accepted, accepted with observations, or rejected with the SUNAT code and message.
Boletas can go one by one or in the daily summary (Resumen Diario). Accepted documents are cancelled with a comunicacion de baja (facturas) or a daily summary with status 3 (boletas); tickets are followed until SUNAT answers. Deliveries become a GRE guia de remision remitente sent over the SUNAT GRE REST API.
Every request and answer is kept in a document log, and the printed invoice shows the SUNAT QR code, the hash and the amount in words.
Who it is for
- Peruvian companies issuing facturas and boletas from Odoo. Companies registered as electronic issuers can sign and send each factura, boleta and credit or debit note to SUNAT when it's validated, and keep the CDR on the invoice instead of in a separate portal.
- Businesses already working with an OSE or Nubefact. If you have an OSE contract, you can point the module at its billService URL. If you use Nubefact, you can send documents as JSON to your own Nubefact account and skip loading a certificate into Odoo.
- Warehouses and carriers that issue guias de remision. Shippers can issue the GRE remitente from a validated delivery, and transport companies can issue the Guia de Remision Transportista with vehicles, drivers and MTC registration.
- Sellers dealing with detracciones, retenciones and percepciones. Companies whose invoices are subject to SPOT, or whose customers withhold the 3% IGV, can register the Banco de la Nacion deposit or the comprobante de retencion and have it reconciled with the invoice.
Setting it up
- Install the module on a company that uses the Peruvian chart of accounts (l10n_pe).
- Go to Accounting > Configuration > Settings, find the SUNAT Peru - CPE and GRE section and set SUNAT environment to SUNAT Beta (test) to begin.
- In the same section, pick your Signing certificate (a .pfx or .p12 file stored in the Odoo certificate store) and enter your SOL user and password for when you go live.
- Decide whether Send to SUNAT on Validate stays on, and set Boletas Sending to One by one or Daily summary (Resumen Diario).
- If you sell from more than one site, open Accounting > Configuration > SUNAT Peru > Establishments (Anexos) and add each annex with its four-digit code and address, then pick it on the invoice series or warehouse operation type.
- For guias de remision, create an API client in SUNAT SOL (Credenciales de API SUNAT) and enter its client id and secret in the GRE section of the settings.
- Validate a test invoice, check the SUNAT tab for the CDR and answer, then switch the environment to SUNAT Production or OSE once SUNAT has registered you.
Peru SUNAT Electronic Invoicing: questions
Do I need a PSE or OSE contract to use it?
No. By default Odoo signs the XML with your certificate and sends it to SUNAT directly. An OSE endpoint and a Nubefact route are optional. Each document stays on the route it was first sent through, so it can't be sent both ways.
Can I try it without being registered with SUNAT?
Yes. Demo mode simulates SUNAT offline, and SUNAT Beta uses the public MODDATOS test credentials SUNAT publishes. You can test facturas, boletas, notes, daily summaries and cancellations there before switching to Production.
What happens when SUNAT rejects a document?
The rejection code and message are saved on the invoice and in the Document Log, which records every call with its request and answer (passwords masked). You reset the invoice to draft, correct it and send it again. Accepted documents are locked, so changes go through a note or a cancellation.
How do cancellations work?
Use Cancel in SUNAT on the document. Facturas are cancelled through a comunicacion de baja and boletas through the resumen diario. A scheduled action polls the ticket every hour, and the invoice is cancelled in Odoo once SUNAT accepts.
Are all tax types supported?
No. Lines with IGV, IVAP, exonerated, unaffected and export taxes are supported. Any line with another SUNAT tax code, such as ISC or ICBPER, is blocked with an error before sending. Check your tax setup with your accountant if you sell products under those regimes.
Which Odoo apps does it need?
It depends on the Peru localization (l10n_pe), Debit Notes, Certificates and Inventory, all standard Odoo modules, so it runs on Community and Enterprise. A Spanish translation is included.
Related apps

Peru PLE and SIRE Electronic Books
Peru PLE and SIRE electronic books from your Odoo accounting
Localization & compliance
Peru RUC DNI Lookup
Consulta RUC and consulta DNI inside the Odoo contact form
Localization & compliance
Philippines Payroll
Philippines Payroll for Odoo 19: SSS, PhilHealth, Pag-IBIG and BIR Withholding Tax
Localization & compliance
Poland JPK
Your books already know the JPK. Odoo Community cannot write it.
Localization & compliance