stdnum.se.vat

VAT (Moms, Mervärdesskatt, Swedish VAT number).

The Momsregistreringsnummer is used for VAT (Moms, Mervärdesskatt) purposes and consists of 12 digits of which the last two should be 01. The first 10 digits should have a valid Luhn checksum.

>>> validate('SE 123456789701')
'123456789701'
>>> validate('123456789101')  # invalid check digits
Traceback (most recent call last):
    ...
InvalidChecksum: ...
Traceback (most recent call last):
    ...
InvalidChecksum: ...
stdnum.se.vat.compact(number)

Convert the number to the minimal representation. This strips the number of any valid separators and removes surrounding whitespace.

stdnum.se.vat.is_valid(number)

Checks to see if the number provided is a valid VAT number. This checks the length, formatting and check digit.

stdnum.se.vat.validate(number)

Checks to see if the number provided is a valid VAT number. This checks the length, formatting and check digit.

Previous topic

stdnum.se.orgnr

Next topic

stdnum.si.ddv