Skip to main content
POST
Extract PAN card fields from an image
Use PAN OCR to prefill a form from a photo of the PAN card instead of asking the user to type. It reads the card only. It does not check the PAN against any registry, so follow it with PAN Validation when you need to know the PAN is real.

Environments

Upload rules

  • Send multipart/form-data with the card in a field named file.
  • Accepted types: JPEG, PNG or PDF. Anything else, or an empty file, returns IDTO_001.
  • Keep the file under 5 MB. Larger files can be rejected with IDTO_503 (413).
  • One card per image, front side, flat and in focus.

How to read the result

  • error_code: null: the card was read. data.pan_number is set only when the text read is a valid PAN shape; dob is YYYY-MM-DD.
  • error_code: "IDTO_202": no PAN could be read. Ask the user for a clearer photo. This result is billed.
  • name, father_name and dob can be null when that part of the card is unreadable.
Send an Idempotency-Key header so a retried upload returns the first result instead of charging again. See Idempotency.

Errors

A missing or wrong X-Client-ID / X-API-Key pair returns 401 with a detail string and is not billed. The full code list is in v2 error codes.

Test scenarios

The OCR upload recipe has a runnable example. See the PAN FAQ for common questions. Was this page helpful? Email us at tech@idto.ai with the page link.

Authorizations

X-Client-ID
string
header
default:<client-id>
required

The Client ID shown on the API Credentials page of the idto dashboard. It is not your account or customer ID, which returns 401. Send it on every server-to-server request together with X-API-Key. Staging and production client IDs are different.

X-API-Key
string
header
default:<api-key>
required

Your API key from the idto dashboard (API credentials). Keep it on your server; never ship it in a browser or mobile app. Send it on every server-to-server request together with X-Client-ID.

Headers

Idempotency-Key
string

Make retries of this exact request safe. If the same key is replayed with an identical request body, the original result is returned without re-running the verification or billing again. If the same key is replayed with a different body, the request is rejected with IDTO_010 (422). Omitting this header runs every request as new.

Maximum string length: 255

Body

multipart/form-data
file
file
required

PAN card image or PDF: JPEG, PNG or PDF, one page, under 5 MB.

workflow_session_token
string

Set only when the call is made inside an idto workflow session.

Response

The image was OCR'd.

status
enum<string>
required
Available options:
success
message
string
required
error_code
string | null
required

null on a full match, an IDTO_2xx code on a definitive no-record result. Both are billed.

data
object | null
required
billed
enum<boolean>
required
Available options:
true
tranx_id
string | null
timestamp
string<date-time> | null
Last modified on December 1, 2026