Confirm invoice import
POST
https://app.speybooks.com/api/v1/invoice-imports/{id}/confirmConfirm an invoice import. In one atomic transaction the engine, for
each valid row, creates the contact if it was unmatched, creates the
invoice (its status set from the payment state: sent, partial,
or paid), posts the contra-wash clearing entry that moves the
invoice onto the receivables ledger, and, for a partially paid
invoice, records a synthetic payment for the amount already received.
The clearing account must net to zero at commit. If it does not, the entire transaction is rolled back and nothing is written.
Error responses:
422: the import is not confirmable (canConfirm is false), a required account is missing, or the clearing account does not net to zero at commit
Path parameters
idstringrequiredData import ID (e.g. dimp_3). Must be in pending status with canConfirm: true.
Response
200Import confirmed. Returns documentsCreated, syntheticPaymentsCreated, clearingBalance (should be 0), direction, and engineVersion.
Show response fields
clearingBalanceintegerdirectionstringdocumentsCreatedintegerengineVersionstringsyntheticPaymentsCreatedintegerError codes
404Pending invoice import not found.
409An active invoice import was confirmed concurrently (singleton violation).
422Import not confirmable: canConfirm is false, missing accounts, or clearing imbalance on commit.