Validação de Tax IDs em loteBETAcore beta

Valide e normalize identificações pessoais e fiscais (DNI, CUIT, CUIL, CPF, CNPJ, RFC, CURP, RUT, NIT, RUC, Cédula e mais) com checksum por país. Até 1.000 itens por request.

Contrato estável; mudanças breaking apenas com deprecation prévio.

POST/v1/validate/tax-ids
Visão geral

Validate a batch of personal or tax identifications. Each item declares its `country` (required) and optionally a `type` — when `type` is omitted the validator is resolved within the country. Implements the correct per-country checksum: weighted Mod-11 (CUIT), two-round Mod-11 (CPF, CNPJ), the SAT homoclave (RFC), Mod-11 with K check digit (RUT-CL), and more. Covers personal IDs (DNI, CURP, Cédula) and tax IDs. Each result carries `valid`, the `normalized` value (digits only) and a `formatted` representation. The same endpoint serves 1 or N items: up to 1000 per request.

URL base: https://api.normadata.io

Header de autenticação: X-API-Key: nd-...

Corpo da requisição

Corpo da requisição

CampoTipoObrigatórioDescrição
itemsarraysimArray of items to validate (1–1000). Each item is the object described below.
items[].idstringnãoClient-provided correlation id, echoed back verbatim in the matching result.
items[].valuestringsimIdentification value to validate (with or without separators).
items[].countrystringsimISO 3166-1 alpha-2 country code. Determines which validators are eligible.
items[].typestringnãoValidator type (cuit, cuil, cpf, cnpj, rfc, curp, rut, nit, ruc, rif, cedula, …). If omitted, it is resolved within the country.
Exemplo de requisição

Exemplo de requisição

cURL
curl -X POST https://api.normadata.io/v1/validate/tax-ids \
  -H "X-API-Key: nd_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" \
  -H "Content-Type: application/json" \
  -d '{"items":[
    {"id":"a","value":"20-12345678-6","country":"AR","type":"cuit"},
    {"id":"b","value":"123.456.789-09","country":"BR"}
  ]}'
Go
package main

import (
	"bytes"
	"encoding/json"
	"fmt"
	"net/http"
	"os"
)

type TaxIDItem struct {
	ID      string `json:"id"`
	Value   string `json:"value"`
	Country string `json:"country"`
	Type    string `json:"type,omitempty"`
}

type TaxIDResult struct {
	ID         string `json:"id"`
	Country    string `json:"country"`
	Type       string `json:"type"`
	Valid      bool   `json:"valid"`
	Normalized string `json:"normalized"`
	Formatted  string `json:"formatted"`
}

type TaxIDResponse struct {
	Results []TaxIDResult `json:"results"`
}

func main() {
	body, _ := json.Marshal(map[string][]TaxIDItem{
		"items": {
			{ID: "a", Value: "20-12345678-6", Country: "AR", Type: "cuit"},
			{ID: "b", Value: "123.456.789-09", Country: "BR"},
		},
	})
	req, _ := http.NewRequest("POST", "https://api.normadata.io/v1/validate/tax-ids", bytes.NewReader(body))
	req.Header.Set("X-API-Key", os.Getenv("NORMADATA_API_KEY"))
	req.Header.Set("Content-Type", "application/json")

	res, err := http.DefaultClient.Do(req)
	if err != nil { panic(err) }
	defer res.Body.Close()

	var out TaxIDResponse
	json.NewDecoder(res.Body).Decode(&out)
	for _, r := range out.Results {
		fmt.Println(r.ID, r.Valid, r.Normalized)
	}
}
Exemplo de resposta

Exemplo de resposta 200

JSON
{
  "results": [
    {
      "id": "a",
      "country": "AR",
      "type": "cuit",
      "valid": true,
      "normalized": "20123456786",
      "formatted": "20-12345678-6"
    },
    {
      "id": "b",
      "country": "BR",
      "type": "cpf",
      "valid": true,
      "normalized": "12345678909",
      "formatted": "123.456.789-09"
    }
  ]
}
Erros comuns

Erros comuns

Códigos de erro que você pode encontrar ao chamar este endpoint. O envelope completo está documentado na referência principal.

Código
INVALID_TAX_ID
MISSING_VALUE
MISSING_COUNTRY
INVALID_COUNTRY
empty_batch
batch_too_large
quota_exceeded

Ver todos os códigos de erro

Notas

Notas

Validates format, length and check digit only — it does not confirm the taxpayer exists or is active in any registry. Separators are stripped before validation. Personal IDs without a check digit (e.g. DNI AR) fall back to length and shape validation. The envelope is shared by every endpoint: POST `{items:[…]}` (1–1000) and the response is `{results:[…]}` correlated by `id`.

Acesso

Use este endpoint em acesso antecipado

O acesso à Normadata é provisionado manualmente. Solicite acesso com seu caso de uso e provisionamos a API key para sua conta.

Solicitar acesso