Skip to content

vies API

Everything the package exports, by the path you import it from. Open an export for its signature and options.

@evolve-framework/vies

ViesVatNumberCheckModule, ViesClient and their options

Classes

ViesClientLive VAT number validation against the European Commission's VIES service.
import { ViesClient } from "@evolve-framework/vies";
new ViesClient(options?: ViesOptions)
OptionTypeDescription
baseUrl?string

Defaults to the European Commission's public VIES REST API.

timeoutMs?number

How long one request may take. Defaults to 8 seconds, as VIES often takes about 5.

retries?number

How often a timed-out request is asked again before the answer is UNKNOWN. Defaults to 1.

fetch?((url: string | URL | Request, options?: RequestInit | undefined, spanName?: string | undefined) => Promise<Response>)

Defaults to the framework's traced fetch.

MethodDescription
check(country: string, vatNumber: string): Promise<VatNumberCheck>
ViesVatNumberCheckModuleQuery.vatNumberCheck: whether an EU VAT number is registered, checked live against the European Commission's VIES service, with the company name and address when VIES gives them.
import { ViesVatNumberCheckModule } from "@evolve-framework/vies";

Extends AbstractModule<unknown>

new ViesVatNumberCheckModule(options?: ViesOptions)
OptionTypeDescription
baseUrl?string

Defaults to the European Commission's public VIES REST API.

timeoutMs?number

How long one request may take. Defaults to 8 seconds, as VIES often takes about 5.

retries?number

How often a timed-out request is asked again before the answer is UNKNOWN. Defaults to 1.

fetch?((url: string | URL | Request, options?: RequestInit | undefined, spanName?: string | undefined) => Promise<Response>)

Defaults to the framework's traced fetch.

Types

VatNumberCheck
import { type VatNumberCheck } from "@evolve-framework/vies";
export type VatNumberCheck = {
status: "VALID" | "INVALID" | "UNKNOWN";
name?: string;
address?: string;
};

Not listed: 1 options types. They appear as the tables under the constructors and functions they type.