lookup_taxpayer
Look up one taxpayer by exact tax id, to confirm who it is.
Use it to check a recipient's name before issuing against them. It takes the id exactly — punctuation is fine, but there is no search by name, by prefix or by state, and there will not be: the registry holds the names and addresses of real people.
A 404 does not mean the company does not exist. The registry reloads monthly from the RFB's dump, so a recently registered CNPJ is simply not in it yet. Say that to the user rather than reporting the tax id as invalid, and never turn a 404 here into a validation rule.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tax_id | Yes | The exact tax id. A CNPJ is 14 digits. | |
| 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 |
|---|---|---|---|
| kind | No | Whether it is a company or a person. | |
| name | No | ||
| state | No | ||
| status | No | ||
| tax_id | No | ||
| country | No | ||
| metadata | No | Whatever the registry holds beyond these. | |
| city_code | No | ||
| started_at | No | ||
| trade_name | No | ||
| postal_code | No | ||
| activity_code | No |