Skip to main content

ITR OCR API

The following document highlights the details of the ITR OCR API.

API Description

Objective

The ITR OCR API extracts accurate information from a user's Income Tax Return (ITR) document using optical character recognition (OCR) and returns the extracted data in a JSON format.

InputOutput
An image or PDF file of the user's ITR documentThe data extracted from the ITR document and converted into a JSON format. The complete list of output fields is provided under the Success Response Details section.

API URL

https://ind-engine.thomas.hyperverge.co/v1/readITR

API Endpoint

readITR

Overview

The ITR OCR 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.

Method - POST

Authentication

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

Headers

HeaderMandatory / OptionalDescriptionInput Format
content-type MandatoryThis parameter defines the media type for the request payloadmultipart/form-data
appId MandatoryThe application identifier shared by HyperVerge. You can find the details in the dashboard's credentials tabThis should be a unique value
appKey MandatoryThe application key shared by HyperVerge. You can find the details in the dashboard's credentials tabThis should be a unique value
transactionIdMandatoryUnique ID for the customer journeyAny defined unique value mapped to a transaction in your business ecosystem

Inputs

The following table provides the details of the parameters required for the ITR OCR API's request body:

ParameterMandatory / OptionalTypeDescriptionInput FormatDefault Value
imageMandatoryfileThe image file for OCR extractionImage file (JPEG, JPG, PNG) or PDFNot Applicable

Request

The following code snippet demonstrates a standard curl request for the ITR OCR API:

curl --location --request POST 'https://ind-engine.thomas.hyperverge.co/v1/readITR' \
--header 'appid: <Enter_the_appId-Shared-by-HyperVerge>' \
--header 'appkey: <Enter_the_appKey-shared-by-HyperVerge>' \
--header 'transactionId : <Enter_the_Transaction_ID>' \
--form 'image=@"<path_to_image_file>"'

Document Sample

The following is an ITR Document. itr_ocr_api

Success Response

The following code snippet demonstrates a success response from the ITR OCR API:

{
"status": "success",
"statusCode": "200",
"result": {
"details": [
{
"fieldsExtracted": {
"name": {
"value": "<Name_of_the_Individual>"
},
"dateOfFiling": {
"value": "<Date_Of_Filing_in_DD-MM-YYYY_Format>"
},
"acknowledgementNumber": {
"value": "<Acknowledgement_Number>"
},
"totalIncome": {
"value": "<Total_Income>"
},
"status": {
"value": "<Filing_Status>"
},
"assessmentYear": {
"value": "<Assessment_Year>"
},
"formNumber": {
"value": "<Form_Number>"
},
"PANNumber": {
"value": "<10_digit_PAN>"
}
},
"type": "<Document_Type>"
}
]
},
"metaData": {
"requestId": "<Unique_Request_ID>"
}
}

Success Response Details

The following table outlines the details of the success response from the ITR OCR API:

info

The response's field values reflect only the data recorded in the user's document.

ParameterTypeDescription
statusstringThe status of the API response
statusCodestringThe HTTP status code for the response
resultobjectThe JSON object containing the extracted ITR details
detailsarrayAn array containing the extracted document information
fieldsExtractedobjectThe JSON object containing all the fields extracted from the ITR document
namestringThe name of the user
statusstringThe status associated with the ITR document. For example, "Individual".
dateOfFilingstringThe date of electronic filing of the ITR
acknowledgementNumberstringThe E-Filing acknowledgement identifier
totalIncomestringThe total income of the user
assessmentYearstringThe assessment year for the ITR
formNumberstringThe form number used for filing the ITR
PANNumberstringThe PAN of the user
typestringThe type of document detected
metaDataobjectThe JSON object containing request identifiers
requestIdstringUnique identifier for the request

Failure Response

The following code snippet demonstrates a failure response from the ITR OCR API:

{
"status": "failure",
"statusCode": 400,
"error": "API call requires one input image"
}

Error Responses

The following are some error responses from the ITR OCR API:

{
"status": "failure",
"statusCode": 400,
"error": "API call requires one input image"
}

Error Response Details

A failure or error response contains a failure status with a relevant status code and error message.
The following table lists all error responses:

Status CodeError MessageError DescriptionError Resolution
400API call requires one input imageThe request does not include an input image, which is mandatory for processing.Ensure the request includes the image parameter with a valid image or PDF file
400Image size cannot be greater than 6MBThe provided image exceeds the maximum allowed size of 6MB.Reduce the image file size to 6MB or less before submitting the request
422Document Not DetectedThe system was unable to detect any document in the provided image.Ensure the image contains a clear and visible ITR document, or contact the HyperVerge team if the issue persists
Was this helpful?
Ask AIBeta
Hi! How can I help?
Ask me anything about HyperVerge products, APIs, and SDKs.
Try asking: