multipart/form-data in a field named file. This recipe reads a PAN card with POST /v2/verify/pan_ocr. The same pattern works for dl_ocr, aadhaar_ocr and invoice_ocr.
1
Set your credentials
Use
https://dev.idto.ai (staging) while you build and https://prod.idto.ai (production) when you go live. Keep the client ID and API key on your server only. Never ship them to a browser or a mobile app..env
2
Upload the image
3
Read the result
200
2xx with a non-null error_code. Branch on error_code as in Verify a PAN and branch on error_code.Good to know
- Do not set the
Content-Typeheader yourself. curl-Fandrequestsfiles=set the multipart boundary for you. - Send an
Idempotency-Keyto make retries safe. See Retry safely with an idempotency key.