Skip to main content

Cheque OCR API

API Description

Objective

The Cheque OCR API extracts the textual information from a scanned image of a cheque.

InputOutput
An image or PDF file containing a cheque documentThe textual information extracted from the document

API URL

https://ind.thomas.hyperverge.co/v1/readCheque

API Endpoint

/readCheque

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 OptionalTypeDescriptionAllowed Values
content-typeMandatory stringThis parameter defines the media type for the request payload.multipart/form-data
appIdMandatorystringThe application ID shared by HyperVergeNot Applicable - this is a unique value.
appKeyMandatorystringThe application key shared by HyperVergeNot Applicable - this is a unique value.
transactionIdMandatorystringThe unique ID for the customer journey.Not Applicable - this is a unique value related to a transaction in your application.

Inputs

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

ParameterDescriptionMandatory or OptionalAllowed ValuesDefault Value
imageThe image file for OCR extractionMandatoryThe file format can be JPG, JPEG, PNG, or PDFNot Applicable
outputImageBase64Returns the image in base64 formatOptional'yes' or 'no'no
outputAccountTypeReturns the account type in the response detailsOptional'yes' or 'no'no
returnS3UrlReturns the S3 URL for the logOptional'yes' or 'no'no

Request

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

curl --location --request POST 'https://ind.thomas.hyperverge.co/v1/readCheque' \
--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_cheque_image>"' \
--form 'outputImageBase64="<Enter_yes_or_no>"' \
--form 'outputAccountType="<Enter_yes_or_no>"' \
--form 'returnS3Url="<Enter_yes_or_no>"'

Success Response

The following code is a of success response from the API:

{
"status": "success",
"statusCode": "200",
"result": [
{
"details": {
"account_number": {
"value": "<Masked_Account_Number>",
"conf": "<Confidence_Score_for_Account_Number>",
"to-be-reviewed": "<Review_Status_For_Account_Number>"
},
"name": {
"value": "<Name_of_the_Account_Holder>",
"conf": "<Confidence_Score_for_Name>",
"to-be-reviewed": "<Review_Status_For_Name>"
},
"ifsc_code": {
"value": "<IFSC_Code>",
"conf": "<Confidence_Score_for_IFSC_Code>",
"to-be-reviewed": "<Review_Status_For_IFSC_Code>"
},
"cheque_number": {
"value": "<Masked_Cheque_Number>",
"conf": "<Confidence_Score_for_Cheque_Number>",
"to-be-reviewed": "<Review_Status_For_Cheque_Number>"
},
"acc_type": {
"value": "<Account_Type>",
"conf": "<Confidence_Score_for_Account_Type>",
"to-be-reviewed": "<Review_Status_For_Account_Type>"
},
"bank_name": {
"value": "<Bank_Name>",
"conf": "<Confidence_Score_for_Bank_Name>",
"to-be-reviewed": "<Review_Status_For_Bank_Name>"
}
},
"type": "<Document_Type>",
"base64Image": "<Base64_Encoded_Image>",
"s3Url": "<S3_URL>"
}
]
}

Success Response Details

ParameterTypeDescription
statusstringThe status of the request
statusCodeintegerThe HTTP status code returned in the response
resultarrayThe array containing the result details
detailsobjectAn object holding specific details of the document
account_number.valuestringThe masked account number from the document
account_number.confstringThe confidence score for the extracted account number
account_number.to-be-reviewedstringThe review status of the extracted account number
name.valuestringThe name of the account holder
name.confstringThe confidence score for the extracted name
name.to-be-reviewedstringThe review status of the extracted name
ifsc_code.valuestringThe IFSC code of the bank account
ifsc_code.confstringThe confidence score for the extracted IFSC code
ifsc_code.to-be-reviewedstringThe review status of the extracted IFSC code
cheque_number.valuestringThe masked cheque number from the document
cheque_number.confstringThe confidence score for the extracted cheque number
cheque_number.to-be-reviewedstringThe review status of the extracted cheque number
acc_type.valuestringThe type of account (e.g., savings)
acc_type.confstringThe confidence score for the extracted account type
acc_type.to-be-reviewedstringThe review status of the extracted account type
bank_name.valuestringThe name of the bank
bank_name.confstringThe confidence score for the extracted bank name
bank_name.to-be-reviewedstringThe review status of the extracted bank name
typestringThe document type being processed
base64ImagestringThe base64 encoded image of the document
s3UrlstringThe URL of the document stored in the S3 bucket

Failure Response

The following is a failure response where the API fails to detect a document from the image.

{
"status": "failure",
"statusCode": 422,
"error": "No Document detected",
"requestId" : "<Request_ID>"
}

Error Response

The following are the error responses for the API.

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

Failure and Error Response Details

A failure or error response from the API contains a failure status, with a relavant status code and error message. The following table lists all error responses.


Status CodeError MessageError Description
400API call requires one input imageThe request missed the image input
400API call handles only one input imageThe request had more than one image file input. It expects only one file in the request.
400image size cannot be greater than 12MBThe image size is larger than the allowed limit
400Input Validation Error: is not one of enum values: yes,noThe input parameters (other than image) are provided with values other than yes/no
422Document not detected from ImageThe API failed to detect a document in the image. Ensure that the image captures the document following the guidlines mentioned under the Input Image Guidelines section.
5xxInternal Server ErrorPlease check the request headers or 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: