Swagger UI openapi.json openapi.yaml
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

FieldValues
auth_method1 = Certificate, 2 = Pass-invoices / Pass-govs
cnpjAny test CNPJ (e.g. 12345678000195)
senhaSee scenario tables below

Certificate Validation

auth_method: 1. Validates the digital certificate password and expiry.

Test scenarios

Password (senha)HTTPResponse
Any non-error value200{valido: true}
wrong_password200{valido: false, codigo_erro: "CREDENCIAIS_INVALIDAS"}
certificate_expired200{valido: false, codigo_erro: "CERTIFICADO_SENHA_INVALIDA"}
certificate_not_found200{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)HTTPResponse
Any non-error value200{valido: true, cnpj: "00000000000000"}
wrong_password200{valido: false, codigo_erro: "CREDENCIAIS_INVALIDAS"}
rate_limited408{valido: false, codigo_erro: "TIMEOUT"}
portal_unavailable503{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)HTTPResponse
Any non-error value200{valido: true, cnpj: "00000000000000"}
wrong_password200{valido: false, codigo_erro: "CREDENCIAIS_INVALIDAS"}
rate_limited408{valido: false, codigo_erro: "TIMEOUT"}
portal_unavailable503{valido: false, codigo_erro: "TIMEOUT"}

Error Codes Reference

Error codeDescriptionHTTPTrigger password
CREDENCIAIS_INVALIDASInvalid credentials or blocked user200wrong_password
CERTIFICADO_SENHA_INVALIDAWrong certificate password200certificate_expired
CERTIFICADO_NAO_RECONHECIDOCertificate not recognized by server200certificate_not_found
TIMEOUTPortal timeout or unavailable408/503rate_limited / portal_unavailable