vies library
Dart client for the VIES (VAT Information Exchange System) SOAP service.
See ViesProvider.validateVat for the entry point.
Classes
- Country
- A country exposed by the package as a known VAT origin.
- VatShape
- Offline syntactic validation of VAT numbers.
- ViesProvider
- Entry point of the package. All operations are static - the class is not instantiable.
- ViesValidationResponse
- Result of a successful VAT validation, either from the VIES SOAP service or from a local shape check. source says which of the two answered.
Enums
- RegexType
- Which VAT-number regular expression to apply when ValidationLevel.regex or ValidationLevel.all is requested.
- ValidationLevel
- Granularity of validation performed by ViesProvider.validateVat.
- ValidationSource
-
Where the answer carried by a
ViesValidationResponsecomes from. - ViesErrorCode
- Enumeration of all error codes that can be reported by the VIES package.
Constants
- defaultRequestTimeout → const Duration
-
Default timeout applied to a VIES call when the caller does not override
it. It bounds one attempt, not a whole
validateVatwith retries. -
europeanCountries
→ const List<
Country> - Convenience list of European country codes the package may encounter when dealing with VAT numbers. This is not a strict list of EU member states - it includes EEA neighbours and a few other European territories that frequently appear in business directories.
- maxRetryBackoff → const Duration
-
Upper bound on the exponential backoff between two retried attempts, so a
large
retriescannot turn into an unbounded wait. - viesServiceUrl → const String
-
Production endpoint of the VIES
checkVatSOAP service. - viesTestServiceUrl → const String
-
Test endpoint of the VIES
checkVatservice - returns deterministic success/failure based on the VAT number tail, useful for integration testing without hitting the real database.
Exceptions / Errors
- ViesClientError
- Errors caused by the input or the parsed response (e.g. invalid VAT number, malformed SOAP body).
- ViesError
-
Base class for every error raised by the
viespackage. - ViesServerError
- Errors caused by the transport or by VIES itself (timeouts, faults, connectivity loss).