CURP Validation Module

The CURP Validation module verifies a Mexican CURP (Clave Única de Registro de Población) — either by accepting the user's CURP and validating it server-side

📘

This guide is specific to Web SDK 2.0. If you are still using 1.x, you can find documentation here. We strongly recommend upgrading - contact your Incode Representative for upgrade information.

The CURP Validation module verifies a Mexican CURP (Clave Única de Registro de Población) — either by accepting the user's CURP and validating it server-side, or by generating one from the user's identity data when missing.

Follows the form-based pattern with three input variants (enter, confirm, generate). See the patterns page for the shared lifecycle.

Tag

<incode-curp-validation> is a standard Web Component. Importing the UI subpath registers the custom element; importing the CSS applies the module's styles.

import '@incodetech/web/curp-validation';
import '@incodetech/web/curp-validation/styles.css';

Properties

PropertyTypeRequiredDescription
configCurpValidationConfigConfiguration options
onFinish() => voidCalled when validation completes
onError(error: string) => voidCalled when an error occurs

Configuration

CurpValidationConfig extends FlowModuleConfig['CURP_VALIDATION'] with two manager-level options:

type CurpValidationConfig = FlowModuleConfig['CURP_VALIDATION'] & {
  maxRetries?: number; // Maximum validation retries before auto-advancing (default: 1)
  prefillFromOcr?: boolean; // Attempt OCR pre-fill on load (default: true)
};
OptionTypeRequiredDescription
maxRetriesnumberAuto-advance after this many failed validation attempts. Default 1.
prefillFromOcrbooleanPre-fill the CURP field from prior ID OCR data when available. Default true.

Plus the dashboard-driven fields from FlowModuleConfig['CURP_VALIDATION'].

State machine

CurpValidationState is a discriminated union over status:

StatusDescription
idleInitial state.
loadingLoading prior OCR data (when prefillFromOcr is true).
enterCurpUser enters their CURP.
verifyingBackend verifying the entered CURP.
confirmCurpBackend returned an OCR'd CURP candidate; user confirms or rejects.
generateCurpNo CURP available; user fills the generate form (name, DOB, gender, birth state).
generatingBackend generating a CURP from the form.
generateErrorGenerate failed; user can retry.
successCURP validated.
failureValidation failed (deceased status, mismatch, etc.).
finishedTerminal.
closedUser dismissed.

See also