Swagger UI openapi.json openapi.yaml
Guide

Test Fixtures

All mocked CPF, CNPJ, and document numbers from the QA mocks service. Valid formats, scenarios, and fixture mappings for Brazilian fiscal documents.

Golden Test Identities

End-to-end happy path: Use these three identities for complete integration testing across all services.

Individual (CPF)

12345678909

Main test individual — works across ALL services for end-to-end happy-path testing.

Company (CNPJ)

12345678000195

EMPRESA TESTE LTDA — Non-MEI. Works across ALL non-MEI services for end-to-end testing.

MEI Company

33333333000191

EMPRESA TESTE SEM DIVIDA LTDA — MEI. All MEI-specific scenarios: DAS, DASN, barcode, CND, registration flow.

Focused Guides

The full fixture reference is split into focused guides by document type. Each guide includes all fixtures, supported scenarios, and credential validation test cases.

CPF Fixtures

Individuals — standalone CPFs, CPFs linked to MEI/non-MEI CNPJs, and error scenario CPFs (not found, invalid format, rate limit).

CNPJ MEI Fixtures

MEI companies — scenario-specific, sequential success range, and complete test workflow.

CNPJ Non-MEI Fixtures

Regular companies — scenario-specific, sequential success range, and complete test workflow.

Test Credentials

Password-based error scenarios for certificate, pass-invoices, and pass-govs validation. Curl examples for each error type.

Test Scenarios

Test environment only. These scenarios are available in QA and Staging.

Error scenarios

ScenarioTax NumberHTTPError
CPF Not Found00000000000404ERRO-001 — CPF não encontrado
CPF Invalid Format11111111111400ERRO-002 — CPF formato inválido
CPF Rate Limit99999999999429Rate limit exceeded
CND Pending11111111000191200Status 7 — retry after delay
CND Unavailable22222222000191200Status 5 — not available
DASN Error (MEI)55555555000191200DASN error scenario

Scenario override

Override the default scenario with ?mock_scenario=success. Add delay with ?mock_delay=3000 (milliseconds). Only available in QA and Staging.

Validation Rules

CPF validation (11 digits)

  1. First 9 digits multiplied by weights 10, 9, 8, 7, 6, 5, 4, 3, 2
  2. Sum mod 11: if remainder < 2, check digit = 0; else check digit = 11 - remainder
  3. First 10 digits (including first check digit) multiplied by weights 11, 10, 9, 8, 7, 6, 5, 4, 3, 2
  4. Sum mod 11: same rule for second check digit

CNPJ validation (14 digits)

  1. First 12 digits multiplied by weights 5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 2
  2. Sum mod 11: if remainder < 2, check digit = 0; else check digit = 11 - remainder
  3. First 13 digits (including first check digit) multiplied by weights 6, 5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 2
  4. Sum mod 11: same rule for second check digit
All-zeros documents (CPF 00000000000, CNPJ 00000000000000) are always rejected, even though they technically pass the check digit algorithm.

Generating additional test numbers

To generate valid test numbers, compute the check digits using the CPF (11-digit) or CNPJ (14-digit) validation algorithm above.