Package com.idanalyzer
Class Scanner
java.lang.Object
com.idanalyzer.Scanner
Document scanning & ID verification (POST /scan, /quickscan, /veryquickscan).
-
Method Summary
Modifier and TypeMethodDescriptioncom.fasterxml.jackson.databind.JsonNodeQuick OCR-only scan.restrictCountry(String countryCodes) Restrict accepted documents to the given issuing country code(s).restrictState(String states) Restrict accepted documents to the given issuing state(s)/province(s).restrictType(String documentType) Restrict accepted documents to the given document type(s).com.fasterxml.jackson.databind.JsonNodeInitiate a full identity document scan & optional biometric verification.Auto-generate one or more contracts from the parsed ID.setCustomData(String customData) Arbitrary string stored with the transaction (e.g.setProfile(Profile profile) Attach a KYC profile (required beforescan(java.lang.String, java.lang.String, java.lang.String, java.lang.String)).Pass a user IP for issuer-country geolocation check (use "user" for the connection IP).verifyUserInformation(String documentNumber, String fullName, String dob, String ageRange, String address, String postcode) Supply expected customer information to match against the document.com.fasterxml.jackson.databind.JsonNodeveryQuickScan(String documentFront, String documentBack, boolean cacheImage) Very fast OCR-only scan.
-
Method Details
-
setUserIp
Pass a user IP for issuer-country geolocation check (use "user" for the connection IP).- Parameters:
ip- the user IP address, or "user" to use the connection IP.- Returns:
- this scanner, for chaining.
-
setCustomData
Arbitrary string stored with the transaction (e.g. internal reference).- Parameters:
customData- the custom data string to store with the transaction.- Returns:
- this scanner, for chaining.
-
setContractOptions
public Scanner setContractOptions(String templateId, String format, Map<String, Object> extraFillData) Auto-generate one or more contracts from the parsed ID.- Parameters:
templateId- the contract template id; when null/empty no contract is generated.format- the output format; defaults to "PDF" when null/empty.extraFillData- optional extra fields to populate the contract; applied when non-empty.- Returns:
- this scanner, for chaining.
-
setProfile
Attach a KYC profile (required beforescan(java.lang.String, java.lang.String, java.lang.String, java.lang.String)).- Parameters:
profile- the KYC profile to apply; its overrides are sent when non-empty.- Returns:
- this scanner, for chaining.
- Throws:
InvalidArgumentException- if profile is null.
-
verifyUserInformation
public Scanner verifyUserInformation(String documentNumber, String fullName, String dob, String ageRange, String address, String postcode) Supply expected customer information to match against the document.- Parameters:
documentNumber- the expected document number.fullName- the expected full name.dob- the expected date of birth inYYYY/MM/DDformat; may be null/empty.ageRange- the expected age range inminAge-maxAgeformat; may be null/empty.address- the expected address.postcode- the expected postcode.- Returns:
- this scanner, for chaining.
- Throws:
InvalidArgumentException- if dob or ageRange is non-empty but malformed.
-
restrictCountry
Restrict accepted documents to the given issuing country code(s).- Parameters:
countryCodes- comma-separated ISO country code(s) to accept.- Returns:
- this scanner, for chaining.
-
restrictState
Restrict accepted documents to the given issuing state(s)/province(s).- Parameters:
states- comma-separated state/province code(s) to accept.- Returns:
- this scanner, for chaining.
-
restrictType
Restrict accepted documents to the given document type(s).- Parameters:
documentType- the document type(s) to accept (e.g. "P" passport, "D" driver license).- Returns:
- this scanner, for chaining.
-
scan
public com.fasterxml.jackson.databind.JsonNode scan(String documentFront, String documentBack, String facePhoto, String faceVideo) Initiate a full identity document scan & optional biometric verification.- Parameters:
documentFront- the front document image (file path, base64, URL or cache reference).documentBack- the back document image; sent when non-empty.facePhoto- a face photo for biometric verification; used when non-empty.faceVideo- a face video for biometric verification; used when facePhoto is empty.- Returns:
- the API response as a
JsonNode. - Throws:
InvalidArgumentException- if no profile is configured or the front document image is missing.ApiException- if the API returns an error or a transport error occurs.
-
quickScan
public com.fasterxml.jackson.databind.JsonNode quickScan(String documentFront, String documentBack, boolean cacheImage) Quick OCR-only scan.- Parameters:
documentFront- the front document image (file path, base64 or URL).documentBack- the back document image; sent when non-empty.cacheImage- whether the uploaded image should be cached server-side for later reference.- Returns:
- the API response as a
JsonNode. - Throws:
InvalidArgumentException- if the front document image is missing.ApiException- if the API returns an error or a transport error occurs.
-
veryQuickScan
public com.fasterxml.jackson.databind.JsonNode veryQuickScan(String documentFront, String documentBack, boolean cacheImage) Very fast OCR-only scan.- Parameters:
documentFront- the front document image (file path, base64 or URL).documentBack- the back document image; sent when non-empty.cacheImage- whether the uploaded image should be cached server-side for later reference.- Returns:
- the API response as a
JsonNode. - Throws:
InvalidArgumentException- if the front document image is missing.ApiException- if the API returns an error or a transport error occurs.
-