Skip to main content
POST
/
bharat-ocr
Smart OCR
curl --request POST \
  --url https://sandbox.cashfree.com/verification/bharat-ocr \
  --header 'Content-Type: multipart/form-data' \
  --header 'x-api-version: <x-api-version>' \
  --header 'x-client-id: <api-key>' \
  --header 'x-client-secret: <api-key>' \
  --form verification_id=test_verification_id \
  --form document_type=PAN \
  --form file='@example-file' \
  --form file_url=https://linkofFile \
  --form do_verification=true
{
  "verification_id": "test_verification_id",
  "reference_id": 1358,
  "document_type": "VOTED_ID",
  "document_fields": {
    "voter_id_number": "ABC1234567",
    "name": "John Doe",
    "guardian_name": "Josh Doe",
    "gender": "Male",
    "date_of_birth": "2001-10-02",
    "address": "RMZ Eco world, Building 7 10th Floor, Devarabeesanahalli, Marathalli Outer Ring road, Bangalore - 560103",
    "date_of_issue": "2023-08-15"
  },
  "quality_checks": {
    "blur": false,
    "glare": false,
    "partially_present": false,
    "black_and_white": true,
    "face_present": true,
    "face_clear": true,
    "qr_present": false,
    "obscured": false
  },
  "fraud_checks": {
    "is_screenshot": false,
    "is_photo_of_screen": false,
    "is_photo_imposed": false,
    "is_overwritten": false,
    "is_forged": false
  },
  "qr_details": {
    "status": "SECURE",
    "name": "John Doe",
    "dob": "1979-01-01T00:00:00.000Z",
    "gender": "Male",
    "care_of": "S / O Josh Doe",
    "address": "House No 120, M.V-30, Ward No 04, Kambeda, Orkel, Malkangiri, Kamwada, Odisha - 764051",
    "split_address": {
      "country": "India",
      "dist": "Malkangiri",
      "house": "House No 120",
      "landmark": "Near ABC Complex",
      "pincode": 764051,
      "po": "Kambeda",
      "state": "Odisha",
      "street": "M.V-30",
      "subdist": "Orkel",
      "vtc": "Kamwada",
      "locality": "Ward No 04"
    },
    "year_of_birth": 1979,
    "aadhaar_last_four_digit": 3783,
    "email_linked": true,
    "mobile_linked": true,
    "mobile_hash": "hashed_mobile_value",
    "email_hash": "hashed_email_value",
    "photo_link": "<base64 encoded image>"
  },
  "verification_details": {
    "reference_id": 123,
    "pan": "ABCTY1234D",
    "name": "John Doe",
    "dob": "1993-06-30",
    "name_match": "Y",
    "dob_match": "Y",
    "pan_status": "E",
    "status": "VALID",
    "aadhaar_seeding_status": "Y",
    "aadhaar_seeding_status_desc": "Aadhaar is linked to PAN"
  }
}
Sandbox environment is a testing environment and responses are mocked. For real time verifications, please use the production environment.

Authorizations

x-client-id
string
header
required

Your unique client identifier issued by Cashfree. You can find this in your Merchant Dashboard.

x-client-secret
string
header
required

The secret key associated with your client ID. Use this to authenticate your API requests. You can find this in your Merchant Dashboard.

Headers

x-cf-signature
string

Send the signature if two-factor authentication is selected as Public Key. More details

x-api-version
string
default:2024-12-01
required

API version to be used. Format is in YYYY-MM-DD.

Example:

"2024-12-01"

Body

multipart/form-data

Find the request parameters to perform Smart OCR verification.

verification_id
string
default:test_verification_id
required

It is the unique ID you create to identify the verification request. The maximum character limit is 50. Only alphaumeric, period (.), hyphen (-), and underscore ( _ ) are allowed.

Example:

"test_verification_id"

document_type
enum<string>
required

Tag depicts the document type of the file being shared in the request.

Available options:
PAN,
AADHAAR,
DRIVING_LICENCE,
VOTER_ID,
PASSPORT,
VEHICLE_RC,
CANCELLED_CHEQUE,
INVOICE
Example:

"PAN"

file
file
required

Image of the document. Allowed file types: JPEG, JPG, PNG or PDF. The maximum size of an image and a PDF file is 5 MB and 1 MB, respectively. Conditionally required when file_url is missing. Use image file for better latency of the api.

Example:

"image"

file_url
string
default:file_url

Public URL of the image. Allowed only https URL. Allowed file types: JPEG, JPG, PNG or PDF. The maximum size of image and pdf file are 5 MB and 1 MB respectively. Conditionally required when the file is missing. Use image file link for better latency of the api.

Example:

"https://linkofFile"

do_verification
boolean
default:false

When set to true, performs real-time verification of extracted document data against government databases. Adds a verification_details section to the response with validation results. Currently supports: PAN Card and Driving Licence verification.

Example:

true

Response

Success response for retrieving the list of information associated with the mobile number.

verification_id
string

It is the unique ID shared by the merchant for each request.

Example:

"test_verification_id"

reference_id
integer

It displays the unique ID created by Cashfree Payments for document OCR reference purposes.

Example:

1358

document_type
string

The field will show the document_type shared or predicted if it is not shared in the request.

Example:

"VOTED_ID"

document_fields
object

Structure with all the relevant fields in the input image.

quality_checks
object

Contains all the quality checks the product performs on the given input image. Note: This field can return true, false, or null.

fraud_checks
object

It displays the personal information of the mobile number holder. Note: This field can return true, false, or null.

qr_details
object

It displays the details extracted from QR code present on the document.

verification_details
PAN Verification Details · object

Contains detailed verification information specific to the document type being verified.