ID Document OCR: How It Works and How to Build It (2026)
ID document OCR turns a photo of a passport, ID card or licence into validated fields after authenticity checks run. On Didit it costs $0.15 per check inside a workflow, or $0.20 per standalone API call.

Contents
In this guide
Jump to the part you need.
ID document OCR fits teams who hold photos or scans of passports, ID cards or driver licences and need the fields read, validated and decisioned in one call. On Didit a document check costs $0.15 in a workflow and $0.20 on the standalone API. Caveat: extracted text is not proof of identity. A readable printed copy can still raise a document-liveness warning, and adding liveness and face match is an optional broader KYC check, not a requirement for standalone OCR.
Last updated: November 26, 2026. Prices checked against the live Didit price feed on November 26, 2026.
| Item | Detail |
|---|---|
| What it does | Reads front and back images of a government ID, decodes the MRZ and barcodes, extracts holder fields, checks the document for tampering, returns a status and a warning list |
| Coverage | 14,000+ document types across 220+ countries and territories, document recognition in 130+ languages |
| Price inside a workflow | $0.15 per check |
| Price, standalone API call | $0.20 per call |
| Latency | Sub-2-second p99 inference |
| Statuses | Approved, In Review, Declined, plus Not Started, In Progress, Abandoned, Kyc Expired |
| Main outputs | full_name, document_type, document_number, date_of_birth, expiration_date, parsed_address, mrz, barcodes, portrait and document images, warnings[] |
| Good fit for | Onboarding, re-verification and step-up, age gates, payouts and claims, marketplace sellers, KYB key people |
Start free in the sandbox at business.didit.me, no sales call. For developers, connect Didit to an AI assistant through the Didit MCP server. The reference for this check is the ID Verification overview, and every published number is on the pricing page. Didit runs identity and fraud checks for 4,000+ companies.
What ID document OCR does inside the pipeline
OCR is one stage in the verification flow, and the order of the stages matters. Didit checks whether a document is genuine before it trusts what the document says. The Academy lesson on reading a verification result puts authenticity checks ahead of extracted data, and that ordering is deliberate: a readable printed copy can still trigger a document-liveness warning.
- Capture. The user photographs or uploads the document. Didit detects the document type and issuing country, gives visual cues for framing, light and focus, and captures automatically when the frame is usable. Passports, national ID cards, driver licences and residence permits are all covered.
- Classification. You never declare the country or the document type. The front image is matched against known official document designs, and a front image that does not match a known design with high confidence comes back as
COULD_NOT_DETECT_DOCUMENT_TYPEand declines. - Extraction. The visual zone is read with OCR, the machine-readable zone is parsed with its check digits, and any barcodes are decoded. Fields are returned for the name, document number, dates, nationality and address.
- Cross-validation. Dates, number formats and MRZ check digits are validated, and the visual zone is compared against the MRZ. Disagreements raise
INCONSISTENT_DATAorINVALID_MRZ, which you can configure to decline. - Document liveness. With
perform_document_liveness=true, the images are screened for screen replays, printed copies and portrait manipulation. This is on by default on the standalone endpoint.

A check that did not run is not evidence that the document is genuine. When the forgery provider fails, Didit returns In Review instead of Approved.
Choosing the method: document capture, lookup or wallet
ID Verification is one feature with three methods, and you choose per country which of them are allowed. The session records which method produced the result, and every result carries an assurance tier that states what was actually proven. The tier is an honest description, not a ranking.
| Method | What the user does | Tier on the session | When to choose it |
|---|---|---|---|
| Document capture | Photographs a passport, ID card, driver licence or residence permit | documentary | The default, and the only method available in every supported country. Use it when you need the document itself read and checked for authenticity. |
| Non-document lookup | Types a national ID number plus a few personal details, checked against a government or other authoritative source | data_match | Use it where the country has a source and you would rather not ask for a photograph. The source is named per country, never generalised. |
| Wallet | Signs in with a digital identity such as MitID, BankID or Smart-ID | cryptographic | Use it when the population already holds a wallet and you want signed attributes with no document photograph. |
Methods sit under the methods key on the ID Verification feature config, keyed by ISO 3166-1 alpha-3 country code. Omit a country, or a method inside a country, and that country is document capture only. Each method also takes a fallback such as on_no_match: fallback_to_document for a lookup that finds nothing. Where a lookup source returns a portrait, a selfie is taken and face-matched inside the lookup price; where it returns data only, run Liveness and Face Match as their own workflow steps if you need them.

