Invoke-PortInvoiceValidation #
ÜBERSICHT #
Validiert eine E-Rechnung (XML oder ZUGFeRD-PDF) über die portinvoice.com API.
SYNTAX #
Invoke-PortInvoiceValidation [-FilePath] <string> [-ApiToken] <string> [[-Validators] <string[]>]
[[-Language] <string>] [[-ResponseFormat] <string>] [[-BaseUrl] <string>] [-Raw]
[<CommonParameters>]
BESCHREIBUNG #
Sendet eine Rechnungsdatei an die portinvoice.com REST-API und gibt das Validierungsergebnis strukturiert zurück. Unterstützt die Validatoren Mustang, KoSIT und Valitool.
Voraussetzung: Ein portinvoice.com-Konto mit Embedded-Edition-Zugang (25 EUR/Monat). Der API-Token wird im Konto unter OpenAPI generiert.
PARAMETER #
-FilePath #
Type: string
Pfad zur Rechnungsdatei (XML oder PDF).
-ApiToken #
Type: string
Bearer-Token für die portinvoice.com API (aus dem Konto-Bereich).
-Validators #
Type: string[]
Default: @('mustang'
Array der zu verwendenden Validatoren. Standard: alle drei. Mögliche Werte: ‘mustang’, ‘kosit’, ‘valitool’.
-Language #
Type: string
Default: 'de'
Sprache für die Validierungsmeldungen. Standard: ‘de’.
-ResponseFormat #
Type: string
Default: 'xml'
Format der Antwort: ‘xml’ (Standard, wird als Objekt geparst) oder ‘pdf’.
-BaseUrl #
Type: string
Default: 'https://portinvoice.obwyse.net/API'
Basis-URL der API. Standard: ‘https://www.portinvoice.com’.
-Raw #
Type: switch
Gibt die rohe API-Antwort zurück statt eines aufbereiteten Objekts.
AUSGABEN #
PSCustomObject
Objekt mit Specification, Recommendation, Details und RateLimit-Informationen.
BEISPIELE #
Invoke-PortInvoiceValidation -FilePath 'rechnung.pdf' -ApiToken 'eyJ...'
Invoke-PortInvoiceValidation -FilePath 'factur-x.xml' -ApiToken 'eyJ...' -Validators @('kosit')
$result = Invoke-PortInvoiceValidation -FilePath 'zugferd.pdf' -ApiToken $token
if ($result.Specification -eq 'FULLY_VALID') { Write-Host 'Rechnung ist valide' }