Hanzo
OpenapiBooks

Queue a document for later scanning

Takes a document as RAW BYTES and queues it in the caller org's inbox as `unsorted`, answering the queued item.

POST /v1/books/inbox

Addresshttps://api.hanzo.ai/v1/books/inbox
MethodPOST
Operationpost_books_inbox
AuthAuthorization: Bearer $HANZO_API_KEY

Takes a document as RAW BYTES and queues it in the caller org's inbox as unsorted, answering the queued item. It is the drop box: get the paperwork in now, read it later.

It EXTRACTS NOTHING and calls no model — that is what separates it from the scan. Nothing is proposed and nothing is posted; the item simply waits to be scanned, and a booked document leaves the queue.

IDEMPOTENT BY CONTENT: the item's id is the file hash, so re-uploading the same bytes answers the existing item rather than adding a duplicate row — and it is the same id a scan of those bytes uses, which is how the two routes address one document. Scoped to the caller's own org from the validated principal and refused without one; sandbox=true targets the sandbox ledger, and filename is recorded for display. An empty or oversized upload is a 400.

Request

1 field, body application/octet-stream.

FieldInTypeRequiredDescription
(body)bodystring (binary)yes

Response

StatusBodyMeaning
2XXInboxItemSuccess

2XX body — 18 fields.

FieldInTypeAlwaysDescription
categorybodystringCategory is the expense account the scanner proposed, as a chart number — a PROPOSAL, not a posting: nothing is booked until it is accepted.
confidencebodystringConfidence is how sure the scanner is of that reading, and is the signal for whether a person needs to check it before it is booked.
createdAtbodystringCreatedAt is when the document was uploaded.
extractedbodyExtracted
extracted.categorybodystringCategory is the expense bucket the SCANNER guessed, as a slug — a hint only.
extracted.currencybodystringCurrency is the ISO code the document is denominated in.
extracted.issuedAtbodystringIssuedAt is the document's OWN date as YYYY-MM-DD — when the bill was issued, which is not when it was uploaded or when it will post.
extracted.lineItemsbodyLineItem[]LineItems are the individual lines read off the document, where it had any.
extracted.lineItems[].amountCentsbodyintegerAmountCents is that line's amount in whole cents.
extracted.lineItems[].descriptionbodystringDescription is the line as it appears on the document.
extracted.merchantbodystringMerchant is the supplier as printed on the document.
extracted.notebodystringNote is anything else worth carrying from the document that has no field of its own.
extracted.taxCentsbodyintegerTaxCents is how much of that total is tax, in cents.
extracted.totalCentsbodyintegerTotalCents is the document total in whole cents, tax INCLUDED.
filenamebodystringFilename is the name the document was uploaded under, for a person to recognise it by.
idbodystringID is the CONTENT HASH of the uploaded bytes, which is what makes the queue idempotent: re-uploading the same document returns this item rather than adding a…
statusbodystringStatus is where the document is in the queue — unsorted until the scanner has read it, and thereafter whether it is waiting on a person or has been booked.
vendorbodystringVendor is the supplier the scanner identified, surfaced beside the item so a queue renders without opening each document.

Failure carries the platform error shape — see Errors.

Examples

hanzo books inbox create

Books API · All Hanzo APIs · Interactive reference

How is this guide?

On this page