> ## Documentation Index
> Fetch the complete documentation index at: https://docs.didit.me/llms.txt
> Use this file to discover all available pages before exploring further.

# API de DPI + coincidencia facial en Guatemala (RENAP)

> Validación DPI + coincidencia facial en RENAP (Guatemala) con Didit. Pago por consulta desde $0.40, sin contratos ni mínimos.

Verifica un CUI guatemalteco en el registro nacional (RENAP) y compara la selfie del solicitante con la fotografía oficial del RENAP, además de contrastar los nombres y la fecha de nacimiento del titular con el registro. Didit ofrece este servicio a través de `POST /v3/database-validation/` para que verifiques los datos enviados con la fuente oficial y recibas resultados de coincidencia normalizados.

## Cobertura

* **Cobertura:** \~ 100%
* **País:** Guatemala
* **ID de servicio:** `gtm_dpi_facial`
* **Dominio de datos:** Biométrico
* **Categoría:** NationalIDRegistry

## Datos de entrada

| Campo | Obligatorio | Ejemplo |
| - | -: | - |
| `document_number` | Sí | `1234567890101` |
| `selfie` | Sí | `@./selfie.jpg` |
| `first_name` | No | `John` |
| `last_name` | No | `Doe` |
| `date_of_birth` | No | `1990-01-01` |
| `vendor_data` | No | `user-1234` |

* **Datos obligatorios:** `document_number`, `selfie`
* **Datos opcionales:** `first_name`, `last_name`, `date_of_birth`, `vendor_data`
* **Consentimiento:** Obligatorio
* **Disponibilidad en el workflow:** Disponible en el workflow
* **Cobertura:** \~ 100%
* **Precio:** \$0.40 por consulta exitosa

## Parámetros del cuerpo

**issuing\_state** `string` *required* (default: GTM)

Código de país ISO 3166-1 alfa-3 de este servicio de base de datos.

Ejemplo: `GTM`

**services** `string` *required* (default: gtm\_dpi\_facial)

Array que contiene este ID de servicio. Fijar el servicio limita la solicitud a esta base de datos exacta.

Ejemplo: `gtm_dpi_facial`

**consent** `boolean` *required* (default: true)

Consentimiento explícito del usuario final para este servicio.

Ejemplo: `true`

**document\_number** `string` *required* (default: 1234567890101)

Número de documento extraído o proporcionado por el usuario.

Ejemplo: `1234567890101`

**selfie** `file` *required*

Archivo de imagen de la selfie que se sube para la validación biométrica en la base de datos. Formatos aceptados: JPEG, PNG o WebP.

Ejemplo: `@./selfie.jpg`

**first\_name** `string` (default: John)

Nombre de pila que se valida.

Ejemplo: `John`

**last\_name** `string` (default: Doe)

Apellido que se valida.

Ejemplo: `Doe`

**date\_of\_birth** `string` (default: 1990-01-01)

Fecha de nacimiento en formato `YYYY-MM-DD`.

Ejemplo: `1990-01-01`

**vendor\_data** `string` (default: user-1234)

Tu referencia de usuario estable para esta persona, como tu ID interno de usuario. Didit la usa para vincular las comprobaciones independientes al mismo usuario final y reducir el ruido en la detección de duplicados.

Ejemplo: `user-1234`

## Reglas de entrada y notas de validación

* DPI guatemalteco (exactamente 13 dígitos)
* `document_number` solo debe contener dígitos; elimina los espacios, guiones y signos de puntuación antes de enviar la solicitud.
* `document_number` debe tener exactamente 13 caracteres.
* `document_number` debe coincidir con `\d{13}`.

## Cómo invocarlo

```bash cURL theme={null}
curl -X POST "https://verification.didit.me/v3/database-validation/" \
  -H "x-api-key: YOUR_API_KEY" \
  -F "issuing_state=GTM" \
  -F "services=gtm_dpi_facial" \
  -F "vendor_data=user-1234" \
  -F "consent=true" \
  -F "document_number=1234567890101" \
  -F "selfie=@./selfie.jpg" \
  -F "first_name=John" \
  -F "last_name=Doe" \
  -F "date_of_birth=1990-01-01"
```

