Class LeitwegIdValidator

Namespace
EInvoice.Core.Validation
Assembly
EInvoice.Core.dll

Validates Leitweg-IDs used in German public sector e-invoicing (XRechnung BT-10). Format: [Mandant]-[Verwaltungseinheit]-[Prüfziffer], e.g. 04011000-12345-03. Check digit uses ISO 7064 MOD 97-10.

public static class LeitwegIdValidator
Inheritance
LeitwegIdValidator
Inherited Members

Fields

SchemeId

The scheme identifier that marks a buyer reference as a Leitweg-ID, triggering format and check digit validation.

public const string SchemeId = "leitweg-id"

Field Value

string

Methods

ComputeCheckDigit(string)

Computes the 2-digit Prüfziffer for the given Mandant + Verwaltungseinheit parts (i.e. the Leitweg-ID without the trailing -XX check segment).

public static string ComputeCheckDigit(string leitwegIdWithoutCheckDigit)

Parameters

leitwegIdWithoutCheckDigit string

Returns

string

IsValid(string)

Returns true if leitwegId matches the Leitweg-ID format and has a valid ISO 7064 MOD 97-10 check digit.

public static bool IsValid(string leitwegId)

Parameters

leitwegId string

Returns

bool