Confirm bill import
POST
https://app.speybooks.com/api/v1/bill-imports/{id}/confirmConfirm a bill import, atomically creating bills with line items, posting contra-wash clearing journal entries, and recording synthetic payments for partially paid bills.
For each valid row:
- Auto-creates the supplier contact if unmatched
- Creates the bill (status based on payment:
sent,partial, orpaid) - Posts a clearing journal: DR MC_AP, CR Trade Creditors
- If partially paid, posts a synthetic payment: DR Trade Creditors, CR Suspense (9999)
The clearing zero-sum invariant is verified at commit — if MC_AP does not net to zero, the entire transaction is rolled back.
Path parameters
id string requiredData import ID (e.g. dimp_4). Must be in pending status with canConfirm: true.
Response
200 Import confirmed. Returns documentsCreated, syntheticPaymentsCreated, clearingBalance (should be 0), direction, and engineVersion.
Show response fields
clearingBalance integerdirection stringdocumentsCreated integerengineVersion stringsyntheticPaymentsCreated integerError codes
404 Pending bill import not found.
409 An active bill import was confirmed concurrently (singleton violation).
422 Import not confirmable: canConfirm is false, missing accounts, or clearing imbalance on commit.