# NFE-679

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

> Rejeição: Chave de Acesso referenciada com Modelo inválido [nOcor: …] (modelo …).

- 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:ide/nfe:NFref/nfe:refNFe`
- Test: `substring($k, 21, 2) = ('55', '65', '59')`

> Rejeição: Chave de Acesso referenciada com Modelo inválido [nOcor: …] (NF-e de saída referencia o modelo …, a partir de …).

- 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:ide/nfe:NFref/nfe:refNFe`
- Test: `not($ide/nfe:tpNF = '1' and not($ide/nfe:finNFe = ('2', '4')) and exists($emitted) and $emitted ge $modelFrom) or not(substring($k, 21, 2) = ('65', '59'))`

> Rejeição: Chave de Acesso referenciada com Modelo inválido [nOcor: …] (CT-e modelo …).

- 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:ide/nfe:NFref/nfe:refCTe`
- Test: `substring($k, 21, 2) = '57'`

In English: A referenced key is of the wrong model: 55, 65 or 59 for an NF-e reference, 57 for a CT-e; from 14 December 2026 (1 September in homologação) an outgoing normal NF-e cannot reference an NFC-e or CF-e.

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