Referenzprüfung und Fehlerbehandlung im Ventoo Document Reader

This article describes in detail how Ventoo Document Reader evaluates a recognized payment reference, and how it handles errors, timeouts, and ambiguous results.

Reference types in detail

Reference type

Description

Counts as a complete match?

QRR

Swiss QR reference, 27 numeric digits, with Mod10r check digit.

Yes, provided both validation stages pass.

SCOR

Creditor Reference per ISO 11649, alphanumeric.

No – fails the 27-digit numeric check.

NON

No structured reference value present.

No – an empty reference fails the 27-digit check.

Two-stage validation in detail

  1. Check digit (Azure Function): The Azure Function computes the Mod10r check digit of the recognized reference and returns the result as a valid flag.

  2. Structural check (Business Central): Ventoo Document Reader additionally checks that the reference consists of exactly 27 numeric digits.

Only if both stages are positive does TryExtractFromAttachment return true, and the data counts as a complete match.

Important: In practice, this combination means that only QRR references can result in a true return value. If a SCOR reference or a reference-less (NON) QR-bill is recognized, the creditor, debtor, and amount data are still decoded by the Azure Function, but the procedure still reports false. Calling extensions that also want to work with SCOR or NON documents currently cannot distinguish this directly from the return value of TryExtractFromAttachment.

Error types overview

Situation

Behavior

Is this an error?

App not enabled

Immediate return of false, no request to the Azure Function.

No

Function URL not configured

Immediate return of false.

No

PDF with no recognizable QR code

Azure Function returns "found": false.

No

Reference fails the 27-digit check (SCOR/NON)

Returns false, despite decoded data.

No

Azure Function unreachable or timed out

The error message "The QR-bill reading service could not be reached or returned an error." is raised.

Yes

Azure Function responds with a status code outside the 2xx range

Same error message as above.

Yes

Note: Ventoo Document Reader deliberately distinguishes between "no match" (not an error, a very common normal case) and "service unreachable" (a genuine error). Only the latter raises an error message, which the calling extension can catch, e.g. via TryFunction semantics.

Timeouts

If the Azure Function doesn't respond within the Timeout (ms) period configured in the connection settings, the request is aborted and treated as an error. Ventoo Document Reader does not automatically retry.