For the complete documentation index, see llms.txt. This page is also available as Markdown.

External bank statement

External bank statement API reference

Public API for analyzing a statement JSON URL via Midax. Results arrive on your callbackUrl and/or by polling analysisId.

See also: External decisioning, Decision matrices (staff).

Swagger tag: External Bank Statement, Webhooks.

1. Concepts

Piece
What it does

External bank statement

Analyze a statement JSON URL via Midax; you get results on your callbackUrl (and/or poll by analysisId).

External decisioning

Score a payload against an active Forms decision matrix (separate page).

Decision matrices

Staff-authored scoring + decision bands (separate page). Must be isActive: true for external evaluate.

2. Auth

API group
Auth

/external-bank-statement/*

Public — pass orgKey in body

/webhooks/external-bank-statement

Public — Midax callback into your system

3. Response envelope

{
  "status": "success",
  "message": "Human-readable message",
  "data": {}
}

Errors follow NestJS exception format (statusCode, message, error).

4. Enums

Enum
Values

ExternalBankStatementAnalysisStatus

PENDING, PROCESSING, COMPLETED, FAILED

5. External bank statement

Base path: /external-bank-statement

5.1 Start analysis

Creates/updates a tracking row and calls Midax. Midax POSTs the finished analysis to callbackUrl (caller-owned).

Behaviour

Condition
Result

Same analysisId is PROCESSING and started < 24h ago

Return existing processing row (no new Midax call)

Same analysisId is COMPLETED and rerun is not true

Return cached completed analysis

New id, failed, expired processing, or rerun: true

Create/update → call Midax

Request body (StartExternalBankStatementAnalysisDto)

Field
Type
Required
Notes

orgKey

string (2–120)

Yes

Organisation key / orgRef for Midax billing & public key

analysisId

string (2–120)

Yes

Unique id for this job

statementJsonUrl

URL

Yes

Absolute URL to JSON array of transactions (naira)

accountName

string

Yes

Max 200

accountNumber

string

Yes

Max 32

bank

string

Yes

Max 120

callbackUrl

URL

Yes

Absolute URL Midax will POST when done

appId

string

No

Your tracking id

mobileUserId

string

No

Your tracking id

rerun

boolean

No

Default false. Force fresh Midax run (rebill)

Response data

When the server returns immediately completed / cache hit:

5.2 Get status by analysisId

Response data is the same shape as start-analysis data (status, analysis, timestamps, errorMessage).