Zum Inhalt springen

API reference / Quittio \ Country \ DE \ Support

TaxNumber

final readonly class in quittio/country-de

Quittio\Country\DE\Support\TaxNumber · Source

German tax number (Steuernummer, BT-32) as described in "Prüfung der Steuer- und Steueridentifikationsnummer" of the Bayerisches Landesamt für Steuern (ELSTER, as of 2 September 2026): the 13-digit ELSTER format FFFF0BBBUUUUP (NRW: FFFF0BBBBUUUP), the 12-digit federal format without the 0, and the notation of the federal states on tax notices (e.g. 181/815/08155 in Bavaria, 133/8150/8159 in NRW).

A number is valid when it passes the formal checks and the check digit procedure of its state: the modified 11 procedure (Rhineland-Palatinate), the 2 procedure (Baden-Württemberg, Hesse, Schleswig-Holstein) or the 11 procedure with the factors of the state (all others, Berlin with the variants A and B). A state notation without the state is checked against every state that uses it; as several states share a notation (e.g. FF/BBB/UUUUP), parse() then returns the first valid interpretation unless the state is given. Whether the tax office exists (ELSTER list of tax offices) is not checked.

Constants#

ConstantValueDescription
STATE_PREFIXES['10' => 'SL', '11' => 'BE', '21' => 'SH', '22' => 'HH', '23' => 'NI', '24' => 'HB', '26' => 'HE', '27' => 'RP', '28' => 'BW', '30' => 'BB', '31' => 'ST', '32' …First digits of the ELSTER format (Bundesfinanzamtsnummer) => state (ISO 3166-2:DE).

Methods#

MethodDescription
->formatted()Notation on tax notices, e.g. 181/815/08155 or 133/8150/8159.
::looksLikeVatId()A VAT identification number (DE + 9 digits) given as tax number.
::parse()The valid tax number in any notation, or null when it is invalid or cannot be checked.
::validate()true = valid, false = invalid, null = plausible but not checkable (a Bavarian notation without the tax office number, BBB/UUUUP).

formatted()#

public function formatted(): string

Notation on tax notices, e.g. 181/815/08155 or 133/8150/8159.

Returns
string

looksLikeVatId()#

public static function looksLikeVatId(string $value): bool

static

A VAT identification number (DE + 9 digits) given as tax number.

ParameterTypeDescription
$valuestring
Returns
bool

parse()#

public static function parse(string $value, string|null $state = null): ?self

static

The valid tax number in any notation, or null when it is invalid or cannot be checked.

ParameterTypeDescription
$valuestring
$statestring|null = nullISO 3166-2:DE code (e.g. BY) to read a state notation
Returns
?self

validate()#

public static function validate(string $value, ?string $state = null): ?bool

static

true = valid, false = invalid, null = plausible but not checkable (a Bavarian notation without the tax office number, BBB/UUUUP).

ParameterTypeDescription
$valuestring
$state?string = null
Returns
?bool

Die Open-Core-Pakete stehen unter der MIT-Lizenz. Die rechtlichen Formulierungen der Länderpakete sind mit einer Steuerberatung abzustimmen.