```python Python theme={null}
from didit import Didit

# Reads DIDIT_API_KEY.
client = Didit()

result = client.database_validation.validate(
    issuing_state="GTM",
    services=["gtm_dpi_facial"],
    consent=True,
    first_name="John",
    last_name="Doe",
    date_of_birth="1990-01-01",
    document_number="1234567890101",
    vendor_data="user-1234",
    selfie=open("selfie.jpg", "rb"),
)
print(result)
```

```javascript Node.js theme={null}
import Didit, { fileFromPath } from "@didit-protocol/sdk-node";

// Reads DIDIT_API_KEY.
const didit = new Didit();

const result = await didit.databaseValidation.validate({
  issuing_state: "GTM",
  services: ["gtm_dpi_facial"],
  consent: true,
  first_name: "John",
  last_name: "Doe",
  date_of_birth: "1990-01-01",
  document_number: "1234567890101",
  vendor_data: "user-1234",
  selfie: await fileFromPath("selfie.jpg"),
});
console.log(result);
```

```go Go theme={null}
ctx := context.Background()
// Reads DIDIT_API_KEY.
client := didit.NewClient()

result, err := client.DatabaseValidation.Validate(ctx, didit.DatabaseValidationValidateParams{
	IssuingState:   "GTM",
	Services:       didit.Some([]string{"gtm_dpi_facial"}),
	Consent:        didit.Bool(true),
	FirstName:      didit.String("John"),
	LastName:       didit.String("Doe"),
	DateOfBirth:    didit.String("1990-01-01"),
	DocumentNumber: didit.String("1234567890101"),
	VendorData:     didit.String("user-1234"),
	Selfie:         didit.Some(didit.FileFromPath("selfie.jpg")),
})
if err != nil {
	log.Fatal(err)
}
fmt.Printf("%+v\n", result)
```

```java Java theme={null}
import java.nio.file.Path;
import java.time.LocalDate;
import java.util.List;
import me.didit.Didit;
import me.didit.types.DatabaseValidationValidateParams;

// Reads DIDIT_API_KEY.
Didit client = new Didit();

var result = client.databaseValidation().validate(DatabaseValidationValidateParams.builder()
        .issuingState("GTM")
        .services(List.of("gtm_dpi_facial"))
        .consent(true)
        .firstName("John")
        .lastName("Doe")
        .dateOfBirth(LocalDate.parse("1990-01-01"))
        .documentNumber("1234567890101")
        .vendorData("user-1234")
        .selfie(Path.of("selfie.jpg"))
        .build());
System.out.println(result);
```

```php PHP theme={null}
<?php

require 'vendor/autoload.php';

use Didit\DiditClient;
use Didit\File;

// Reads DIDIT_API_KEY.
$didit = new DiditClient();

$result = $didit->databaseValidation->validate([
    'issuing_state' => 'GTM',
    'services' => ['gtm_dpi_facial'],
    'consent' => true,
    'first_name' => 'John',
    'last_name' => 'Doe',
    'date_of_birth' => '1990-01-01',
    'document_number' => '1234567890101',
    'vendor_data' => 'user-1234',
    'selfie' => File::fromPath('selfie.jpg'),
]);
print_r($result->toArray());
```

```ruby Ruby theme={null}
require "didit"

# Reads DIDIT_API_KEY.
didit = Didit::Client.new

result = didit.database_validation.validate(
  issuing_state: "GTM",
  services: ["gtm_dpi_facial"],
  consent: true,
  first_name: "John",
  last_name: "Doe",
  date_of_birth: "1990-01-01",
  document_number: "1234567890101",
  vendor_data: "user-1234",
  selfie: Pathname("selfie.jpg")
)
puts result.to_h
```

