Automate US & Canadian Driver License Verification in n8n
Send front and back driver's license photos (including native iPhone HEIC) from an n8n Form or Webhook to POST /v1/driver-license-verify, cross-check printed text against the back AAMVA PDF417 barcode, and route Approved, Retake (422 auto-refunded), or Manual Review decisions automatically.

Why pair n8n with StructOCR POST /v1/driver-license-verify
n8n is great for orchestrating onboarding forms, Slack alerts, and CRM records, but it cannot decode dense AAMVA PDF417 barcodes or reconcile front-side OCR with back-side barcode fields across 50 US states and 13 Canadian provinces. StructOCR's zero-retention POST /v1/driver-license-verify endpoint runs deterministic back-side PDF417 decoding first, extracts printed front fields, compares core identity fields plus Document Discriminator (DD vs. DCF), and returns a single decision payload. Want to skip manual wiring? Download the ready-to-import n8n workflow JSON (n8n: Workflows → Import from File) with dual-file Form Trigger, HTTP Request node, outcome Code node, and 3-way Switch router.
Why front-only ID OCR breaks automated onboarding in n8n
Reading only the front photo of a driver's license inside an automation workflow cannot catch an edited date of birth or altered license number when the back AAMVA PDF417 barcode was never re-encoded. Conversely, wiring two separate OCR and barcode services in n8n forces you to maintain fragile state-by-state normalization rules for middle initials, suffixes, and Document Discriminators across 63 US and Canadian jurisdictions—while mobile-SDK vendors require sales-gated annual contracts.
One zero-retention endpoint built for n8n Switch routing
StructOCR's Driver License Verification API (POST /v1/driver-license-verify) combines deterministic back-side AAMVA PDF417 decoding, front-side OCR, and deterministic cross-checking in a single REST request. Back barcode decoding runs first so blurry uploads return HTTP 422 with a full 4-credit refund and zero wasted spend. Review every response field in the API reference, test a single barcode first in our free PDF417 scanner, or compare pay-as-you-go pricing against enterprise SDKs in our 9-vendor pricing comparison matrix.
Build the n8n verification workflow (5 nodes)
Capture front and back photos in a Form or Webhook trigger
Add an n8n Form Trigger (or a Webhook node accepting multipart uploads from your web/mobile app) with two required file fields named
frontandback, plus an optional numeric fieldmin_age(for example21for alcohol/cannabis delivery or25for car rentals).Supported formats: JPG, PNG, WebP, and native iPhone HEIC/HEIF (up to 4.5 MB per image). Do not downsample or JPEG-recompress back barcode photos before upload—sharp barcode edges minimize 422 retakes.Store your StructOCR API key using Header Auth
In n8n Credentials, create a Header Auth credential with Name
x-api-keyand Value set to your StructOCR API key. Using credentials keeps secrets out of exported workflow JSON files.New accounts include 200 permanent free credits (50 full front+back verifications at 4 credits each) with no credit card required at structocr.com/register.Credential type: Header Auth Name: x-api-key Value: <your StructOCR API key>Configure the HTTP Request node for POST /v1/driver-license-verify
Add an HTTP Request node set to
POST https://api.structocr.com/v1/driver-license-verifywith Body Content Type Form-Data. Attach two n8n Binary File parameters namedfrontandbackmapped to your trigger's binary keys, plus an optional Form Data parametermin_age.Enable Options → Response → Never Error. When a back PDF417 barcode is too blurry or glared to read, StructOCR returns HTTP 422 withfailed_side: "back"andcapture_issueand automatically refunds all 4 credits—with Never Error enabled, your workflow routes directly to a clean retake prompt instead of crashing.Method: POST URL: https://api.structocr.com/v1/driver-license-verify Authentication: Generic Credential Type → Header Auth Send Body: On Body Content Type: Form-Data Parameter 1: n8n Binary File | Name: front | Input Data Field: front Parameter 2: n8n Binary File | Name: back | Input Data Field: back Parameter 3: Form Data | Name: min_age | Value: ={{ $json.min_age || '21' }} Options: Response → Never Error: OnNormalize the verdict into 3 clean routes in a Code node
Add a Code node (Run Once for All Items, JavaScript) right after the HTTP Request node. It checks
res.success,data.verification.overall_status,is_expired, andmeets_min_ageto emit one flat record withrouteset toapproved,retake_required, ormanual_review.Prefer the authoritative AAMVA barcode values indata.backfor canonical storage, while keepingdd_dcf_matchandmismatchesfor auditability. Remember: StructOCR enforces strict Zero Data Retention and does not retain images or identity payloads.Branch with a Switch node to your CRM, Slack, or retake email
Connect a built-in Switch node on
{{ $json.route }}with three outputs: Approved (write verified fields to Postgres, HubSpot, Airtable, or your rental system), Retake Required (422) (send the actionablecapture_issuemessage back to the applicant at 0 credit cost), and Manual Review (alert compliance in Slack whenoverall_statusismismatch,expired, or underage).Note the scope boundary:POST /v1/driver-license-verifyverifies card-level front/back consistency, DD vs. DCF, expiration, and age thresholds—it does not query state DMV or AAMVA DLDV government databases.
Production n8n workflows you can launch without custom backend code
- Car rental & peer-to-peer fleet onboarding (min_age=25): Verify driver license front/back consistency, expiration, and 25+ age requirements automatically before unlocking reservation confirmation or sending insurance addendums.
- Age-gated e-commerce & local delivery compliance (min_age=21): Gate alcohol, tobacco, or regulated delivery orders from Shopify/WooCommerce webhooks by routing
verified_match+is_over_21: trueto fulfillment and flagging expired or mismatched IDs. - Property management & short-term rental guest screening: Collect iPhone HEIC license photos through a branded n8n Form, verify front/back fields with strict zero data retention on the OCR layer, and push only your approved status into your PMS.
- KYC pre-screening before paid DMV or background checks: Filter out expired, underage, or front/back mismatched cards at $0.0232–$0.04/check before triggering expensive downstream background-check or authorized DMV/DLDV registry calls.
n8n Code node: classify Approved, Retake (422), and Manual Review
Paste this JavaScript snippet into a <strong>Code</strong> node (Run Once for All Items) right after the HTTP Request node. It produces a clean <code>route</code> key for n8n's built-in <strong>Switch</strong> node while preserving <code>dd_dcf_match</code>, <code>mismatches</code>, and 422 capture hints.
Prerequisite: n8n Cloud or self-hosted n8n + a free StructOCR API key (200 permanent credits = 50 full checks)
Method: POST
URL: https://api.structocr.com/v1/driver-license-verify
Authentication: Generic Credential Type
Generic Auth Type: Header Auth
Name: x-api-key
Value: <your StructOCR API key>
Send Body: on
Body Content Type: Form-Data
Body Parameters:
1. Parameter Type: n8n Binary File
Name: front
Input Data Field Name: front
2. Parameter Type: n8n Binary File
Name: back
Input Data Field Name: back
3. Parameter Type: Form Data (optional)
Name: min_age
Value: ={{ $json.min_age || '21' }}
Options:
Response → Never Error: onSample HTTP Request node output (Synthetic Example)
Fictional California driver's license verification payload returned by <code>POST /v1/driver-license-verify</code> before entering the n8n Code node.
{
"success": true,
"data": {
"verification": {
"overall_status": "verified_match",
"front_back_match": true,
"dd_dcf_match": "matched",
"is_expired": false,
"is_over_18": true,
"is_over_21": true,
"age_years": 34,
"meets_min_age": true,
"mismatches": [],
"field_checks": {
"document_number": "matched",
"surname": "matched",
"given_names": "matched",
"date_of_birth": "matched",
"date_of_expiry": "matched",
"region": "matched",
"document_discriminator": "matched"
},
"scope_notice": "Card-level front/back consistency check only; does not query DMV or government registries."
},
"front": {
"country_code": "USA",
"region": "CA",
"document_number": "F1234567",
"surname": "SMITH",
"given_names": "JESSICA LYNN",
"date_of_birth": "1992-04-12",
"date_of_expiry": "2031-04-12",
"extra_details": {
"card_security_number": "08/15/2023612345/AAFD/31"
}
},
"back": {
"source": "pdf417",
"country_code": "USA",
"region": "CA",
"document_number": "F1234567",
"surname": "SMITH",
"given_names": "JESSICA LYNN",
"date_of_birth": "1992-04-12",
"date_of_expiry": "2031-04-12",
"document_discriminator": "08/15/2023612345/AAFD/31",
"issuer_identification_number": "636014",
"aamva_version": 9
}
}
}Technical Specs
- Endpoint:
POST https://api.structocr.com/v1/driver-license-verifywithx-api-keyheader - Upload format: Direct binary
multipart/form-data(front+back+ optionalmin_age) or Base64 JSON; max 4.5 MB per image - Accepted files: JPG, PNG, WebP, and native Apple iPhone HEIC/HEIF (with automatic EXIF orientation handling)
- Privacy: Strict Zero Data Retention — images execute strictly in memory,
raw_response: nullin logs, zero AI training - Cost & Auto-Refund: 4 permanent credits per completed verification ($0.0232–$0.04/check; 200 free credits = 50 checks). Unreadable back PDF417 barcodes return HTTP 422 and automatically refund all 4 credits
Key Features
- 100% Built-in n8n Nodes: Runs on both n8n Cloud and self-hosted Docker using only Form Trigger, HTTP Request, Code, Switch, and Set nodes.
- Back-First Short-Circuit: Decodes the back AAMVA barcode before reading the front, returning structured
failed_sideandcapture_issueretake prompts at 0 credit cost on unreadable photos. - Deterministic Cross-Check Rules: Normalizes middle initials (
partial_match), suffixes (JR/SR/III), diacritics, and all 63 US/Canadian jurisdiction codes. - Explicit Scope Boundary: Verifies card-level consistency, DD vs. DCF, expiry, and age thresholds cleanly—without pretending to query state DMV registries.
Frequently Asked Questions
Does this n8n workflow require paid community nodes or a mobile SDK?
Can applicants upload raw iPhone HEIC photos directly through an n8n Form?
front and back inputs accept JPG, PNG, WebP, and native Apple HEIC/HEIF files up to 4.5 MB each, with automatic EXIF orientation correction on the server.What happens in n8n if the back PDF417 barcode is blurry or has glare?
failed_side: "back" and a specific capture_issue (such as out_of_focus or glare) and automatically refunds all 4 credits. Because the HTTP Request node has Never Error enabled, the workflow routes cleanly to the Retake Required branch.Does StructOCR store uploaded driver's license photos or identity data?
POST /v1/driver-license-verify enforces strict Zero Data Retention: uploaded images and extracted identity payloads are processed in memory only and are never saved to storage buckets or database audit logs. Note that if you turn on execution data saving inside your own n8n instance, configure n8n's execution pruning policy according to your compliance requirements.Does this workflow check whether a license is suspended in a DMV database?
POST /v1/driver-license-verify performs card-level front/back consistency, Document Discriminator (DD vs. DCF), expiration, and age checks only. It does not query state DMV or AAMVA DLDV government databases; if your workflow needs live DMV status, pass the verified output from the Approved branch to an authorized records provider.More Tutorials
n8n Image to Excel OCR Workflow – Photo to Sheets
Configure an n8n workflow that converts JPG, PNG, and WebP table photos into Excel (.xlsx) files or Google Sheets rows using one HTTP Request node to POST /v1/image-to-excel with zero data retention.
Saudi Driving Licence OCR in n8n: Licences to JSON
Read Saudi driving licences in n8n with one HTTP Request node: licence and ID number, name, dates and licence class as JSON. Includes a ready-made workflow to import.
Saudi Istimara OCR in n8n: Registration Cards to JSON
Build an n8n workflow that reads Saudi vehicle registration cards (Istimara) with one HTTP Request node: owner and user IDs, plate, VIN, vehicle weight, load capacity and sequence number as JSON.
Saudi National ID & Iqama OCR in n8n: KYC to JSON
Read Saudi National IDs and Iqamas in n8n with one HTTP Request node: 10-digit ID number, name, nationality, dates and MRZ as JSON. Includes a ready-made workflow to import.
Ready to Build with StructOCR?
Get your API key in under a minute. New users receive 200 free credits to test Passport, VIN, License Plate, Container, Receipt, HIN, Driver License, ID Card, Vehicle Registration, Weighbridge Ticket, ATM Cassette and Invoice OCR APIs.
✓ No credit card required · ✓ Instant API key · ✓ Full API access