Skip to main content

ID Card Validation API

The following document highlights the details of the ID Card Validation API.

API Description

Objective

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

InputOutput
An image of any officially valid document supported by HyperVerge, along with the associated country and document typeThe data extracted from the image

API URL

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

API Endpoint

readId

regionCode Details

The {regionCode} placeholder accepts the following values. For example: https://ind.idv.hyperverge.co/v1/readId

RegionregionCode Value
Indiaind
USAusa
Africazaf
Europeirl
Singaporesgp

Overview

The ID Card Validation API is RESTful and uses standard HTTP verbs and status codes. Responses are in JSON format. Upload all images and files as form-data through a POST request.

Method - POST

Authentication

You need a unique pair of application ID (appId) and application key (appKey) from HyperVerge to access the API.

Headers

HeaderMandatory / OptionalDescriptionInput Format
content-typeMandatoryDefines the media type for the request payload.multipart/form-data
appIdMandatoryThe application ID shared by HyperVerge. You can find the details in the dashboard's credentials tab.This should be a unique value
appKeyMandatoryThe application key shared by HyperVerge. You can find the details in the dashboard's credentials tab.This should be a unique value
transactionIdMandatoryA unique identifier for tracking a user journey.This should be both unique and easily associated with the user's journey in your application(s)

Inputs

The following table provides the details of the parameters required for the ID Card Validation API request body:

ParameterMandatory / OptionalTypeDescriptionInput FormatDefault Value
image or pdfMandatoryfileThe image file or PDF of the ID document.JPG, JPEG, PNG, or PDFNot Applicable
countryIdMandatorystringThe 3-letter alpha code of the country. See the list of supported countries and country IDs.Not ApplicableNot Applicable
documentIdMandatorystringThe ID of the document. See the list of supported documents and document IDs.Not ApplicableNot Applicable
expectedDocumentSideOptionalstringThe expected side of the document.front / backNot Applicable
shouldSupportEPANOptionalstringEnables support for ePAN documents during ID processing.yes / nono
shouldSupportDigilockerPANOptionalstringEnables support for DigiLocker PAN documents during ID processing.yes / nono

Request

The following code snippet demonstrates a standard curl request for the ID Card Validation API:

curl --location --request POST 'https://ind.idv.hyperverge.co/v1/readId' \
--header 'Content-Type: multipart/form-data' \
--header 'appId: <Enter_the_App_ID>' \
--header 'appKey: <Enter_the_App_Key>' \
--header 'transactionId: <Enter_the_Transaction_ID>' \
--form 'image=@"<Enter_the_File_Path>"' \
--form 'countryId="<Enter_the_Country_ID>"' \
--form 'documentId="<Enter_the_Document_ID>"' \
--form 'expectedDocumentSide="<front_or_back>"' \
--form 'shouldSupportEPAN="<Enter_the_Yes_Or_No>"' \
--form 'shouldSupportDigilockerPAN="<Enter_the_Yes_Or_No>"'

Success Response

The following code snippet demonstrates a success response from the ID Card Validation API:

