Unconfirm a bank operation's reconciliation
DELETE/api/v1/bank_operations/:bank_operation_id/reconciliation
Takes confirmed allocations back off the operation - destroying their payments and restoring the accounting entry's suspense line - and returns the recomputed operation.
Each allocation is independently unconfirmable. Name allocation_ids and the others are left exactly as they are; omit the key entirely and every confirmed allocation comes off. An EMPTY list is refused rather than read as "all", because the two readings are opposite.
An allocation you unconfirm becomes unconfirmed, NOT rejected: undoing a confirmation is a reviewed decision you can reverse, while a rejection is terminal.
This is also the correct way to remove or re-state a bank-linked invoice payment. DELETE on /api/v1/invoices/{invoice_id}/payments/{id} refuses a payment carrying a bank operation with 422 dependent_records, details.bank_operation_id naming this operation, because unlinking the money from the reconciliation that created it would leave the ledger describing a settlement that no longer exists. PATCH on the same path accepts only note on such a payment; a request carrying any other attribute, even with its current value, is refused whole with the same answer.
expected_version is optional here and required on the confirm; when supplied it is enforced identically. Idempotency-Key is accepted and optional.
Request
Responses
- 200
- 401
- 403
- 404
- 409
- 422
The recomputed bank operation.
The request carries no bearer token, or one that is invalid or expired.
The token holds neither destroy nor write, or the bank_reconciliation feature is off for the operation's workspace.
No operation with this id is reachable by the token's grants.
stale_version: you supplied an expected_version and it is no longer current. Nothing was written; details carries the current state.
The request cannot be performed: the operation carries no confirmed allocation to unconfirm, allocation_ids is empty or names something that is not a confirmed allocation of this operation, or the accounting entry has already left the books (entry_already_exported, 422 and not 409 for the reason the confirm states).