Credit Risk Index API
Event-sourced credit intelligence for B2B receivables, BNPL portfolios, and merchant underwriting — delivelihood-checked scores with a full audit trail, streamed live as risk changes.
Why this exists
Traditional bureau scores are slow, opaque, and blind to what actually happens on your book. The Credit Risk Index is computed from observable payment behavior only — every score re-derives from the event log, so a risk team can trace any number back to the payments behind it. No black box, no estimates, and new entities are flagged thin-file instead of punished with a low score for being new.
Built for financial services teams that need:
- BNPL / installment underwriting — score a subscriber at checkout from live payment behavior, not stale bureau files
- Portfolio monitoring — watch the exposure-weighted market level and catch deterioration as ticks, not month-end reports
- Collections prioritization — CRITICAL-band entities with fresh adverse events sort themselves to the top of the queue
- Merchant / counterparty onboarding — thin-file vs scored distinction keeps new-but-clean counterparties moving while flagging real risk
Calibration follows institutional output discipline (D&B PAYDEX-style payment-punctuality semantics, FICO-style factor structure, backtested accuracy published as default outcomes accrue). The differentiator no bureau offers: an event-sourced trail with a physical-settlement leg — audit any score back to its inputs.
graph TD
A[Payment recorded / order settled] --> B[Best-effort index event]
B --> C[Subscriber recompute]
C --> D[0–1000 score + band + thin-file]
D --> E[REST snapshot]
D --> F[WebSocket / SSE ticks]
D --> G[Enterprise gRPC stream]
Base URLs
| Environment | Base |
|---|---|
| Production (facade) | https://business.huntrecht.com/api/data/ |
| Dev standalone service | http://<host>:8001/api/data/ |
| gRPC (enterprise, HFT) | <host>:8002 |
In production only the facade is public: the same routers are mounted
in-process under identical /api/data/* prefixes, so standalone :8001
and the facade can never drift.
Plans & entitlements
Financial data is a paid product. Every surface enforces plan entitlements;
unauthenticated requests get 401, wrong-plan requests get 403 with an
upgrade hint, and unauthenticated sockets close with 4401 (wrong plan:
4403).
| Surface | Free | Starter | Business | Pro | Enterprise |
|---|---|---|---|---|---|
| Index reads (snapshots, score, level) | — | ✅ | ✅ | ✅ | ✅ |
| Live ticks (WebSocket / SSE) | — | — | ✅ | ✅ | ✅ |
| gRPC unary + streams (HFT) | — | — | — | — | ✅ (plan-claim token) |
Streams cost more to serve than snapshots, so live ticks start at Business. gRPC is enterprise-only, enforced per-RPC on the token's plan claim — this is separate from (and stricter than) the REST plan gates.
Methodology v1
Event-sourced composite, 0–1000, observable inputs only.
| Component | Weight | Input |
|---|---|---|
| Punctuality (P) | 50% | Recency-weighted on-time rate over the trailing window |
| Fulfillment (F) | 30% | Completed vs expected payments, blended with settlement completion |
| Severity (S) | 20% | Failed/default events, exponentially decayed |
Score = 1000 × (0.5·P + 0.3·F + 0.2·(1−S)).
Bands
| Band | Range | Typical action |
|---|---|---|
| LOW | ≥ 800 | Auto-approve flows |
| MEDIUM | 600–799 | Standard terms, routine review |
| HIGH | 400–599 | Tightened terms, enhanced monitoring |
| CRITICAL | < 400 | Manual review, collections priority |
Thin-file rule
An entity returns score: null, thin_file: true when history is
insufficient — short expected term, or zero observed history with no adverse
signal. Adverse signals (failures, unpaid/overdue billing) still score.
Newness is never punished as risk.
Input modes
Before per-event rows land, components derive from current state (segment
snapshots + subscription counters) and responses are labeled
state-derived. When event rows land, the same formula consumes them with
recency decay — no formula change, inputs graduate. Every response carries
its methodology label and input mode.
Snapshots (REST)
All reads require a session cookie (session_token) and the
credit_index_read entitlement (Starter and up).
GET /api/data/v1/index/constituents
Per-subscription credit snapshots (inputs only — never a computed score).
Query params: risk_level?, limit (1–1000, default 100). Rows carry their
source; customer emails and raw payloads are excluded.
GET /api/data/v1/index/score?subscription_id={id}
Computed methodology-v1 score for one subscription.
{
"subscription_id": 5,
"score": 200.0,
"band": "CRITICAL",
"thin_file": false,
"components": {"P": 0.0, "F": 0.0, "S": 0.0},
"input_mode": "snapshot",
"methodology": "v1-state-derived",
"computed_at": "2026-10-14T12:00:00+00:00"
}
GET /api/data/v1/index/level
Market level: exposure-weighted mean over scored entities. Thin-file entities are counted as unscored, never folded in as zeros.
GET /api/data/v1/index/events
Recent index event log (audit trail).
REST quickstart
import httpx
client = httpx.Client(
base_url="https://business.huntrecht.com",
cookies={"session_token": "<session>"},
)
score = client.get(
"/api/data/v1/index/score", params={"subscription_id": 5}
).json()
if score["thin_file"]:
print("insufficient history — route to manual review")
else:
print(score["band"], score["score"], score["components"])
const res = await fetch(
"https://business.huntrecht.com/api/data/v1/index/level",
{ headers: { Cookie: "session_token=<session>" } }
);
const { level, entities, unscored } = await res.json();
Live ticks (WebSocket)
WS /api/data/v1/index/stream
Payment recordings and arena settlements emit best-effort events (never
breaking the write path); the subscriber recomputes and broadcasts ticks.
Requires the credit_index_stream entitlement (Business and up). Browsers
send the session cookie automatically; other clients set the Cookie
header. Rejections close the socket: 4401 unauthenticated, 4403 plan
upgrade required.
Tick shape:
{
"type": "index.tick",
"subscription_id": 5,
"score": 200.0,
"band": "CRITICAL",
"components": {"P": 0.0, "F": 0.0, "S": 0.0},
"thin_file": false,
"input_mode": "snapshot",
"events_used": 0,
"methodology": "v1-state-derived",
"ts": "2026-10-14T12:00:01+00:00"
}
WebSocket quickstart
import asyncio, json
import websockets
async def watch():
async with websockets.connect(
"wss://business.huntrecht.com/api/data/v1/index/stream",
additional_headers=[("Cookie", "session_token=<session>")],
) as ws:
async for raw in ws:
tick = json.loads(raw)
if tick.get("band") == "CRITICAL":
print("escalate:", tick["subscription_id"], tick["score"])
asyncio.run(watch())
const ws = new WebSocket(
"wss://business.huntrecht.com/api/data/v1/index/stream"
); // same-origin cookies attach automatically
ws.onmessage = (msg) => {
const tick = JSON.parse(msg.data);
if (tick.band === "CRITICAL") escalate(tick);
};
ws.onclose = (e) => {
if (e.code === 4401) location.href = "/login";
if (e.code === 4403) location.href = "/pricing"; // plan upgrade required
};
Live ticks (SSE)
GET /api/data/v1/index/stream-sse
Curl-friendly alternative carrying the same ticks. Opens with an
index.snapshot market-level event, then streams data: frames.
curl -N -b "session_token=<session>" \
https://business.huntrecht.com/api/data/v1/index/stream-sse
const feed = new EventSource(
"https://business.huntrecht.com/api/data/v1/index/stream-sse",
{ withCredentials: true }
);
feed.onmessage = (e) => route(JSON.parse(e.data));
gRPC (enterprise HFT)
GetScore and GetLevel mirror the REST snapshots; SubscribeTicks
streams recompute ticks (filter by subscription_ids, empty = all plus
market-wide settlement notices). Every RPC requires a platform access token
with an enterprise plan claim — anything else is rejected before any
handler runs. Production gRPC serves TLS.
import grpc
from credit_risk_api.generated import (
credit_index_pb2 as pb2,
credit_index_pb2_grpc as pb2_grpc,
)
channel = grpc.secure_channel(
"data.huntrecht.com:8002",
grpc.ssl_channel_credentials(root_certificates=open("ca.pem", "rb").read()),
)
stub = pb2_grpc.IndexServiceStub(channel)
auth = (("authorization", "Bearer <enterprise-token>"),)
print(stub.GetLevel(pb2.LevelRequest(), metadata=auth))
for tick in stub.SubscribeTicks(
pb2.SubscribeRequest(subscription_ids=[5]), metadata=auth
):
if tick.band == "CRITICAL":
print("escalate:", tick.subscription_id, tick.score)
# explore without code (enterprise token required)
grpcurl -H "authorization: Bearer <enterprise-token>" \
-proto credit_risk_api/proto/credit_index.proto \
data.huntrecht.com:8002 credit.index.v1.IndexService/GetLevel
Proto source of truth: credit_risk_api/proto/credit_index.proto.
Provider connections
CRUD for the data-connect UI at /api/data/connect/providers (session
auth): list (secrets never included), create (passwords and connection
strings Fernet-encrypted before storage), soft-delete, and live
POST /:id/test against the real provider. This is how lending-data
sources (core banking extracts, bureau feeds, warehouse connections) are
registered before their data flows into scoring.
Credit history GraphQL
POST /api/data/graphql/credit-history — paginated creditHistory and
companyCreditSummary reads for case-level investigation behind a score.
(Legacy /graphql/credit-history returns 308 to the new path.)
Error reference
| Surface | Code | Meaning |
|---|---|---|
| REST | 401 | Missing/invalid session |
| REST | 403 | Authenticated but plan lacks the entitlement — upgrade hint in detail |
| REST | 404 | Subscription or provider not found |
| REST | 503 | Connector drivers or secret encryption unavailable in this environment |
| WebSocket | 4401 / 4403 | Unauthenticated / plan upgrade required |
| gRPC | PERMISSION_DENIED | Non-enterprise plan token |
Client libraries & packaging
Typed REST coverage for the data API follows the platform SDK release train (python, typescript, go, ruby, rust ship together). Streaming transports (WebSocket / SSE / gRPC) are documented above with reference snippets per language; generated streaming clients are evaluated per language on demand. The TradeArena API reference remains its own surface — a unified data-stream SDK bundling market data with credit intelligence is the packaging direction under review, and this page will be its reference home when it lands.