{
"status": "success",
"statusCode": "200",
"result": {
"details": [
{
"idType": "<ID_Type>",
"fieldsExtracted": {
"firstName": { "value": "<First_Name>", "confidence": "<high/low>" },
"middleName": { "value": "<Middle_Name>", "confidence": "<high/low>" },
"lastName": { "value": "<Last_Name>", "confidence": "<high/low>" },
"fullName": { "value": "<Full_Name>", "confidence": "<high/low>" },
"dateOfBirth": { "value": "<Date_Of_Birth>", "confidence": "<high/low>" },
"dateOfIssue": { "value": "<Date_Of_Issue>", "confidence": "<high/low>" },
"dateOfExpiry": { "value": "<Date_Of_Expiry>", "confidence": "<high/low>" },
"countryCode": { "value": "<Country_Code>", "confidence": "<high/low>" },
"type": { "value": "<Document_Type>", "confidence": "<high/low>" },
"gender": { "value": "<Gender>", "confidence": "<high/low>" },
"address": {
"value": "<Address>",
"street": "<Street>",
"district": "<District>",
"zipCode": "<Zip_Code>",
"province": "<Province>",
"houseNumber": "<House_Number>",
"additionalInfo": "<Additional_Info>",
"confidence": "<high/low>"
},
"idNumber": { "value": "<ID_Number>", "confidence": "<high/low>" },
"placeOfBirth": { "value": "<Place_Of_Birth>", "confidence": "<high/low>" },
"placeOfIssue": { "value": "<Place_Of_Issue>", "confidence": "<high/low>" },
"yearOfBirth": { "value": "<Year_Of_Birth>", "confidence": "<high/low>" },
"age": { "value": "<Age>", "confidence": "<high/low>" },
"fatherName": { "value": "<Father_Name>", "confidence": "<high/low>" },
"motherName": { "value": "<Mother_Name>", "confidence": "<high/low>" },
"husbandName": { "value": "<Husband_Name>", "confidence": "<high/low>" },
"spouseName": { "value": "<Spouse_Name>", "confidence": "<high/low>" },
"nationality": { "value": "<Nationality>", "confidence": "<high/low>" },
"mrzString": { "value": "<MRZ_String>", "confidence": "<high/low>" },
"homeTown": { "value": "<Home_Town>", "confidence": "<high/low>" }
}
}
],
"summary": {
"action": "<pass/fail/manualReview>",
"details": []
}
},
"metaData": {
"requestId": "<Request_ID>",
"transactionId": "<Transaction_ID>"
}
}

The summary.action field indicates the recommended action for the result. The following are the possible values:

{
"summary": {
"action": "pass",
"details": []
}
}

Success Response Details

The following table describes the fields returned in the ID Card Validation API success response:

ParameterTypeDescription
statusstringThe status of the request.
statusCodestringThe HTTP status code of the response.
result.details[].idTypestringThe type of identification document detected.
result.details[].fieldsExtractedobjectThe fields extracted from the document. Each field contains a value and a confidence level (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 extracted address, broken into sub-fields: street, district, zipCode, province, houseNumber, and additionalInfo.
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.
result.summary.actionstringThe recommended action: pass, fail, or manualReview.
metaData.requestIdstringThe unique identifier for the request.
metaData.transactionIdstringThe transaction ID associated with the request.

Error Responses

The following are sample error responses from the ID Card Validation API:

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

Error Response Details

A failure response contains a failure status with a relevant status code and error message. The following table lists the error responses for the ID Card Validation API:

Status CodeError MessageError DescriptionError Resolution
400API call requires at least one input imageNo image was provided in the request.Include at least one image in the request.
400API call handles only up to 1 imageMore than one image was sent in the request.Send only one image per request.
400TransactionId not detectedThe transactionId header was not included in the request.Add the transactionId header to the request.
400countryId/documentId is missingThe countryId or documentId parameter was not provided.Include both countryId and documentId in the request.
401Missing/Invalid credentialsThe request is missing the mandatory appId and appKey combination or has invalid values.Verify and provide valid appId and appKey credentials.
422Document Not DetectedThe AI model could not find a document in the image.Ensure the image clearly shows the document and retry.
423Document Not SupportedThe document in the image is not supported by the API.Check the supported documents list and retry with a supported document.
429Requests rate limit exceededThe number of transactions per minute has exceeded the limit set for your credentials.Retry after some time or contact the HyperVerge team to review your rate limit.
500Internal Server ErrorKindly check the request headers or contact the HyperVerge team for resolution.Check the request headers or contact the HyperVerge team for resolution.
501Internal Server ErrorAn unexpected server error occurred.Contact the HyperVerge team for resolution.
503Server busyThe server is overloaded.Retry after some time or contact the HyperVerge team if the issue persists.

Additional Configurations and Checks

The ID Card Validation API supports additional image checks and configurations beyond text extraction. See the full list here.

caution

If these additional checks or configurations do not appear in the API response, they may not be enabled for your account. 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: