ForHosting KIT · Validation

Check a tax ID format

The Tax ID Format Validation API reads a national tax identifier — Mexico's RFC, Brazil's CPF/CNPJ, Argentina's CUIT, the US EIN and dozens more — and confirms it matches the length, character pattern and, where the country defines one, check digit for that specific ID type. It's built for the moment before a tax ID gets written into an invoice, a payroll record or a KYC file, when a formatting mistake is still cheap to fix.

● StableFree · in your browser
Use it from WebAPIEmailApp soonTelegram soon

Runs in your browser. Free, unlimited — your data never leaves this page.

Why one generic pattern doesn't work

Every country invents its own tax ID from scratch, so a validator that treats them all the same way is guaranteed to be wrong somewhere. Mexico's RFC mixes letters from a person's name with a birth date and a homoclave; Brazil's CPF and CNPJ each carry two check digits computed with their own weighted algorithm; Argentina's CUIT encodes a check digit using modulo 11 over an eleven-digit string. The tax id validation api keeps a distinct rule set per country and ID type instead of forcing every identifier through the same regular expression, which is the only way to catch a genuinely malformed number without also rejecting a valid one that just looks unusual.

Who ends up needing this

Invoicing platforms operating in Latin America must get the tax ID right before a fiscal document is even generated, since several tax authorities reject the document outright on a bad ID. Payroll and HR systems onboarding contractors across borders need the same check for withholding and reporting. KYC and onboarding flows at fintechs and marketplaces use it as a first, cheap filter before a heavier identity-verification step. Anyone collecting a tax ID from a form and storing it for later use is one typo away from a downstream rejection this endpoint is built to prevent.

The request cycle

Call POST /verify/tax-id with the identifier and the country, and the response comes back immediately with a task_id while the actual check runs asynchronously. The result reports whether the format is valid for that country's ID type, which check-digit algorithm was applied when one exists, and a plain reason when validation fails. A task that fails outright retries three times before returning a clear error, and a failed task is never billed.

A patchwork built over a century of tax administration

National tax identifiers weren't designed together; each was introduced independently, often decades apart, as tax authorities modernized their own record-keeping — some as early as the mid-20th century, others as recently as the digital-invoicing mandates of the last fifteen years. That independent history is exactly why formats diverge so widely in length, structure and check-digit logic. Maintaining accurate rules for more than 40 countries means tracking each authority's own specification rather than approximating from a handful of well-known formats.

Fitting into onboarding and invoicing pipelines

Because the response is structured JSON delivered by webhook, it plugs directly into signup forms, invoicing engines and periodic data-quality sweeps: validate a tax ID inline before a fiscal document is generated, gate contractor onboarding on a passing check, or run an existing customer table through the endpoint to flag records worth fixing before an audit. Access requires prepaid balance, which is what keeps the service fast and abuse-free, and each check is a flat published $0.002 with no bundled credits to reconcile.

Invoice generation in Latin America

An invoicing platform validates a customer's RFC or CUIT before generating a fiscal document, avoiding a rejection from the tax authority over a malformed identifier.

Cross-border contractor onboarding

A payroll system checks a new contractor's national tax ID format at signup, catching a transposed digit before it reaches a withholding or reporting record.

KYC pre-filter at a fintech

An onboarding flow validates the tax ID format as a fast first filter before routing the applicant to a heavier identity-verification step, cutting obviously bad submissions early.

Customer database cleanup

A finance team runs its stored tax ID field through the endpoint ahead of a tax filing season, flagging records that never matched the correct national format.

How do I validate a tax ID with an API?

Send POST /verify/tax-id with the identifier and country. The tax id validation api returns a task_id immediately and delivers the format result to your webhook or a signed link once the check completes.

Which countries and ID types are covered?

More than 40 countries, including Mexico's RFC, Brazil's CPF and CNPJ, Argentina's CUIT, the United States' EIN and SSN formats, and other national tax identifiers, each checked against its own country-specific rules.

Is there a free tier for tax ID validation?

The tool above runs free in your browser. The API is paid — each call draws from your prepaid ForHosting KIT balance: top up from $10.00 (it never expires), pay each request's published price, and a call with no balance returns HTTP 402. No subscription, no tokens, and a failed task is never charged.

Does this confirm the tax ID is registered with the tax authority?

No. It confirms the identifier matches the correct format, length and check digit for its country and type. Confirming live registration with a specific tax authority requires that authority's own lookup service, which this endpoint does not query.

Can I validate tax IDs in bulk?

Yes. Submit each identifier as its own POST and the tasks run in parallel; every request is billed independently and a failed task is retried and never charged.

What does it mean when a check digit fails?

It means at least one character in the identifier doesn't match what that country's algorithm expects given the rest of the number, almost always because of a typo or a digit copied from the wrong source.

How are results delivered?

Either a signed webhook posted to your server the moment the check finishes, which we recommend, or a signed link valid for 24 hours you can fetch on your own schedule.

Is the submitted tax ID kept afterward?

No. The identifier and its result are deleted once the retention window closes and are never used for training; delivery links are signed and expire.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/verify/tax-id

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, and soon from our app, email and Telegram.

curl -X POST https://api.kit.forhosting.com/verify/tax-id \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"items":["valor-1","valor-2"]}'
{
  "items": [
    "valor-1",
    "valor-2"
  ]
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "verify.tax_id",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

Read the full KIT documentation →