Attach a bank line to a transaction the user already logged
attach_statement_lineChanges- What it does
- Changes or deletes something you had. Your assistant can ask you to confirm first. Safe to retry: the same call twice changes nothing more.
- Permission
- Transactions, change
transactions:write
What your assistant is told
Back transactions the user already captured — by hand or from a receipt — with the bank lines they have CONFIRMED are the same payment. This is the second half of a statement import: log_transactions_batch answers match_candidate for a line that looks like an earlier capture, you ask the user, and you call this with the one they picked. Send every confirmed line in ONE call (up to 500) — one call is one entry in the user's activity log. Per item: transactionId is the candidate THE USER CHOSE, and the rest is the statement's line. The statement wins on the amount; the transaction keeps its own date and time, its category and the user's own description — the bank's text is kept beside it (and becomes the description only when there was none). ONLY attach what the user confirmed: never the top candidate because it looked right, and never a "near" candidate (an amount that does not match exactly) without asking about the difference — a wrong attach silently merges two real payments into one. Answers per item in input order: attached, existing (that line was already on that transaction — a safe replay) or error with a code: not_found, already_on_statement (that transaction already has a bank line, so this is a different payment — send it to log_transactions_batch with newEvenIfSimilar instead), duplicate_external_id (another transaction already carries that bank id) or currency_mismatch. Good items are saved even when others fail. This does NOT create transactions — use log_transactions_batch for the lines that are genuinely new.
Parameters
lineslist of object, requiredThe confirmed lines, 1 to 500. One per transaction.