VAT Number Verifier

The VAT Number Verifier (VNV) is a cgi that can be called with an ISO country code and a VAT number to both verify the VAT number is correct and return the VAT rate as a percentage for the matching country code. It will also determine if state tax will be charged.

Syntax:

http://usd.swreg.org/cgi-bin/vnv.cgi?mode=<mode>&country=<ISO country code>&state=<state code>&number=<number>&city=<city>&zip=<zip>

Mode

The mode parameter affects the format of the output. This parameter can be one of the following values.

Plain Mode

In plain mode, the module will return the percentage rate, or 0 with 2 lines of errors separated by return characters. This will be prefixed with a content type line.

Eg. vnv.cgi?mode=plain&country=GB&number=GB123456789

will return ([cr] indicate a carriage return character)..

Content-Type: text/html[CR][CR]
17.5%[cr]

If an error occurrs...

Eg. vnv.cgi?mode=plain&country=GB&number=GB1xxx789

will return ..

Content-Type: text/html[CR][CR]
0%[CR]
4[CR]
Invalid VAT number

See the Errors section below for a list of all possible errors.

HTML Mode

HTML mode is similar to plain mode, however a full basic html page is output with the result encluded between <PRE> tags.

Sparse Mode

Sparse mode is similar to plain mode, however only the full VAT rate or 0% will be output (for both an error condition or countries that do not have VAT).

Sparse HTML Mode

Sparse HTML mode is similar to Sparse mode, however the output is placed in a full HTML page similar to the normal HTML mode.

Error Conditions

If a European country is passed in with a valid VAT number, then the VAT rate will be output othwise it will be treated as an error condition and a rate of 0% will be output. In HTML/Plain mode 3 lines of data will be output

<rate>[CR]
<error_number>[CR]
<textual error message>[CR]

The following are a list of supported error messages. Any error code 10 or greater is a fatal error.

SWREG offers a paypal alternative, affordable ecommerce, payment processing, ecommerce solution, and an online software store with the ability to sell shareware.