POST
/api/cfop/getLook 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
tokenstring | string | Either an integrator token or a company token; no subscription is required. If the header is not sent, the token may also be placed in the token field of the body, but the signature is still computed with the header |
signstring | string | MD5 signature |
timestampstring | string | Unix timestamp in seconds |
Body
cfop*string | string | 4-digit code, with or without the dot ("5101" or "5.101") |
* Required field.
Response fields
cfopstring | string | 4-digit code, no dot |
descricaostring | string | "Título do CFOP" from the official table (Portuguese) |
nota_string | string | "Descrição (nota explicativa)" from the official table: what is classified under the code (Portuguese) |
serieint | int | First digit: 1, 2, 3 (inbound) or 5, 6, 7 (outbound) |
tipostring | string | entrada (inbound) or saida (outbound) |
abrangenciastring | string | intraestadual (same state; series 1 and 5), interestadual (interstate; 2 and 6) or exterior (abroad; 3 and 7) |
grupostring | string | Group of the official table (5.100, 5.200, 5.400...) |
grupo_string | string | Official group title (Portuguese) |
vigencia_string | string | Start of validity (yyyy-mm-dd) |
vigencia_string | string | End of validity (yyyy-mm-dd); empty = no end scheduled |
ind_int | int | 1 = code allowed in NF-e (model 55) |
ind_int | int | 1 = communication service |
ind_int | int | 1 = transport service |
ind_int | int | 1 = goods return (devolução) |
ind_int | int | 1 = return of goods previously shipped (retorno) |
ind_int | int | 1 = value cancellation (anulação) |
ind_int | int | 1 = shipment (remessa) |
ind_int | int | Fuel and lubricant indicator from the official table (0 = no; 1 and 2 as defined in the Technical Report) |
ind_int | int | IBS/CBS indicator from the official table (0 or 1), passed through as published |
ativobool | bool | false = discontinued code (validity ended or removed from the table); kept for old documents |
versaostring | string | Version of the table in force (Technical Report version) |
fontestring | string | Name of the official source |
Common errors
| Message | Cause |
|---|---|
| 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 / 官方表中未找到该 CFOP | The 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
{
"cfop": "5101"
}
{
"success": true,
"message": "成功",
"data": {
"cfop": "5101",
"descricao": "Venda de produção do estabelecimento.",
"nota_explicativa": "Classificam-se neste código as vendas de produtos industrializados ou produzidos pelo próprio estabelecimento.",
"serie": 5,
"tipo": "saida",
"abrangencia": "intraestadual",
"grupo": "5.100",
"grupo_descricao": "Vendas de produção própria ou de terceiros",
"vigencia_inicio": "2006-01-01",
"vigencia_fim": "",
"ind_nfe": 1,
"ind_comunica": 0,
"ind_transp": 0,
"ind_devol": 0,
"ind_retor": 0,
"ind_anula": 0,
"ind_remes": 0,
"ind_comb": 0,
"ind_exc_ibscbs": 0,
"ativo": true,
"versao": "2.10",
"fonte": "Informe Técnico NF-e 2023.002 v2.10 - Tabela CFOP"
}
}