Hanzo
OpenapiBooks

Import a bank statement file into your books

Takes a bank statement as RAW BYTES — the file exactly as downloaded, OFX, QFX or CSV, not wrapped in JSON — parses every row, books it against the caller…

POST /v1/books/bank/import

Addresshttps://api.hanzo.ai/v1/books/bank/import
MethodPOST
Operationpost_books_bank_import
AuthAuthorization: Bearer $HANZO_API_KEY

Takes a bank statement as RAW BYTES — the file exactly as downloaded, OFX, QFX or CSV, not wrapped in JSON — parses every row, books it against the caller org's own ledger, and answers the tally: how many rows were seen, how many vouchers posted, how many inflows reconciled, how many raised a question, how many were own-account transfers, and how many were skipped.

RE-IMPORTING THE SAME STATEMENT DOES NOT DOUBLE-BOOK. Every row goes through the same posting choke point every other source uses, keyed idempotently, so an overlapping statement — the usual case, since exports overlap at the month boundary — lands its new rows and counts the rest as skipped. Skipped is the number to read on a second import.

It is READ-ONLY against the bank: this ingests, it never sends money. Scoped to the caller's own org from the validated principal, and refused without one; sandbox=true writes the org's sandbox ledger instead of its real books. An empty body is a 400, and a file the parser cannot read is a 400 carrying the parser's reason rather than a partial import. On a deployment whose import parser is not built, this answers 501 rather than mishandling the file.

Request

1 field, body application/octet-stream.

FieldInTypeRequiredDescription
(body)bodystring (binary)yes

Response

StatusBodyMeaning
2XXBankTallySuccess

2XX body — 6 fields.

FieldInTypeAlwaysDescription
ingestedbodyintegertransactions seen
postedbodyintegervouchers newly posted (outflow + reconciled)
questionsbodyintegerunmatched inflows that raised a question
reconciledbodyintegerinflows cleared against Square-clearing
skippedbodyintegeralready-processed idempotent no-ops
transfersbodyintegerown-account moves recorded (no P&L)

Failure carries the platform error shape — see Errors.

Examples

hanzo books bank import

Books API · All Hanzo APIs · Interactive reference

How is this guide?

On this page