SunatEmitirNota
Description
Section titled “Description”Issues a Credit Note (code 07) or a Debit Note (code 08) to SUNAT, referencing the original document and the reason for the adjustment. The node builds the corresponding UBL (CreditNote or DebitNote), signs it, packages it into a ZIP file and sends it over SOAP to SUNAT or the OSE, reading the CDR the same way as when issuing invoices and boletas.
Configuration
Section titled “Configuration”| Field | Type | Required | Description |
|---|---|---|---|
| credentials_id | credentials | Yes | SUNAT credential |
| nota | json | No | Note in JSON: tipo (07 credit, 08 debit), serie, numero, motivo (SUNAT catalog 09/10), docRef (tipo, serie, numero) of the original document, receptor, items. If left empty, the input data is used. |
Credentials
Section titled “Credentials”This module requires a sunat credential type with the following fields:
- Certificate (.p12): the issuer’s digital certificate
- Certificate password
- Issuer RUC (11 digits)
- SOL user and SOL password: SUNAT Clave SOL credentials
- Mode: direct (to SUNAT) or OSE (Electronic Services Operator)
- OSE URL, if mode is OSE
- Environment: beta (testing) or production
Output
Section titled “Output”{ "id": "FC01-45", "tipo": "07", "serie": "FC01", "numero": 45, "docRef": { "tipo": "01", "serie": "F001", "numero": 125 }, "estado": "accepted", "codigo": "0", "descripcion": "La Nota de Credito numero FC01-45, ha sido aceptada", "total": 118, "hash": "AbCdEf123...", "xml": "...", "cdrXml": "..."}Usage Example
Section titled “Usage Example”{ "credentials_id": "cred-sunat-prod", "nota": { "tipo": "07", "serie": "FC01", "numero": 45, "motivo": "01", "docRef": { "tipo": "01", "serie": "F001", "numero": 125 }, "items": [ { "descripcion": "Service refund", "cantidad": 1, "valorUnitario": 100, "igv": 18 } ] }}- docRef (tipo, serie, numero) is required: SUNAT rejects the note if it does not reference an existing document.
- motivo uses SUNAT catalog 09 (credit notes) or 10 (debit notes).
- The signing, packaging, sending and CDR reading flow is the same as in SunatEmitirCPE.
Related Nodes
Section titled “Related Nodes”- SunatEmitirCPE - Issue an invoice or boleta
- SunatRepresentacion - Generate the printable representation with QR