Fix AAMVA_NOT_VALID After PDF417 Decoding
Understand AAMVA_NOT_VALID responses when a PDF417 symbol is readable but is not a usable US driver license or State ID record.
What the Failure Means
AAMVA_NOT_VALID is different from an unreadable image. A PDF417 symbol was decoded, but its payload did not contain a usable AAMVA driver-license record with the required structure.
A Reliable Recovery Path
Confirm that the uploaded image is the back of a US driver license or State ID, reject unrelated PDF417 symbols, and route persistent cases to document review. Consult the PDF417 error reference for status codes and use the scanner with fictional or authorized samples while tuning capture guidance.
Where This Workflow Fits
- Correct document type: Validate this condition before the image leaves the capture screen.
- Back side submitted: Include this check in support guidance and quality monitoring.
- AAMVA header present: Include this check in support guidance and quality monitoring.
Handle the Result Explicitly
Treat capture errors as application states. Never substitute guessed identity values when the barcode cannot be validated.
Prerequisite: A server-side API integration and a capture UI that can request a new license-back image
if response.status_code == 422:
error = response.json().get("error")
if error == "AAMVA_NOT_VALID":
return {
"action": "review_document",
"message": "Use the back of a US driver license or State ID.",
}Technical Specs
- •Endpoint: POST https://api.structocr.com/v1/driver-license-pdf417
- •Success status: HTTP 200 after barcode and required AAMVA data are usable
- •Unreadable barcode: HTTP 422 with PDF417_NOT_DECODED
- •Invalid record: HTTP 422 with AAMVA_NOT_VALID
- •Processing failures: Refunded according to the endpoint behavior
- •Safety rule: Never infer missing barcode fields from an unsuccessful response
Key Features
- •Correct document type: Make this condition visible in capture guidance, validation, or review tooling.
- •Back side submitted: Make this condition visible in capture guidance, validation, or review tooling.
- •AAMVA header present: Make this condition visible in capture guidance, validation, or review tooling.
- •No unrelated shipping or ticket barcode: Make this condition visible in capture guidance, validation, or review tooling.
Example Recoverable Error
This illustrative error contains no personal data. Use the error code, rather than free-form text, to select the next application action.
{
"success": false,
"error": "AAMVA_NOT_VALID",
"message": "Upload a clear image of the complete back of the US driver license or State ID."
}Frequently Asked Questions
Are failed PDF417 processing attempts charged?
The endpoint charges 2 credits for a successful decode; documented processing failures are refunded.
Can generative OCR fill fields when PDF417 decoding fails?
Do not present inferred values as barcode data. Ask for a retake or use the separate front-side OCR endpoint with a clearly identified source.
What should be logged?
Log request IDs, status, error code, timing, and capture-quality signals. Avoid logging raw images, Base64 payloads, or complete identity responses.
You May Also Like
Related tutorials, platform guides, and comparisons
ASP.NET Core PDF417 Driver License API
Build a minimal ASP.NET Core API that decodes US driver license PDF417 barcodes and returns normalized AAMVA JSON with safe retake handling.
Driver License PDF417 Glare and Blur Capture Guide
Design a better driver license barcode capture flow by controlling glare, motion blur, distance, perspective, and image compression.
Maryland Driver License OCR: Extract Fields with Python
Extract visible fields from Maryland driver license images into JSON. Map identifiers, names and dates, with a review workflow for incomplete results.
Colombia Driver License OCR: Extract Fields with Python
Extract visible fields from Colombia driver license images into JSON. Map identifiers, names and dates, with a review workflow for incomplete results.
Go Driver License OCR API
Upload an image for a free test! Struggling with manual driver's license data entry? Our Go API delivers structured JSON in seconds, with SOC 2 Type II and AES-256 encryption.
Brazil Driver License OCR with Node.js SDK
Extract structured fields from a Brazil Carteira Nacional de Habilitação (CNH) with the StructOCR Node.js SDK and TypeScript + Express.
Fix PDF417_NOT_DECODED for Driver License Images
Diagnose PDF417_NOT_DECODED responses from US driver license backs. Improve framing, focus, glare control, resolution, and retake UX.
Australia Driver License OCR with Python SDK
Extract structured fields from a Australia state or territory driver licence with the StructOCR Python SDK and FastAPI.
Australia Driver License OCR with Node.js SDK
Extract structured fields from a Australia state or territory driver licence with the StructOCR Node.js SDK and TypeScript + Express.
Brazil Driver License OCR with Python SDK
Extract structured fields from a Brazil Carteira Nacional de Habilitação (CNH) with the StructOCR Python SDK and FastAPI.
Technical Comparisons & Integrations
Explore platform integrations and competitive analysis
Add Driver's License OCR to Your Bolt.new App in 5 Minutes
Step-by-step guide to integrating the StructOCR Driver's License scanner API into a Bolt.new app. Build car rental and mobility onboarding flows right in your browser.
Add Driver's License OCR using Cursor in 5 Minutes
Step-by-step guide to integrating the StructOCR Driver's License scanner API using the Cursor AI code editor. Build car rental and mobility onboarding flows rapidly.
Add Driver's License OCR to Your Lovable.dev App in 5 Minutes
Step-by-step guide to integrating the StructOCR Driver's License scanner API into a Lovable.dev app. Build car rental and mobility onboarding flows with zero backend.
Add Driver's License OCR to Your Replit App in 5 Minutes
Step-by-step guide to integrating the StructOCR Driver's License scanner API into a Replit application. Build car rental and mobility onboarding flows using Replit Agent and Secrets.
Add Driver's License OCR to Your v0 App in 5 Minutes
Step-by-step guide to integrating the StructOCR Driver's License scanner API into a v0 by Vercel app. Build car rental and mobility onboarding flows with zero backend.
Add National ID OCR to Your Replit App in 5 Minutes
Step-by-step guide to integrating the StructOCR National ID scanner API into a Replit application. Build KYC and identity verification flows using Replit Agent and Secrets.
From tutorial to production in 5 minutes.
You've seen the code. Now get your API key, grab your 200 free credits, and see it work with your own images. No credit card required.