Use cases for ID document OCR
- Onboarding. Read the document once, store structured fields, and avoid asking the customer to retype a name or a date of birth the document already carries.
- Step-up and re-verification. A user who already passed biometrics can be re-checked on the document alone when an expired document surfaces in your data.
- Age gates. The standalone call takes
minimum_age, and a document below the threshold raisesMIN_AGE_NOT_REACHEDinstead of quietly passing. - Payouts and claims. Compare the account holder on a claim against the identity document you already hold, and route mismatches to review.
- Marketplace sellers and KYB key people. Every owner and officer in a business verification can be linked to a document check, billed per person.
- Documents that are not IDs. Payslips, bank statements, proof of funds and invoices belong to Document AI, where you define the fields to extract.
Prerequisites before your first call
- A Didit organization and an API key from the Business Console, sent as the
x-api-keyheader againsthttps://verification.didit.me. - Credit on the account. Sandbox testing is free and unlimited, and the Free plan includes $10 of monthly credit for organizations that sign up with a work email. Phone codes are excluded from Free credit.
- Images in jpg, jpeg, png, webp, tiff or pdf, up to 5 MB per file, uncropped, with all four corners of the document visible.
- A decision on delivery mode: a hosted workflow session or the standalone server-to-server call. The paid steps section below lists both rates.
- An endpoint for the
status.updatedwebhook, or a server that can callGET /v3/session/{sessionId}/decision/after the user finishes.
Step by step: from a document image to a decision
- Create the API key and check your balance. Keys are created in the Business Console. A call made with no available credit returns HTTP 403 before any image is processed, so check the balance first.
- Choose the delivery mode, because it decides the billing line. Hosted workflow billing and standalone API billing are separate lines: inside a workflow the check is billed per completed check, while the standalone call is billed per request and only a 200 response consumes a credit. Use the workflow route for user-facing flows, where the document arrives through the hosted session or the Web and Mobile SDKs. Use the standalone route for server-to-server jobs where you already hold the images.
- Configure the workflow. Add the ID Verification feature in the Business Console or through
POST /v3/workflows/. The canonical feature enum isID_VERIFICATION, withOCRkept as the legacy value. Restrict accepted documents withdocuments_allowed, and set the risk actions you want:invalid_mrz_action,inconsistent_data_actionandexpiration_date_not_detected_actioneach takeDECLINEorNO_ACTION. A workflow that says nothing about methods stays document capture only. - Create a session. Send
workflow_id,vendor_dataandcallbacktoPOST /v3/session/. The response returns asession.url. - Hand the user to the session. Open
session.urlor mount the SDK. The user captures the document, and Didit runs capture, extraction and the checks without further input from you. - Fetch the decision. Call
GET /v3/session/{sessionId}/decision/or subscribe to thestatus.updatedwebhook. The result appears under the plural arrayid_verifications[], one entry per document collected in the workflow, each with its ownnode_id. - Call the standalone endpoint when you already hold the images. One multipart request returns OCR plus the fraud checks. This is the snippet from the Didit docs:
curl -X POST 'https://verification.didit.me/v3/id-verification/' \
-H 'x-api-key: YOUR_API_KEY' \
-F 'front_image=@./id_front.jpg' \
-F 'back_image=@./id_back.jpg' \
-F 'perform_document_liveness=true' \
-F 'minimum_age=18' \
-F 'expiration_date_not_detected_action=DECLINE' \
-F 'invalid_mrz_action=DECLINE' \
-F 'inconsistent_data_action=DECLINE' \
-F 'preferred_characters=latin' \
-F 'save_api_request=true' \
-F 'vendor_data=user-123'
front_image is required. back_image is required for two-sided documents such as ID cards and driver licences. Sending the request without the back image is a 400, not a partial read.
- Act on the status and the warnings together. A readable but problematic document returns HTTP 200 with
status: "Declined", so inspecting the HTTP code alone is not enough. Readid_verification.statusandid_verification.warnings, then branch. - Correct a misread field instead of asking for a new photo.
PATCH /v3/session/{session_id}/update-data/fixes KYC fields on a finished session. Send only the fields that change; the name is recomputed and an audit trail records the previous and new value.
curl -X PATCH "https://verification.didit.me/v3/session/<SESSION_ID>/update-data/" \
-H "x-api-key: <API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"first_name": "John",
"last_name": "Doe",
"date_of_birth": "1990-01-01",
"issuing_state": "ESP",
"extra_fields": { "municipality": "Madrid" }
}'
When the image itself is unusable, do not patch around it. Ask the user to resubmit through PATCH /v3/session/{id}/update-status/ with new_status: "Resubmitted", and let the capture step do its job.
What the response looks like
The standalone call returns a correlation id and one report object. Fields the document did not supply, or that could not be read, come back as null rather than as an empty string.
{
"request_id": "...",
"id_verification": {
"status": "Approved",
"full_name": "...",
"document_type": "Passport",
"document_number": "...",
"date_of_birth": "...",
"expiration_date": "...",
"parsed_address": { ... },
"mrz": { ... },
"barcodes": [ ... ],
"portrait_image": "https://<media-host>/ocr/...",
"front_document_image": "https://<media-host>/ocr/...",
"back_document_image": "https://<media-host>/ocr/...",
"warnings": []
}
}
With save_api_request=true, the default, the call is persisted as an API-type session that appears in the Business Console, and request_id is a real session id you can pass to the decision endpoint. Media fields are presigned URLs with a limited validity window, so download them promptly instead of storing the URL.

