Skip to navigation

Book a statement's reviewed rows as transactions

View as Markdown

Requires manage:bank_accounts — this writes accounting data.

Omit entry_ids entirely to book every pending row — on a compare-mode statement, every pending row whose comparison.rows state is missing or before_sync. Sending the key with nothing usable in it — [], or values that are not integers — is refused with 422, never treated as “book everything”. Rows flagged duplicate are left alone unless you name their ids: the flag means a transaction like this already exists, and booking it anyway is a decision, not a default.

Refused with 422 when the statement does not balance. Resend with force: true if you have checked the rows yourself.

On a compare-mode statement (the account is fed by the bank) only rows whose comparison.rows state is missing or before_sync can be booked. matched, awaiting_bank and fetchable rows are refused: naming any of them in entry_ids refuses the whole call with 422, and nothing is booked. Everything is refused while the account is unconfirmed.

updated counts rows that overwrote an existing hand-entered transaction in place rather than creating a new one — that transaction keeps its id and whatever it already settles.

entries carries every row you named that belongs to this statement, including ones that were skipped as already imported or failed, each with its resulting status — so a retry after a partial failure reports what happened to every id.

Authentication

AuthorizationBearer

JWT issued via POST /api/v1/auth/sign_in. Used by mobile and SPA clients. Revoked tokens are rejected.

OR
AuthorizationBearer

Lucanto API key. Two prefixes:

  • lct_pat_<random><checksum> — personal access token (owner: User)
  • lct_live_<random><checksum> — workspace token, live data

Issue keys at /settings/api_keys (personal) or /:workspace_id/settings/api_keys (workspace). Plaintext token is shown once and never again.

Path parameters

workspace_idlongRequired>=1
bank_statement_idlong or stringRequired

Bank statement ID. Either the numeric id or the public_id (bst_…).

Headers

Idempotency-KeystringOptional<=255 characters

Client-supplied unique key (recommended: UUID v4) for safe retries. Within 24 hours, repeating the same key with the same request (method, path, query, body) replays the original response instead of re-executing the action — once the action has run, a 5xx included; a request stopped before it ran is not stored. Reusing a key with a different request returns 422 idempotency_key_conflict (IETF draft §2.7).

Request

This endpoint expects an object.
entry_idslist of longsOptional

Rows to book. Omit the key to book every pending row (on a compare-mode statement, every pending missing / before_sync row); an empty or unparseable value is a 422, not a whole-statement import.

forcebooleanOptional
Book the rows even though the statement does not balance.

Response

OK
createdinteger
updatedinteger
Rows that overwrote an existing manual transaction in place.
skippedinteger
failedinteger
transaction_idslist of longs
entrieslist of objects
balance_checkobject or nullOptional

Errors

401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
409
Conflict Error
422
Unprocessable Entity Error
429
Too Many Requests Error