Skip to main content

attach_inutilizacao

Function attach_inutilizacao 

Source
pub fn attach_inutilizacao(
    request_xml: &str,
    response_xml: &str,
) -> Result<String, FiscalError>
Expand description

Attach the SEFAZ inutilizacao response to the request, producing the <ProcInutNFe> wrapper.

Extracts <inutNFe> from request_xml and <retInutNFe> from response_xml, validates that the response status is 102 (voided), and joins them into a <ProcInutNFe> document.

ยงErrors

Returns FiscalError::XmlParsing if:

  • Either input is empty
  • The <inutNFe> tag is missing from request_xml
  • The <retInutNFe> tag is missing from response_xml

Returns FiscalError::SefazRejection if the response status is not 102.