inn
The string is a Russian tax ID (INN) with a valid checksum: 10 digits for companies, 12 for individuals.
Signature
ts
function inn(msg?: Message): Action<string>
function isInn(value: string): booleanParameters
| Parameter | Type | Description |
|---|---|---|
msg | Message | Custom error message |
Error codes
| Code | When | Default message |
|---|---|---|
inn | Invalid checksum or format | Invalid INN |
You can change the texts: see Messages & i18n.
Notes
The checksum is verified by the tax service algorithm — a single-digit typo is almost always caught. Whether such a company exists is not checked.
- Spaces and dashes are allowed: a masked value can be validated.
- The
isInnfunction is available separately — for checks without a schema. - Format the input with a mask from tinyval-mask.
Example
ts
const Company = object({ inn: pipe(string(), inn()) });
isInn('7707083893'); // true