Docs

Developers/sdk

SDK (@ippopone/loanpilot)

The official TypeScript / JavaScript SDK.

5 sections

SDK

npm install @ippopone/loanpilot
import { LoanPilot } from '@ippopone/loanpilot'
import fs from 'node:fs'

const lp = new LoanPilot({ apiKey: process.env.LOANPILOT_API_KEY! })

const created = await lp.analyses.create({
  file: fs.readFileSync('statement.pdf'),
  fileName: 'statement.pdf',
  productId: 'optional-product-id',
  inputs: { requested_amount: 500000, collateral_value: 700000 },
})

const analysis = await lp.analyses.waitFor(created.id)   // polls until completed
console.log(analysis.decision, analysis.score)
console.log(analysis.result)                              // full report

Methods

await lp.me()
await lp.analyses.list({ limit, offset, status, decision })
await lp.analyses.create({ file, fileName, password?, productId?, applicant?, bureauFile?, inputs? })
await lp.analyses.combine({ files, productId?, applicant?, bureauFile?, inputs? })
await lp.analyses.get(id, { includeResult: true })
await lp.analyses.waitFor(id, { pollMs, timeoutMs, onPoll })
await lp.products.list()

// credit bureau (billable; needs entitlement + consent)
await lp.creditChecks.create({ name, mobile, consent: true })
await lp.creditChecks.list({ limit, offset })
await lp.creditChecks.get(id)

// credit report upload (free; no entitlement, no enquiry)
await lp.creditChecks.upload(file, fileName?)

// customers (PAN-keyed borrower profiles; see /customers)
await lp.customers.create({ pan, name, mobile, email? }) // idempotent on PAN
await lp.customers.list({ q, limit, offset })
await lp.customers.get(id)                                // uuid or ref (CUS-000001)
await lp.customers.update(id, { name?, mobile?, email?, notes?, status? })
await lp.customers.attach(id, { kind, id })               // kind: analysis | credit_check | aa_consent

// customer KYC & businesses (see /customers)
await lp.customers.catalog()                              // the KYC vocabulary
await lp.customers.getProfile(id)
await lp.customers.putProfile(id, body)                   // partial upsert; null clears a field
await lp.customers.businesses(id)
await lp.customers.addBusiness(id, body)                  // name required, category from the catalog
await lp.customers.updateBusiness(id, businessId, body)   // partial
await lp.customers.removeBusiness(id, businessId)

// Account Aggregator (consent-based statement pull, no PDF upload)
await lp.aa.start({ mobile, fi_months?, customer?, product_id?, monitoring? }) // → approval_url (SMS link)
await lp.aa.get(id)                                       // status → ready | completed; offered statements
await lp.aa.analyse(id, statements)                       // each becomes an /analyses record
await lp.aa.list({ limit }); await lp.aa.refresh(id); await lp.aa.cancel(id)

Credit report (free upload)

Attach a free Experian / Equifax / CRIF report (.json/.txt) to an analysis with bureauFile, or upload one on its own with creditChecks.upload. The bureau is auto-detected and parsed with no entitlement and no enquiry cost. On an analysis, an uploaded report takes precedence over applicant (name + mobile).

// attach to an analysis
const created = await lp.analyses.create({
  file: fs.readFileSync('statement.pdf'),
  fileName: 'statement.pdf',
  bureauFile: fs.readFileSync('experian-report.json'),
  bureauFileName: 'experian-report.json',
})

// standalone bureau-only check
const check = await lp.creditChecks.upload(fs.readFileSync('crif-report.json'), 'crif-report.json')
console.log(check.score, check.bureau) // full normalized report + `extra`

Mobile / per-user sign-in

For apps, sign the user in instead of shipping a key (see Authentication):

const { token, client } = await LoanPilot.login({ email, password })
// store `token` in secure storage; next launch:
const lp = new LoanPilot({ apiKey: savedToken })
await lp.logout() // revoke on sign-out

Options

new LoanPilot({
  apiKey,
  baseUrl: 'https://api.ippo.one/v1', // default
  timeoutMs: 60000,
  maxRetries: 2,                       // retries 429/5xx with backoff
  fetch: customFetch,                  // optional
  headers: { 'X-Trace': '...' },
})

Errors throw LoanPilotError with status, code and detail. Works in Node 18+ and modern browsers (global fetch/FormData/Blob).

Flutter / Dart (ippo_loanpilot)

For Flutter apps, the same API is on pub.dev/packages/ippo_loanpilot.

flutter pub add ippo_loanpilot
import 'package:ippo_loanpilot/ippo_loanpilot.dart';

final lp = LoanPilot(apiKey: 'lp_live_...');

// PAN + credit check
final check = await lp.creditChecks.create(name: 'Meera', mobile: '9876543210', consent: true);
print(check.score);

// Analyse a statement and wait for the offer
final started = await lp.analyses.create(
  CreateAnalysis(fileBytes: pdfBytes, fileName: 'statement.pdf'),
);
final done = await lp.analyses.waitFor(started.id);
print('${done.decision} · score ${done.finalScore}');

Same resources as the TypeScript SDK — analyses (create / combine / original / waitFor), creditChecks, customers, loans, products — with timeout, maxRetries and defaultHeaders options, and a baseUrl override for self-host. Pairs with ippo_agents for the voice/chat assistant side.