Skip to main content

Pay Slip OCR API

The following document highlights the details of the Pay Slip OCR API.

API Description

Objective

The Pay Slip OCR API extracts information from a user's payslip or salary slip using optical character recognition (OCR) and returns the extracted data in a JSON format.

InputOutput
An image or PDF file of the user's payslip documentThe pay slip data extracted from the 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/readINDPayslip

API Endpoint

readINDPayslip

Overview

The Pay Slip 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 Pay Slip 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 Pay Slip OCR API's request body:

ParameterMandatory / OptionalTypeDescriptionInput FormatDefault Value
imageMandatoryfileThe image file of the user's pay slipImage file (JPEG, JPG, PNG) or PDFNot Applicable

Request

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

curl --location --request POST 'https://ind-engine.thomas.hyperverge.co/v1/readINDPayslip' \
--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 a Pay Slip or Salary Slip Document: pay_slip_ocr_api

Success Response

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

{
"status": "success",
"statusCode": 200,
"result": {
"details": [
{
"fieldsExtracted": {
"employerName": {
"value": "<Employer_Name>"
},
"monthOfSalarySlip": {
"value": "<Month_Of_Salary_Slip>"
},
"yearOfSalarySlip": {
"value": "<Year_Of_Salary_Slip>"
},
"employeeDesignation": {
"value": "<Employee_Designation>"
},
"employeeName": {
"value": "<Employee_Name>"
},
"employeeID": {
"value": "<Employee_ID>"
},
"employeePANNumber": {
"value": "<Employee_PAN_Number>"
},
"employeeUANNumber": {
"value": "<Employee_UAN_Number>"
},
"employeeDateOfJoining": {
"value": "<Employee_Date_Of_Joining_in_DD/MM/YYYY_Format>"
},
"baseSalary": {
"value": "<Base_Salary_in_INR>"
},
"grossSalary": {
"value": "<Gross_Salary_in_INR>"
},
"netSalary": {
"value": "<Net_Salary_in_INR>"
},
"bonus": {
"value": "<Bonus_Amount_in_INR>"
},
"incentive": {
"value": "<Incentive_Amount_in_INR>"
},
"pfAccountNumber": {
"value": "<PF_Account_Number>"
},
"pfDeducted": {
"value": "<PF_Deducted_Yes_Or_No>"
},
"pfDeductionAmount": {
"value": "<PF_Deduction_Amount_in_INR>"
},
"professionalTaxAmount": {
"value": "<Professional_Tax_Amount_in_INR>"
},
"incomeTaxAmount": {
"value": "<Income_Tax_Amount_in_INR>"
},
"overtimeAllowance": {
"value": "<Overtime_Allowance_in_INR>"
},
"nightShiftAllowance": {
"value": "<Night_Shift_Allowance_in_INR>"
},
"netAppraisedSalary": {
"value": "<Net_Appraised_Salary_in_INR>"
}
},
"type": "<Document_Type>"
}
]
},
"metadata": {
"requestId": "<Request_ID>"
}
}

Success Response Details

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

ParameterTypeDescription
statusstringThe status of the request
statusCodeintegerThe HTTP status code returned for the request
resultobjectContains the extracted details from the payslip
detailsarrayContains the extracted fields with their values and confidence scores
fieldsExtractedobjectContains all the extracted payslip fields and their values
employerNamestringThe name of the employer
monthOfSalarySlipstringThe month for which the salary slip is generated
yearOfSalarySlipstringThe year for which the salary slip is generated
employeeDesignationstringThe designation of the employee
employeeNamestringThe name of the employee
employeeIDstringThe unique identifier for the employee
employeePANNumberstringThe 10-digit PAN of the employee
employeeUANNumberstringThe UAN number of the employee
employeeDateOfJoiningstringThe date of joining of the employee
baseSalarystringThe base salary of the employee
grossSalarystringThe gross salary of the employee
netSalarystringThe net salary of the employee after deductions
bonusstringThe bonus amount for the employee
incentivestringThe incentive amount for the employee
pfAccountNumberstringThe PF account number of the employee
pfDeductedstringIndicates if PF is deducted from the salary
pfDeductionAmountstringThe amount deducted for PF
professionalTaxAmountstringThe professional tax amount deducted
incomeTaxAmountstringThe income tax amount deducted from the salary
overtimeAllowancestringThe allowance for overtime work
nightShiftAllowancestringThe allowance for working night shifts
netAppraisedSalarystringThe net appraised salary of the employee
typestringThe type of document processed
metadataobjectContains request and transaction identifiers
requestIdstringA unique identifier for the request

Failure Response

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

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

Error Responses

The following are some error responses from the Pay Slip 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 payslip 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: