Exclude a statement from its upload's commit
POST/api/v1/bank_statements/:id/exclude
Takes the file out of the commit of the upload it arrived in. The 200 returns the statement with excluded true and excluded_at set.
When you need it. An upload is committed whole or not at all. A file that can never be posted - an extraction that failed - blocks its whole upload: a commit naming another file answers batch_unresolved, and a commit naming the failed file itself answers statement_not_reviewable. A valid file you do not want in the books is the opposite case: it is posted with the rest of the upload unless you exclude it first. Either way, excluding it is the explicit act: the next commit naming another file of the upload posts the rest and leaves this one untouched.
What it moves. Nothing but the exclusion. The file's state and its lines are kept as they are, and POST /bank_statements/{id}/include puts it back exactly as it was. A commit naming an excluded file is refused with statement_excluded.
No Idempotency-Key is required: excluding an excluded file changes nothing and keeps the first excluded_at.
Request
Responses
- 200
- 401
- 403
- 404
- 422
The file is excluded from its upload's commit.
The request carries no bearer token, or one that is invalid or expired.
The token may not perform this call: the OAuth scope derived from the verb (write), the workspace grant, the bank_reconciliation feature flag, or the action's own Pundit check. The example below is refused on the scope.
No statement with this id is reachable by the token's grants. One belonging to another workspace answers the same way, so the response cannot be used to probe for one.
statement_not_reviewable: the file's own state forbids the exclusion, and message says which. It is already posted - its entries are in the general ledger - or archived, or it belongs to no upload and so has no upload commit to be excluded from. Nothing you send can change that. No details.