DocumentCreated
ResponseA created document together with where to upload its bytes.
Returned in responses. Its enums are open: tolerate values not listed here, which later versions may add.
Attributes
2The document, awaiting_upload until confirmed.
19 attributes of document
Nullable because issued rows have no known size (the PDF is a lazy render cache, D-02) — never faked as 0 (Phase 122 UI-SPEC). Always non-null for received rows.
pending until the upload is confirmed, then available; archived once archived (:archive, reversible with :unarchive). New values may be added: treat a value you do not know as valid, not as an error.
Known values (open: expect new ones) pending, available, archived
How the document arrived: manual (uploaded through the app or this API), email (sent to the company's document address), merit_import / source_import (carried over from another accounting system), generated (made by the app itself).
Known values (open: expect new ones) manual, email, ocr, bank_import, merit_import, source_import, generated
Details
New values may be added: treat a value you do not know as valid, not as an error.
Status of the most recent OCR extraction run for this document (Phase 400 EXT-01, core.document_extraction). Extraction state rides this existing read model — there is no separate polling endpoint; the Archive polls listDocuments while any row is non-terminal.
Known values (open: expect new ones) queued, extracting, extracted, failed
Details
Null when the document has never been digitized, and always null on issued rows (they are synthesized from an invoice, not stored objects, so no run can exist). Terminal states are 'extracted' and 'failed'; a re-extract appends a NEW run rather than mutating a terminal one, so this always reflects the newest. New values may be added: treat a value you do not know as valid, not as an error.
Whether the file can be used: awaiting_upload until its upload is confirmed; scanning while the virus check runs; ready once it can be downloaded and digitized; quarantined when the check found malware (or could not judge the file and the deployment blocks such files) -- it is never downloaded or digitized.
Known values (open: expect new ones) awaiting_upload, scanning, ready, quarantined
Details
New values may be added: treat a value you do not know as valid, not as an error.
When the document was created (its upload was announced).
When the document last changed. Also the basis of the ETag.
Whether the document is attached to at least one record; the links themselves are GET /v1/documents/{id}/links. Always computed for a public caller. (App: issued Archive rows are always true, D-04; target-scoped reads too, WR-03.)
The date printed on the document, when known (not the upload date).
The user who uploaded the document; for an API credential, its service user.
What the document is, as its OCR reading or a person in the app typed it. Null until either has. New values may be added: treat a value you do not know as valid, not as an error.
Known values (open: expect new ones) invoice, credit_note, receipt, tax_notice, account_statement, delivery_note, contract, other, quote, late_fee, prepayment_invoice
SHA-256 of the stored bytes, hex, once uploaded. Lets a migration prove a file arrived unchanged. Null for a file confirmed before hashing existed.
Your own id for this document (from the system you migrate from or sync with), up to 200 characters, unique per organization. Filter lists by it; on_conflict resolves a create against it.
What the latest successful OCR run read. Only with expand=extraction on GET /v1/documents/{id}; null when no run has succeeded.
11 attributes of extraction
The OCR run this reading came from; its document_digitize job has this id.
What the reading took the document for (invoice, credit_note, receipt, ...).
The seller as printed.
5 attributes of supplier
The lines as read, in reading order.
8 attributes of each item
Where to PUT the bytes, then call :confirm. Null when the document already has its bytes (on_conflict=return on an uploaded one), and on a dry_run.