Core APIs
NCM Codes
2 endpoints
/api/ncm/getLook 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
| Header | Type | Description |
|---|---|---|
| token | string | Issuing company token |
| sign | string | MD5 signature |
| timestamp | string | Unix timestamp in seconds |
Body
| Field | Type | Required | Description |
|---|---|---|---|
| ncm | string | Yes | 2, 4, 5, 6, 7 or 8 digits, e.g. "8517.13.00" or "85171300" |
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; 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.
/api/ncm/listNCM list (paginated)
Returns the official NCM nomenclature page by page. The result can be narrowed to a subtree by code prefix, searched by keyword, or limited to the 8-digit codes that may be used on an invoice. Filters travel in the JSON request body; all of them are optional and combinable, and an empty body ({}) returns the whole nomenclature (over fifteen thousand entries) one page at a time. Entries always come in ascending code order. This endpoint is free of charge.
Required headers
| Header | Type | Description |
|---|---|---|
| token | string | Issuing company token |
| sign | string | MD5 signature |
| timestamp | string | Unix timestamp in seconds |
Body
| Field | Type | Required | Description |
|---|---|---|---|
| page | int | No | Page number, starting at 1; defaults to 1 |
| page_size | int | No | Entries per page; defaults to 50, maximum 200 |
| prefixo | string | No | Code prefix restricting the result to one subtree: 2, 4, 5, 6, 7 or 8 digits. "8517", for instance, returns every code under that heading |
| termo | string | No | Keyword matched against the full description; at least 2 characters. The match runs over the whole chain, so when the word appears in a parent title the entire subtree is returned; narrow it with prefixo or somente_folhas |
| somente_folhas | string | No | Send "1" to return only 8-digit codes, the sole level accepted on an invoice line |
| incluir_extintos | string | No | Send "1" to include codes already revoked; by default only codes in force are returned |
| incluir_impostos | string | No | Send "0" to omit ipi and cest for a smaller response; included by default |
| incluir_hierarquia | string | No | Send "0" to omit hierarquia for a smaller response; included by default |
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; 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.