Skip to main content

ID Card Validation API

Objective

The ID Card Validation API extracts text from officially valid documents (OVDs) images while conducting supplementary image checks for thorough verification.

InputOutput
An image of any of the officially valid documents
supported by HyperVerge, the associated country, and the document type
The data extracted from the image

API URL

https://{regionCode}.idv.hyperverge.co/v1/readId

API Endpoint

readId

regionCode Details

The API URL accepts any of the following region code values against the regionCode placeholder. For example, "https://ind.idv.hyperverge.co/v1/readId"

RegionregionCode Value
Indiaind
USAusa
Africazaf
Europeirl
Singaporesgp

Overview

The API is RESTful and uses standard HTTP verbs and status codes. The responses are in JSON format and you should upload all images and files as form-data through a POST request.

Authentication

You need a unique pair of application ID ( appId ) and application key (appKey) from HyperVerge to verify your identity for accessing the API.

API Request Details

Method - POST

Headers

ParameterMandatory or OptionalDescriptionValid Values
content-type Mandatory This parameter defines the media type for the request payload.multipart/form-data
appId Mandatory Application ID shared by HyperVerge. N/A. This is a unique value.
appKey MandatoryApplication Key shared by HyperVerge. N/A. This is a unique value.
transactionIdMandatoryA unique identifier for tracking this specific API request. N/A. Any defined unique value mapped to a transaction in your business ecosystem.

Inputs

The following table provides information on the parameters used in the request body for the API.

ParameterDescriptionMandatory or OptionalAllowed ValuesDefault Value
imageor pdfThe image file or PDF for the ID documentMandatoryThe file can be in JPG, JPEG, PNG or PDF formatNot Applicable
countryIdThe 3 Letter Alpha-code of the country. Click here to see the list of supported countries and associated country IDs.MandatoryNot ApplicableNot Applicable
documentIdThe ID of the document. Click here to see the list of supported documents and associated document IDsMandatoryNot ApplicableNot Applicable
expectedDocumentSideThe expected side of the document (front or back)Optional"front" or "back"Not Applicable

Request

The following code shows a standard curl request for the API.

curl --location --request POST 'https://ind.idv.hyperverge.co/v1/readId' \
--header 'Content-Type: multipart/form-data' \
--header 'appId: <Enter_the_HyperVerge_appId>' \
--header 'appKey: <Enter_the_HyperVerge_appKey>' \
--header 'transactionId: <Enter_the_HyperVerge_transactionID>' \
--form 'image=@"<path_to_image_file>"' \
--form 'countryId="<Enter_the_Country_ID>"' \
--form 'documentId="<Enter_the_Document_ID>"' \
--form 'expectedDocumentSide="<front_or_back>"'

Success Response

The following is a SUCCESS response for a valid request made to the API.

{
"status": "success",
"statusCode": "200",
"result": {
"details": [
{
"idType": "<Type_Of_ID>",
"fieldsExtracted": {
"firstName": {
"value": "<Extracted_First_Name>",
"confidence": "<High/Low>"
},
"middleName": {
"value": "<Extracted_Middle_Name>",
"confidence": "<High/Low>"
},
"lastName": {
"value": "<Extracted_Last_Name>",
"confidence": "<High/Low>"
},
"fullName": {
"value": "<Extracted_Full_Name>",
"confidence": "<High/Low>"
},
"dateOfBirth": {
"value": "<Date_Of_Birth_In_DD-MM-YYYY_Format>",
"confidence": "<High/Low>"
},
"dateOfIssue": {
"value": "<Date_Of_Issue>",
"confidence": "<High/Low>"
},
"dateOfExpiry": {
"value": "<Date_Of_Expiry>",
"confidence": "<High/Low>"
},
"countryCode": {
"value": "<Extracted_Country_Code>",
"confidence": "<High/Low>"
},
"type": {
"value": "<Extracted_Type>",
"confidence": "<High/Low>"
},
"gender": {
"value": "<Extracted_Gender>",
"confidence": "<High/Low>"
},
"address": {
"value": "<Extracted_Address>",
"street": "<Extracted_Street>",
"district": "<Extracted_District>",
"zipCode": "<Extracted_Zip_Code>",
"province": "<Extracted_Province>",
"houseNumber": "<Extracted_House_Number>",
"additionalInfo": "<Additional_Info>",
"confidence": "<High/Low>"
},
"idNumber": {
"value": "<Extracted_ID_Number>",
"confidence": "<High/Low>"
},
"placeOfBirth": {
"value": "<Extracted_Place_Of_Birth>",
"confidence": "<High/Low>"
},
"placeOfIssue": {
"value": "<Extracted_Place_Of_Issue>",
"confidence": "<High/Low>"
},
"yearOfBirth": {
"value": "<Extracted_Year_Of_Birth>",
"confidence": "<High/Low>"
},
"age": {
"value": "<Extracted_Age>",
"confidence": "<High/Low>"
},
"fatherName": {
"value": "<Extracted_Father_Name>",
"confidence": "<High/Low>"
},
"motherName": {
"value": "<Extracted_Mother_Name>",
"confidence": "<High/Low>"
},
"husbandName": {
"value": "<Extracted_Husband_Name>",
"confidence": "<High/Low>"
},
"spouseName": {
"value": "<Extracted_Spouse_Name>",
"confidence": "<High/Low>"
},
"nationality": {
"value": "<Extracted_Nationality>",
"confidence": "<High/Low>"
},
"mrzString": {
"value": "<Extracted_MRZ_String>",
"confidence": "<High/Low>"
},
"homeTown": {
"value": "<Extracted_Home_Town>",
"confidence": "<High/Low>"
}
}
}
],
"summary": {
"action": "<Pass/Fail/Manual_Review>",
"details": []
}
},
"metaData": {
"requestId": "<Request_ID>",
"transactionId": "<Transaction_ID>"
}
}