```csharp .NET theme={null}
using System;
using System.Text.Json;
using Didit;

// Reads DIDIT_API_KEY.
using var client = new DiditClient();

var result = await client.DatabaseValidation.ValidateAsync(new DatabaseValidationValidateParams
{
    IssuingState = "GTM",
    Services = new string[] { "gtm_dpi_facial" },
    Consent = true,
    FirstName = "John",
    LastName = "Doe",
    DateOfBirth = "1990-01-01",
    DocumentNumber = "1234567890101",
    VendorData = "user-1234",
    Selfie = FileUpload.FromPath("selfie.jpg"),
});
Console.WriteLine(JsonSerializer.Serialize(result));
```

Toda llamada exitosa devuelve HTTP `200`. El campo **`outcome_code`** indica lo que ocurrió realmente; por ejemplo, distingue una falta real de coincidencia biométrica (`BIOMETRIC_NO_MATCH`) de una selfie que no se pudo leer (`BIOMETRIC_IMAGE_UNUSABLE`). El `status` que se muestra es el estado predeterminado de la función; las [acciones de coincidencia parcial / sin coincidencia](https://docs.didit.me/es/core-technology/database-validation/database-validation-warnings.md) que hayas configurado pueden sobrescribirlo.

**`MATCH`**: el registro confirmó la identidad y todos los campos comprobados coincidieron.

```json 200 OK — MATCH theme={null}
{
  "request_id": "req_01H…",
  "status": "Approved",
  "issuing_state": "GTM",
  "match_type": "full_match",
  "validations": [
    {
      "outcome_code": "MATCH",
      "service_id": "gtm_dpi_facial",
      "service_name": "Guatemala - DPI + face match (RENAP)",
      "source_data": {
        "date_of_birth": "1990-01-01",
        "document_expiration_date": "2031-11-24",
        "face_match": true,
        "face_match_score": 98.5,
        "first_name": "JOHN",
        "full_name": "JOHN DOE",
        "gender": "M",
        "identification_number": "1234567890101",
        "last_name": "DOE"
      },
      "validation": {
        "date_of_birth": "full_match",
        "full_name": "full_match",
        "identification_number": "full_match"
      }
    }
  ]
}
```

**`PARTIAL_MATCH`**: se encontró el número de identificación, pero uno o más campos personales (normalmente el nombre o la fecha de nacimiento) no coincidieron por completo.

```json 200 OK — PARTIAL_MATCH theme={null}
{
  "request_id": "req_01H…",
  "status": "In Review",
  "issuing_state": "GTM",
  "match_type": "partial_match",
  "validations": [
    {
      "outcome_code": "PARTIAL_MATCH",
      "service_id": "gtm_dpi_facial",
      "service_name": "Guatemala - DPI + face match (RENAP)",
      "source_data": {
        "date_of_birth": "1990-01-01",
        "document_expiration_date": "2031-11-24",
        "face_match": true,
        "face_match_score": 98.5,
        "first_name": "JOHN",
        "full_name": "JOHN DOE",
        "gender": "M",
        "identification_number": "1234567890101",
        "last_name": "DOE"
      },
      "validation": {
        "date_of_birth": "full_match",
        "full_name": "no_match",
        "identification_number": "full_match"
      }
    }
  ]
}
```

**`NO_MATCH`**: el registro no devolvió ninguna coincidencia para los datos enviados.

```json 200 OK — NO_MATCH theme={null}
{
  "request_id": "req_01H…",
  "status": "Declined",
  "issuing_state": "GTM",
  "match_type": "no_match",
  "validations": [
    {
      "outcome_code": "NO_MATCH",
      "service_id": "gtm_dpi_facial",
      "service_name": "Guatemala - DPI + face match (RENAP)",
      "source_data": {
        "date_of_birth": "NO_MATCH",
        "full_name": "NO_MATCH",
        "identification_number": "NO_MATCH"
      },
      "validation": {
        "date_of_birth": "no_match",
        "full_name": "no_match",
        "identification_number": "no_match"
      }
    }
  ]
}
```

**`BIOMETRIC_NO_MATCH`**: la puntuación de coincidencia facial quedó por debajo del umbral de aceptación; la persona de la selfie no es la misma que la de la fotografía del registro.

```json 200 OK — BIOMETRIC_NO_MATCH theme={null}
{
  "request_id": "req_01H…",
  "status": "Declined",
  "issuing_state": "GTM",
  "match_type": "no_match",
  "validations": [
    {
      "outcome_code": "BIOMETRIC_NO_MATCH",
      "service_id": "gtm_dpi_facial",
      "service_name": "Guatemala - DPI + face match (RENAP)",
      "source_data": {
        "date_of_birth": "NO_MATCH",
        "face_match": false,
        "face_match_score": 0,
        "first_name": "NO_MATCH",
        "identification_number": "NO_MATCH",
        "last_name": "NO_MATCH"
      },
      "validation": {
        "date_of_birth": "no_match",
        "full_name": "no_match",
        "identification_number": "no_match"
      }
    }
  ]
}
```

**`DOCUMENT_NOT_FOUND`**: el número de documento enviado no corresponde a ningún registro.

```json 200 OK — DOCUMENT_NOT_FOUND theme={null}
{
  "request_id": "req_01H…",
  "status": "Declined",
  "issuing_state": "GTM",
  "match_type": "no_match",
  "validations": [
    {
      "outcome_code": "DOCUMENT_NOT_FOUND",
      "service_id": "gtm_dpi_facial",
      "service_name": "Guatemala - DPI + face match (RENAP)",
      "source_data": {
        "date_of_birth": "NO_MATCH",
        "full_name": "NO_MATCH",
        "identification_number": "NO_MATCH"
      },
      "validation": {
        "date_of_birth": "no_match",
        "full_name": "no_match",
        "identification_number": "no_match"
      }
    }
  ]
}
```

**`DECEASED`**: la identidad coincidió, pero el registro marca a la persona como fallecida.

```json 200 OK — DECEASED theme={null}
{
  "request_id": "req_01H…",
  "status": "In Review",
  "issuing_state": "GTM",
  "match_type": "full_match",
  "validations": [
    {
      "outcome_code": "DECEASED",
      "service_id": "gtm_dpi_facial",
      "service_name": "Guatemala - DPI + face match (RENAP)",
      "source_data": {
        "date_of_birth": "1990-01-01",
        "document_expiration_date": "2031-11-24",
        "face_match": true,
        "face_match_score": 98.5,
        "first_name": "JOHN",
        "full_name": "JOHN DOE",
        "gender": "M",
        "identification_number": "1234567890101",
        "last_name": "DOE"
      },
      "validation": {
        "date_of_birth": "full_match",
        "full_name": "full_match",
        "identification_number": "full_match"
      }
    }
  ]
}
```

## Datos devueltos

Los campos exactos que aparecen en `source_data` dependen de lo que devuelva el registro. El ejemplo generado para `gtm_dpi_facial` documenta actualmente esta estructura normalizada:

* `date_of_birth`
* `document_expiration_date`
* `face_match`
* `face_match_score`
* `first_name`
* `full_name`
* `gender`
* `identification_number`
* `last_name`

## Precios y SLA

Las consultas de Guatemala - DPI + coincidencia facial (RENAP) solo se facturan cuando Didit recibe un resultado concluyente de la fuente de validación.

* **Precio por llamada:** \$0.40 USD.
* **Facturación:** por consulta exitosa. No se te cobra cuando no se puede acceder al registro, cuando faltan campos obligatorios o cuando la solicitud se rechaza antes de llegar a la fuente.
* **Latencia:** p95 habitual \< 2 s.
* **Disponibilidad:** 99.9% por trimestre por parte de Didit; la disponibilidad de la fuente externa varía según el país y el conjunto de datos.

## Continúa leyendo

* [Visión general de la Validación de base de datos en Guatemala](https://docs.didit.me/api-reference/database-validation/guatemala.md)
* [Visión general de la Validación de base de datos](https://docs.didit.me/es/core-technology/database-validation/overview.md)
* [Códigos de resultado](https://docs.didit.me/es/core-technology/database-validation/database-validation-outcome-codes.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.