TF Fiscal

CFOP Codes

POST/api/cfop/get

Look up CFOP

Returns one code from the official CFOP table published by the NF-e Portal (Technical Report 2023.002), with every column: the tax authority's title and explanatory note, validity dates, the table's nine indicators, plus type (inbound or outbound), scope and group. The platform maintains the table: when the tax authority publishes a new version, the update is applied with no change on the integration side, and the versao field states the version in force. Parameter passed in the JSON body. Discontinued codes remain queryable, with ativo = false. Free of charge.

Required headers

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

Body

cfop*stringstring4-digit code, with or without the dot ("5101" or "5.101")

 * Required field.

Response fields

cfopstringstring4-digit code, no dot
descricaostringstring"Título do CFOP" from the official table (Portuguese)
nota_explicativastringstring"Descrição (nota explicativa)" from the official table: what is classified under the code (Portuguese)
serieintintFirst digit: 1, 2, 3 (inbound) or 5, 6, 7 (outbound)
tipostringstringentrada (inbound) or saida (outbound)
abrangenciastringstringintraestadual (same state; series 1 and 5), interestadual (interstate; 2 and 6) or exterior (abroad; 3 and 7)
grupostringstringGroup of the official table (5.100, 5.200, 5.400...)
grupo_descricaostringstringOfficial group title (Portuguese)
vigencia_iniciostringstringStart of validity (yyyy-mm-dd)
vigencia_fimstringstringEnd of validity (yyyy-mm-dd); empty = no end scheduled
ind_nfeintint1 = code allowed in NF-e (model 55)
ind_comunicaintint1 = communication service
ind_transpintint1 = transport service
ind_devolintint1 = goods return (devolução)
ind_retorintint1 = return of goods previously shipped (retorno)
ind_anulaintint1 = value cancellation (anulação)
ind_remesintint1 = shipment (remessa)
ind_combintintFuel and lubricant indicator from the official table (0 = no; 1 and 2 as defined in the Technical Report)
ind_exc_ibscbsintintIBS/CBS indicator from the official table (0 or 1), passed through as published
ativoboolboolfalse = discontinued code (validity ended or removed from the table); kept for old documents
versaostringstringVersion of the table in force (Technical Report version)
fontestringstringName of the official source

Common errors

MessageCause
Informe o CFOP com 4 dígitos (ex.: 5102) / 请传入 4 位 CFOP(如 5102)cfop does not have 4 digits after removing punctuation
CFOP não encontrado na tabela oficial / 官方表中未找到该 CFOPThe code is not in the official table
Tabela de CFOP ainda não carregada. Contate o suporte. / CFOP 表尚未加载,请联系技术支持The platform has not loaded the CFOP table 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/cfop/get" \
  -H "Content-Type: application/json" \
  -H "token: $TOKEN" \
  -H "timestamp: $TIMESTAMP" \
  -H "sign: $SIGN" \
  -d @body.json