New Romanian Identity Cards OCR

The Druid API engine supports OCR and data extraction for Romanian identity cards issued with a CIP (electronic chip), applicable to identity cards issued starting in January 2024.

Note:  
  • In order to use this Druid Vision service, contact Druid Tech Support.
  • For any APIs that are used for testing purposes and not in a production environment, Druid CANNOT be held responsible for the security of the processed data under the General Data Protection Regulation (GDPR). We highly recommend you to use sample data and documents for all APIs in testing environments.

Request

Method POST
API Resource URL (Endpoint) The endpoint of the Druid Vision New_IdentityCard service. For information on how to get the endpoint, see Druid Vision.
Authorization

Select Bearer Token and provide the Druid Vision Token. For information on how to get the endpoint, see Druid Vision.

Headers

Content-Type: “multipart/form-data”

Body without face validation

“file”: <attached document file> (file attachment). Add both the front and the back of the new identity card.

Supported formats: png, jpg, pdf.

If extraction fails due to issues like poor image quality, you can skip any of the following validation checks:

  • Sex
  • DateOfBirth
  • ExpireDate
  • SIRUTA - to skip Address validation from the identity card back.

Add the skipValidations parameter in the request body as many times as validation checks you want to escape from validation.

Note:  Skipping validations is available in DRUID 8.1 and higher.
Body with face validation

“file”: <attached document file> (file attachment). Add the front of the new identity card.

“selfie”: <attached selfie photo> (file attachment)

Supported formats: png, jpg, pdf.

Note:  The user needs to smile in the selfie, otherwise the face validation will fail.

Note:  You can skip the same validation checks listed at Body without face validation.

Response

Data Returned by MRZ interpretation is found in the Data section of the response.

Click the desired option below to see the response for the specific request.

Validations

Validations performed in the MRZ section:

  • DocumentNumber - checksum cross-checked with MRZ Line_2 first control digit.
  • DateOfBirth - checksum cross-checked with MRZ Line_2 second control digit.
  • DateOfExpiry - checksum cross-checked with MRZ Line_2 third control digit.
  • Line_2 - checksum of the entire MRZ line 2 (if any of the above fails, the entire line fails and the entire MRZ checksum fails).
  • Sex - validation on values “F” or “M”.

Based on Code and Nationality, an existing template of the OCR service is identified:

  • If Code = “ID” and Nationality = “ROU”, the template “Identity Card” is used.
  • If Code = “IS” and Nationality = “ROU”, the template “RO_ResidenceCard” is used.

The results of the “Identity Card” template provide the following validations:

  • CNP - Status Invalid if the checksum of the CNP cross-checked with the control digit fails. The CNP validation is performed against the ID values provided in the reference table below.
  • ID

    County of Birth

    0

    Invalid

    1

    Alba

    2

    Arad

    3

    Argeș

    4

    Bacău

    5

    Bihor

    6

    Bistrița_Năsăud

    7

    Botoșani

    8

    Brașov

    9

    Brăila

    10

    Buzău

    11

    Caraș_Severin

    12

    Cluj

    13

    Constanța

    14

    Covasna

    15

    Dâmbovița

    16

    Dolj

    17

    Galați

    18

    Gorj

    19

    Harghita

    20

    Hunedoara

    21

    Ialomița

    22

    Iași

    23

    Ilfov

    24

    Maramureș

    25

    Mehedinți

    26

    Mureș

    27

    Neamț

    28

    Olt

    29

    Prahova

    30

    Satu_Mare

    31

    Sălaj

    32

    Sibiu

    33

    Suceava

    34

    Teleorman

    35

    Timiș

    36

    Tulcea

    37

    Vaslui

    38

    Vâlcea

    39

    Vrancea

    40

    București

    41

    București_Sector_1

    42

    București_Sector_2

    43

    București_Sector_3

    44

    București_Sector_4

    45

    București_Sector_5

    46

    București_Sector_6

    47

    București_Sector_7

    48

    București_Sector_8

    51

    Călărași

    52

    Giurgiu

    80

    Outside_Romania

  • Validity - Status Invalid if the OCR service fails to retrieve information in IssueDate and ExpiryDate.
  • MRZ - Status Invalid if at least one of the cross-checks on the MRZ field fails (document number, date of birth, date of expiry, sex, IssuingState).
  • Sex - Status Invalid if the cross-check of the following fields fail: Sex from CNP, Sex from Document, Sex from MRZ.
  • DateOfBirth - Status Invalid if the cross-check of the following fields fail: DateOfBirth from CNP, DateOfBirth from Document, DateOfBirth from MRZ.
  • IssueDate - Status Invalid if the cross-check of the following fields fail: IssueDate from Document, IssueDate from MRZ.
  • ExpireDate - Status Invalid if the cross-check of the following fields fail: ExpireDate from Document, ExpireDate from MRZ.
  • SIRUTA - Status Invalid if the value of field Locality cannot be matched to the SIRUTA dictionary.
  • Face - Status Invalid if the "Face.Confidence" is not 1.0 or "Invalid: you forgot to smile" if the customer is not smiling in the selfie. This validation is done for OCR of Romanian identity cards with selfie.

If the data cannot be extracted by the OCR Service, validations on all of the above fields will fail.

Status field

  1. InvalidDocument. All validations on the document failed.
  2. Partial. There are failed validations.
  3. Complete. All validations succeeded.
  4. InvalidTemplate. Template is invalid (for development purpose only).
  5. InvalidImage. Image is invalid (format, size).

If Status is other than “Complete”, you see the error and the validation details in the “ValidationResult” attribute.

Image Validation

To ensure optimal OCR results, the API automatically enhances the image before processing by applying multiple image optimization algorithms.

Supported formats: PNG, JPG, PDF.