Response formats
JSON, CSV, and redacted output.
POST /v1/parse shapes its output with the format query param. Redaction is its own route, POST /v1/redact.
JSON (default)
?format=json (or omit it) returns the ParseResponse object: metadata, totals, the transaction array, and reconciliation (which checks ran and passed; see Quickstart). Money fields are decimal strings; dates are ISO 8601.
Row money rules, in JSON and CSV:
debitandcreditare never negative. A statement row with a negative amount fails the parse with a422(error_class: "LayoutDriftError"). It never comes back as a clean result.- A zero
debit,creditorbalanceis always unsigned. You never get-0.00. debitandcreditcan both be nonzero on one row when the statement prints both. They are never netted. Sum each column on its own.
CSV
?format=csv returns text/csv with a Content-Disposition attachment header, serialized by the engine's own writer:
curl -X POST "https://bankstract.logickoder.dev/v1/parse?format=csv" \
-H "Authorization: Bearer bsk_live_xxx" \
-F "pdf=@statement.pdf" -o statement.csvColumns: date, narration, debit, credit, balance, reference, currency, has_time. has_time is true or false.
Redaction
POST /v1/redact runs the NDPR-aware redactor and returns the redacted document bytes (PDF or XLSX), not JSON, with the matching Content-Type and two headers:
X-Bankstract-Redactions: count of redactions appliedX-Bankstract-Format-Version: engine format version
curl -X POST https://bankstract.logickoder.dev/v1/redact \
-H "Authorization: Bearer bsk_live_xxx" \
-F "pdf=@statement.pdf" -o redacted.pdfSame key, same 50 MB limit, optional bank. It counts as one parse. Over a free cap it returns 402 with error_class: "free_limit_reached": there is no canned sample for a redacted document. The old redact=true field on /v1/parse is gone. A request that still sends it gets 422 with error_class: "removed_parameter", never an unredacted statement.
Optional inputs
bank=<name>: skip auto-detection and force a parser (fbn,opay,palmpay,zenith).
The PDF is parsed in memory and never written to disk, for any format.