📅 Date of Birth Check
The Date of Birth (DOB) Check report validates a provided date of birth against the date of birth retrieved from official government databases for a given document ID. This report is essential for identity verification and age validation.
Overview
Section titled “Overview”DOB Check performs precise date matching between user-provided birth dates and official registry data. It supports various date formats and provides detailed validation results for compliance and verification purposes.
Input Requirements
Section titled “Input Requirements”Required Fields
Section titled “Required Fields”Field | Type | Description | Example |
---|---|---|---|
document_id | string | National ID (CURP for Mexico, CPF for Brazil, etc.) | ABCD123456EFGHIJ78 |
date_of_birth | string | Date of birth to validate (YYYY-MM-DD) | 1990-01-15 |
Optional Fields
Section titled “Optional Fields”Field | Type | Description | Default |
---|---|---|---|
report_settings | object | Configuration options for date validation | {} |
Data Sources by Country
Section titled “Data Sources by Country”Country | Source | Registry | Date Format | Coverage |
---|---|---|---|---|
Mexico | RENAPO | Registro Nacional de Población | DD-MM-YYYY | All citizens and residents |
Brazil | SRF | Secretaria da Receita Federal | DD/MM/YYYY | All CPF holders |
Chile | SII | Servicio de Impuestos Internos | DD-MM-YYYY | All RUN holders |
Colombia | RNEC | Registro Nacional del Estado Civil | DD/MM/YYYY | All citizens |
Costa Rica | TSE | Tribunal Supremo de Elecciones | DD/MM/YYYY | All citizens |
Output Schema
Section titled “Output Schema”Successful Match
Section titled “Successful Match”{ "dob_check": { "state": "COMPLETED", "created_at": "2021-03-30T03:18:33.021945", "updated_at": "2021-03-30T03:18:58.365633", "outcome": "PASSED", "details": { "provided_dob": "1990-01-15", "registry_dob": "15-01-1990", "normalized_provided": "1990-01-15", "normalized_registry": "1990-01-15", "match": true, "age_calculated": 34, "validation_method": "exact_match" } }}
Date Mismatch
Section titled “Date Mismatch”{ "dob_check": { "state": "COMPLETED", "created_at": "2021-03-30T03:18:33.021945", "updated_at": "2021-03-30T03:18:58.365633", "outcome": "FAILED", "details": { "provided_dob": "1990-01-15", "registry_dob": "15-02-1990", "normalized_provided": "1990-01-15", "normalized_registry": "1990-02-15", "match": false, "discrepancy": { "type": "day_month_mismatch", "provided_components": { "year": 1990, "month": 1, "day": 15 }, "registry_components": { "year": 1990, "month": 2, "day": 15 } }, "validation_method": "exact_match" } }}
Registry Error
Section titled “Registry Error”{ "dob_check": { "state": "COMPLETED", "created_at": "2021-03-30T03:18:33.021945", "updated_at": "2021-03-30T03:18:58.365633", "outcome": "FAILED", "details": { "provided_dob": "1990-01-15", "registry_dob": null, "error": "NO_DOB_IN_REGISTRY", "message": "Date of birth not found in registry for provided document ID" } }}
Configuration Options
Section titled “Configuration Options”Basic Configuration
Section titled “Basic Configuration”{ "report_settings": { "dob_check": { "strict_validation": true, "allow_future_dates": false } }}
Advanced Configuration
Section titled “Advanced Configuration”{ "report_settings": { "dob_check": { "strict_validation": false, "allow_future_dates": false, "tolerance_days": 0, "validate_age_range": { "min_age": 18, "max_age": 100 } } }}
Configuration Parameters
Section titled “Configuration Parameters”Parameter | Type | Description | Default | Range |
---|---|---|---|---|
strict_validation | boolean | Require exact date match | true | true/false |
allow_future_dates | boolean | Allow dates in the future | false | true/false |
tolerance_days | integer | Days tolerance for near matches | 0 | 0-365 |
validate_age_range | object | Age validation constraints | null | See below |
Age Range Validation
Section titled “Age Range Validation”{ "validate_age_range": { "min_age": 18, "max_age": 100, "reference_date": "2024-01-01" // Optional, defaults to current date }}
Validation Logic
Section titled “Validation Logic”Date Normalization
Section titled “Date Normalization”All dates are normalized to ISO 8601 format (YYYY-MM-DD) for comparison:
function normalizeDateFormat(dateString, sourceFormat) { // Convert various formats to YYYY-MM-DD const formats = { 'DD-MM-YYYY': /^(\d{2})-(\d{2})-(\d{4})$/, 'DD/MM/YYYY': /^(\d{2})\/(\d{2})\/(\d{4})$/, 'MM/DD/YYYY': /^(\d{2})\/(\d{2})\/(\d{4})$/, 'YYYY-MM-DD': /^(\d{4})-(\d{2})-(\d{2})$/ };
// Apply appropriate transformation based on detected format return normalizedDate;}
Validation Steps
Section titled “Validation Steps”- Format Detection: Identify input and registry date formats
- Normalization: Convert both dates to standard format
- Validation: Check for valid calendar dates
- Comparison: Perform exact or tolerance-based matching
- Age Calculation: Calculate current age if validation passes
Tolerance Matching
Section titled “Tolerance Matching”When tolerance_days > 0
, dates within the specified range are considered matches:
function isWithinTolerance(date1, date2, toleranceDays) { const diffMs = Math.abs(date1.getTime() - date2.getTime()); const diffDays = Math.ceil(diffMs / (1000 * 60 * 60 * 24)); return diffDays <= toleranceDays;}
Business Logic and Usage
Section titled “Business Logic and Usage”When to Use DOB Check
Section titled “When to Use DOB Check”- Age Verification: Confirm minimum age requirements
- Identity Verification: Validate provided personal information
- Compliance: Meet age-related regulatory requirements
- Fraud Prevention: Detect inconsistent personal data
Configuration Strategies
Section titled “Configuration Strategies”Strict Verification (Financial Services)
Section titled “Strict Verification (Financial Services)”{ "strict_validation": true, "allow_future_dates": false, "tolerance_days": 0, "validate_age_range": { "min_age": 18, "max_age": 100 }}
Use Case: Banking, insurance, high-security applications Rationale: Zero tolerance for date discrepancies
Flexible Verification (General Employment)
Section titled “Flexible Verification (General Employment)”{ "strict_validation": false, "tolerance_days": 1, "validate_age_range": { "min_age": 16, "max_age": 80 }}
Use Case: Employment screening, general verification Rationale: Account for minor data entry errors
Lenient Verification (Customer Onboarding)
Section titled “Lenient Verification (Customer Onboarding)”{ "strict_validation": false, "tolerance_days": 3, "allow_future_dates": false}
Use Case: E-commerce, low-risk applications Rationale: Maximize conversion while maintaining basic validation
Error Handling
Section titled “Error Handling”Common Issues
Section titled “Common Issues”Error Type | Description | Resolution |
---|---|---|
INVALID_DATE_FORMAT | Date format not recognized | Use YYYY-MM-DD format |
FUTURE_DATE_PROVIDED | Date is in the future | Verify date accuracy |
NO_DOB_IN_REGISTRY | No birth date found for document ID | Verify document ID validity |
AGE_OUT_OF_RANGE | Calculated age outside valid range | Check age constraints |
INVALID_CALENDAR_DATE | Date doesn’t exist (e.g., Feb 30) | Verify date components |
Best Practices
Section titled “Best Practices”- Input Validation: Validate date format before API submission
- Error Handling: Implement proper error handling for all failure types
- Age Logic: Consider business rules for age calculations
- Timezone Awareness: Account for timezone differences in age calculations
Country-Specific Considerations
Section titled “Country-Specific Considerations”Mexico (RENAPO)
Section titled “Mexico (RENAPO)”- Registry Format: DD-MM-YYYY
- Challenges: Some older records may have incomplete dates
- Recommendation: Use strict validation for recent registrations
Brazil (Receita Federal)
Section titled “Brazil (Receita Federal)”- Registry Format: DD/MM/YYYY
Chile (SII)
Section titled “Chile (SII)”- Registry Format: DD-MM-YYYY
- Challenges: Consistent format across all records
- Recommendation: Strict validation recommended
Colombia (RNEC)
Section titled “Colombia (RNEC)”- Registry Format: DD/MM/YYYY
- Challenges: Regional data quality differences
- Recommendation: Moderate tolerance settings
Costa Rica (TSE)
Section titled “Costa Rica (TSE)”- Registry Format: DD/MM/YYYY
- Challenges: High data quality standards
- Recommendation: Strict validation appropriate
API Integration
Section titled “API Integration”Create Person with DOB Check
Section titled “Create Person with DOB Check”curl -X POST "https://api.emptor.io/v3/mx/persons" \ -H "X-Api-Key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "document_id": "ABCD123456EFGHIJ78", "date_of_birth": "1990-01-15", "city_locode": "MX MEX", "pipeline": { "name": "basic_id_check" }, "report_settings": { "dob_check": { "strict_validation": true, "validate_age_range": { "min_age": 18, "max_age": 65 } } } }'
Get DOB Check Details
Section titled “Get DOB Check Details”curl -X GET "https://api.emptor.io/v3/mx/details/{person_id}/dob_check" \ -H "X-Api-Key: YOUR_API_KEY"
Age Calculation Examples
Section titled “Age Calculation Examples”Current Age Calculation
Section titled “Current Age Calculation”function calculateAge(birthDate, referenceDate = new Date()) { const birth = new Date(birthDate); const reference = new Date(referenceDate);
let age = reference.getFullYear() - birth.getFullYear(); const monthDiff = reference.getMonth() - birth.getMonth();
if (monthDiff < 0 || (monthDiff === 0 && reference.getDate() < birth.getDate())) { age--; }
return age;}
Age at Specific Date
Section titled “Age at Specific Date”// Calculate age at employment start dateconst employmentDate = "2024-06-01";const age = calculateAge("1990-01-15", employmentDate);// Returns: 34
Related API Endpoints
Section titled “Related API Endpoints”- Create Person - Initiate DOB verification
- Get Reports - Retrieve DOB check results
- Get Report Details - Detailed DOB check data
- Update Reports - Refresh DOB verification
Related Documentation
Section titled “Related Documentation”- CURP Validation - Mexico ID validation
- Name Check - Name validation
- Pipeline Selection Guide - Choosing verification strategies
- Legal Glossary - Legal terminology