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.
// 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",
});# 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.
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}...]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) # 3Supported Document Types
| Type | Value | Description |
|---|---|---|
| Bank Statement | bank_statement | Monthly or quarterly bank statements (primary input) |
| Tax Return | tax_return | Business tax returns (1120, 1120-S, Schedule C) |
| Profit & Loss | profit_and_loss | P&L statements for revenue verification |
| Voided Check | voided_check | For bank account verification |
| Driver's License | drivers_license | Owner identity verification |
| Business License | business_license | Business 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.