Valid fake Brazilian data for tests.

Generate realistic people, companies, addresses matching real CEP ranges, credit cards, bank accounts, Pix keys, and financial charges in seconds. Built with zero dependencies, 100% deterministic with seeds, and ready to populate the Asaas mock in a single call. Works in Docker, via HTTP API, or directly in your browser.

docker run --rm -p 45450:45450 ghcr.io/instituto-ama/generator-mock:latest

What it generates.

Twelve kinds of Brazilian entities and documents, generated on demand or in batches up to 1,000 items. Every kind is deterministic and conforms to official formatting rules.

Kind Description Example field
person Complete individual with documents, contact details, and address cpf: "123.456.789-09"
company Company with registrations, CNAE activity, address, and partners cnpj: "12.345.678/0001-95"
address Address aligned with real city CEP ranges and IBGE codes postalCode: "01310-100"
cpf Individual Taxpayer Registry with valid check digits value: "11144477735"
cnpj National Registry of Legal Entities with valid check digits value: "11222333000181"
cnh National Driver's License with DENATRAN check digits value: "12345678901"
pis Social Integration Program with mod-11 check digits value: "12034567890"
rg General Registry identity document with check digit value: "12345678X"
credit-card Test credit card (approves 4444..., declines 5184..., or Luhn random) number: "4444444444444444"
bank-account Bank account with real Brazilian bank code, agency, and account agency: "1234"
pix-key Pix keys of type CPF, CNPJ, EMAIL, PHONE, or EVP key: "+5511987654321"
charge Financial charge with billing type, value in BRL, and due date value: 129.90

Use cases.

Whether filling out forms by hand, provisioning automated test fixtures, or seeding your local payment simulator, realistic data is a single call away.

The examples call

Fill a form in a manual test

Testing a registration flow that validates CPF, phone numbers with correct DDDs, and addresses with real postal codes? Grab a complete person or company in JSON, copy it to clipboard, or generate one in your browser without inventing fake phone numbers.

curl https://instituto-ama.github.io/ama4devs/generator/api/v1/person
curl https://instituto-ama.github.io/ama4devs/generator/api/v1/cnpj

Validate a CPF or CNPJ

Verify whether a document string passes official validation rules and check digits, without importing heavy external packages into your testing scripts.

curl https://instituto-ama.github.io/ama4devs/generator/api/v1/validate/cpf/11144477735
curl https://instituto-ama.github.io/ama4devs/generator/api/v1/validate/cnpj/11222333000181

Seed a test suite with a fixed seed

Eliminate flaky tests caused by random values. Pass seed and optionally a reference now date to obtain identical data on every test run across machines and CI runs.

curl https://instituto-ama.github.io/ama4devs/generator/api/v1/company/42

The API in one table.

A tiny HTTP server with zero runtime dependencies. All endpoints support CORS, and internal routes are guarded for local safety.

Method & Route Response / Description
GET /health {"status":"ok","service":"generator","version":"0.2.0"}
GET / Serves the web application (static assets from public/)
GET /core/<name>.js Serves raw ES modules from src/core/ for browser use
GET /v1/kinds {"kinds":[{"id":"person","label":"Person"},...]}
GET /v1/validate/:type/:value {"type":"cpf","value":"...","valid":true} for cpf, cnpj, cnh, pis
GET /v1/:kind {"kind":"...","seed":"...","count":1,"items":[...]}
GET /_mock/asaas/status {"asaasUrl":"...","panelUrl":"...","reachable":true,"customers":0}
POST /_mock/asaas/populate {"seed":"...","panelUrl":"...","customers":[...],"payments":[...],"errors":[]}