REST API for automated bank statement scoring. Submit a JSON bank statement file and receive a full credit decision with MPCR, LDCR, ADCR metrics.
Endpoints
GET
/health
Health check — returns server status and version.
GET
/api/config
View active scoring configuration (read-only).
POST
/api/score
Score a bank JSON statement. Returns decision, score, MPCR, LDCR, ADCR and full breakdown.
Request — multipart/form-data
| Field | Type | Description |
|---|---|---|
| json_file | File | Bank statement JSON (.json) — required |
| loan_amount | number | Requested loan amount (default: 300) |
| customer_id | string | Customer identifier (metadata only) |
| aba | string | ABA / routing number for account verification |
| account | string | Account number for verification |
Request — application/json
| Field | Description |
|---|---|
| json | Raw JSON string or parsed object of bank statement |
| loan_amount, customer_id, aba, account | Same as above |
Query Parameters
| Param | Values | Description |
|---|---|---|
| format | json | html | both | Response format. Default: json |
Example — cURL (JSON response)
curl -X POST http://YOUR_SERVER:3000/api/score \ -F "[email protected]" \ -F "loan_amount=300" \ -F "customer_id=CUST001" \ -F "aba=021000021" \ -F "account=123456789"
Example — cURL (HTML scorecard)
curl -X POST "http://YOUR_SERVER:3000/api/score?format=html" \ -F "[email protected]" \ -F "loan_amount=300" \ -o scorecard.html
Example — JSON body
curl -X POST http://YOUR_SERVER:3000/api/score \
-H "Content-Type: application/json" \
-d '{
"json": { "TransactionSummaries": [...], "Accounts": [...] },
"loan_amount": 300,
"customer_id": "CUST001"
}'
Response fields (format=json)
| Field | Description |
|---|---|
| decision | APPROVE / MANUAL REVIEW / DECLINE |
| repayment_probability | 0–100 probability score |
| score_points | Raw score points |
| mpcr | Monthly Payroll Coverage Ratio (monthly avg ÷ loan) |
| ldcr | Largest Deposit Coverage Ratio |
| adcr | Average Deposit Coverage Ratio (new in v4.1) |
| avg_verified_deposit | Average single verified deposit amount |
| decline_triggers | Array of hard-decline reasons if any |
| manual_flags | Array of warning flags |
| strengths | Array of positive signals |
| score_rows | Full point-by-point breakdown array |
| aba_match / account_match | FULL_MATCH / PARTIAL_MATCH / NO_MATCH (when provided) |
Authentication
If server.apiKeys is set in config.json, include the key in requests:
curl -H "X-Api-Key: your-key-here" -X POST http://YOUR_SERVER:3000/api/score ...
When no keys are configured, the API is open.
Server Configuration
Edit config.json on the server and send SIGHUP to reload without restart:
kill -HUP $(pgrep -f "node server.js")