curl -X POST "https://verification.didit.me/v3/database-validation/" \
-H "x-api-key: YOUR_API_KEY" \
-F "issuing_state=BRA" \
-F "services=bra_cnh_facial_qrcode" \
-F "vendor_data=user-1234" \
-F "consent=true" \
-F "tax_number=11111111111" \
-F "selfie=@./selfie.jpg" \
-F "cnh_qr_code_image=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAB"
{
"request_id": "req_01H…",
"status": "Approved",
"issuing_state": "BRA",
"match_type": "full_match",
"validations": [
{
"outcome_code": "MATCH",
"service_id": "bra_cnh_facial_qrcode",
"service_name": "Brazil - CNH QR code + face match (Datavalid)",
"source_data": {
"cnh_qrcode": "sample_value",
"date_of_birth": "1990-01-01",
"face_match_probability": "Altíssima probabilidade",
"face_match_score": "0.990",
"first_name": "John",
"identification_number": "SAMPLE-ID-12345",
"last_name": "Doe",
"name_match_score": "1.000",
"verifications": {
"identification_number": true
}
},
"validation": {
"identification_number": "full_match"
}
}
]
}
{
"request_id": "req_01H…",
"status": "Declined",
"issuing_state": "BRA",
"match_type": "no_match",
"validations": [
{
"outcome_code": "NO_MATCH",
"service_id": "bra_cnh_facial_qrcode",
"service_name": "Brazil - CNH QR code + face match (Datavalid)",
"source_data": {
"identification_number": "NO_MATCH"
},
"validation": {
"identification_number": "no_match"
}
}
]
}
{
"request_id": "req_01H…",
"status": "Declined",
"issuing_state": "BRA",
"match_type": "no_match",
"validations": [
{
"outcome_code": "BIOMETRIC_NO_MATCH",
"service_id": "bra_cnh_facial_qrcode",
"service_name": "Brazil - CNH QR code + face match (Datavalid)",
"source_data": {
"identification_number": "NO_MATCH"
},
"validation": {
"identification_number": "no_match"
}
}
]
}
{
"request_id": "req_01H…",
"status": "In Review",
"issuing_state": "BRA",
"match_type": "no_match",
"validations": [
{
"outcome_code": "BIOMETRIC_IMAGE_UNUSABLE",
"service_id": "bra_cnh_facial_qrcode",
"service_name": "Brazil - CNH QR code + face match (Datavalid)",
"source_data": {
"identification_number": "NO_MATCH"
},
"validation": {
"identification_number": "no_match"
}
}
]
}
🇧🇷 Brasil
CNH QR code + correspondência facial (Datavalid) Brasil
Validação de base de dados no Brasil via Didit: consulta à CNH por QR code e correspondência facial. Desde $0.62/chamada, sem contratos nem mínimos.
POST
/
v3
/
database-validation
/
curl -X POST "https://verification.didit.me/v3/database-validation/" \
-H "x-api-key: YOUR_API_KEY" \
-F "issuing_state=BRA" \
-F "services=bra_cnh_facial_qrcode" \
-F "vendor_data=user-1234" \
-F "consent=true" \
-F "tax_number=11111111111" \
-F "selfie=@./selfie.jpg" \
-F "cnh_qr_code_image=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAB"
{
"request_id": "req_01H…",
"status": "Approved",
"issuing_state": "BRA",
"match_type": "full_match",
"validations": [
{
"outcome_code": "MATCH",
"service_id": "bra_cnh_facial_qrcode",
"service_name": "Brazil - CNH QR code + face match (Datavalid)",
"source_data": {
"cnh_qrcode": "sample_value",
"date_of_birth": "1990-01-01",
"face_match_probability": "Altíssima probabilidade",
"face_match_score": "0.990",
"first_name": "John",
"identification_number": "SAMPLE-ID-12345",
"last_name": "Doe",
"name_match_score": "1.000",
"verifications": {
"identification_number": true
}
},
"validation": {
"identification_number": "full_match"
}
}
]
}
{
"request_id": "req_01H…",
"status": "Declined",
"issuing_state": "BRA",
"match_type": "no_match",
"validations": [
{
"outcome_code": "NO_MATCH",
"service_id": "bra_cnh_facial_qrcode",
"service_name": "Brazil - CNH QR code + face match (Datavalid)",
"source_data": {
"identification_number": "NO_MATCH"
},
"validation": {
"identification_number": "no_match"
}
}
]
}
{
"request_id": "req_01H…",
"status": "Declined",
"issuing_state": "BRA",
"match_type": "no_match",
"validations": [
{
"outcome_code": "BIOMETRIC_NO_MATCH",
"service_id": "bra_cnh_facial_qrcode",
"service_name": "Brazil - CNH QR code + face match (Datavalid)",
"source_data": {
"identification_number": "NO_MATCH"
},
"validation": {
"identification_number": "no_match"
}
}
]
}
{
"request_id": "req_01H…",
"status": "In Review",
"issuing_state": "BRA",
"match_type": "no_match",
"validations": [
{
"outcome_code": "BIOMETRIC_IMAGE_UNUSABLE",
"service_id": "bra_cnh_facial_qrcode",
"service_name": "Brazil - CNH QR code + face match (Datavalid)",
"source_data": {
"identification_number": "NO_MATCH"
},
"validation": {
"identification_number": "no_match"
}
}
]
}
SERPRO Datavalid v4 pf-facial-qrcode — descodifica o código QR impresso nas cartas de condução brasileiras (CNH, físicas ou digitais, emitidas desde maio de 2017), valida o CPF, o nome e a data de nascimento junto da Receita Federal e compara a selfie em tempo real com o retrato da CNH armazenado na Senatran. A Didit disponibiliza este serviço através de
POST /v3/database-validation/ para que possa verificar os dados submetidos contra a fonte oficial e receber resultados de correspondência normalizados. Formato de entrada: tax_number aceita o CPF brasileiro (exatamente 11 dígitos).
Cobertura
- Cobertura: —
- País: Brasil
- ID do serviço:
bra_cnh_facial_qrcode - Domínio de dados: Biométrico
- Categoria: DriverLicence
Entradas
| Campo | Obrigatório | Exemplo |
|---|---|---|
tax_number | Sim | 11111111111 |
selfie | Sim | @./selfie.jpg |
cnh_qr_code_image | Sim | data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAB |
first_name | Não | John |
last_name | Não | Doe |
date_of_birth | Não | 1990-01-01 |
vendor_data | Não | user-1234 |
- Entradas obrigatórias:
tax_number,selfie,cnh_qr_code_image - Entradas opcionais:
first_name,last_name,date_of_birth,vendor_data - Consentimento: Obrigatório
- Disponibilidade no fluxo: Disponível no fluxo
- Cobertura: —
- Preço: $0.62 por consulta bem-sucedida
Parâmetros do corpo
string
padrão:"BRA"
obrigatório
Código de país ISO 3166-1 alpha-3 para este serviço de base de dados.Exemplo:
BRAstring
padrão:"bra_cnh_facial_qrcode"
obrigatório
Array que contém o ID deste serviço. Fixar o serviço mantém o pedido limitado a esta base de dados exata.Exemplo:
bra_cnh_facial_qrcodeboolean
padrão:"true"
obrigatório
Consentimento explícito do utilizador final para este serviço.Exemplo:
truestring
padrão:"11111111111"
obrigatório
Número de identificação fiscal.Exemplo:
11111111111file
obrigatório
Ficheiro de imagem de selfie a carregar para a validação biométrica de base de dados. Formatos aceites: JPEG, PNG ou WebP.Exemplo:
@./selfie.jpgstring
obrigatório
Valor de
cnh_qr_code_image exigido por este serviço de base de dados.Exemplo: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABstring
Nome próprio a validar.Exemplo:
Johnstring
Apelido a validar.Exemplo:
Doestring
Data de nascimento no formato
YYYY-MM-DD.Exemplo: 1990-01-01string
padrão:"user-1234"
A sua referência estável de utilizador para esta pessoa, como o ID interno de utilizador. A Didit usa-a para associar verificações avulsas ao mesmo utilizador final e reduzir o ruído na deteção de duplicados.Exemplo:
user-1234Regras de entrada e notas de validação
- CPF brasileiro (exatamente 11 dígitos)
tax_numberdeve conter apenas dígitos; remova espaços, hífens e pontuação antes de enviar o pedido.tax_numberdeve ter exatamente 11 caracteres.
Como chamar
curl -X POST "https://verification.didit.me/v3/database-validation/" \
-H "x-api-key: YOUR_API_KEY" \
-F "issuing_state=BRA" \
-F "services=bra_cnh_facial_qrcode" \
-F "vendor_data=user-1234" \
-F "consent=true" \
-F "tax_number=11111111111" \
-F "selfie=@./selfie.jpg" \
-F "cnh_qr_code_image=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAB"
Cada chamada bem-sucedida devolve HTTP 200. O campo outcome_code indica o que realmente aconteceu — distinguindo, por exemplo, uma verdadeira falta de correspondência biométrica (BIOMETRIC_NO_MATCH) de uma selfie que não pôde ser lida (BIOMETRIC_IMAGE_UNUSABLE). O status apresentado é o estado predefinido da funcionalidade; as ações de correspondência parcial / sem correspondência que tiver configuradas podem substituí-lo.MATCH — O registo confirmou a identidade e todos os campos verificados corresponderam.{
"request_id": "req_01H…",
"status": "Approved",
"issuing_state": "BRA",
"match_type": "full_match",
"validations": [
{
"outcome_code": "MATCH",
"service_id": "bra_cnh_facial_qrcode",
"service_name": "Brazil - CNH QR code + face match (Datavalid)",
"source_data": {
"cnh_qrcode": "sample_value",
"date_of_birth": "1990-01-01",
"face_match_probability": "Altíssima probabilidade",
"face_match_score": "0.990",
"first_name": "John",
"identification_number": "SAMPLE-ID-12345",
"last_name": "Doe",
"name_match_score": "1.000",
"verifications": {
"identification_number": true
}
},
"validation": {
"identification_number": "full_match"
}
}
]
}
NO_MATCH — O registo não devolveu qualquer correspondência para os dados submetidos.{
"request_id": "req_01H…",
"status": "Declined",
"issuing_state": "BRA",
"match_type": "no_match",
"validations": [
{
"outcome_code": "NO_MATCH",
"service_id": "bra_cnh_facial_qrcode",
"service_name": "Brazil - CNH QR code + face match (Datavalid)",
"source_data": {
"identification_number": "NO_MATCH"
},
"validation": {
"identification_number": "no_match"
}
}
]
}
BIOMETRIC_NO_MATCH — A pontuação de correspondência facial ficou abaixo do limiar de aceitação - a selfie não é da mesma pessoa que a fotografia do registo.{
"request_id": "req_01H…",
"status": "Declined",
"issuing_state": "BRA",
"match_type": "no_match",
"validations": [
{
"outcome_code": "BIOMETRIC_NO_MATCH",
"service_id": "bra_cnh_facial_qrcode",
"service_name": "Brazil - CNH QR code + face match (Datavalid)",
"source_data": {
"identification_number": "NO_MATCH"
},
"validation": {
"identification_number": "no_match"
}
}
]
}
BIOMETRIC_IMAGE_UNUSABLE — A selfie não pôde ser processada (vazia, sem rosto, de baixa qualidade ou que o registo não conseguiu ler). Peça ao utilizador que volte a tirar a selfie.{
"request_id": "req_01H…",
"status": "In Review",
"issuing_state": "BRA",
"match_type": "no_match",
"validations": [
{
"outcome_code": "BIOMETRIC_IMAGE_UNUSABLE",
"service_id": "bra_cnh_facial_qrcode",
"service_name": "Brazil - CNH QR code + face match (Datavalid)",
"source_data": {
"identification_number": "NO_MATCH"
},
"validation": {
"identification_number": "no_match"
}
}
]
}
Dados devolvidos
Os campos exatos apresentados emsource_data dependem do que o registo devolver. O exemplo gerado para bra_cnh_facial_qrcode documenta atualmente esta estrutura normalizada:
cnh_qrcodedate_of_birthface_match_probabilityface_match_scorefirst_nameidentification_numberlast_namename_match_score
Preços e SLAs
Brasil – código QR da CNH + correspondência facial (Datavalid): as consultas só são faturadas quando a Didit recebe um resultado conclusivo da fonte de validação.- Preço por chamada: $0.62 USD.
- Faturação: por consulta bem-sucedida. Não lhe é cobrado qualquer valor quando o registo está inacessível, quando faltam campos obrigatórios ou quando o pedido é rejeitado antes de chegar à fonte.
- Latência: p95 típico < 2 s.
- Disponibilidade: 99.9% por trimestre do lado da Didit; a disponibilidade da fonte de dados a jusante varia consoante o país e o conjunto de dados.
Continuar a ler
Última modificação em 7 de novembro de 2026