Validate a company identifier (no network call)
validate_company_idCheck whether a national company identifier is well-formed — no network call.
country="NO" checksum-checks a Norwegian organisasjonsnummer (orgnr, org.nr) for
Brønnøysundregistrene / Enhetsregisteret (brreg) — the cheap norway company lookup
pre-check for the norwegian business registry. country="GB" shape-checks and
normalises a UK company number (company registration number, CRN) for Companies House
('445790' → '00445790', 'oc303675' → 'OC303675'); a CRN has no check digit, so a GB
valid: true means the shape is right and nothing more. country="SE" shape-checks and
normalises a Swedish organisationsnummer for Bolagsverket ('556016-0680' and
'SE556016068001' both become '5560160680') and accepts a sole trader's twelve-digit
personnummer; Sweden's check digit is not enforced here (registry://rules/SE says
why), so an SE valid: true means the shape is right, reason may carry a caveat,
and the register's own verdict arrives on the lookup. It is the cheapest way to tell a
ten-digit Swedish organisationsnummer from a nine-digit Norwegian organisasjonsnummer.
Use it on user input or a spreadsheet column before spending a real lookup_company
call, since it is instant and free.
Returns a ValidationResult and never raises for a malformed identifier: valid: false
comes with reason and hint rather than a tool error — this tool answers a question,
it does not fail on bad input (D-010). A valid identifier does not mean the entity
exists; follow it with lookup_company if you need facts. The only error it raises is
unsupported_country, in the usual {"error": {"code", "message", "hint"}} envelope —
call list_countries.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The company's national identifier, normalised for you — a Norwegian organisasjonsnummer (orgnr), a Companies House company number (CRN), or a Swedish organisationsnummer or personnummer. Spaces, dots, hyphens, a NO...MVA suffix and a short CRN are accepted; list_countries gives each country's exact shape. | |
| country | No | ISO-3166-1 alpha-2 — NO Norway, GB United Kingdom, SE Sweden. UK is not a country code here and is rejected. Call list_countries for the live set. | NO |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| hint | No | What to do next when `valid` is false — the same hint the invalid_id error carries. None when valid: the next call is simply lookup. | |
| input | Yes | The identifier exactly as the caller supplied it. | |
| valid | Yes | True when the identifier passes this country's format and checksum. | |
| reason | No | One English sentence saying why it is valid, or what failed. | |
| country | Yes | ISO-3166-1 alpha-2, upper-case. | |
| registry | Yes | Registry slug, e.g. 'brreg'. | |
| formatted | No | The identifier as a local would write it, e.g. '923 609 016'. None when invalid. | |
| id_scheme | No | Name of the identifier scheme, e.g. 'organisasjonsnummer'. | |
| normalized | No | Canonical form to pass to lookup, e.g. '923609016'. None when invalid. |