Hanzo
OpenapiBooks

Posts a reviewed scanned bill to the ledger.

Posts a reviewed scanned bill to the ledger.

POST /v1/books/scan/book

Addresshttps://api.hanzo.ai/v1/books/scan/book
MethodPOST
Operationpost_books_scan_book
AuthAuthorization: Bearer $HANZO_API_KEY

Posts a reviewed scanned bill to the ledger. It is the scanner's ONLY write: the voucher goes through the same post() choke point every other source uses, so it is checked to balance (Σdebit == Σcredit) and is idempotent by (scan, scanId) — re-booking the same scan answers posted=false and writes nothing. A bill whose economic identity (vendor, total, issue date) already posted under a DIFFERENT scan is refused 409 unless override is set, which is what stops the same receipt re-scanned into a new file hash from double-booking. An unbalanced voucher is refused 400.

Request

11 fields, body application/json (required).

FieldInTypeRequiredDescription
overridebodybooleanOverride books this bill even when one of the SAME economic identity (vendor, total, issue date) already posted — the explicit human confirmation that a…
scanIdbodystringScanID is the scanned document's file hash, as GET /v1/books/inbox and the scan draft report it.
voucherbodyVoucher
voucher.descriptionbodystringDescription is the human line for the event, e.g.
voucher.legsbodyLeg[]Legs are the sides of the posting.
voucher.legs[].accountbodystringAccount is the chart-of-accounts number this side posts to, e.g.
voucher.legs[].creditbodyintegerCredit is the leg's credit in exact cents.
voucher.legs[].debitbodyintegerDebit is the leg's debit in exact cents.
voucher.postingAtbodystringPostingAt is the RFC3339 instant the event posts at — the time every statement window filters on.
voucher.sourceIdbodystringSourceID is the source event's own id within that namespace.
voucher.sourceKindbodystringSourceKind is the idempotency namespace naming what booked this, e.g.

Response

StatusBodyMeaning
200BookResponseok

200 body — 2 fields.

FieldInTypeAlwaysDescription
postedbodybooleanPosted is true when this call wrote the voucher, false when the same scan had already booked and nothing was written.
scanIdbodystringScanID echoes the scan that was booked.

Failure carries the platform error shape — see Errors.

Examples

hanzo books scan book

Books API · All Hanzo APIs · Interactive reference

How is this guide?

On this page