Inputs and outputs
| Field | Required | Notes |
|---|---|---|
front_image | Yes | jpg, jpeg, png, webp, tiff or pdf, max 5 MB, uncropped |
back_image | For two-sided documents | ID cards and driver licences |
perform_document_liveness | No | Defaults to true on the standalone endpoint |
minimum_age | No | Raises MIN_AGE_NOT_REACHED below the threshold |
invalid_mrz_action, inconsistent_data_action, expiration_date_not_detected_action | No | Each takes DECLINE or NO_ACTION |
preferred_characters | No | Script preference for extraction |
save_api_request | No | Default true; false stores nothing and returns one-off URLs |
vendor_data | No | Your own identifier for the person |
| Output | Why it matters |
|---|---|
status | Approved is the only state that means the check passed. In Review is not an approval. |
warnings[] | Each entry carries risk, log_type, short_description and long_description; the long description is written for end-user surfaces. |
full_name, date_of_birth, document_number | Typed fields for your own records, matching and downstream screening. |
document_type, document_subtype | Readable class plus the registry code, filtered to what the workflow accepts. |
expiration_date, mrz, barcodes | Validity window and the machine-readable evidence behind the cross-checks. |
portrait_image, front_document_image, back_document_image | Short-lived media URLs for your case file or face match step. |
Failure cases and recovery
| Layer | What you see | What it means | Recovery |
|---|---|---|---|
| HTTP | 403, not enough credits | The organization balance cannot cover the call; nothing was processed | Top up or wait for the monthly credit, then retry |
| HTTP | 400 with COULD_NOT_RECOGNIZE_DOCUMENT | The document cannot be processed at all | Ask for a new capture: uncropped, all four corners visible, better light |
| HTTP | 400 multipart validation | Missing back_image on a two-sided document, file over 5 MB, unsupported extension | Fix the request; nothing is billed |
| Status | Declined with DOCUMENT_EXPIRED or DOCUMENT_LIVENESS_FAILED | On an HTTP 200 response, a terminal warning resolved to a decline | Surface the first warning long description, stop the flow, do not retry blindly |
| Status | In Review with DOCUMENT_LIVENESS_NOT_COMPUTED | The forgery check returned no usable score, so the document is unchecked | Route to manual review. This escalation is not configurable |
| Status | In Review with other warnings | The check could not reach a decision | Send to your review queue; do not approve |
| Warning | INVALID_MRZ, INCONSISTENT_DATA, EXPIRATION_DATE_NOT_DETECTED | A risk group governed by your per-request action parameter, so the same warning can decline or pass | Set the action to DECLINE where the risk is unacceptable to you, or handle the warning yourself under NO_ACTION |
| Warning | DUPLICATED_DOCUMENT | A duplicate-document warning. We do not publish a fixed disposition for it. | Inspect the warning details and apply your review policy |
Read the HTTP status and the feature status as two separate layers: the HTTP code tells you whether the call ran, the feature status and warnings tell you what the check concluded. The full risk catalogue, with the description text for every code, is the ID verification warnings page. The canonical field schema is in the data models reference.
Paid steps and review boundaries
- ID document check in a workflow: $0.15 per check. This is the price that applies when the check runs as a step in a session.
- Standalone ID verification API: $0.20 per call, one credit per HTTP 200 response.
- NFC chip reading: $0.15 per check, as a separate add-on to a document check when you need the chip rather than the print.
- Document liveness: runs inside the same call. The published price book has no separate line for it.
- Full KYC: $0.33, which is the document check at $0.15 plus passive liveness at $0.10, face match 1:1 at $0.05 and device and IP analysis at $0.03.
- Non-document lookup and wallets: priced separately from the document check, variable per country for a lookup and published per wallet. Check the pricing page before you enable a method in a country.
The review boundary is the part teams get wrong. Didit returns a decision per check: Approved, Declined or In Review. In Review means the system could not reach a trustworthy answer, and the session must land in a human queue. Do not build logic that treats a timeout, a provider error or a missing forgery score as a pass. Build the opposite: the default on an unanswered check is review.
Worked cost example
Take 20,000 onboarding checks a month, all of them document plus biometrics.
- Document only, inside a workflow: 20,000 x $0.15 = $3,000.00 a month.
- Full KYC, inside a workflow: 20,000 x $0.33 = $6,600.00 a month.
- Full KYC on Growth: $0.33 x 0.96 = $0.3168 per check, so 20,000 x $0.3168 = $6,336.00 a month, and the plan fee is $99.00 a month with $115.00 of credit included.
- Full KYC on Scale: $0.33 x 0.90 = $0.297 per check, so 20,000 x $0.297 = $5,940.00 a month, and the plan fee is $299.00 a month with $350.00 of credit included.
- The same 20,000 documents sent through the standalone API instead: 20,000 x $0.20 = $4,000.00 a month, which is $1,000.00 more than the workflow route. Use the standalone call when you already hold the images and do not need a session, not as a default.
Add Document AI at $0.20 per document only for the files that are not IDs, such as a bank statement uploaded as proof of funds.
Sources
- Didit docs: ID Verification overview
- Didit docs: standalone ID Verification API (OCR and authenticity)
- Didit docs: ID verification methods, document, lookup and wallet
- Didit docs: ID verification warnings catalogue
- Didit docs: data models and report schemas
- Didit docs: update session data API
- Didit docs: Document AI API
- Didit docs: pricing and billing rules
- Didit pricing page and pricing JSON feed, read November 26, 2026
- Didit integration prompt and Didit MCP server
Next step: open the sandbox at business.didit.me, create a workflow with ID verification, and run one document through it. No sales call and no contract, and the Free plan's $10 of monthly credit covers the test.
Try it
Try this in the sandbox
Run the check this guide describes, free.
The product this post is about, taken from its topic. Run it free in the sandbox.
Author
Alberto Rosas
Co-founder and CEO

