Skip to main content

Bank Statement OCR API

The following document highlights the details of the Bank Statement OCR API.

API Description

Objective

The Bank Statement OCR API extracts accurate information from a user's bank statement document (in PDF format) using optical character recognition(OCR) and returns the extracted data in a JSON format.

InputOutput
A PDF file of the user's bank statement documentThe bank statement data extracted from the document in a JSON format.
It can extract fields such as:
  • Bank Name
  • Account Number
  • Customer Name
  • Customer Address
  • IFSC Code
  • MICR Code
  • Account Category
  • Statement start date (from date)
  • Statement end date (to date)
  • Page Count of the document

API URL

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

API Endpoint

bankStatementUpload

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.

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 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
transactionIdMandatoryA unique identifier for tracking a user journeyThis 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 Bank Statement OCR API's request body:

ParameterMandatory / OptionalTypeDescriptionInput FormatDefault Value
uploadPdfMandatoryfileThe file containing the user's bank statement documentJPG, JPEG, PNG, or PDF formatNot Applicable
pdfPasswordOptionalstringIf the PDF is password protected, the password should be shared using this parameterNot ApplicableNot Applicable

Request

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

curl --location --request POST 'https://ind-engine.thomas.hyperverge.co/v1/bankStatementUpload' \
--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 'uploadPdf=@"<Path_to_PDF_File>"' \
--form 'pdfPassword="<PDF_File_Password>"'

Success Response

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

{
"status": "success",
"statusCode": 200,
"result": {
"bankName": "<Bank_Name>",
"statementId": "<Statement_Identifier>",
"entityId": "<Entity_Identifier>",
"accountNumber": "<Account_Number>",
"name": [
"<Account_Holder_Name>"
],
"address": "<User_Address>",
"ifsc": "<IFSC_Code>",
"micr": "<MICR_Code>",
"accountCategory": "<Account_Category>",
"fromDate": "<From_Date_in_YYYY-MM-DD_Format>",
"toDate": "<To_Date_in_YYYY-MM-DD_Format>",
"pageCount": "<Page_Count>",
"currencyCode": "<Currency_Code>",
"countryCode": "<Country_Code>"
},
"metaData": {
"requestId": "<Request_ID>",
"transactionId": "<Transaction_ID>"
}
}

Success Response Details

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

ParameterTypeDescription
statusstringThe status of the request
statusCodeintegerThe HTTP status code returned for the request
resultobjectObject containing the extracted details from the bank statement
result.bankNamestringThe name of the bank extracted from the bank statement
result.statementIdstringThe unique identifier for the bank statement
result.entityIdstringThe unique identifier for the entity
result.accountNumberstringThe account number extracted from the bank statement
result.namearrayArray containing the account holder name or names
result.name[]stringThe account holder name value
result.addressstringThe address of the account holder extracted from the bank statement
result.ifscstringThe IFSC code extracted from the bank statement
result.micrstringThe MICR code extracted from the bank statement
result.accountCategorystringThe category of the account extracted from the bank statement
result.fromDatestringThe start date of the bank statement period
result.toDatestringThe end date of the bank statement period
result.pageCountstringThe total number of pages in the bank statement document
result.currencyCodestringThe currency code of the bank statement
result.countryCodestringThe country code of the bank statement
metaDataobjectMetadata object containing request tracking information
metaData.requestIdstringUnique identifier for the API request
metaData.transactionIdstringUnique identifier for tracking the user journey

Error Responses

The following are some error responses from the Bank Statement OCR API:

{
"message": "Input Validation Error: requires property \"uploadPdf\"",
"statusCode": 400,
"status": "failure"
}

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
400Input Validation Error: requires property "uploadPdf"The request does not contain the required "uploadPdf" propertyProvide the uploadPdf parameter in the request
400Invalid file type for: uploadPdfThe file type for "uploadPdf" is invalidEnsure the file is in JPG, JPEG, PNG, or PDF format
400Password provided was incorrectThe password in the request is incorrectProvide the correct password for the password-protected PDF
422Document Not DetectedThe system was unable to detect a bank statement document in the provided fileEnsure the file contains a valid bank statement document
500internal server errorThere was an internal 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: