Skip to main content
Version: v5

Import your events

You can load your events from a .csv or .xlsx file instead of typing them. SuiviBourse shows what the file would add, line by line, and writes nothing until you confirm.

Import a file​

You need at least one account first. See Accounts.

  1. On the Ledger, click Import.
  2. Next to Import into, choose the account that receives the lines whose file names no account.
  3. Drop your file on the frame, or click Choose a file. You import one file at a time.
  4. Read the preview. Nothing has been written yet.
  5. Settle the lines that need it. See Read the preview.
  6. Click Import N events.

The page then confirms how many events were imported. Click Another file to import the next one. The search palette's Import a statement action also opens this page.

The format, column by column on the import page opens the file format below.

Read the preview​

The import preview: the file name, the tabs by outcome, and each line with its Outcome column

Each line of the file gets an Outcome. The tabs above the table show one outcome at a time.

OutcomeWhat it meansWhat to do
NewYour ledger does not have this line yet.It will be written.
Already presentThe account already has this event: same date, security, quantity and price (or amount). A free share grant matches without its price.It is skipped.
Unknown securitySuiviBourse cannot tell which security the line is about.Type its ticker in the field of the line and click Associate. The other lines with the same ISIN follow.
UnreadableThe line cannot be read. The row says why, for example a date or a number it cannot read.Fix the file and import it again.

If the file names accounts in an account column, each one must already exist in Accounts. A line naming another account is Unreadable.

When the file holds securities quoted in another currency, the page asks Currency of the amounts for each of them. Keep your base currency, selected by default, if your broker converted the amounts. Choose the security's own currency to have them converted at each day's rate.

When a file is refused​

A refused file writes nothing. The page says why:

MessageCause
The app only reads .csv and .xlsx filesThe file has another extension.
… could not be readThe file is damaged, or in another format.
… is emptyThe file has no lines.
The header of … is not recognisedThe first row lacks the date and event_type columns.
What you handed over is larger than the app takes in one goThe file is over 8 MiB. Export a shorter period.

File format​

The file is a .csv or an .xlsx with a header row, then one event per row. In a workbook, every sheet is read. Rows can come in any order.

ColumnRequiredWhat it holds
dateyesThe day of the event.
event_typeyesBUY, SELL, GRANT, DIVIDEND, DEPOSIT or WITHDRAWAL.
accountnoThe identifier of an account. Empty: the account chosen in Import into.
symbolfor a securityThe Yahoo! Finance ticker, such as ACME.PA. An ISIN is accepted too.
isinnoThe ISIN of the security.
namenoThe name of the security.
quantityBUY, SELL, GRANTThe number of shares. Fractions are allowed.
unit_priceBUY, SELLThe price of one share, in your base currency. Optional on GRANT.
feenoThe fee, or the tax withheld on a dividend.
amountDIVIDEND, DEPOSIT, WITHDRAWALThe sum received or moved, in your base currency.
notesnoA free label, shown in the Ledger.
base_currencynoWritten by the export. When it is filled, the page asks no currency question and writes the amounts as they are.

The six kinds are described in Ledger. A line about a security needs a symbol, an isin or a name.

Accepted spellings​

ItemAccepted
Column namesAny case. event_type, Event Type and event type are the same column. Unknown columns are ignored.
Separator (.csv)Comma, semicolon or tab.
Encoding (.csv)UTF-8, or Windows-1252.
Event kindsAny case: buy, Buy, BUY.
DatesDay first: 2026-03-14, 14/03/2026, 14-03-2026, 14.03.2026, 14/03/26. Spreadsheet date cells work too.
Numbers1234.56, 1234,56, 1 234,56, 1.234,56, 1,234.56. Currency signs are ignored.
SignsA minus sign is ignored. The kind of event gives the direction.
Price or amountOn BUY and SELL, an amount can replace unit_price. The price is then worked out from the amount, the fee and the quantity.

Sample file​

date,event_type,account,symbol,name,quantity,unit_price,fee,amount,notes
2026-01-05,DEPOSIT,broker-a,,,,,,5000.00,January transfer
2026-01-12,BUY,broker-a,ACME.PA,Acme Industries,20,84.50,1.99,,
2026-02-03,BUY,broker-a,WRLD.AS,World Index ETF,30,96.20,1.99,,
2026-04-20,DIVIDEND,broker-a,ACME.PA,Acme Industries,,,6.40,42.00,2025 dividend
2026-06-15,GRANT,broker-a,ACME.PA,Acme Industries,2,,,,Bonus shares
2026-09-08,SELL,broker-a,ACME.PA,Acme Industries,10,91.30,1.99,,
2026-10-01,WITHDRAWAL,broker-a,,,,,,800.00,

A file exported from the Ledger has these columns plus base_currency, and imports as is.

Import a broker statement with the agent​

If your broker's statement has another layout, the agent can read it. On the Agent page, click Attach a statement, choose the Statement account and paste the Statement text. The agent proposes events, and nothing is written until you review and confirm them. See Agent.

Undo an import​

An import cannot be undone in one step. On the Ledger, filter on the account and period of the file, tick the events and delete them. See Delete events.

From a script​

With an access token that opens /api, a script can import a file. See Secure access.

# Preview: count what would be written, write nothing
curl -H "Authorization: Bearer $TOKEN" \
-F 'file=@events.csv' \
'http://localhost:8080/api/events/import?dry_run=1'

# Import
curl -H "Authorization: Bearer $TOKEN" \
-F 'file=@events.csv' \
http://localhost:8080/api/events/import

This route is stricter than the import page. It needs the column names of the sample and dates as YYYY-MM-DD, and refuses the file at the first bad line.

You can send several files in one call with several -F 'file=@…' parts. Lines already in your ledger are skipped.