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.

Accounts represent the bank accounts, wallets, or cash reserves that a user manages in Finper. Each account tracks a running balance that is updated automatically when transactions are created or when a transfer is executed. All endpoints require the token header.

POST /api/accounts

Create a new account for the authenticated user. POST /api/accounts

Request Body

name
string
required
Human-readable name for the account (e.g. "Checking", "Savings").
bank
string
required
Name of the bank or institution that holds this account (e.g. "Chase", "Revolut").
balance
number
Initial balance of the account in the user’s currency. Defaults to 0 if omitted.

Response — 201 Created

Returns the newly created account object.
_id
string
Unique identifier for the account.
name
string
Account name.
bank
string
Bank or institution name.
balance
number
Current balance.
isActive
boolean
Whether the account is active. Defaults to true on creation.

Example

curl -X POST http://localhost:3008/api/accounts \
  -H 'token: <your-jwt>' \
  -H 'Content-Type: application/json' \
  -d '{"name": "Checking", "bank": "Chase", "balance": 1500.00}'

GET /api/accounts

List all accounts belonging to the authenticated user. GET /api/accounts

Response — 200 OK

Returns an array of account objects.
_id
string
Unique identifier.
name
string
Account name.
bank
string
Bank or institution name.
balance
number
Current balance.
isActive
boolean
true if the account is active; false if it has been deactivated.

Example

curl http://localhost:3008/api/accounts \
  -H 'token: <your-jwt>'

GET /api/accounts/:id

Retrieve the details of a single account. GET /api/accounts/:id

Path Parameters

id
string
required
The unique identifier of the account.

Response — 200 OK

Returns the account object. Same fields as the list response.

Example

curl http://localhost:3008/api/accounts/64a1f2e3b4c5d6e7f8g9h0i1 \
  -H 'token: <your-jwt>'

PATCH /api/accounts/:id

Partially update an existing account. The request body must match one of two mutually exclusive shapes — you cannot mix isActive toggling with a full profile update in the same request:
  • Toggle active state — send only isActive.
  • Full profile update — send name, bank, and balance together (all three are required in this form).
PATCH /api/accounts/:id
The edit schema is a strict Joi.alternatives: either { isActive: boolean } or { name, bank, balance } — the two forms are mutually exclusive. Sending a mix of fields from both groups will result in a 422 Unprocessable Entity response.

Path Parameters

id
string
required
The unique identifier of the account to update.

Request Body — Option A: Toggle active state

isActive
boolean
required
Pass true to reactivate or false to deactivate the account. Must be the only field in the body when using this form.

Request Body — Option B: Full profile update

name
string
required
New account name. Must be provided together with bank and balance.
bank
string
required
New bank or institution name. Must be provided together with name and balance.
balance
number
required
New balance value. Must be provided together with name and bank.

Response — 200 OK

Returns the updated account object.

Example

# Option A: Deactivate an account
curl -X PATCH http://localhost:3008/api/accounts/64a1f2e3b4c5d6e7f8g9h0i1 \
  -H 'token: <your-jwt>' \
  -H 'Content-Type: application/json' \
  -d '{"isActive": false}'
# Option B: Full profile update
curl -X PATCH http://localhost:3008/api/accounts/64a1f2e3b4c5d6e7f8g9h0i1 \
  -H 'token: <your-jwt>' \
  -H 'Content-Type: application/json' \
  -d '{"name": "Main Checking", "bank": "Chase", "balance": 2000.00}'

POST /api/accounts/transfer

Transfer an amount of funds from one account to another. POST /api/accounts/transfer
The transfer is applied atomically: the amount is subtracted from the source account’s balance and added to the destination account’s balance in a single operation. Both accounts must belong to the authenticated user and must not be the same account.

Request Body

sourceId
string
required
The ID of the account to deduct funds from.
destinationId
string
required
The ID of the account to add funds to. Must be different from sourceId.
amount
number
required
The amount to transfer. Must be a positive number.

Response — 200 OK

Returns the updated account objects for both the source and destination accounts.

Example

curl -X POST http://localhost:3008/api/accounts/transfer \
  -H 'token: <your-jwt>' \
  -H 'Content-Type: application/json' \
  -d '{
    "sourceId": "64a1f2e3b4c5d6e7f8g9h0i1",
    "destinationId": "64a1f2e3b4c5d6e7f8g9h0i2",
    "amount": 250.00
  }'

Build docs developers (and LLMs) love