How to Automate Income Verification From Pay Stubs, W-2s, and Bank Statements Aman Mishra, writing for Unsiloed AI, described a four-step pipeline that uses the Unsiloed extraction API to pull key figures from pay stubs, W-2s, and bank statements with confidence scores and page coordinates, then compares them in Python to flag only the discrepancies for human review. The walkthrough follows one applicant's file of five documents that each pass a page-by-page read but fail a cross-document check, illustrating how mismatches surface only when figures are compared across documents. By Aman Mishra. Originally published on Unsiloed AI https://www.unsiloed.ai/blog/automated-income-verification . A lender or landlord who wants to know what someone earns usually gets three kinds of paperwork. A pay stub covers one pay period. A W-2 covers last year. A bank statement shows what actually arrived in the account. Each one tells part of the story, and the useful question is whether the parts agree. Answering that by hand means reading figures off five or six pages and doing arithmetic across them, which is slow and easy to get wrong. We use the Unsiloed extraction API to pull the handful of figures each check needs, each with a confidence score and the exact spot on the page it came from. Then we use Python to compare the documents and hand a person only the parts that don't agree. The guide below takes that approach through one applicant's file, five documents that pass a page-by-page read and fail a cross-check. Income verification is checking evidence of what someone earns. Automating it means software reads that evidence, compares the figures, and leaves a person only the exceptions. Some services skip the paperwork and connect to payroll or bank accounts directly. This guide covers the other route, where the applicant uploads documents and each one answers a different question. | Document | What It Shows | What It Can't Tell You | |---|---|---| | Pay stub | Earnings and deductions for one pay period. | Whether the money reached the bank account. | | W-2 | Total wages and tax withheld for one year from one US employer. | What the employee earns now. | | Bank statement | Deposits and other transactions for the statement period. | Whether a deposit is pay from a job. | The work happens in four steps. If the documents arrive in one mixed PDF, classify and separate its pages https://www.unsiloed.ai/blog/document-classification-python first. The rest of this guide takes one applicant's file through the four steps. Elian Voss works for Ternvale Fabrication LLC and banks with Larkmere Bank. The file has two monthly pay stubs, last year's W-2 and two months of bank statements. | Document | | Extracted JSON | |---|---|---| | August pay stub | stub-08.pdf https://www.unsiloed.ai/blog-assets/automated-income-verification/stub-08.pdf | stub-08.json https://www.unsiloed.ai/blog-assets/automated-income-verification/stub-08.json | | September pay stub | stub-09.pdf https://www.unsiloed.ai/blog-assets/automated-income-verification/stub-09.pdf | stub-09.json https://www.unsiloed.ai/blog-assets/automated-income-verification/stub-09.json | | 2025 W-2 | w2-2025.pdf https://www.unsiloed.ai/blog-assets/automated-income-verification/w2-2025.pdf | w2-2025.json https://www.unsiloed.ai/blog-assets/automated-income-verification/w2-2025.json | | August bank statement | bank-08.pdf https://www.unsiloed.ai/blog-assets/automated-income-verification/bank-08.pdf | bank-08.json https://www.unsiloed.ai/blog-assets/automated-income-verification/bank-08.json | | September bank statement | bank-09.pdf https://www.unsiloed.ai/blog-assets/automated-income-verification/bank-09.pdf | bank-09.json https://www.unsiloed.ai/blog-assets/automated-income-verification/bank-09.json | Read one page at a time, nothing stands out. The name matches everywhere. Each stub shows $6,000 of gross pay https://www.federalreserveeducation.org/teaching-resources/personal-finance/earning-income/understanding-your-pay-stub , the figure before deductions, and $4,500 of net pay, the figure that goes to the bank, paid by direct deposit to the account ending 4826. The bank statements are for that same account, and last year's W-2 reports $66,000. Two things are hiding in these documents. One looks like a problem and isn't. The other looks fine and is a problem. Both only show up when the documents are compared. A schema tells the API which fields to return and what type each one is. We ask for very little, because every extra field is one more value someone might need to review. The pay stub guide https://www.unsiloed.ai/blog/pay-stub-ocr , W-2 form guide https://www.unsiloed.ai/blog/extract-data-from-pdf-form and bank statement guide https://www.unsiloed.ai/blog/bank-statement-data-extraction cover extracting each document in full. python def field kind, description : return {"type": kind, "null" , "description": description} def obj fields : return {"type": "object", "properties": fields, "required": list fields } stub schema = obj name=field "string", "Employee full name" , employer=field "string", "Employer name" , pay date=field "string", "Pay date as YYYY-MM-DD" , periods paid=field "integer", "Payments this calendar year" , gross pay=field "number", "Current gross pay" , net pay=field "number", "Current net pay" , taxable pay=field "number", "Current federal taxable wages" , ytd taxable=field "number", "Year-to-date federal taxable wages" , w2 schema = obj name=field "string", "Box e employee name" , employer=field "string", "Box c employer name" , tax year=field "integer", "Tax year" , box 1=field "number", "Box 1 wages, tips, other compensation" , deposit = obj date=field "string", "Deposit date as YYYY-MM-DD" , description=field "string", "Description, verbatim" , amount=field "number", "Deposit amount" , bank schema = obj name=field "string", "Account holder name" , deposits={"type": "array", "items": deposit, "description": "Every deposit row. Empty list if none."}, The pay stub fields include federal taxable wages, the earnings federal income tax is calculated on. That field turns out to matter more than gross pay. We send each PDF to the extraction endpoint https://www.unsiloed.ai/docs/api-reference/extraction/extract-data with its schema and poll until the job finishes. model is set to gamma , which reads these forms reliably, and enable citations asks for the location of every value. python import json, os, time, requests BASE = "https://prod.visionapi.unsiloed.ai" HEADERS = {"api-key": os.environ "UNSILOED API KEY" } def extract pdf, schema : with open pdf, "rb" as f: job = requests.post f"{BASE}/v2/extract", headers=HEADERS, files={"pdf file": pdf, f, "application/pdf" }, data={"schema data": json.dumps schema , "model": "gamma", "enable citations": "true"} .json while True: result = requests.get f"{BASE}/extract/{job 'job id' }", headers=HEADERS .json if result "status" == "completed": return result "result" time.sleep 3 docs = {name: extract f"{name}.pdf", schema for name, schema in "stub-08", stub schema , "stub-09", stub schema , "w2-2025", w2 schema , "bank-08", bank schema , "bank-09", bank schema } Every value comes back with two scores and a citation. Here is Box 1 from the W-2. { "value": 66000.0, "score": {"grounding score": 0.98, "extraction score": 0.998}, "citation": {"page": 1, "bbox": 48, 282, 130, 301 , "page width": 612.0, "page height": 792.0} } The extraction score is the API's confidence in the value itself. The grounding score is its confidence that it found the value at the cited spot. Both run from zero to one. The citation gives the page and a bounding box, the rectangle on the page where the value sits. That rectangle is what lets every check below point a reviewer to the exact figure behind it. None of the documents can be verified alone, so each check takes a few fields from two or three of them and compares them. Each check below is a sketch written against the docs dictionary from the previous step. A production system would add its own handling for low scores and missing values, which we come back to at the end. python from datetime import date, timedelta import re v = lambda f: f "value" stubs = {name: docs name for name in "stub-08", "stub-09" } w2 = docs "w2-2025" banks = docs "bank-08" , docs "bank-09" Every document should name the same person and the same employer. We lowercase the names and strip punctuation before comparing, which handles "ELIAN VOSS" on the bank statement. The employer is harder. On the bank statement, the paycheck shows up as TERNVALE FAB PAYROLL PPD , the bank's shorthand for a payroll deposit from Ternvale Fabrication. No string cleanup turns that into "Ternvale Fabrication LLC". Fuzzy matching might, but it might also match a deposit that isn't pay. A small table of descriptions a person has already confirmed is safer, and it grows as reviewers approve new ones. python def normal text : return " ".join re.sub r" ^\w\s ", " ", text.casefold .split ALIASES = {"ternvale fab payroll ppd": "ternvale fabrication llc"} payroll = row for bank in banks for row in v bank "deposits" if normal v row "description" in ALIASES people = {normal v d "name" for d in docs.values } employers = {normal v d "employer" for d in stubs.values , w2 } employers |= {ALIASES normal v row "description" for row in payroll} print "person:", "PASS" if len people == 1 else "REVIEW", people print "employer:", "PASS" if len employers == 1 else "REVIEW", employers The September stub shows $6,000 gross pay a month. Multiply by twelve, the usual way to annualize a stub, and the applicant earns $72,000 a year. The W-2 for last year says $66,000 in Box 1. A naive check would flag a $6,000 gap and conclude the stubs overstate the income. The answer is on the stub itself. Each month, $500 goes into a traditional 401 k , a workplace retirement plan paid into before income tax. The IRS instructions for Box 1 https://www.irs.gov/instructions/iw2w3 leave those contributions out. So the stub figure to hold against Box 1 is federal taxable wages. $5,500 of taxable pay a month is $66,000 a year, which matches the W-2 exactly. The year-to-date figure, the running total since January 1, gives a second view of the same year. September's stub shows $49,500 of taxable pay over nine payments, which also projects to $66,000. latest = stubs "stub-09" gross = v latest "gross pay" 12 taxable = v latest "taxable pay" 12 projected = v latest "ytd taxable" / v latest "periods paid" 12 print f"gross x 12: {gross:,.0f}" print f"taxable x 12: {taxable:,.0f}" print f"YTD projected: {projected:,.0f}" print f"W-2 Box 1: {v w2 'box 1' :,.0f}" These figures match to the dollar because the salary and contribution didn't change between years. With raises, bonuses, hourly pay or a midyear start, compare within a tolerance and send larger gaps to a person with both cited figures. Each stub says $4,500 went by direct deposit to the account ending 4826. For each stub, we look for a payroll deposit of the same amount within three days of the pay date. for name, stub in stubs.items : paid = date.fromisoformat v stub "pay date" hits = row for row in payroll if v row "amount" == v stub "net pay" and abs date.fromisoformat v row "date" - paid <= timedelta days=3 page = stub "net pay" "citation" "page" status = "PASS" if hits else "REVIEW, no matching deposit" print f"{paid} net {v stub 'net pay' :,.0f}: {status} {name}.pdf p.{page} " Run against the five documents, the checks print this. person: PASS {'elian voss'} employer: PASS {'ternvale fabrication llc'} gross x 12: 72,000 taxable x 12: 66,000 YTD projected: 66,000 W-2 Box 1: 66,000 2026-08-31 net 4,500: REVIEW, no matching deposit stub-08.pdf p.1 2026-09-30 net 4,500: PASS stub-09.pdf p.1 The names agree, and once taxable wages are compared like for like, so does the income. The gap that looked like a problem was a 401 k contribution. The month that looked fine is the one to worry about. September's paycheck arrived on September 30. The August statement for account 4826 shows rent, groceries, a utility bill and a card payment, and no deposits at all. The August paycheck is the one exception, and the output says where to look, so a reviewer opens the August stub and the August statement instead of rereading all five documents. There are ordinary explanations, such as a changed account, a delayed payroll run or a stub that doesn't match what was paid. Deciding which applies is a job for a person. Values with scores below your cutoff, and fields that come back null, are exceptions too, and they go to a person before any comparison runs. The confidence score thresholds guide https://www.unsiloed.ai/blog/confidence-score-thresholds-document-automation covers choosing a cutoff for each field. The same pattern covers whatever else your team checks, such as a second employer or an employment letter. Extract the few fields the check needs, compare them across documents, and keep the citations so every flag points back to the page that raised it. What the loan officer or leasing agent gets is a short list of places where the paperwork disagrees, with the decision still theirs.