POST
/api/invoice/received/get_prodGet products from received NF-e
Required headers
tokenstring | string | Company token |
signstring | string | MD5 signature: MD5(token + path + body + timestamp) |
timestampstring | string | Unix timestamp in seconds (5-minute window) |
Fields
| Field | Type | Required | Description |
|---|---|---|---|
| chave | string | Yes | 44-digit NF-e access key (model 55). The check digit is validated before calling the tax authority |
| ciencia_ | bool | No | Defaults to false. "true", "1" and "sim" are also accepted. With true, if the tax authority has not released the full XML yet, the endpoint registers the Acknowledgement of Operation (event 210210) with the company certificate and queries once more; if an Acknowledgement was already registered through the platform, it is not sent again |
| ambiente | int | No | 1 production (default) or 2 staging; any other value is treated as production |
Response fields
chavestring | string | Access key that was queried |
total_number | number | Number of items in the invoice |
itensarray | array | One object per invoice item (det) |
nItemnumber | number | Item number within the invoice |
prodobject | object | The prod group of the NF-e layout, keeping the original tag names.Quantities and amounts come as numbers; codes such as cProd, NCM and cEAN come as text, preserving leading zeros. Tags that repeat in the layout (NVE, gCred, DI, adi, detExport, rastro, arma) always come as a list |
infAdProdstring | string | Additional item information, when present |
impostoobject | object | Item imposto group with the NF-e tag names: ICMS (the subgroup found, e.g.ICMS00 or ICMSSN101, named in grupo), IPI, II, PIS, COFINS, ICMSUFDest and IBSCBS. Amounts, rates and quantities are numbers with the XML decimals; codes (CST, CSOSN, orig) are text. Tags missing in the XML are omitted |
emitobject | object | Issuer's CNPJ, xNome, IE, UF and CRT |
ideobject | object | nNF, serie, dhEmi, tpNF, natOp and finNFe |
totalobject | object | ICMSTot and, when present, IBSCBSTot |
How the tax authority delivers the XML
- The receiving company comes from the token; do not send a CNPJ in the body.
- The query uses document distribution (DistDFe) at the National Environment, with the company’s own certificate.
- Without a manifestation, the tax authority returns only the summary, with no items. Use
ciencia_nota: trueto release the full XML. - The Acknowledgement only states awareness of the invoice: it neither confirms receipt of the goods nor prevents the issuer from cancelling it.
- A freshly authorized invoice may take a few minutes until the National Environment distributes it. Until then the response is invoice not found.
- An invoice issued by the company itself is not distributed to it; query with the receiving company’s token.
- The query stores nothing. Only the Acknowledgement, when triggered, registers an event at the tax authority.
Common errors
| Message | Cause |
|---|---|
| Chave inserida inválida / 发票密钥无效 | Key without 44 digits, with a non-numeric character, or with a wrong check digit |
| Apenas NF-e modelo 55 pode ser consultada pela chave | The key belongs to an NFC-e (model 65), which the tax authority does not distribute |
| empresa não encontrada para este token | The token is not linked to any registered company |
| empresa não possui certificado configurado | The company has no valid A1 certificate on file |
| nenhum documento localizado para esta chave e este CNPJ... | The National Environment has not distributed the invoice yet, the environment is different, the company is not the recipient, or no Acknowledgement has been registered yet |
| esta nota foi emitida por este CNPJ e a SEFAZ não a distribui ao próprio emitente | Querying an outgoing invoice with the issuer’s own token (rejection 641) |
| SEFAZ devolveu apenas o resumo da nota (sem itens)... | Invoice still without Acknowledgement; call with ciencia_nota=true |
| consumo indevido: a SEFAZ bloqueou consultas repetidas | The tax authority per-CNPJ limit; wait before retrying |
When the
ciencia_nota flag triggers the event or finds one already registered, the error response carries data.ciencia with the event outcome. Every other error returns only success and message.data.ciencia fields
enviadabool | bool | Whether this request registered the Acknowledgement successfully |
ja_bool | bool | true means it had already been registered through the platform and was not sent again |
tipo_int | int | Always 210210 |
cStatint | int | Status code returned by the tax authority for the event |
nProtstring | string | Event protocol number |
registrada_string | string | Returned only when ja_registrada is true: time of the earlier registration |
mensagemstring | string | Description of the event outcome |
Examples
# sign = md5(token + path + body + timestamp) # Template generated from the endpoint path; replace the placeholders curl -X POST "https://api.tffiscal.com/api/invoice/received/get_prod" \ -H "Content-Type: application/json" \ -H "token: $TOKEN" \ -H "timestamp: $TIMESTAMP" \ -H "sign: $SIGN" \ -d @body.json
{
"chave": "35260912345678000195550010000012341000012345",
"ciencia_nota": false
}
{
"success": true,
"message": "成功",
"data": {
"chave": "35260912345678000195550010000012341000012345",
"total_itens": 1,
"itens": [
{
"nItem": 1,
"prod": {
"cProd": "PROD-A",
"cEAN": "SEM GTIN",
"xProd": "Produto exemplo",
"NCM": "84733011",
"CFOP": 5102,
"uCom": "UN",
"qCom": 1.0000,
"vUnCom": 1.0000000000,
"vProd": 1.00,
"cEANTrib": "SEM GTIN",
"uTrib": "UN",
"qTrib": 1.0000,
"vUnTrib": 1.0000000000,
"indTot": 1,
"xPed": "PED-77"
}
}
]
}
}
"emit": { "CNPJ": "12345678000195", "xNome": "FORNECEDOR", "IE": "1234567890", "CRT": 3, "UF": "PR" },
"ide": { "serie": 1, "nNF": 10, "dhEmi": "2026-11-05T10:00:00-03:00", "tpNF": 1, "finNFe": 1 },
"total": { "ICMSTot": { "vBC": 1000.00, "vICMS": 120.00, "vST": 0.00, "vProd": 1000.00, "vIPI": 50.00, "vNF": 1050.00 } },
"itens": [{
"nItem": 1,
"prod": { "...": "..." },
"imposto": {
"ICMS": { "grupo": "ICMS00", "orig": "0", "CST": "00", "modBC": "3", "vBC": 1000.00, "pICMS": 12.0000, "vICMS": 120.00 },
"IPI": { "cEnq": "999", "IPITrib": { "CST": "50", "vBC": 1000.00, "pIPI": 5.0000, "vIPI": 50.00 } },
"PIS": { "PISAliq": { "CST": "01", "vBC": 1000.00, "pPIS": 1.6500, "vPIS": 16.50 } },
"COFINS": { "COFINSAliq": { "CST": "01", "vBC": 1000.00, "pCOFINS": 7.6000, "vCOFINS": 76.00 } }
}
}]