Class Scanner

java.lang.Object
com.idanalyzer.Scanner

public class Scanner extends Object
Document scanning & ID verification (POST /scan, /quickscan, /veryquickscan).
  • Method Details

    • setUserIp

      public Scanner setUserIp(String ip)
      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

      public Scanner setCustomData(String customData)
      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

      public Scanner setProfile(Profile profile)
      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 in YYYY/MM/DD format; may be null/empty.
      ageRange - the expected age range in minAge-maxAge format; 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

      public Scanner restrictCountry(String countryCodes)
      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

      public Scanner restrictState(String states)
      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

      public Scanner restrictType(String documentType)
      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.