nationid - v2.2.1
    Preparing search index...

    Function validate

    • Validate a Swedish (SE) identity or tax document.

      Parameters

      • code: "SE_PERSONNUMMER" | "SE_ORGNR" | "SE_VAT" | ShortCode

        Document type, either fully-qualified (SE_PERSONNUMMER, SE_ORGNR, SE_VAT) or short (PERSONNUMMER, PNR, ORGNR, ORG, VAT, MOMS).

      • input: string

        Raw document string (formatting tolerated).

      Returns boolean

      true if the value passes SE-specific validation rules.

      import { validate } from "nationid/se";
      validate("SE_PERSONNUMMER", "811228-9874");
      validate("ORGNR", "556016-0680");