Questions
Frequently asked questions
How does ID document OCR work?
ID document OCR turns a photo of a passport, ID card, driver licence or residence permit into typed fields. Didit classifies the document automatically, reads the visual zone with OCR, decodes the MRZ and any barcodes, then cross-checks the two before returning values such as name, date of birth, document number and expiry. Authenticity checks run in the same call, so a value can come back with a warning attached to it.
How much does ID document OCR cost on Didit?
Didit charges $0.15 per document check inside a workflow and $0.20 per call on the standalone ID verification API. Growth takes 4% off every Didit price and Scale takes 10%, which makes the workflow check $0.144 and $0.135. Billing is per completed check from prepaid credit, with $10 of monthly credit on the Free plan for organizations that sign up with a work email.
Which image formats and sizes does the API accept?
Didit accepts jpg, jpeg, png, webp, tiff and pdf, with a maximum of 5 MB per file. Send front_image always, and back_image for two-sided documents such as ID cards and driver licences. Upload uncropped photos with all four corners visible, because Didit detects, aligns and crops the document itself.
What should I do when the status comes back In Review?
Treat In Review as an unresolved check, never as an approval. The most common cause is DOCUMENT_LIVENESS_NOT_COMPUTED, where the forgery check returned no usable score and the document is effectively unchecked. Route those sessions to a manual review queue and read the whole warnings[] array rather than the status alone.
Can I correct fields that the OCR read wrong?
Yes. PATCH /v3/session/{session_id}/update-data/ corrects KYC fields on a finished session, including document number, dates, name, nationality and parsed address, and only the fields you send change. Each update fires a data.updated webhook and the audit trail records the previous and new values. When the image itself is unusable, ask the user to resubmit instead.
Does ID document OCR work on documents that are not IDs?
Not on the ID verification endpoint, which is built for government-issued identity documents. Didit runs a separate Document AI product at $0.20 per document for payslips, bank statements, proof of funds, invoices and tax documents, where you define up to 30 fields and can compare a name against an expected person or company.
Is ID document OCR the same thing as KYC?
No. The document check reads and authenticates the ID; a full KYC check on Didit also runs passive liveness, face match 1:1 and device and IP analysis, priced together at $0.33. You can buy the document check alone when biometrics sit in another system you already trust, or when you only need the document read.
Which document types and countries are supported?
Didit covers 14,000+ document types across 220+ countries and territories, including passports, national ID cards, driver licences, residence permits, work permits, visas and health insurance cards. Classification is automatic, so you do not declare the country or the type in the request. A workflow can still restrict which types and subtypes it accepts.
How fast is the check?
Didit reports sub-2-second p99 inference for ID verification. In a hosted session the end-to-end time also includes the user's capture step, so measure latency against your own flow rather than the API figure alone.
What is the difference between the $0.15 and the $0.20 price?
The $0.15 price applies when the ID check runs as a step inside a Didit workflow, where the document arrives through the hosted session or the SDK. The $0.20 price applies to the standalone POST /v3/id-verification/ call that you make server to server when you already hold the images.
Can a user verify without a document at all?
In some countries, yes. ID Verification has three methods: document capture, a non-document lookup against an authoritative source, and a digital ID wallet such as MitID, BankID or Smart-ID. Each result carries an assurance tier so you can see whether a document was inspected, a record was matched or a wallet signed the attributes. Document capture remains available in every supported country, and the methods are set per country in the feature config.
Compliance built in
Audited, certified and attested.
We hold the certifications and build each country's rules into your flows, so you can launch anywhere without worrying. Security and Compliance center
- Regulation encoded into your flows
Tell us what you do and where. Didit lists the rules that apply to you, with sources, and builds the checks each country needs into one workflow.
- Ready for AMLR
Every requirement of the new EU anti-money laundering rules, from checking customers to human review, is already covered by a Didit check.
- Tested in Spain's Treasury sandbox
Spain's Treasury published its supervised sandbox report on Didit's NFC plus active liveness onboarding; SEPBLAC took part and valued the added measures positively.
- Audited, not self-declared
iBeta Level 1 and Level 2. Liveness tested under ISO/IEC 30107-3.
Your obligations · 3 regions
SOC 2 Type 2
ISO 27001
iBeta Level 1 and Level 2
EU regulator attestation
FSM youth protection
GDPR
EBA remote onboarding
MiCA compatible
FIDO Alliance member
- AMLREU AML Regulation ready
Integration · Didit MCP
Run Didit from your own AI agent
Connect Didit to Claude, Cursor, VS Code or ChatGPT and just ask in plain words. Your agent can do anything you can do in the console, with the same permissions you have.
- Build workflowsDescribe the checks you need. The agent creates and publishes the flow.
- Run investigationsAsk why a session was declined, review cases, search people and companies.
- Change rulesCreate payment rules, test them on past data and switch them on.
- Pull reportsAsk for numbers, exports or the audit log.
Didit Academy


