In Peru, e-invoicing revolves around the Electronic Payment Receipt (CPE) in XML format (UBL 2.1 standard), digitally signed and sent to the SUNAT, which responds with a Reception Acknowledgment (CDR). Doing it by hand is tedious; doing it via API, embedded in your workflows, makes every sale invoice itself. This guide reviews what you need and how to automate it with Floogos.
Note: this article is a general technical guide, not tax advice. Always validate the current requirements with the SUNAT or your accountant.
- Authority
- SUNAT
- CDR
- Accepted
- Tax
- IGV 18%
- Delivery
- XML + PDF
Key concepts in 30 seconds
Gather what you need
Before issuing via API, have your data and certificate in order:
- Issuer RUC and tax data
- Digital certificate for signing (XMLDSig)
- SOL / your OSE-PSE credentials depending on how you issue
- Your receipt series and numbering
💡 Tip: start in the SUNAT's test (beta) environment. You issue test CPEs before going to production.
Build the CPE (UBL 2.1)
With the sale's data, the receipt is built in the required standard:
- Issuer, buyer and item detail
- IGV (18%) and other taxes, with totals
- Receipt type (invoice, ticket) and its series-number
- UBL 2.1 structure compliant with the SUNAT
💡 Tip: mind the buyer's document type (RUC/DNI). A wrong value is a common cause of rejection.
Sign the receipt
The digital signature is what gives the XML validity:
- XMLDSig signature with your digital certificate
- Guarantees the receipt's authenticity and integrity
- It's required for the SUNAT to accept it
- Applied before submission
💡 Tip: keep the certificate and its key safe. Without a valid signature, no receipt goes through.
Send to the SUNAT and get the CDR
The signed receipt is sent and the SUNAT responds:
- You send the CPE (often zipped) through the relevant service
- The SUNAT validates and returns the Reception Acknowledgment (CDR)
- The CDR confirms acceptance (or indicates rejection)
- You keep the XML and the CDR as valid documents
💡 Tip: always keep the CDR alongside the XML. It's the proof the SUNAT accepted the receipt.
Delivery and notes
You close the cycle by delivering the receipt and handling adjustments:
- Send the XML and the representation (PDF) to the customer
- Record the receipt in your ERP or database
- Credit note for returns/voids; debit note for charges
- Notes are also signed and sent to the SUNAT
💡 Tip: automate the delivery to the customer and the CDR archiving; it saves complaints and eases any review.
How you automate it with Floogos
In Floogos, the whole flow fits into a workflow. The Peru invoicing node handles the CPE, the signature and the submission to the SUNAT; you connect the trigger and the data:
- 1A trigger starts the process (a sale, a form, an order in your ERP)
- 2The workflow builds the CPE (UBL 2.1) with the IGV and totals
- 3The Peru node signs (XMLDSig) and sends to the SUNAT
- 4It receives the CDR and another node delivers the XML/PDF to the customer
- 5The receipt and CDR are archived, with traces and insights per run
💡 The credential is configured once and reused. As a workflow, you can issue in batches, retry rejections and notify errors automatically.
Frequently asked questions
What is the SUNAT's CDR?
The Reception Acknowledgment: the SUNAT's response accepting or rejecting your receipt. Floogos receives it automatically within the workflow and archives it with the XML.
What do I need to issue via API?
Your RUC and tax data, a digital certificate to sign (XMLDSig), your SOL or OSE-PSE credentials, and your series and numbering. With that, the Peru node can already issue.
Can I test before issuing real receipts?
Yes. The SUNAT offers a test (beta) environment where you issue CPEs with no fiscal validity to validate your integration before production.
How do I void or correct a receipt?
With notes: a credit note for returns or voids and a debit note for additional charges, which are also signed and sent to the SUNAT.
E-invoicing in Peru doesn't have to slow your operation. With the CPE issued via API, signed and validated with the SUNAT inside your processes, every sale invoices, gets its CDR, is delivered and archived, with full traceability. Floogos turns all of that into a node in your workflow; you focus on selling.
Official sources
General technical guide, not tax advice. Requirements verified against official sources; always check the current regulations with the SUNAT or your accountant.
