Skip to content

📅 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.

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.

FieldTypeDescriptionExample
document_idstringNational ID (CURP for Mexico, CPF for Brazil, etc.)ABCD123456EFGHIJ78
date_of_birthstringDate of birth to validate (YYYY-MM-DD)1990-01-15
FieldTypeDescriptionDefault
report_settingsobjectConfiguration options for date validation{}
CountrySourceRegistryDate FormatCoverage
MexicoRENAPORegistro Nacional de PoblaciónDD-MM-YYYYAll citizens and residents
BrazilSRFSecretaria da Receita FederalDD/MM/YYYYAll CPF holders
ChileSIIServicio de Impuestos InternosDD-MM-YYYYAll RUN holders
ColombiaRNECRegistro Nacional del Estado CivilDD/MM/YYYYAll citizens
Costa RicaTSETribunal Supremo de EleccionesDD/MM/YYYYAll citizens
{
"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"
}
}
}
{
"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"
}
}
}
{
"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"
}
}
}
{
"report_settings": {
"dob_check": {
"strict_validation": true,
"allow_future_dates": false
}
}
}
{
"report_settings": {
"dob_check": {
"strict_validation": false,
"allow_future_dates": false,
"tolerance_days": 0,
"validate_age_range": {
"min_age": 18,
"max_age": 100
}
}
}
}
ParameterTypeDescriptionDefaultRange
strict_validationbooleanRequire exact date matchtruetrue/false
allow_future_datesbooleanAllow dates in the futurefalsetrue/false
tolerance_daysintegerDays tolerance for near matches00-365
validate_age_rangeobjectAge validation constraintsnullSee below
{
"validate_age_range": {
"min_age": 18,
"max_age": 100,
"reference_date": "2024-01-01" // Optional, defaults to current date
}
}

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;
}
  1. Format Detection: Identify input and registry date formats
  2. Normalization: Convert both dates to standard format
  3. Validation: Check for valid calendar dates
  4. Comparison: Perform exact or tolerance-based matching
  5. Age Calculation: Calculate current age if validation passes

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;
}
  • Age Verification: Confirm minimum age requirements
  • Identity Verification: Validate provided personal information
  • Compliance: Meet age-related regulatory requirements
  • Fraud Prevention: Detect inconsistent personal data
{
"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 TypeDescriptionResolution
INVALID_DATE_FORMATDate format not recognizedUse YYYY-MM-DD format
FUTURE_DATE_PROVIDEDDate is in the futureVerify date accuracy
NO_DOB_IN_REGISTRYNo birth date found for document IDVerify document ID validity
AGE_OUT_OF_RANGECalculated age outside valid rangeCheck age constraints
INVALID_CALENDAR_DATEDate doesn’t exist (e.g., Feb 30)Verify date components
  • 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
  • Registry Format: DD-MM-YYYY
  • Challenges: Some older records may have incomplete dates
  • Recommendation: Use strict validation for recent registrations
  • Registry Format: DD/MM/YYYY
  • Registry Format: DD-MM-YYYY
  • Challenges: Consistent format across all records
  • Recommendation: Strict validation recommended
  • Registry Format: DD/MM/YYYY
  • Challenges: Regional data quality differences
  • Recommendation: Moderate tolerance settings
  • Registry Format: DD/MM/YYYY
  • Challenges: High data quality standards
  • Recommendation: Strict validation appropriate
Terminal window
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
}
}
}
}'
Terminal window
curl -X GET "https://api.emptor.io/v3/mx/details/{person_id}/dob_check" \
-H "X-Api-Key: YOUR_API_KEY"
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;
}
// Calculate age at employment start date
const employmentDate = "2024-06-01";
const age = calculateAge("1990-01-15", employmentDate);
// Returns: 34