lookup_fiscal_code
Resolve one code of one classification, when you know both.
Use this to confirm a code before putting it on a document — an NCM that does not exist is rejected by the tax authority after issuing, which costs a cancellation.
A code that is not there answers 404. That means the code is wrong, not that the lookup failed; do not retry it.
metadata differs per kind and is passed through as published:
utrib on an NCM, ncm_code on a CEST, tax_type on a CST, and
nothing at all on an ISS service.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | The code itself, as published: 84716052 for an NCM, 5102 for a CFOP. Digits only, no dots. | |
| kind | Yes | cfop, ncm, cest, cst, csosn, ... | |
| country | No | ISO 3166-1 alpha-2 code. A code means nothing without it, and Brazil is the default rather than a guess. | BR |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | No | ||
| kind | No | cfop, ncm, cest, cst, csosn, ... | |
| country | No | ||
| metadata | No | Whatever the classification carries beyond a code and a description, and it differs per kind: utrib on an NCM, ncm_code on a CEST, tax_type on a CST, null on an ISS service. | |
| description | No |