Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/akevalion/life_cost/llms.txt

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

The /pi_data endpoint scans every MoneyTransfer record in the user’s active wallet and partitions each transaction into one of two buckets based on sign: positive amounts are accumulated into outcome, and negative amounts are accumulated into income. The resulting sums are returned as a single JSON object that powers the income-vs-expense pie chart on the dashboard. All time history is included — unlike the monthly endpoints, there is no date filter applied here.

Authentication

This endpoint requires an active session. Requests without a valid session cookie are rejected by the @login_required decorator and redirected to the login flow.

Wallet scope

All records are filtered to current_user.last_visited_wallet_id — the wallet the authenticated user most recently switched to. To query a different wallet, call POST /update_last_visited_wallet first.

Request

Body parameters

timeZone
string
An IANA timezone database name representing the client’s local timezone (e.g. "America/New_York", "Europe/Madrid", "Asia/Tokyo"). The timezone is used when iterating over transfers to localise each created_at timestamp, keeping the data processing pipeline consistent with other analytics endpoints. Defaults to "SYSTEM" if omitted.

Response

Returns a single JSON object with the following fields.
income
number
The sum of all negative-amount transactions (expenses) across all time for the active wallet. Because expense entries are stored as negative numbers, this field will be a negative number or zero.
outcome
number
The sum of all positive-amount transactions (income entries) across all time for the active wallet. This field will be a positive number or zero.

Example

Request

curl -X POST https://your-domain.com/pi_data \
  -H "Content-Type: application/json" \
  --cookie "session=<your-session-cookie>" \
  -d '{"timeZone": "Europe/Madrid"}'

Request body

{
  "timeZone": "Europe/Madrid"
}

Response

{
  "income": -842.75,
  "outcome": 1500.00
}
The field names in this response are counter-intuitive. income holds the sum of negative amounts (expenses/withdrawals) and will be a negative number or zero. outcome holds the sum of positive amounts (credits/deposits) and will be a positive number or zero. This naming reflects the internal variable convention in the source code exactly — no transformation is applied before the JSON is returned.

Build docs developers (and LLMs) love