v3

Check a tax identification number

A POST rather than a GET so the TIN does not travel in a URL: request logs record the full query string and retention is unlimited, and a TIN is a national identifier. Validation is local, so no caching is lost.

POST/api/v3/tax-identification-numbers/validate

Send two credentials: your own, and the customer's.

How authentication works
Yours
x-api-keyorAuthorization: Bearer
The customer's
User-Authorization: BearerorUser-Identifier

Language

Environment

Credentials

Your credential

The customer's credential

Choose an environment first.

cURL request
curl -X POST https://api.btcdirect.eu/api/v3/tax-identification-numbers/validate \  -H "x-api-key: $BTCD_API_KEY" \  -H "User-Authorization: Bearer $BTCD_USER_TOKEN" \  -H "Content-Type: application/json" \  -d '{    "country": "NL",    "tin": "111222333"  }'
Choose an environment to run this.

Response

The verdict. A non-valid TIN is a 200 with state != "valid", not an error.
{  "state": "valid",  "reason": "bad_checksum",  "matched": "PESEL",  "formatHint": "111222333"}

Request

countrystringrequired

ISO 3166-1 alpha-2.

ExampleNL

tinstringrequired

Example111222333

subjectstring

Whose TIN this is. `business` validates against the entity catalogue, so a company's TIN is checked as a company's rather than a person's. Omitted, it is a person's. A value naming neither is a 400.

Can be one ofuserbusiness

Defaultuser

Responses

200The verdict. A non-valid TIN is a 200 with state != "valid", not an error.
400`country` is missing, or `subject` names neither `user` nor `business`.
503`maintenance` — full maintenance is on, and every endpoint refuses every request until it ends (`endsAt`, when it has an end). Nothing is wrong with the request and nothing was done; the same request is accepted afterwards. Told apart from any other 503 by `code`.

Body of the success response

statestringrequired

"incomplete" means the value is a prefix of a well-formed number; keep typing. Not an error state.

Can be one ofvalidincompleteinvalidnot_issued

reasonstring

Why state is "invalid". Absent otherwise. "bad_checksum" is a wrong check digit; "bad_structure" is a rule about shape instead — an impossible calendar date, a permanently-unissued area — for the handful of countries whose format has one.

Can be one ofbad_lengthbad_charsetbad_checksumbad_structureno_format_matchunknown_country

Examplebad_checksum

matchedstring

Which of the country's formats matched, for a country with more than one. Absent for a single-format country and the generic fallback.

ExamplePESEL

formatHintstring

A specimen of the expected shape, present on every non-valid verdict for an issued country.

Example111222333

Every failure answers with a message and a code. Switch on the code — messages are written for people and can change.