Upload invoices file
POST
https://app.speybooks.com/api/v1/invoice-imports/uploadUpload an outstanding invoices CSV. The ODCE engine parses invoices, resolves contacts via UCI-lite matching (exact normalised name match then Levenshtein fuzzy at ≥ 85%), and validates the clearing zero-sum invariant.
Requires an active opening balance imported in Clearing Mode. Blocked if a completed invoice 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, contacts 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 invoice import already exists (singleton violation).
422 Precondition failed: no opening balances, OB not in clearing mode, or Cash VAT scheme.