Success Response Details

The Summary Object

The summary object suggests the final action for the user's application.

  • The configuration is customizable. It can be changed based on your preferences at anytime of your integration and after go-live.
  • The configuration is hosted in the backend and not in the SDK/frontend.
  • New features can be supported immediately, thus not requiring app release at your end.

The following code samples are the 3 types of actions responses that you will find in the response.

This is the response where the application is approved for further processing.

{
"summary": {
"action": "pass",
"details": []
}
}
ParameterTypeDescription
statusstringThe status of the request
statusCodestringThe HTTP status code of the response
idTypestringThe type of identification document
valuestringThe value extracted for a specific field
confidencestringThe confidence level of the extracted value, either "high" or "low"
firstNamestringThe extracted first name
middleNamestringThe extracted middle name
lastNamestringThe extracted last name
fullNamestringThe extracted full name
dateOfBirthstringThe extracted date of birth in DD-MM-YYYY format
dateOfIssuestringThe extracted date of issue
dateOfExpirystringThe extracted date of expiry
countryCodestringThe extracted country code
typestringThe extracted document type
genderstringThe extracted gender
addressobjectThe detailed address fields extracted
streetstringThe extracted street name
districtstringThe extracted district name
zipCodestringThe extracted ZIP code
provincestringThe extracted province name
houseNumberstringThe extracted house number
additionalInfostringAdditional address-related information
idNumberstringThe extracted ID number
placeOfBirthstringThe extracted place of birth
placeOfIssuestringThe extracted place of issue
yearOfBirthstringThe extracted year of birth
agestringThe extracted age
fatherNamestringThe extracted father's name
motherNamestringThe extracted mother's name
husbandNamestringThe extracted husband's name
spouseNamestringThe extracted spouse's name
nationalitystringThe extracted nationality
mrzStringstringThe extracted Machine Readable Zone (MRZ) string
homeTownstringThe extracted home town
actionstringThe action recommended for the result, such as "pass," "fail," or "manualReview"
requestIdstringThe unique identifier for the request
transactionIdstringThe transaction ID associated with the request

Error Responses

{ 
"status": "failure",
"statusCode": "400",
"metadata": {
"requestId": "<Request_ID>",
"transactionId": "<Transaction_ID>"
},
"result": {
"error": "API call requires at least one input image"
}
}

Error Response Details

Status CodeError MessageError Description
400API call requires at least one input imageThis error is returned when 'image' is not sent in the API call.
400API call handles only upto 1 imagesThis error is returned when more than 1 images are sent in the API call.
400TransactionId not detectedThis error is returned when 'transactionId' is not sent in request headers.
400countryID/documentId is missingThis error is returned when 'country/document ID' is missing.
422Document Not DetectedWhen the AI model could not find a Document in the image sent.
423Document not supportedThis error is returned when the document in the image is not supported.
429Rate limit exceededThis error is returned when the number of transactions per minute has crossed the limit set for your credentials.
500/501Internal Server ErrorThis happens when there is something wrong with HyperVerge's server.
503Server busyThis happens when there is an overload on HyperVerge's server.

Additional Configurations and Checks

In addition to the text extraction, the ID Card Validation API can also perform additional checks on the image and support additional configurations. You can find the detailed list here.

Some of these checks and configurations are included in the prior response samples.

caution

If you do not find any of these additional checks or configurations in the API response then they might not have been enabled for you. Contact the HyperVerge team for resolution.

Was this helpful?
Ask AIBeta
Hi! How can I help?
Ask me anything about HyperVerge products, APIs, and SDKs.
Try asking: