BanklyzeBanklyze/Developer Docs
Sign In

SDKs & Libraries

Official client libraries make it easier to integrate the Banklyze API into your applications. SDKs handle authentication, request serialization, error handling, and type safety so you can focus on your business logic.

Official SDKs are currently in development and will be published soon. The interfaces below reflect the planned API surface. In the meantime, you can use the REST API directly or generate a client from our OpenAPI spec.

Python SDK

Package: banklyze
Requires: Python 3.9+
Status: Coming soon

Installation

pip install banklyze

Quick Start

Python
import os
from banklyze import BanklyzeClient

client = BanklyzeClient(api_key=os.environ["BANKLYZE_API_KEY"])

# List deals
deals = client.deals.list(status="ready", per_page=10)
for deal in deals.data:
    print(f"{deal.business_name} — Grade: {deal.health_grade}")

# Create a deal
deal = client.deals.create(
    business_name="Acme Corp",
    funding_amount_requested=50000,
    ein="123456789",
    entity_type="llc",
    owner_name="John Smith",
)
print(f"Created deal #{deal.id}")

# Upload a document
with open("bank_statement.pdf", "rb") as f:
    document = client.documents.upload(deal_id=deal.id, file=f)
print(f"Document {document.id} — Status: {document.status}")

Working with Results

Python
# Fetch a completed deal with underwriting results
deal = client.deals.get(42)

print(f"Health Grade: {deal.health.grade}")
print(f"Health Score: {deal.health.score}")
print(f"Recommendation: {deal.recommendation.decision}")
print(f"Max Advance: ${deal.recommendation.max_advance:,.2f}")
print(f"CFCR: {deal.recommendation.cfcr}")

# Export the deal report as PDF
pdf_bytes = client.exports.pdf(deal_id=42)
with open("report.pdf", "wb") as f:
    f.write(pdf_bytes)

# Get transactions for a document
transactions = client.transactions.list(
    document_id=15,
    type="credit",
    flagged=True,
    start_date="2026-01-01",
    end_date="2026-01-31",
)
for txn in transactions.data:
    print(f"  {txn.date} | {txn.description} | ${txn.amount:,.2f}")

Webhook Verification Helper

Python
from banklyze.webhooks import verify_signature

# In your Flask/FastAPI handler:
is_valid = verify_signature(
    raw_body=request.body,
    signature=request.headers["X-Webhook-Signature"],
    secret=os.environ["BANKLYZE_WEBHOOK_SECRET"],
)

if not is_valid:
    raise HTTPException(status_code=401, detail="Invalid signature")

Rulesets

Python
# List rulesets
rulesets = client.rulesets.list()
for rs in rulesets.data:
    print(f"{rs.name} — Default: {rs.is_default}")

# Create a custom ruleset (weights must sum to 100)
ruleset = client.rulesets.create(
    name="Conservative",
    weight_revenue=20,
    weight_balance_health=15,
    weight_nsf_overdraft=15,
    weight_deposit_frequency=10,
    weight_revenue_trend=10,
    weight_debt_service=10,
    weight_transaction_screening=10,
    weight_health_score=5,
    weight_cross_doc=5,
    grade_a_min_score=90,
    grade_b_min_score=75,
    grade_c_min_score=60,
)
print(f"Created ruleset #{ruleset.id}")

# Evaluate a deal with specific rulesets
result = client.deals.evaluate(deal_id=42, ruleset_ids=[1, ruleset.id])
print(f"Grade: {result.grade}, Score: {result.score}")

Bulk Ingest

Python
# Bulk ingest multiple documents
batch = client.ingest.create(
    files=["statement_jan.pdf", "statement_feb.pdf", "statement_mar.pdf"],
    metadata={
        "business_name": "Acme Corp",
        "ein": "123456789",
    },
)
print(f"Batch {batch.batch_id}{len(batch.documents)} documents queued")

# Poll batch status
status = client.ingest.get_batch(batch.batch_id)
print(f"Status: {status.status}{status.processed}/{status.total} processed")

TypeScript / Node.js SDK

Package: @banklyze/sdk
Requires: Node.js 18+ or any modern runtime (Deno, Bun)
Status: Coming soon

Installation

npm install @banklyze/sdk

Quick Start

TypeScript
import { Banklyze } from "@banklyze/sdk";

const client = new Banklyze({
  apiKey: process.env.BANKLYZE_API_KEY!,
});

// List deals
const { data: deals, meta } = await client.deals.list({
  status: "ready",
  perPage: 10,
});

for (const deal of deals) {
  console.log(`${deal.businessName} — Grade: ${deal.healthGrade}`);
}

// Create a deal
const deal = await client.deals.create({
  businessName: "Acme Corp",
  fundingAmountRequested: 50000,
  ein: "123456789",
  entityType: "llc",
  ownerName: "John Smith",
});

console.log(`Created deal #${deal.id}`);

Uploading Documents

TypeScript
import { readFile } from "fs/promises";

const fileBuffer = await readFile("bank_statement.pdf");

const document = await client.documents.upload({
  dealId: deal.id,
  file: fileBuffer,
  filename: "bank_statement.pdf",
});

console.log(`Document ${document.id} — Status: ${document.status}`);

// Poll for completion using the status endpoint
let status = await client.documents.getStatus(document.id);
while (status.status !== "completed" && status.status !== "failed") {
  await new Promise((r) => setTimeout(r, 2000));
  status = await client.documents.getStatus(document.id);
}

console.log(`Processing complete: ${status.status}`);

Webhook Verification Helper

TypeScript
import { verifyWebhookSignature } from "@banklyze/sdk/webhooks";

// In your Express/Fastify handler:
const isValid = verifyWebhookSignature({
  rawBody: req.body.toString(),
  signature: req.headers["x-webhook-signature"] as string,
  secret: process.env.BANKLYZE_WEBHOOK_SECRET!,
});

if (!isValid) {
  return res.status(401).json({ error: "Invalid signature" });
}

Rulesets

TypeScript
// List rulesets
const { data: rulesets } = await client.rulesets.list();
for (const rs of rulesets) {
  console.log(`${rs.name} — Default: ${rs.isDefault}`);
}

// Create a custom ruleset (weights must sum to 100)
const ruleset = await client.rulesets.create({
  name: "Conservative",
  weightRevenue: 20,
  weightBalanceHealth: 15,
  weightNsfOverdraft: 15,
  weightDepositFrequency: 10,
  weightRevenueTrend: 10,
  weightDebtService: 10,
  weightTransactionScreening: 10,
  weightHealthScore: 5,
  weightCrossDoc: 5,
  gradeAMinScore: 90,
  gradeBMinScore: 75,
  gradeCMinScore: 60,
});

console.log(`Created ruleset #${ruleset.id}`);

Bulk Ingest

TypeScript
import { readFile } from "fs/promises";

// Bulk ingest multiple documents
const files = await Promise.all([
  readFile("statement_jan.pdf"),
  readFile("statement_feb.pdf"),
  readFile("statement_mar.pdf"),
]);

const batch = await client.ingest.create({
  files: files.map((buf, i) => ({
    buffer: buf,
    filename: `statement_${["jan", "feb", "mar"][i]}.pdf`,
  })),
  metadata: {
    businessName: "Acme Corp",
    ein: "123456789",
  },
});

console.log(`Batch ${batch.batchId} — ${batch.documents.length} documents queued`);

// Poll batch status
const status = await client.ingest.getBatch(batch.batchId);
console.log(`Status: ${status.status} — ${status.processed}/${status.total}`);

OpenAPI Specification

The Banklyze API publishes an OpenAPI 3.1 specification that you can use to generate client libraries in any language. The spec is always in sync with the latest API version.

https://api.banklyze.com/v1/openapi.json

Generating a Client

Use any OpenAPI code generator to create a typed client in your preferred language:

Generate Client
# Using openapi-generator-cli
npx @openapitools/openapi-generator-cli generate \
  -i https://api.banklyze.com/v1/openapi.json \
  -g typescript-fetch \
  -o ./generated/banklyze-client

# Using openapi-python-client
pip install openapi-python-client
openapi-python-client generate \
  --url https://api.banklyze.com/v1/openapi.json

Generated clients include full type definitions, request/response models, and inline documentation derived from the API spec.

Community Libraries

Community-maintained libraries are not officially supported by Banklyze but may be useful for languages we do not yet cover. If you have built a client library and would like it listed here, contact us at developers@banklyze.com.

NameTypeRequiredDescription
GolanguageOptionalNone yet
RubylanguageOptionalNone yet
PHPlanguageOptionalNone yet
Java / KotlinlanguageOptionalNone yet
C# / .NETlanguageOptionalNone yet

In the meantime, you can use the OpenAPI spec to auto-generate a typed client in any of these languages.

Getting Help