Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/soker90/finper/llms.txt

Use this file to discover all available pages before exploring further.

Finper provides two modules for tracking long-term investments outside your day-to-day accounts: Pensions for recording periodic snapshots of your pension plan, and Stocks for logging individual portfolio movements and computing an aggregated portfolio summary at runtime.

Pensions

A Pension entry is a monthly snapshot of your pension plan — not a record of an individual contribution. Each entry captures the state of the plan at a point in time, including the number of units held by both employee and employer, the per-unit value, and the monetary amounts contributed by each party.

Fields

FieldTypeRequiredDescription
datenumberUnix timestamp (ms) — the date of the snapshot
employeeAmountnumberTotal monetary amount contributed by the employee
employeeUnitsnumberNumber of plan units held by the employee
companyAmountnumberTotal monetary amount contributed by the employer
companyUnitsnumberNumber of plan units held by the employer
valuenumberUnit value at the time of the snapshot

Endpoints

MethodRouteDescription
POST/api/pensionsCreate a new monthly snapshot
GET/api/pensionsList all snapshots (chronological)
PUT/api/pensions/:idReplace a snapshot record
There is no DELETE endpoint for pension snapshots. If you need to remove an incorrect entry, use PUT /api/pensions/:id to overwrite it with corrected values.

Example: Create a pension snapshot

curl -X POST http://localhost:3008/api/pensions \
  -H 'token: <your-jwt>' \
  -H 'Content-Type: application/json' \
  -d '{
    "date": 1717200000000,
    "employeeAmount": 1200.50,
    "employeeUnits": 42.35,
    "companyAmount": 600.25,
    "companyUnits": 21.10,
    "value": 28.35
  }'

Stocks

A Stock entry represents a single portfolio movement — a buy, sell, or dividend reinvestment. There is no persisted aggregation; the portfolio summary is computed at runtime from all recorded movements each time GET /api/stocks/summary is called.

Stock types

TypeDescription
buyPurchase of shares. Increases position size and total cost.
sellSale of shares. Reduces position size proportionally (weighted-average cost basis).
dividendDividend reinvested as additional shares. Counted separately as dividendShares.

Endpoints

MethodRouteDescription
GET/api/stocks/summaryAggregated portfolio summary (calculated at runtime)
GET/api/stocksList all stock movement records
POST/api/stocksCreate a new stock movement
DELETE/api/stocks/:idDelete a stock movement
There is no PUT endpoint for stock entries. To correct a movement, delete it with DELETE /api/stocks/:id and recreate it with POST /api/stocks.

Stock movement fields

FieldTypeRequiredDescription
tickerstringTicker symbol (automatically uppercased)
namestringHuman-readable company name
sharesnumberNumber of shares (positive)
pricenumberPrice per share at the time of the movement
typebuy | sell | dividendType of movement
datenumberUnix timestamp (ms) of the movement
platformstringBroker or platform name (e.g. "DEGIRO", "Interactive Brokers")

Portfolio summary

GET /api/stocks/summary returns a calculated object with the following shape:
{
  "totalCost": 4850.00,
  "totalValue": 5320.00
}
totalValue may be null if the current market price could not be fetched for one or more tickers. Individual position details — including avgCost, gainLoss, gainLossPct, and a purchases array — are available from GET /api/stocks.

Example: Record a stock purchase

curl -X POST http://localhost:3008/api/stocks \
  -H 'token: <your-jwt>' \
  -H 'Content-Type: application/json' \
  -d '{
    "ticker": "MSFT",
    "name": "Microsoft Corporation",
    "shares": 5,
    "price": 415.50,
    "type": "buy",
    "date": 1718000000000,
    "platform": "DEGIRO"
  }'

Example: Get portfolio summary

curl http://localhost:3008/api/stocks/summary \
  -H 'token: <your-jwt>'
Example response:
{
  "totalCost": 2077.50,
  "totalValue": 2189.40
}

Build docs developers (and LLMs) love