Costa Rica Electronic Invoice Key Generator (Clave de Factura)
Generate valid 50-digit Costa Rican electronic invoice numerical keys (Clave Numérica) for DGT Hacienda compliance.
Waiting for generation...
About Costa Rica Electronic Invoice Key (Clave Numérica)
The 50-digit numerical key (Clave Numérica del Comprobante Electrónico) is the mandatory unique identifier used in Costa Rica's electronic invoicing system regulated by the Dirección General de Tributación (DGT) / Ministerio de Hacienda.
It encapsulates critical transactional data: country code (506), emission date (DDMMAA), 12-digit zero-padded emitter tax ID, 20-digit consecutive number (branch, POS terminal, document type code, and sequential count), 1-digit document situation, and an 8-digit security code.
Anatomy & Structure of the 50-Digit Key
Sequential segments of the Costa Rican e-invoicing key:
| Position | Field | Length | Regulatory Meaning | Example |
|---|---|---|---|---|
| Digits 1 to 3 | Country Code | 3 digits | Costa Rica numeric ISO code (fixed at '506'). | 506 |
| Digits 4 to 9 | Emission Date | 6 digits | Date formatted as DDMMAA (Day, Month, Year). | 290924 |
| Digits 10 to 21 | Emitter ID | 12 digits | Tax ID zero-padded to 12 positions. | 003101123456 |
| Digits 22 to 41 | Consecutive Number | 20 digits | Branch (3), POS Terminal (5), Doc Type (2), and Sequential (10). | 00100001010000000001 |
| Digit 42 | Document Situation | 1 digit | 1 = Normal, 2 = Contingency, 3 = Offline. | 1 |
| Digits 43 to 50 | Security Code | 8 digits | Random 8-digit numeric integrity code. | 12345678 |
Structural Integrity Specifications
Rules mandated by DGT-R-48-2016 resolution:
Total Length = 50 decimal digits
- 1. Country Prefix: Must strictly begin with '506'.
- 2. Date Validation: Day (01-31), Month (01-12), and 2-digit year.
- 3. Emitter Tax ID: 12 numeric digits, non-zero.
- 4. Consecutive Number: Valid branch, terminal, accepted document type, and non-zero sequential.
- 5. Situation: Digit 42 must be 1, 2, or 3.
- 6. Security Code: 8 non-zero digits.
Frequently Asked Questions (FAQ)
What document types are supported in Costa Rica's e-invoicing?
Standard DGT document type codes include 01 (Factura Electrónica), 02 (Nota de Débito), 03 (Nota de Crédito), 04 (Tiquete Electrónico), 08 (Purchase Invoice), and 09 (Export Invoice).
What does the situation code represent?
The situation code denotes the connectivity status during emission: 1 for Normal, 2 for Contingency mode, and 3 for Offline (sin internet).