How to Batch Process Checks via MICR

How to Batch Process Checks via MICR

Recently, a potential customer reached out to our Support Team during a Live Chat session and asked us if we had any JavaScript APIs to capture MICR from a Canon scanner.  

After asking a few follow-up questions to get a better idea of their project requirement, the question was asked:

“I have a Canon TWAIN CR-120 scanner for MICR, do you have any API to capture the MICR from the scanner using JavaScript?”

In short, the answer is YES. The developer who had the inquiry was looking to build a batch check processing application and was looking for TWAIN-based MICR reading APIs to use and accomplish his goals.

Keep reading to find out what is MICR, its application, and how to integrate the capability to scan MICR and build a batch check-scanning application. 

What is MICR? 

MICR stands for Magnetic Ink Character Recognition, which is a character-recognition technology used mainly by the banking industry to streamline the processing and clearance of checks and other documents.

If you’ve ever seen a bank check then you have likely come across MICR encoding, also known as MICR line. They are human-readable characters at the bottom of checks and typically include:

  • Bank code
  • Account number
  • Check number 

sample check

How to Build a Batch check Processing Web App?

Although most of the scanners in the market are TWAIN-compliant, before you start you will want to ensure your device is TWAIN-compliant. Check the device manufacturer’s website or use the TWACKER tool on Windows. 

MICR check scanner

Download this sample code that reads a single check and displays the MICR value on the page. To get the magnetic data from your TWAIN scanner:

  1. Read the value in MagType to see which type of magnetic data your scanner supports
  2. Read the value of MagData and pass that information to another part of the application depending on the workflow

Refer to the shortcode snippet below:

MICR value: <input id="MICRVALUE" type="text" name="MICRVALUE" >
MICR type: <input id="MICRTYPE" type="text" name="MICRTYPE" >
<script type="text/javascript">
	Dynamsoft.WebTwainEnv.RegisterEvent('OnWebTwainReady', Dynamsoft_OnReady);
        var DWObject;
        function Dynamsoft_OnReady() {
            DWObject = Dynamsoft.WebTwainEnv.GetWebTwain('dwtcontrolContainer');		  
            if (DWObject) {              
				DWObject.IfUseTWAINDSM = true;
                var count = DWObject.SourceCount;
                for (var i = 0; i < count; i++) {
                    document.getElementById("source").options.add(new Option(DWObject.GetSourceNameItems(i), i));
              DWObject.RegisterEvent('OnPostTransfer', function () {
                    document.getElementById('MICRVALUE').value = DWObject.MagData;
					document.getElementById('MICRTYPE').value = DWObject.MagType;

You can also build a more complex application by reading multiple checks and display the results at once. Or use IfDuplexEnabled to scan both sides of the check and display them alongside the MICR value to compare the result. Check out the full API list and build a robust and efficient check processing web app suitable for your workflow.

Start your Free 30-Day Trial

Subscribe Newsletter

Subscribe to our mailing list to get the monthly update.