Guide
Test Credentials
Password-based error scenarios for certificate, pass-invoices, and pass-govs validation. The senha field determines which error the mock returns.
Overview
All credential validation uses the same endpoint. The senha value (not the CNPJ) determines which error scenario is triggered.
API Key:
test_faturamento_api_key_12345 via X-API-Key header.
Request body
| Field | Values |
|---|---|
auth_method | 1 = Certificate, 2 = Pass-invoices / Pass-govs |
cnpj | Any test CNPJ (e.g. 12345678000195) |
senha | See scenario tables below |
Certificate Validation
auth_method: 1. Validates the digital certificate password and expiry.
Test scenarios
| Password (senha) | HTTP | Response |
|---|---|---|
| Any non-error value | 200 | {valido: true} |
wrong_password | 200 | {valido: false, codigo_erro: "CREDENCIAIS_INVALIDAS"} |
certificate_expired | 200 | {valido: false, codigo_erro: "CERTIFICADO_SENHA_INVALIDA"} |
certificate_not_found | 200 | {valido: false, codigo_erro: "CERTIFICADO_NAO_RECONHECIDO"} |
Test environment only. These password-based error scenarios are available in QA and Staging.
Pass-invoices Validation
auth_method: 2. Validates portal login credentials. On success, returns the CNPJ associated with the credentials.
Test scenarios
| Password (senha) | HTTP | Response |
|---|---|---|
| Any non-error value | 200 | {valido: true, cnpj: "00000000000000"} |
wrong_password | 200 | {valido: false, codigo_erro: "CREDENCIAIS_INVALIDAS"} |
rate_limited | 408 | {valido: false, codigo_erro: "TIMEOUT"} |
portal_unavailable | 503 | {valido: false, codigo_erro: "TIMEOUT"} |
CNPJ cross-check
On success, the system compares the returned cnpj against the seller CNPJ. A mismatch triggers a CNPJMismatch fatal error.
Pass-govs Validation
auth_method: 2. Pass-govs uses the same endpoint as pass-invoices — the CNPJ determines which flow applies (MEI entities).
Test scenarios
| Password (senha) | HTTP | Response |
|---|---|---|
| Any non-error value | 200 | {valido: true, cnpj: "00000000000000"} |
wrong_password | 200 | {valido: false, codigo_erro: "CREDENCIAIS_INVALIDAS"} |
rate_limited | 408 | {valido: false, codigo_erro: "TIMEOUT"} |
portal_unavailable | 503 | {valido: false, codigo_erro: "TIMEOUT"} |
Error Codes Reference
| Error code | Description | HTTP | Trigger password |
|---|---|---|---|
CREDENCIAIS_INVALIDAS | Invalid credentials or blocked user | 200 | wrong_password |
CERTIFICADO_SENHA_INVALIDA | Wrong certificate password | 200 | certificate_expired |
CERTIFICADO_NAO_RECONHECIDO | Certificate not recognized by server | 200 | certificate_not_found |
TIMEOUT | Portal timeout or unavailable | 408/503 | rate_limited / portal_unavailable |