Skip to content

SunatEmitirNota

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.

FieldTypeRequiredDescription
credentials_idcredentialsYesSUNAT credential
notajsonNoNote 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.

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
{
"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": "..."
}
{
"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.