Import a bank statement
upload_bank_statementUpload a bank statement file as the bank gave it, for one bank account of the company. A file read in a shell that cannot reach app.octobooks.ai goes in parts: file_sha256 (sha256sum of the file), parts, part, part_sha256 (sha256sum of the part's text) and content_base64 the part's text, 20,000 characters a part; the confirm request of a PDF then names file_sha256 and confirm only. content_base64: the original file bytes, base64 (at most 5 MB): OFX, QIF, CAMT.053, MT940, the CSV export of Barclays, NatWest, Lloyds, HSBC, Wise, American Express, Monzo, Starling, N26, Sparkasse, Deutsche Bank, Commerzbank, ING, George or ELBA, or the statement PDF as the online banking gives it, or a scan or photo of a paper statement (scanned PDF, PNG, JPEG, TIFF; read by OCR, pdf.read_by scan or photo); the format is read from the file. A PDF or scan (round 662) is read without storing anything: a request without confirm returns every line as read, each checked against the balances the PDF prints (status ok or refused with the reason), the opening and closing balance and a confirm code; the same request with confirm= imports the lines that reconcile, the PDF kept as the statement's document. Refused lines are not imported; they can be added by hand or through the CSV export. A statement that does not reconcile as a whole (a refused line, or opening plus lines is not closing) is not imported with confirm alone: confirm and import_anyway=true imports its reconciling lines, with the owner's agreement; the default is to import nothing. The preview also checks the statement's opening balance against the books (opening_check). A scan or a picture that cannot be read is refused with the formats taken (CSV, OFX, QIF, CAMT.053 or MT940 from the online banking). bank_account: the code of the bank account. Takes the bank's own file only, not typed or rebuilt lines. preview=true reads the file and stores nothing: the opening lines as read (date, amount with its sign, payee), money in and out, new lines, whether its balances add up and whether its signs agree with the account's history; a CSV of a layout not known yet comes back with its columns, then give mapping (date, amount or money_in and money_out, counterparty, description, balance, delimiter, decimal_comma, date_format). The decimal mark of a CSV is read from all its amount cells (1,234.56 UK, 1.234,56 DE and AT, 1'234.56 CH); the preview says it under numbers, and where no cell shows it, gives both readings with their totals: then send decimal_comma 1 (1.234,56) or 0 (1,234.56). Without preview, a CSV of a layout not known yet whose columns are guessed for sure is imported at once (mapping_used, undo); an unsure guess comes back unsure with why, nothing stored. invert=true turns the signs of a CSV round. A QIF file names no currency and no balance: currency (default the bank account's) and opening_balance (optional; the closing balance is then the opening balance plus the lines) say them; its dates are read from the whole file (a day over 12 decides), and where no date decides, qif_dates (day first or month first) is asked once. The file is kept with its hash and marked as uploaded through this connection; a line already on file is skipped. New lines land on the open list. Nothing is booked. Needs the right upload.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"bank_account": "<bank_account>",
"filename": "<filename>"
},
"name": "upload_bank_statement"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| part | No | ||
| parts | No | ||
| invert | No | ||
| company | No | ||
| confirm | No | ||
| mapping | No | ||
| preview | No | ||
| currency | No | ||
| filename | Yes | ||
| qif_dates | No | ||
| csv_profile | No | ||
| file_sha256 | No | ||
| part_sha256 | No | ||
| bank_account | Yes | ||
| import_anyway | No | ||
| content_base64 | No | ||
| opening_balance | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||