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.

The Debts API tracks informal money obligations between you and third parties — friends, family, or colleagues. Use type: "from" when someone owes you money and type: "to" when you owe someone else. POST /api/debts/:id/pay records a payment or receipt that adjusts the running balance and can optionally generate a linked transaction in your account.

Debt types

ValueMeaning
fromThe third party owes you money
toYou owe the third party money

POST /api/debts

Create a new debt record.
from
string
required
Free-text name of the third party (e.g. "John", "Alice"). Used to group debts by counterpart.
amount
number
required
Debt amount.
type
string
required
Direction of the debt. One of from (they owe you) or to (you owe them).
date
number
Date the debt was created, as a Unix timestamp (ms).
paymentDate
number
Expected or agreed repayment date, as a Unix timestamp (ms). Optional.
concept
string
Free-text description of what the debt is for. Optional.
curl -X POST http://localhost:3008/api/debts \
  -H 'token: <your-jwt>' \
  -H 'Content-Type: application/json' \
  -d '{
    "from": "John",
    "amount": 150,
    "type": "from",
    "date": 1704067200000,
    "concept": "Concert tickets"
  }'
Response 201 — the created debt object.

GET /api/debts

List all debt records for the authenticated user.
curl http://localhost:3008/api/debts \
  -H 'token: <your-jwt>'
Response 200
[
  {
    "_id": "64f1a...",
    "from": "John",
    "amount": 150,
    "type": "from",
    "date": 1704067200000,
    "concept": "Concert tickets",
    "user": "alice"
  }
]

GET /api/debts/from/:from

List all debts associated with a specific third party name.
from
string
required
The third party name to filter by (must match the from field exactly).
curl http://localhost:3008/api/debts/from/John \
  -H 'token: <your-jwt>'
Response 200 — array of debt objects for that counterpart.

PUT /api/debts/:id

Edit an existing debt. All body fields from the create schema are accepted.
id
string
required
Debt ID.
from
string
required
Name of the third party.
amount
number
required
Updated debt amount.
type
string
required
from or to.
date
number
Updated debt date (Unix ms).
paymentDate
number
Updated expected repayment date (Unix ms).
concept
string
Updated description.
curl -X PUT http://localhost:3008/api/debts/64f1a... \
  -H 'token: <your-jwt>' \
  -H 'Content-Type: application/json' \
  -d '{
    "from": "John",
    "amount": 100,
    "type": "from",
    "concept": "Partial repayment received"
  }'
Response 200 — the updated debt object.

DELETE /api/debts/:id

Delete a debt record permanently.
id
string
required
Debt ID.
curl -X DELETE http://localhost:3008/api/debts/64f1a... \
  -H 'token: <your-jwt>'
Response 204 — no content.

POST /api/debts/:id/pay

Record a payment or receipt against a debt. Adjusts the debt’s running balance. Can optionally generate a linked account transaction.
id
string
required
Debt ID.
amount
number
required
Amount paid or received. Must be positive.
curl -X POST http://localhost:3008/api/debts/64f1a.../pay \
  -H 'token: <your-jwt>' \
  -H 'Content-Type: application/json' \
  -d '{"amount": 50}'
Response 200 — the updated debt object reflecting the adjusted balance.

Build docs developers (and LLMs) love