# Toll402 CPF/CNPJ Validator

> Toll402 CPF/CNPJ Validator is a paid API for AI agents from toll402.dev, paid per call via x402, $0.002/call, status unknown (last checked 2026-09-14).

Offline validator for Brazilian CPF (individual) and CNPJ (company) registration numbers using modulo-11 check digit verification

## Facts

- Endpoint: POST https://toll402.dev/v1/t/cpf_cnpj_validate
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/toll402-cpf-cnpj-validator-4890581b
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_IkX6GfU8Fl1Hi4dknmt1J

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 toll402-cpf-cnpj-validator-4890581b -d '<json body>'
```

Example prompt: Can you validate this Brazilian CPF number for me — 123.456.789-09 — and tell me if it's legitimate with correct check digits?

## When to prefer this

Choose this endpoint when you need a fast, offline, algorithmic check of Brazilian CPF or CNPJ numbers without making a live query to Receita Federal or any government database. Ideal for pre-validation before submitting forms, KYC pipelines, or data quality checks where you want to catch obviously invalid numbers (wrong length, all-same-digit, bad check digits) instantly and cheaply. Not suitable if you need to confirm whether a CPF/CNPJ is actually registered and active — that requires a live government lookup.

## Known failure modes

- Input is neither a valid-length CPF (11 digits) nor CNPJ (14 digits) — returns invalid with length error
- Number consists of all identical digits (e.g. 111.111.111-11) — rejected as known invalid sequence
- Check digits do not match modulo-11 recomputation — returns invalid with check digit mismatch
- Non-numeric characters remain after stripping that corrupt the digit count — returns format error
- Missing or malformed request body — returns HTTP 400 or equivalent schema validation error

## How this service works

Offline validator for Brazilian CPF (individual) and CNPJ (company) registration numbers. Strips formatting, checks length, rejects known invalid sequences (all same digit), and recomputes the official modulo-11 check digits for both formats.

## Output

Returns a validation result indicating whether the CPF or CNPJ is valid, along with the reason for rejection if invalid (e.g. wrong length, all-same-digit sequence, or failed modulo-11 check digit verification). May also return a normalized/stripped version of the input number.

## 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": {}
    },
    "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"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/toll402-cpf-cnpj-validator-4890581b/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from toll402.dev](https://www.zero.xyz/host/toll402.dev/llms.txt)
