API Reference
Accounts
Manage the financial accounts the user tracks — bank, mobile money, and cash accounts.
Every response includes a calculated balance attribute derived from
the account's starting balance plus its transactions.
/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." }
/api/accounts
Create an account
Creates a new financial account for the authenticated user.
Request body
| Name | Type | Required | Description |
|---|---|---|---|
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." }
/api/accounts/{id}
Retrieve an account
Returns a single account by ID, including its calculated balance.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
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" }
/api/accounts/{id}
Update an account
Updates one or more fields of an existing account. Only the fields you send are updated.
Request body
| Name | Type | Required | Description |
|---|---|---|---|
name | string | Optional | Display name. Max 255 characters. |
type | string | Optional | One of: bank, mobile, cash. |
starting_balance | number | Optional | New starting balance. |
notes | string | Optional | Free-form notes. |
/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