# NFE-388

Source: https://xmlvalid.com/rules/NFE-388

> Rejeição: Código de Situação Tributária do IPI incompatível com o Código de Enquadramento Legal do IPI [nItem: …] (CST …, cEnq …).

- Level: error
- Rule sets: SEFAZ authorisation rules of NF-e 4.00 MOC 7.0 Anexo I, NTs up to 2026.010
- Context: `nfe:infNFe/nfe:det`
- Test: `(if ($ipiCst = ('02', '52')) then $enq ge 301 and $enq le 399 else true()) and (if ($ipiCst = ('04', '54')) then $enq ge 1 and $enq le 99 else true()) and (if ($ipiCst = ('05', '55')) then $enq ge 101 and $enq le 199 else true())`

In English: The IPI CST and legal framework code (cEnq) do not match: exemption 02/52 with 301 to 399, immunity 04/54 with 001 to 099, suspension 05/55 with 101 to 199.

Validate a document against these rules: https://xmlvalid.com/validate
