MhEmitirComprobante
Description
Section titled “Description”Issues a Tax Credit Voucher (type 03), a Credit Note (type 05) or a Debit Note (type 06) to El Salvador’s Ministry of Finance (Hacienda). Unlike the consumer invoice, VAT in this document is broken out as a separate tribute instead of being included in the price.
Credit and debit notes reference the original tax document through documentoRelacionado. The node builds the DTE in JSON, signs it with JWS (RS512) and performs the reception against Hacienda.
Configuration
Section titled “Configuration”| Field | Type | Required | Description |
|---|---|---|---|
| credentials_id | credentials | Yes | mh credential (key, NIT and Hacienda API) |
| comprobante | json | No | Voucher as JSON: tipo (03 CCF, 05 CN, 06 DN), receptor (nit, nrc, nombre), items (precioUnitario without VAT). For notes: documentoRelacionado with codigoGeneracion and fecha |
Issuer data is automatically filled from the credential when not present in comprobante.
Credentials
Section titled “Credentials”This module requires an mh credential type with the following fields:
- Issuer NIT / NRC: taxpayer tax identification
- Hacienda API user and password: credentials used to obtain the authentication token
- Signing certificate: material used to sign the document with JWS (RS512)
- Environment: test or production, according to Hacienda’s configured environment
Output
Section titled “Output”{ "success": true, "codigoGeneracion": "B2C3D4E5-F6A7-1234-5678-9ABCDEF01234", "numeroControl": "DTE-03-00000001-000000000000001", "selloRecibido": "2026080598765432109876543210987654", "estado": "PROCESADO", "fhProcesamiento": "05/08/2026 11:02:10"}Usage Example
Section titled “Usage Example”Tax Credit Voucher
Section titled “Tax Credit Voucher”{ "credentials_id": "cred-mh-prod", "comprobante": { "tipo": "03", "receptor": { "nit": "06141804941035", "nrc": "123456", "nombre": "Distribuidora SA de CV" }, "items": [ { "descripcion": "Mixed merchandise", "cantidad": 10, "precioUnitario": 100 } ] }}Credit Note referencing a CCF
Section titled “Credit Note referencing a CCF”{ "credentials_id": "cred-mh-prod", "comprobante": { "tipo": "05", "receptor": { "nit": "06141804941035", "nrc": "123456", "nombre": "Distribuidora SA de CV" }, "documentoRelacionado": { "codigoGeneracion": "B2C3D4E5-F6A7-1234-5678-9ABCDEF01234", "fecha": "2026-08-05" }, "items": [ { "descripcion": "Merchandise return", "cantidad": 2, "precioUnitario": 100 } ] }}- The items’
precioUnitariodoes not include VAT; the tribute is calculated and broken out separately at 13%. - Credit and Debit Notes require
documentoRelacionadowith thecodigoGeneracionand date of the voucher being corrected. - The document type (03, 05 or 06) determines the structure and validations Hacienda applies to the DTE.
- Just like the invoice, the voucher only becomes valid once Hacienda responds
PROCESADOwith the Reception Seal.
Related Nodes
Section titled “Related Nodes”- MhEmitirFactura - Issue a consumer electronic invoice
- MhAnular - Cancel an already issued DTE