Verify and decide
This page shows how to verify an ID using the SDK and how to interpret the result in a way that supports automated decisions.
The SDK does not change verification semantics.
It exposes the same engine output returned by the /verify endpoint and adds helpers to reason about that output safely and consistently.
For the underlying verification operation and response structure, see Verify an ID.
Typical decision flow
A common integration follows these steps:
- Receive an ID, and optionally infer its type.
- Verify the ID using the engine.
- Interpret the outcome and issues.
- Decide whether to accept, reject, or flag the ID.
If you intend to verify multiple IDs in a batch, see Bulk verification for a more efficient execution pattern.
Verifying an ID with the SDK
import { createVerifyVatClient, Verifier } from '@verifyvat/sdk'
const client = createVerifyVatClient()const verifier = new Verifier(client)
const verification = await verifier.verifyId({ id: '914778271', type: 'no_orgnr',})from verifyvat_sdk import VerifyVatClient, Verifier
client = VerifyVatClient()verifier = Verifier(client)
verification = verifier.verify_id( id="914778271", type="no_orgnr",)client.close()At this point, verification contains the full output produced by the engine, equivalent to the REST API response data.
Interpreting the outcome
The engine always returns a structured result, even when the ID is invalid or unconfirmed.
Decisions should be based on the combination of overall outcome, reported issues, and registry evidence, rather than on the presence or absence of entity data alone.
The SDK exposes helpers that encapsulate the recommended interpretation rules.
Using decision helpers
The Verifier class provides helpers to extract meaningful signals from a verification result.
// continuing from above
const desc = verifier.describeVerification(verification)
// A selection of useful signals:console.log('Is confirmed:', desc.isConfirmed)console.log('Is invalid:', desc.isInvalid)console.log('Is degraded:', desc.isDegraded)
console.log('Has partial coverage:', desc.hasPartialCoverage)console.log('Has stale outcome:', desc.hasStaleOutcome)
console.log('Is review recommended:', desc.reviewRecommended)console.log('Is retry recommended:', desc.retryRecommended)# continuing from above
desc = verifier.describe_verification(verification)
# A selection of useful signals:print('Is confirmed:', desc.isConfirmed)print('Is invalid:', desc.isInvalid)print('Is degraded:', desc.isDegraded)
print('Has partial coverage:', desc.hasPartialCoverage)print('Has stale outcome:', desc.hasStaleOutcome)
print('Is review recommended:', desc.isReviewRecommended)print('Is retry recommended:', desc.isRetryRecommended)These helpers do not hide data.
They derive their signals directly from the verification output, using the same semantics described in the API documentation.
Making decisions safely
Once you have decision-grade signals, product logic becomes explicit and auditable. The SDK helpers encode opinionated interpretation rules, but you are free to granularly change the policy used to describe the verification result.
The default policy produces the following recommended decision signals:
| Signal | Meaning |
|---|---|
isConfirmed | At least one registry returned a confirmed match, from real-time data. |
isSoftConfirmed | At least one registry returned a confirmed match, but it comes from stale data. |
isUnconfirmed | No registries returned a confirmed match, and no signals of degradation are present. |
isSoftUnconfirmed | No registries returned a confirmed match, and signals of degradation are present. |
hasRequestError | The process encountered a request-level error, such as a network failure or timeout. |
hasRegistryOutage | At least one registry was unreachable or returned an error during the verification process. |
hasStaleOutcome | The result is based solely on stale data, with no real-time registry responses available. |
hasPartialCoverage | The process had partial coverage, meaning that all registries queried didn't provide a definitive outcome. |
isDegraded | The result is degraded due to errors, outages, stale data, or partial coverage without confirmation. |
isInvalid | The identifier failed syntactic validation and was not processed by any registry. |
retryRecommended | A retry may yield a different result, especially if there were transient issues or stale data. |
reviewRecommended | Human review is recommended, especially for soft outcomes or when unknown outcomes are accompanied by signals of degradation. |
Common patterns include:
- accepting only confirmed, non-stale results
- routing degraded cases to manual review
- retrying when registry outages are detected
- rejecting immediately on invalid syntax
The SDK helpers encode these principles so they can be applied consistently across a codebase.
Error handling behaviour
SDK methods return verification results for all domain-level outcomes. Only envelope-level failures, such as authentication errors or malformed requests, raise exceptions by default. If suppress-errors mode is enabled, exceptions are swallowed and replaced with tainted results that clearly signal upstream failure. This allows batch and pipeline processing to continue without interruption.