LendWorksLendWorksDocs

Documents

Upload bank statements, tax returns, and other financial documents for AI-powered extraction and analysis.

Upload a Document

Upload financial documents to a deal for processing. Supports file paths, Buffers, and streams. The pipeline begins automatically after upload.

TypeScript
// Upload from file path
const doc = await client.documents.upload(
  dealId,
  "./statements/chase_jan_2024.pdf"
);
console.log(doc.id);      // 67890
console.log(doc.status);  // "classifying"

// Upload with options
const doc2 = await client.documents.upload(
  dealId,
  "./statements/bofa_feb_2024.pdf",
  {
    documentType: "bank_statement",
    idempotencyKey: "upload-bofa-feb",
    geminiModel: "gemini-2.0-flash-exp",
  }
);

// Upload from Buffer
import { readFileSync } from "fs";
const pdfBuffer = readFileSync("./tax_return_2023.pdf");
const doc3 = await client.documents.upload(dealId, pdfBuffer, {
  filename: "tax_return_2023.pdf",
  documentType: "tax_return",
});
Python
# Upload from file path
doc = client.documents.upload(
    deal_id,
    "./statements/chase_jan_2024.pdf"
)
print(doc.id)      # 67890
print(doc.status)  # "classifying"

# Upload with options
doc2 = client.documents.upload(
    deal_id,
    "./statements/bofa_feb_2024.pdf",
    document_type="bank_statement",
    idempotency_key="upload-bofa-feb",
)

Bulk Upload

Upload multiple documents at once. All files are queued for parallel processing.

TypeScript
const bulkResult = await client.documents.uploadBulk(dealId, [
  "./statements/march.pdf",
  "./statements/april.pdf",
  "./statements/may.pdf",
]);

console.log(bulkResult.total);    // 3
console.log(bulkResult.queued);   // 3
console.log(bulkResult.results);  // [{filename, status, document_id}...]
Python
bulk_result = client.documents.upload_bulk(deal_id, [
    "./statements/march.pdf",
    "./statements/april.pdf",
    "./statements/may.pdf",
])

print(bulk_result.total)    # 3
print(bulk_result.queued)   # 3

Supported Document Types

TypeValueDescription
Bank Statementbank_statementMonthly or quarterly bank statements (primary input)
Tax Returntax_returnBusiness tax returns (1120, 1120-S, Schedule C)
Profit & Lossprofit_and_lossP&L statements for revenue verification
Voided Checkvoided_checkFor bank account verification
Driver's Licensedrivers_licenseOwner identity verification
Business Licensebusiness_licenseBusiness registration documents

Info: If you omit documentType, LendIQ will automatically classify the document using AI. Providing the type upfront skips the classification stage and speeds up processing.