Import a bank statement
Reads a bank statement from the file store (CSV, CAMT.053 or OFX) onto a bank account, skipping lines imported before.
Free
This tool costs nothing to call.
An example
Here's this month's bank statement as a CSV. Load it into the books.
Your agent callsbooks_import_bankFree
The example business is Hansen & Voss, a restaurant-equipment wholesaler in Hamburg with 60 staff. The reply is the one the tool really gives.
{
"file_id": "6b2d9f41-7c3e-4a8b-9d0f-1e2a3b4c5d6e",
"date_format": "DD.MM.YYYY",
"decimal": ","
}Use it when
A new statement arrived; its lines then wait in books_bank_lines to be matched.
What it does
Read a bank statement from the file store onto a bank account (default the bank account): CSV as the bank exports it, CAMT.053 (.052, .054) or OFX/QFX. CSV columns are found by their headers in several languages; when they aren't, name them with columns. Lines imported before are skipped, so overlapping statements are fine. Each line then waits in books_bank_lines to be matched. Charged per line added.
What comes back
The account and the file's format, how many lines were added, already imported or before the start date, the dates covered, skipped rows, and next. Every reply also carries cost_usd and balance_usd.
Inputs
| Name | Type | What it is |
|---|---|---|
file_idRequired | string | A file_id from the file store. Exactly 36 characters. |
account | string | An account code from the chart, e.g. "6600". 1 to 20 characters. |
columns | object | CSV header names, e.g. {"date": "Buchungstag", "amount": "Betrag", "description": "Verwendungszweck"}. money_in and money_out are for files with two amount columns; direction for a debit/credit marker column. |
columns.date | string | Up to 100 characters. |
columns.amount | string | Up to 100 characters. |
columns.money_in | string | Up to 100 characters. |
columns.money_out | string | Up to 100 characters. |
columns.description | string | Up to 100 characters. |
columns.counterparty | string | Up to 100 characters. |
columns.reference | string | Up to 100 characters. |
columns.currency | string | Up to 100 characters. |
columns.balance | string | Up to 100 characters. |
columns.direction | string | Up to 100 characters. |
columns.bank_id | string | Up to 100 characters. |
date_format | string | One of: YYYY-MM-DD,DD.MM.YYYY,DD.MM.YY,DD/MM/YYYY,MM/DD/YYYY,DD/MM/YY,MM/DD/YY,DD-MM-YYYY,MM-DD-YYYY,YYYY/MM/DD,YYYY.MM.DD,YYYYMMDD,DD MMM YYYY,DD-MMM-YYYY,MMM DD, YYYY,DD MMMM YYYY. |
decimal | string | The CSV's decimal mark. One of: ,,. |
currency | string | The statement's currency when the file doesn't say. Default the base currency. Matches ^[A-Za-z]{3}$. |
max_lines | integer | The most lines this call may add (and hold the price for). 1 to 5,000. Default: 500. |
The call
Over MCP, call books_import_bank on https://api.conecto.chat/mcp/books. Over REST:
curl -X POST https://api.conecto.chat/v1/tools/books_import_bank \
-H "Authorization: Bearer $CONECTO_KEY" \
-H "Content-Type: application/json" \
-d '{"file_id":"6b2d9f41-7c3e-4a8b-9d0f-1e2a3b4c5d6e","date_format":"DD.MM.YYYY","decimal":","}'When it refuses
A refused call costs nothing and says what to do next.
| Code | When | What to do |
|---|---|---|
no_books409 | The business keeps no books yet. | Set them up with books_setup (base currency, start date). |
not_found404 | No account, tax, entry or file of the books has that code, name or id. | Check the codes with books_list_accounts and the taxes with books_get. |
archived409 | The account or tax is archived. | Use another one, or un-archive it with books_save_accounts. |
invalid_statement400 | The file is not a statement that can be read: an amount, a date or a currency is unreadable. | Pass decimal "," for comma decimals, or check the file. |
columns_needed400 | No header row with a date and an amount was found. | Name the columns with columns, like {"date": "Buchungstag", "amount": "Betrag"}. |
date_format_needed400 | The dates are in no known format, or could be several. | Pass date_format, like "DD.MM.YYYY". |
too_many_lines413 | The statement has more lines than max_lines. | Pass a higher max_lines (up to 5,000). |
too_large413 | The statement is over 10 MB. | Split it by month. |
invalid_input400 | The account is not a bank, card or cash account, or a setting is not valid. | Import onto a bank account. |
More Bookkeeping tools
All 33 tools- Set up the books
books_setupStarts the business's double-entry books (currency, start date, chart of accounts) or changes their settings.$0.001 a call - Read the books' settings
books_getThe books' settings: currency, start date, fiscal year, locked period, roles, payment accounts, taxes, and what is waiting.Free* - List the chart of accounts
books_list_accountsEvery account with its code, type, role and balance on a day.Free* - Add or change accounts
books_save_accountsAdds accounts or changes them, matched by code: name, type, description, code, role or archived.$0.001 a call - Add or change a tax
books_save_taxAdds or changes a tax rate the books use (VAT, GST, sales tax), matched by name.$0.001 a call - Book an expense
books_record_expenseBooks a cost the business paid, with its tax split off and the receipt attached.$0.01 a call - Book a journal entry
books_record_entryBooks a journal entry of two or more balancing lines, for whatever the other tools do not cover.$0.01 a call - Attach a receipt
books_attach_receiptAttaches a receipt from the file store to an entry that has none.$0.01 a call
Give this to your agent.
Set up Conecto from https://conecto.chat/SKILL.md