NFS-e
Query received NFS-e
Detail of one received NFS-e: parties, amounts, origin, links and this company manifestation.
/openapi/v2/empresas/{empresaId}/nfse/recebidas/{chaveAcesso}token, timestamp and sign signature headers, see Authentication.Returns one service invoice in which this company is the recipient or intermediary, by access key. The response is shaped like the items of Received NFS-e and additionally carries the eventos array, which list items do not. To register a manifestation use Manifest on received NFS-e. A key that is not among this company received invoices returns 404.
Path parameters
empresaId* | string | Company identifier |
chaveAcesso* | string | Access key |
* Required field
chaveAcesso | string | Access key |
numero | int | NFS-e number |
codigoVerificacao | string | Verification code |
status | string | Document status |
papel | string | Role of this company |
origem | string | Row origin |
dataEmissao | string | Issue time |
dataAutorizacao | string | Authorization time |
competencia | string | Competence |
| object | Provider |
| object | Service recipient |
| object | Intermediary |
codigoTributacaoNacional | string | National service code |
discriminacao | string | Service description |
valorServico | number | Service amount |
valorLiquido | number | Net amount |
valorIss | number | ISS amount |
issRetido | bool | ISS withheld |
chaveSubstituida | string | Key of the replaced invoice |
chaveSubstituta | string | Key of the replacing invoice |
dataUltimoEvento | string | Last event |
dataRecebimento | string | Receipt time |
| object | This company manifestation |
linkXml | string | Official XML link |
linkDanfse | string | DANFSe link |
| array | Invoice events |
Received invoices arrive through the national distribution. A São Paulo company has a second source: after each sync the platform also pulls from the São Paulo municipal system the invoices this company received, and they are visible before the national transcription arrives. A PrefeituraSP row switches to `ADN` on its own once the transcription arrives, without producing a second row; at that moment chaveAcesso swaps the temporary key for the official one and the links become the national original and the DANFSe. Use prestador.cpfCnpj + numero as the identifier that is stable across syncs and never treat the temporary key as a permanent primary key.
Row from the national distribution
The definitive shape: official key, national-layout original and DANFSe available.
{"chaveAcesso": "35503082406730610001340000000000000000000000000077","numero": 77,"codigoVerificacao": null,"origem": "ADN","prestador": { "cpfCnpj": "40673061000134" },"linkXml": "https://api.v2.tffiscal.com/openapi/files/xml/9101?token=...","linkDanfse": "https://api.v2.tffiscal.com/openapi/files/danfse/35503082406730610001340000000000000000000000000077?token=..."}
origem* | string | Origin |
chaveAcesso* | string | Official key |
* Required field
Row pulled straight from the São Paulo system
São Paulo companies only, before the merge. The temporary key is 3550308 + 0 + the 14-digit provider CNPJ + the invoice number left-padded with zeros to 28 digits, recognizable by the 0 in position 8; it works in the detail and manifestation paths. linkXml points to the original from the municipal system and linkDanfse is still null.
{"chaveAcesso": "35503080406730610001340000000000000000000000000077","numero": 77,"codigoVerificacao": "A1B2C3D4","origem": "PrefeituraSP","prestador": { "cpfCnpj": "40673061000134" },"linkXml": "https://api.v2.tffiscal.com/openapi/files/xml/9099?token=...","linkDanfse": null}
origem* | string | Origin |
chaveAcesso* | string | Temporary key |
codigoVerificacao* | string | Municipal verification code |
* Required field
The received invoice status stays Autorizada / Cancelada / Substituida; this company manifestation is kept separately in the manifestacao block, and each party manifests only once per invoice, while it is Autorizada. The meaning of each state is in the enumeration.
(not manifested, filter Pendente) ──┬──► Confirmada├──► Rejeitada ──► RejeicaoAnulada└──► ConfirmacaoTacita
statusDocument status
| Values | Meaning |
|---|---|
| Autorizada | Valid at the authority |
| Cancelada | Cancelled by the provider or of record by the municipality |
| Substituida | Replaced by another invoice; chaveSubstituta carries the new key |
papelRole of this company
| Values | Meaning |
|---|---|
| Tomador | Service recipient; manifests with 203202 (confirmation) or 203206 (rejection) |
| Intermediario | Service intermediary; manifests with 204203 (confirmation) or 204207 (rejection) |
origemRow origin
| Values | Meaning |
|---|---|
| ADN | Delivered by the national distribution |
| PrefeituraSP | Pulled straight from the São Paulo municipal system; São Paulo companies only; becomes ADN once the transcription arrives |
manifestacao.statusManifestation state
null in the field means not manifested; in the list filter that case is Pendente.
| Values | Meaning |
|---|---|
| Confirmada | Confirmed by this company (203202 / 204203); terminal |
| Rejeitada | Rejected by this company (203206 / 204207); the municipality may still annul it |
| ConfirmacaoTacita | Tacit confirmation by the municipality for lack of manifestation within the deadline (205204); terminal |
| RejeicaoAnulada | The municipality annulled this company rejection (205208); terminal |
manifestacao.codigoEventoManifestation event code
| Values | Meaning |
|---|---|
| 203202 | Confirmation by the recipient |
| 204203 | Confirmation by the intermediary |
| 203206 | Rejection by the recipient |
| 204207 | Rejection by the intermediary |
| 205204 | Tacit confirmation by the municipality |
| 205208 | Rejection annulled by the municipality |
manifestacao.codigoMotivoRejection reason code
| Values | Meaning |
|---|---|
| 1 | Duplicate invoice |
| 2 | The recipient already issued the invoice itself |
| 3 | The taxable event did not occur, the service was not provided |
| 4 | Wrong responsible party |
| 5 | Wrong amount or data |
| 9 | Other; explain in motivo |
eventos[].tipoEvent type
The list follows the official events and may grow.
| Values | Meaning |
|---|---|
| Cancelamento | Cancellation registered by the provider (101101) |
| CancelamentoPorSubstituicao | Cancelled because another invoice replaced it (105102) |
| PedidoAnalise | Cancellation tax review request (101103) |
| AnaliseDeferida | Municipality granted the cancellation (105104) |
| AnaliseIndeferida | Municipality refused the cancellation (105105) |
| CancelamentoDeOficio | Cancellation of record by the municipality (305101) |
| Bloqueio | Block of record by the municipality (305102) |
| Desbloqueio | Unblock of record by the municipality (305103) |
| Confirmacao | One of the parties confirmed the invoice, or tacit confirmation by the municipality (202201 / 203202 / 204203 / 205204) |
| Rejeicao | One of the parties rejected the invoice (202205 / 203206 / 204207) |
| RejeicaoAnulada | Municipality annulled a rejection (205208) |
| Outro | Official event not modelled yet; the real code is in status |
eventos[].codigoOfficial event code
| Values | Meaning |
|---|---|
| 101101 | Cancellation by the provider |
| 105102 | Cancellation by replacement |
| 101103 | Cancellation tax review request |
| 105104 | Review granted |
| 105105 | Review refused |
| 305101 | Cancellation of record |
| 305102 | Block of record |
| 305103 | Unblock of record |
| 202201 | Confirmation by the provider |
| 203202 | Confirmation by the recipient |
| 204203 | Confirmation by the intermediary |
| 205204 | Tacit confirmation by the municipality |
| 202205 | Rejection by the provider |
| 203206 | Rejection by the recipient |
| 204207 | Rejection by the intermediary |
| 205208 | Rejection annulled by the municipality |
| 000000 | Official event not modelled yet; the real code is in status |
| Code | HTTP | |
|---|---|---|
| 10018003 | 404 | The key is not among this company received invoices. Check chaveAcesso and empresaId, and remember that the sync runs every 15 minutes by default. |
| 10003000 | 404 | empresaId does not exist or does not belong to this application. |
