CSOSN

Código de Situação da Operação no Simples Nacional: the tax situation codes of Simples Nacional operations.

  • Parity matrix

Validate

Checks whether a CSOSN is one of the 10 codes of the official table: 101, 102, 103, 201, 202, 203, 300, 400, 500, 900.

  • Accepts the bare 3 digits as a string, or a non-negative integer. A CSOSN has no printed grouping, so the function rejects a masked value.
  • Surrounding whitespace is ignored. Any other string is rejected: the function does not pick out its digits ("abc101").
  • Nothing is padded: no code starts with a zero, so a value narrower than 3 digits is not a code. A number is read only when it is a safe non-negative integer.
  • No behavior change in 2.5.0.
  • Source: Anexo III-A of Convênio SINIEF s/nº 1970 (table instituted by Ajuste SINIEF 03/2010).
ParameterTypeRequired
valuestring | numberyes
returnsboolean

Check if a CSOSN (Código de Situação da Operação no Simples Nacional) code is one of the 10 codes of the official table: 101, 102, 103, 201, 202, 203, 300, 400, 500 or 900.

  • Accepts a string with the bare 3 digits, or a number. A CSOSN has no printed grouping, so '1-01' is rejected.
import { isValidCsosn } from '@brazilian-utils/brazilian-utils';

isValidCsosn('101'); // true
isValidCsosn(900); // true
isValidCsosn('999'); // false
isValidCsosn('abc101'); // false (not a documented form)
isValidCsosn(-101); // false (not a non-negative safe integer)

Source: consolidated Anexo III-A of Convênio SINIEF s/nº 1970 and Ajuste SINIEF 03/2010.

Code: brazilian-utils/javascript
Try it with JavaScript isValidCsosn
The inputs start with the first shared case. Change one to see the new result.

Runs @brazilian-utils/brazilian-utils 2.5.0 in your browser.

Shared test cases (26) and the result in each library csosn.isValid

Official sources

See also CST

Last updated on

On this page