Skip to main content

Margin Money Receipt OCR API

The following document highlights the details of the Margin Money Receipt OCR API.

API Description

Objective

The Margin Money Receipt OCR API extracts the textual data from an image of a receipt document and returns it in a JSON format.

InputOutput
An image or PDF file containing the margin money receipt document.The textual information extracted from the document.

API URL

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

API Endpoint

readMRR

Overview

The Margin Money Receipt 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 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 Margin Money Receipt OCR API's request body:

ParameterMandatory / OptionalTypeDescriptionInput FormatDefault Value
imageMandatorystringThe image or PDF file containing the margin money receipt documentJPG, JPEG, PNG, or PDFNot Applicable
Caution
  • If you send multiple files in the same API request, the OCR extraction will be performed only on one of the files. Kindly send only one file in a request to avoid confusion.
  • If the PDF file has multiple pages, only the first page will be considered for the OCR extraction.

Request

The following code snippet demonstrates a standard curl request for the Margin Money Receipt OCR API:

curl --location --request POST 'https://ind-engine.thomas.hyperverge.co/v1/readMRR' \
--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>"'

Success Response

The following code snippet demonstrates a success response from the Margin Money Receipt OCR API:

{
"status": "success",
"statusCode": "200",
"result": [
{
"details": {
"customerName": {
"value": "<Customer_Name>"
},
"amountInFigures": {
"value": "<Amount_In_Figures>"
},
"amountInWords": {
"value": "<Amount_In_Words>"
},
"dealerName": {
"value": "<Dealer_Name>"
},
"receiptNumber": {
"value": "<Receipt_Number>"
},
"receiptDate": {
"value": "<Receipt_Date_in_DD/MM/YYYY_Format>"
}
}
}
],
"metaData": {
"requestId": "<Request_ID>",
"transactionId": "<Transaction_ID>"
}
}
Caution

When the image is not of a valid margin money receipt document, the JSON output might contain null or random values.

Success Response Details

The following table outlines the details of the success response from the Margin Money Receipt OCR API:

ParameterTypeDescription
statusstringThe status of the request
statusCodestringThe HTTP status code for the response
resultarrayAn array containing the extracted details from the margin money receipt document
result[].detailsobjectThe object containing the extracted fields from the document
result[].details.customerNameobjectThe customer name extracted from the document
result[].details.customerName.valuestringThe value of the customer name
result[].details.amountInFiguresobjectThe amount in figures extracted from the document
result[].details.amountInFigures.valuestringThe value of the amount in figures
result[].details.amountInWordsobjectThe amount in words extracted from the document
result[].details.amountInWords.valuestringThe value of the amount in words
result[].details.dealerNameobjectThe dealer name extracted from the document
result[].details.dealerName.valuestringThe value of the dealer name
result[].details.receiptNumberobjectThe receipt number extracted from the document
result[].details.receiptNumber.valuestringThe value of the receipt number
result[].details.receiptDateobjectThe receipt date extracted from the document
result[].details.receiptDate.valuestringThe value of the receipt date in DD/MM/YYYY format
metaDataobjectThe object containing metadata information
metaData.requestIdstringThe unique identifier associated with the request
metaData.transactionIdstringThe unique identifier for the transaction

Error Responses

The following are some error responses from the Margin Money Receipt OCR API:

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

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 did not contain the mandatory image file inputProvide a valid image file in the request
400No Image inputThe request is missing the image input parameterEnsure the image parameter is included in the request
400image size cannot be greater than 6 MBThe uploaded image exceeds the supported size limit of 6MBEnsure the image file size is 6MB or less
401Missing/Invalid credentialsThe request is either missing the mandatory appId and appKey combination or has invalid valuesProvide valid appId and appKey credentials in the request
422Document Not DetectedNo valid document could be detected in the provided imageEnsure the image contains a clear, readable margin money receipt document
500Internal Server ErrorThere was an error with HyperVerge's serverPlease 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: