Import bank statement into the review queue (nothing posts)
import_bank_statementImports a bank or credit-card statement that has been read (PDF, CSV or image) into Banking → Review. Nothing posts: the user categorizes and posts each row there. A statement is one account's transactions over a period; intake_contract(doc_type:'statement') lists the company's accounts, their currencies and the balance rule. Inputs: the account id, the printed opening and closing balances, statementDate and beginningBalanceDate when printed, and every row with a signed amount (+ money in, − money out). Opening plus the rows must tie to the closing balance, or the import is refused with the exact difference. A foreign-currency account's statement imports, but its lines cannot be posted or matched yet. A credit-card statement needs signConvention (refused on a bank account); each card line is expensed on its own date, and the line that pays the card bill is excluded automatically. An overlapping period is refused unless confirmOverlap is true. A statement another account of the company already holds (the same balances, dates and amounts, imported through this tool or as a file) is refused, naming that account and linking its statement. The original file is archived on the statement (s.82 record-keeping) when attachmentToken (from request_attachment_upload) or an inline file comes with the import; without one nothing is archived. Repeating an identical import with a token adopts the file onto the existing statement, and adding the two dates records them, without staging any row twice. Single receipts, invoices and bills have their own draft tools.
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": {
"bankAccountId": "<bankAccountId>",
"openingBalance": "<openingBalance>",
"closingBalance": "<closingBalance>",
"rows": "<rows>"
},
"name": "import_bank_statement"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rows | Yes | ||
| bankAccountId | Yes | ||
| statementDate | No | The statement date printed on the statement (the ending-balance date), `YYYY-MM-DD`: the end of the period, even when the last transaction is earlier. Omitted only when the statement prints none. | |
| closingBalance | Yes | ||
| confirmOverlap | No | true when the user has confirmed this is a separate statement whose period overlaps one already imported; it bypasses the overlap guard that stops the same transactions counting twice. | |
| openingBalance | Yes | ||
| signConvention | No | Required for a credit-card account, refused for a bank account: the sign of the rows and balances. 'PRINTED_CARD' = as the card prints them (a purchase positive, a payment or refund negative, balances owed positive). 'STORED' = Taokeh's convention (a spend negative, balances negative while owed). A wrong choice still ties out, so it books the month backwards. | |
| attachmentBytes | No | Decoded byte size of the original file. Sent with attachmentBase64, it lets the server refuse a truncated paste instead of filing a corrupt file. | |
| attachmentToken | No | The token from request_attachment_upload, once the statement bytes have been PUT to its uploadUrl. Not combined with attachmentBase64. The file is archived on the statement and downloadable from its page. | |
| attachmentBase64 | No | The original statement as base64, for small files (a few KB); a statement PDF normally goes through request_attachment_upload and `attachmentToken`. Not combined with attachmentToken. A bad type or oversize file is refused and nothing is imported. | |
| attachmentSha256 | No | SHA-256 of the original file as 64 hex characters: an optional second integrity check on attachmentBase64. | |
| attachmentFilename | No | The original filename, shown when browsing statements. | |
| attachmentMediaType | No | The attachment's media type, e.g. 'image/jpeg' or 'application/pdf'. Required with attachmentBase64; a type that does not match the file's bytes is refused and nothing is filed. | |
| beginningBalanceDate | No | The date on the opening-balance line, `YYYY-MM-DD`: the start of the period. Every row falls between it and statementDate. Omitted only when the statement prints none. | |
| confirmSignConvention | No | true when the user confirms the card sat in credit for the whole period; it bypasses the directional check that refuses a statement reading as a card that never owed anything (usually a printed statement declared 'STORED', or the reverse). |