TF Fiscal

NCM Codes

POST/api/ncm/get

Look up NCM

Returns one entry of the official NCM nomenclature by code, with the chain of descriptions from chapter to code, the rate taken from the IPI rate table, and the CEST codes the entry belongs to. The code may be sent with or without dots, as a full 8-digit code or as a chapter (2 digits), heading (4 digits) or intermediate level (5 to 7 digits). This endpoint is free of charge.

Required headers

tokenstringstringEither an integrator token or a company token; no subscription is required.
signstringstringMD5 signature
timestampstringstringUnix timestamp in seconds

Body

FieldTypeRequiredDescription
ncmstringYes2, 4, 5, 6, 7 or 8 digits, e.g. "8517.13.00" or "85171300". Discontinued codes can also be queried; see vigencia_fim

Only 8-digit codes may be written on an invoice line (valido_para_nota is true); levels of 2 to 7 digits are classification steps, useful for browsing and filtering but not valid on a document.

The official nomenclature carries codes, descriptions and validity dates only, never rates. ipi comes from the IPI rate table, and excecoes lists the exception rates under the same code; ipi is null when the code does not have 8 digits or is not in the rate table, and aliquota is null when nao_tributado is true (NT); cest comes from the tax substitution list, and appearing in that list means the goods fall within the scope where tax substitution may apply, while whether it actually applies depends on the agreement between the two states involved.

The descricao of a leaf is often a fragment such as "Outras", unreadable on its own. Prefer descricao_completa, or assemble the text from hierarquia.

The nomenclature is replaced whenever a new official act is published. Cache it by versao and resynchronise when that value changes.

Common errors

MessageCause
Informe o NCM com 2, 4, 5, 6, 7 ou 8 dígitos (ex.: 8471.30.19) / ...ncm has an invalid number of digits after removing punctuation
NCM não encontrado na nomenclatura oficial / 官方名录中未找到该 NCMThe code is not in the nomenclature
Nomenclatura NCM ainda não carregada. Contate o suporte. / NCM 名录尚未加载,请联系技术支持The platform has not loaded the NCM nomenclature yet
Falha na consulta. Tente novamente mais tarde. / 查询失败,请稍后重试The platform query failed; retry later

Examples

# sign = md5(token + path + body + timestamp)
# Template generated from the endpoint path; replace the placeholders
curl -X POST "https://api.tffiscal.com/api/ncm/get" \
  -H "Content-Type: application/json" \
  -H "token: $TOKEN" \
  -H "timestamp: $TIMESTAMP" \
  -H "sign: $SIGN" \
  -d @body.json