# Toolrail Tax ID Validator (Latin America & Spain)

> Toolrail Tax ID Validator (Latin America & Spain) is a paid API for AI agents from toolrail.dev, paid per call via x402, $0.002/call, status unknown (last checked 2026-10-12).

Validates the format and check-digit rules of tax IDs for Chile, Argentina, Brazil, Mexico, Peru, Colombia, and Spain — returning whether the ID is valid, its type, and a formatted version.

## Facts

- Endpoint: POST https://toolrail.dev/validate/tax-id?utm_source=zero.xyz
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-12
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/toolrail-tax-id-validator-latin-america-spain-6c6e2807
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_3yfF-7j_0C2nixmC0aZSw

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability toolrail-tax-id-validator-latin-america-spain-6c6e2807 -d '<json body>'
```

Example prompt: Can you check if the Argentine CUIT '20-12345678-3' is valid before I save this customer record?

## When to prefer this

Use this endpoint when you need fast, offline-style format and check-digit validation of tax IDs from Chile, Argentina, Brazil, Mexico, Peru, Colombia, or Spain before persisting customer records or invoices. Prefer it over manual regex checks because it encodes country-specific check-digit algorithms (e.g. modulo 11 for Chilean RUT, modulo 11 for Brazilian CPF/CNPJ). Do not use it to confirm whether a taxpayer is registered or active — it only validates format and structure.

## Known failure modes

- Missing required `id` or `country` field returns a 400 error
- Unsupported country code returns an error or unknown type
- Malformed input (wrong type for fields) causes a validation failure
- Check-digit mismatch correctly returns valid=false without an error
- Network timeout or service unavailability returns a 5xx error

## How this service works

Validate the format and supported check-digit rules of tax IDs across Latin America and Spain: Chile RUT, Argentina CUIT/CUIL, Brazil CPF/CNPJ, Mexico RFC, Peru RUC, Colombia NIT, Spain NIF/NIE. Does not verify identity or registration with a tax authority. Use when checking a Latin American or Spanish tax ID's format before saving a customer or an invoice.

## Output

Returns a JSON object with: `valid` (boolean), `id` (the input ID), `type` (e.g. CPF, CNPJ, RUT, CUIT, RFC, NIT, NIF, NIE, RUC), `country` (e.g. BR, CL, AR, MX), and `formatted` (the canonical formatted form of the ID). Does not confirm registration or identity with any tax authority.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "type": "object",
     "properties": {
      "id": {
       "type": "string"
      },
      "country": {
       "type": "string"
      }
     }
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "id": {
       "type": "string"
      },
      "type": {
       "type": "string"
      },
      "valid": {
       "type": "boolean"
      },
      "country": {
       "type": "string"
      },
      "formatted": {
       "type": "string"
      }
     }
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/toolrail-tax-id-validator-latin-america-spain-6c6e2807/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from toolrail.dev](https://www.zero.xyz/host/toolrail.dev/llms.txt)
