Upload bills file
POST
https://app.speybooks.com/api/v1/bill-imports/uploadUpload an outstanding bills CSV. The ODCE engine parses bills, resolves supplier contacts via UCI-lite matching (exact normalised name then Levenshtein fuzzy at ≥ 85%), and validates the clearing zero-sum invariant against the AP migration clearing account (2198).
Requires an active opening balance imported in Clearing Mode. Blocked if a completed bill import already exists (singleton) or if the organisation uses Cash VAT accounting.
Maximum file size: 5 MB. Only CSV files are accepted.
The response includes the full preview payload — rows with per-row contact resolution, clearingProof, and warnings — everything needed to render the import wizard UI. There is no need for a subsequent GET call after upload.
Response
201 CSV parsed, suppliers resolved, clearing proof validated. Returns full import wizard payload: rows with per-row contact resolution, clearingProof, stats, errors, warnings, and canConfirm gate.
Show response fields
canConfirm booleanclearingProof objectShow child attributes
cleared booleanimportDelta stringnetBalance stringopeningBalance stringcutoverDate stringdirection stringerrors array<object>filename stringimportId stringrows array<object>Show child attributes
contact objectShow child attributes
confidence integercontactId stringcontactName stringoutcome stringreason stringcontactName stringdocDate stringdocNumber stringdueDate stringerror string nullableerrorDetail string nullablegross stringoutstanding stringpaid stringrowIndex integerstatus stringstats objectShow child attributes
errorRows integertotalGross stringtotalOutstanding stringtotalPaid stringtotalRows integervalidRows integerwarnings array<object>Error codes
400 No file uploaded, parse error, empty file, or file exceeds 5MB limit.
409 An active bill import already exists (singleton violation).
422 Precondition failed: no opening balances, OB not in clearing mode, or Cash VAT scheme.