Skip to main content
Skip to main content

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:

PositionFieldLengthRegulatory MeaningExample
Digits 1 to 3Country Code3 digitsCosta Rica numeric ISO code (fixed at '506').506
Digits 4 to 9Emission Date6 digitsDate formatted as DDMMAA (Day, Month, Year).290924
Digits 10 to 21Emitter ID12 digitsTax ID zero-padded to 12 positions.003101123456
Digits 22 to 41Consecutive Number20 digitsBranch (3), POS Terminal (5), Doc Type (2), and Sequential (10).00100001010000000001
Digit 42Document Situation1 digit1 = Normal, 2 = Contingency, 3 = Offline.1
Digits 43 to 50Security Code8 digitsRandom 8-digit numeric integrity code.12345678

Structural Integrity Specifications

Rules mandated by DGT-R-48-2016 resolution:

Total Length = 50 decimal digits
  1. 1. Country Prefix: Must strictly begin with '506'.
  2. 2. Date Validation: Day (01-31), Month (01-12), and 2-digit year.
  3. 3. Emitter Tax ID: 12 numeric digits, non-zero.
  4. 4. Consecutive Number: Valid branch, terminal, accepted document type, and non-zero sequential.
  5. 5. Situation: Digit 42 must be 1, 2, or 3.
  6. 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).