Intelligent Document Automation
One upload. Every document type. Zero manual sorting.
Your customers don't think about document types. They have a folder of files, a form to fill out, or an email inbox full of attachments. They just want it handled. This guide shows how Veryfi's Classify API, various extraction APIs, Business Rules Engine, and Workflows fit together to build that experience, across real industry use cases.
One Upload, Smart Routing
The core architecture behind every scenario in this guide is the same. A single document enters the system through one endpoint.
- The Classify API identifies what type of document it is.
- That classification can serve as a driver for routing to the right Veryfi extraction API. - Business Rules validate and enrich the extracted data.
- Workflows connect everything to your downstream systems.
Document in ↓ POST /classify → { document_type: 'w9', score: 0.97 } ↓ Route to → POST /w9s | /documents | /any-documents | ... ↓ Business Rules → validate, enrich, tag ↓ Workflows → push to ERP / CRM / Xero / Google Sheets / email |
Same credentials, all APIs You use the same CLIENT-ID and API key across Classify, AnyDocs, W-9, Receipts, and all other Veryfi APIs. There is no separate provisioning per endpoint. Billing is tracked separately by API endpoint usage. |
The Four Layers
Layer | What it does | When it runs |
Orchestrates the full pipeline and pushes data to downstream systems | Could start the whole flow | |
Identifies document type and returns a confidence score | Step 1, before any extraction | |
Extracts structured data fields from the identified document | Step 2, on the routed document | |
Validates, transforms, tags, and enriches extracted data | After extraction, automatically per endpoint | |
Orchestrates the full pipeline and pushes data to downstream systems | Wraps the whole flow end to end |
Scenarios & Use Cases
👤 Scenario 1 · Financial Services. Know Your Customer (KYC)
KYC requires collecting and verifying identity and financial documents from individual customers before they can open accounts, apply for loans, or access regulated services. The problem is that customers upload whatever they have, and it arrives as a mix of passports, driver's licenses, bank statements, and sometimes completely unrelated files.
Instead of building separate upload flows per document type, you give customers one drop zone Web or Mobile - does not matter. Classify sorts it out on the way in.
Document routing map
Document detected | routes to | Veryfi API |
passport | → | /any-documents (Blueprint: us_passport) Name, DOB, nationality, expiry, MRZ |
driver_license | → | /any-documents (Blueprint: us_driver_license) Name, DOB, address, license number, expiry |
bank_statement | → | /bank-statements Account holder, account/routing numbers, balance, transactions |
check | → | /checks Payer, payee, amount, routing/account numbers, date |
w9 | → | /w9s Legal name, EIN/SSN, entity type, certification signature |
other | → | Manual review queue Flag for human review, notify compliance team |
Business Rules for KYC
Expiry check: If expiration_date is before today, tag 'document-expired' and block onboarding.
Confidence gate: If confidence < 0.80, tag 'low-confidence' and route to manual review before any further processing.
Name consistency: If first_name or last_name is empty, tag 'incomplete-identity' and pause the onboarding workflow.
Jurisdiction routing: If place_of_issue does not contain 'United States', tag 'foreign-document' for enhanced due diligence review.
Fraud flag: Use the Fraud Suite score to tag documents with fraud.score > 0.6 as 'fraud-review' before approving any identity document.
Workflow setup
GMAIL INPUT or API IMPORT Customer uploads documents via your app or emails them to a monitored inbox. |
DOCUMENT CLASSIFIER Classify API identifies each file: passport, bank_statement, w9, driver_license, or other. |
DECISION node Route each detected type to the correct EXTRACT DATA node with the matching API and Blueprint. |
EXTRACT DATA Each branch runs the appropriate Veryfi API: AnyDocs for identity docs, Bank Statements API for financials, W-9 API for tax docs. |
DECISION: confidence check If confidence < 0.80, branch to EMAIL APPROVAL to notify compliance. If confidence >= 0.80, continue. |
UPLOAD TO GSHEETS or XERO EXPORT or ELSE Verified documents and extracted data are pushed to your KYC system, CRM, or compliance ledger. |
Faster onboarding means less drop-off. Automated compliance checks reduce manual review by the team. An audit trail is created automatically for every document submitted. |
🏢 Scenario 2 · Financial Services b Know Your Business (KYB)
KYB verifies the identity and legitimacy of business entities before a fintech, bank, or marketplace accepts them as customers or partners. It involves more document variety than KYC: incorporation papers, tax forms, ownership documents, bank details, and more, often arriving together in a single upload.
Document routing map
Document detected | routes to | Veryfi API |
w9 | → | /w9s Business name, EIN, entity type, address, signature |
bank_statement | → | /bank-statements Business account verification, average balance, transactions |
article_of_incorporation | → | /any-documents (Blueprint: article_of_incorporation) Entity name, state, registered agent, date, officers |
contract | → | /any-documents (Blueprint: service_contract) Parties, governing law, key dates, obligations |
certificate_of_good_standing | → | /any-documents (Blueprint: cert_good_standing) Entity name, state, status, date issued |
business_card | → | /business-cards Contact name, company, email, phone, address |
other | → | Manual review queue Route to compliance team for identification |
Business Rules for KYB
EIN validation: If ein is empty on a W-9, tag 'missing-ein' and pause verification.
Entity type check: If entity_type equals 'Individual', tag 'sole-proprietor-review' for enhanced checks.
State routing: If state_of_incorporation equals 'Delaware', auto-assign category 'DE-entity'. Other states trigger a jurisdiction-specific review rule.
Standing check: If the certificate of good standing status does not equal 'Active', tag 'entity-not-in-good-standing' and block approval.
Document completeness: Create a rule that checks for all required document types. If any are missing, trigger a webhook to notify your onboarding team.
⚠ Handling document packets Businesses often upload a single ZIP file containing multiple documents. Veryfi supports .zip submission. The Classify API processes each file inside the archive and returns a classification per document, so you can route each one independently. |
🤝 Scenario 3 · Procurement / AP Vendor Onboarding
Before a company can pay a vendor, it typically needs to collect a W-9 for tax purposes, proof of insurance, banking details for ACH payments, and sometimes a signed contract or scope of work. This process is usually manual, slow, and spread across email chains.
With Veryfi, your vendor portal has one upload field. Everything is classified and routed automatically. Missing documents are detected by Business Rules and flagged before the vendor ever gets to payment setup.
Document routing map
Document detected | routes to | Veryfi API |
w9 | → | /w9s Legal name, EIN, entity type, address, certification date |
auto_insurance_card | → | /any-documents (Blueprint: auto_insurance_card) Policy number, insurer, coverage dates, vehicle |
health_insurance_card | → | /any-documents (Blueprint: health_insurance_card) Member ID, group number, insurer, effective date |
bank_statement | → | /bank-statements Account name, routing number, account number, institution |
invoice | → | /documents Vendor name, amount, payment terms, line items |
contract | → | /any-documents (Blueprint: service_contract) Parties, scope, payment terms, expiry date |
other | → | Manual review queue Notify AP team, request resubmission |
Business Rules for vendor onboarding
Coverage expiry: If insurance policy_expiration_date is within 30 days, tag 'insurance-expiring-soon' and email the vendor.
EIN match: Compare W-9 ein against your vendor master. Mismatch triggers a 'tax-id-discrepancy' tag for AP review.
Policy type check: If insurance_company does not match your approved insurer list, flag for procurement review.
Payment terms: If invoice payment_terms contains 'Net 60' or longer, tag 'non-standard-terms' and route to finance approval.
Completeness check: Create an Extract Action rule that checks: W-9 received, insurance received, bank info received. Until all three are tagged 'received', block the vendor from being marked 'onboarded'.
Workflow setup
GDRIVE IMPORT or API IMPORT Vendor submits documents via your portal (API), or uploads to a shared Google Drive folder. |
DOCUMENT CLASSIFIER Classify identifies each file: w9, auto_insurance_card, bank_statement, contract, invoice, or other. |
DECISION: route by type W-9 goes to /w9s. Insurance goes to /any-documents with the right Blueprint. Bank statements to /bank-statements. Invoices to /documents. |
Business Rules fire Expiry checks, EIN validation, completeness rules run automatically after each document is extracted. |
EMAIL FILE or EMAIL APPROVAL Incomplete or flagged vendor submissions trigger an automated email to your AP team or back to the vendor. |
UPLOAD TO GSHEETS All extracted vendor data is appended to your vendor master spreadsheet in real time. |
🧾 Scenario 4 · Finance / HR. Expense Management and Reimbursement
Expense platforms receive a constant stream of receipts, invoices, hotel folios, and the occasional completely wrong upload. Pre-classifying every submission before extraction saves processing cost and prevents junk data from entering your system.
Document routing map
Document detected | routes to | Veryfi API |
receipt | → | /documents Merchant, date, total, line items, tip, tax, payment method |
invoice | → | /documents Vendor, invoice number, due date, line items, total, tax |
purchase_order | → | /documents PO number, vendor, items, quantities, prices |
bank_statement | → | /bank-statements For reconciliation workflows |
other | → | Reject + notify user Ask the employee to resubmit a valid expense document |
Business Rules for Expense Management
Policy limit: If total > [policy threshold], tag 'over-limit' and route to manager approval via email.
Alcohol filter: If line_items.description contains 'alcohol' or line_items.type equals 'alcohol', tag 'policy-violation' and flag for review.
Travel category: If category is 'Travel', automatically apply the company travel policy tag and check per-diem limits.
Duplicate detection: Veryfi's built-in duplicate detection flags matching documents. Add a Business Rule: if is_duplicate is true, tag 'duplicate-submission' and reject.
HSA/FSA eligibility: If category equals 'Healthcare', tag as 'hsa-eligible' for downstream benefits processing.
OR Customly creating a Fraud Suite
i CPG and loyalty programs Business Rules are especially powerful for loyalty reward programs. Example: tag a receipt as 'reward-approved' only when line_items.description contains the target product AND total >= minimum purchase AND date is within the campaign window. All three conditions must be true simultaneously. |
📄 Scenario 5 · Tax / Accounting. Tax Season and Document Processing
Tax preparers and accounting firms receive batches of mixed documents from clients: W-2s, W-9s, W-8s, 1099s, receipts, bank statements, and more. Pre-classifying the batch before extraction means each document goes to the right API automatically, without a human sorting the pile first.
Document routing map
Document detected | routes to | Veryfi API |
w2 | → | /w2s Employer, wages, federal/state withholding, SSN, box fields |
w9 | → | /w9s Legal name, EIN/SSN, entity type, address |
w8 | → | /w8s Foreign entity name, country, treaty claims, certification |
bank_statement | → | /bank-statements Account numbers, balances, transactions for reconciliation |
receipt | → | /documents Business expense receipts for deductions |
invoice | → | /documents Vendor invoices for deductible business expenses |
statement | → | /bank-statements Account statements, credit card statements |
other | → | Manual review queue Notify accountant, request document identification |
Business Rules for tax processing
W-2 completeness: If employer_name or wages or federal_tax_withheld is empty, tag 'w2-incomplete' and notify the preparer.
Year validation: If tax_year does not match the current filing year, tag 'wrong-tax-year' and quarantine the document.
Foreign entity routing: W-8 documents trigger a 'foreign-entity' tag, automatically routing to the international tax specialist queue.
Multi-state: If a W-2 includes multiple state withholding entries, tag 'multi-state' for specialist review.
🏥 Scenario 6 · Healthcare / Insurance Insurance Intake and Claims Preprocessing
Healthcare providers, insurers, and benefits platforms deal with insurance cards, medical invoices, prescription labels, and HSA/FSA receipts on a daily basis. Routing these correctly at intake dramatically reduces claim processing time and prevents costly rework.
Document routing map
Document detected | routes to | Veryfi API |
health_insurance_card | → | /any-documents (Blueprint: health_insurance_card) Member ID, group number, insurer, effective date, copay |
receipt (medical) | → | /documents Provider name, service date, amount, payment method |
invoice (medical) | → | /documents Provider, patient, procedure codes, billed amount, insurance adjustment |
prescription_label | → | /any-documents (Blueprint: prescription_label) Drug name, dosage, prescriber, patient, NDC code, refills |
statement (insurance) | → | /bank-statements Explanation of benefits, claim amounts, adjustments |
other | → | Manual review queue Non-medical documents flagged for human review |
Business Rules for healthcare intake
Coverage date check: If policy_effective_date is after the service date or policy_expiration_date is before the service date, tag 'coverage-gap' and flag for eligibility verification.
Group number present: If group_number is empty on a health insurance card, tag 'incomplete-insurance-card' before allowing claim submission.
HSA eligible: If receipt category is 'Healthcare', tag 'hsa-eligible' and route to benefits processing.
High-value claim: If invoice total > $5,000, tag 'high-value-claim' and trigger an email to the clinical review team.
⚖️ Scenario 7 · Legal / Operations Contract and Legal Document Management
Legal teams, operations managers, and real estate professionals deal with a constant flow of contracts, certificates, incorporation documents, and work orders. Manually sorting these into the right folders and extracting key terms is slow, error-prone, and often done by people whose time is worth a lot more.
Document routing map
Document detected | routes to | Veryfi API |
contract | → | /any-documents (Blueprint: service_contract) Parties, scope, governing law, payment terms, renewal date |
article_of_incorporation | → | /any-documents (Blueprint: article_of_incorporation) Entity name, state, registered agent, officers, date |
certificate_of_good_standing | → | /any-documents (Blueprint: cert_good_standing) Entity name, status, state, date issued |
w9 | → | /w9s For counterparty tax documentation |
other | → | /any-documents (Blueprint: generic_legal) Catch-all Blueprint for novel document types |
Business Rules for legal document management
Renewal alerts: If renewal_date is within 60 days of today, tag 'renewal-approaching' and fire a webhook to your task management system.
Non-standard jurisdiction: If governing_law does not contain 'New York' or 'California', tag 'non-standard-jurisdiction' and route to senior counsel.
Good standing check: If status does not equal 'Active', block the counterparty from proceeding and notify the legal team.
Missing signatures: If signature_present is false on a contract, tag 'unsigned-contract' and do not route to executed document storage.
i Custom Blueprints for legal Legal documents are highly varied in layout. The recommended approach is to create a Blueprint per contract template (MSA, SOW, NDA, lease) so AnyDocs extracts exactly the fields that matter for each type. See the Blueprint creation guide at faq.veryfi.com/en/articles/11359041-how-to-create-a-blueprint. |
Complete API Routing Reference
The Classify API returns a document_type value that maps to a specific Veryfi extraction endpoint. Use this as your routing dictionary.
Classify returns | Route to endpoint | What gets extracted |
receipt | /documents | Merchant, date, total, line items, tax, tip, payment method |
invoice | /documents | Vendor, invoice #, due date, line items, total, tax |
purchase_order | /documents | PO number, vendor, items, quantities, prices |
bank_statement | /bank-statements | Account holder, account/routing numbers, transactions, balances |
check | /checks | Payer, payee, amount, routing number, account number, date |
w2 | /w2s | Employer, employee, wages, withholdings, all box fields |
w9 | /w9s | Legal name, TIN/EIN, entity type, address, certification |
w8 | /w8s | Foreign entity, country, treaty claims, certification |
statement | /bank-statements | Account statements, credit card statements |
contract | /any-documents + Blueprint | Parties, scope, terms, governing law, dates |
passport | /any-documents + Blueprint | Name, DOB, nationality, passport #, expiry, MRZ |
driver_license | /any-documents + Blueprint | Name, DOB, address, license #, expiry, state |
auto_insurance_card | /any-documents + Blueprint | Policy #, insurer, coverage dates, insured, vehicle |
health_insurance_card | /any-documents + Blueprint | Member ID, group #, insurer, effective date, copay |
article_of_incorporation | /any-documents + Blueprint | Entity name, state, registered agent, officers |
business_card | /business-cards | Name, company, title, email, phone, address |
packing_slip | /documents | Shipper, items, quantities, tracking number |
remittance_advice | /documents | Invoice references, amounts paid, payment date |
other | Manual review queue | Flag for human review; optionally try a generic Blueprint |
Custom document types The Classify API supports custom document_types beyond the standard list. Use the document_types parameter in the classify request to define categories specific to your industry (e.g., 'property_deed', 'medical_record', 'shipping_manifest'). Contact [email protected] if you need any help. |
Questions? Reach out to [email protected] or schedule a demo at veryfi.com/schedule-complimentary-demo.

