GET /api/accounts

List accounts

Returns every account owned by the authenticated user, each with its calculated balance.

Responses

200 OK
[
  {
    "id": 1,
    "user_id": 1,
    "name": "GTBank Checking",
    "type": "bank",
    "starting_balance": "1000.00",
    "notes": null,
    "created_at": "2026-06-03T12:00:00Z",
    "updated_at": "2026-06-03T12:00:00Z",
    "balance": 1350.00
  },
  {
    "id": 2,
    "user_id": 1,
    "name": "MTN MoMo",
    "type": "mobile",
    "starting_balance": "200.00",
    "notes": "Personal mobile money",
    "created_at": "2026-06-03T12:00:00Z",
    "updated_at": "2026-06-03T12:00:00Z",
    "balance": 75.50
  }
]
401 Unauthorized
{ "message": "Unauthenticated." }
POST /api/accounts

Create an account

Creates a new financial account for the authenticated user.

Request body

NameTypeRequiredDescription
name string Required Display name. Max 255 characters.
type string Required One of: bank, mobile, cash.
starting_balance number Required Opening balance for the account.
notes string Optional Free-form notes.

Request body example

REQUEST
{
  "name": "GTBank Checking",
  "type": "bank",
  "starting_balance": 1000.00,
  "notes": "Primary salary account"
}

Responses

201 Created
{
  "id": 1,
  "user_id": 1,
  "name": "GTBank Checking",
  "type": "bank",
  "starting_balance": "1000.00",
  "notes": "Primary salary account",
  "created_at": "2026-06-03T12:00:00Z",
  "updated_at": "2026-06-03T12:00:00Z",
  "balance": 1000.00
}
422 Unprocessable Entity
{
  "message": "The given data was invalid.",
  "errors": {
    "type": ["The selected type is invalid."]
  }
}
401 Unauthorized
{ "message": "Unauthenticated." }
GET /api/accounts/{id}

Retrieve an account

Returns a single account by ID, including its calculated balance.

Path parameters

NameTypeRequiredDescription
id integer Required The account's unique identifier.

Responses

200 OK
{
  "id": 1,
  "user_id": 1,
  "name": "GTBank Checking",
  "type": "bank",
  "starting_balance": "1000.00",
  "notes": null,
  "created_at": "2026-06-03T12:00:00Z",
  "updated_at": "2026-06-03T12:00:00Z",
  "balance": 1350.00
}
403 Forbidden
{ "message": "This action is unauthorized." }
404 Not Found
{ "message": "No query results for model [App\Models\Account] #99" }
PUT /api/accounts/{id}

Update an account

Updates one or more fields of an existing account. Only the fields you send are updated.

Request body

NameTypeRequiredDescription
namestringOptionalDisplay name. Max 255 characters.
typestringOptionalOne of: bank, mobile, cash.
starting_balancenumberOptionalNew starting balance.
notesstringOptionalFree-form notes.
DELETE /api/accounts/{id}

Delete an account

Permanently deletes an account and all of its associated transactions. This action cannot be undone.

Response

204 No Content
HTTP/1.1 204 No Content

© 2026 Pasona Finance Tracker API. All rights reserved.

API version: v1