Skip to main content

Endpoints

MethodEndpointDescription
GET/transactionsList all transactions
POST/transactionsCreate new transaction
GET/transactions/:idGet transaction by ID
PUT/transactions/:idUpdate transaction
DELETE/transactions/:idDelete transaction

List Transactions

GET /transactions
Authorization: Bearer <token>
Query parameters:
ParameterTypeDescription
wallet_idUUIDFilter by wallet
category_idUUIDFilter by category
start_dateDateStart of date range
end_dateDateEnd of date range
Response:
[
  {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "wallet_id": "550e8400-e29b-41d4-a716-446655440001",
    "category_id": "550e8400-e29b-41d4-a716-446655440002",
    "amount": 25.50,
    "type": "expense",
    "description": "Lunch",
    "date": "2024-01-15",
    "created_at": "2024-01-15T12:00:00Z",
    "updated_at": "2024-01-15T12:00:00Z"
  }
]

Create Transaction

POST /transactions
Authorization: Bearer <token>
Content-Type: application/json

{
  "wallet_id": "550e8400-e29b-41d4-a716-446655440001",
  "category_id": "550e8400-e29b-41d4-a716-446655440002",
  "amount": 50.00,
  "type": "expense",
  "description": "Grocery shopping",
  "date": "2024-01-15"
}
Response (201):
{
  "id": "550e8400-e29b-41d4-a716-446655440003",
  "wallet_id": "550e8400-e29b-41d4-a716-446655440001",
  "category_id": "550e8400-e29b-41d4-a716-446655440002",
  "amount": 50.00,
  "type": "expense",
  "description": "Grocery shopping",
  "date": "2024-01-15",
  "created_at": "2024-01-15T12:30:00Z",
  "updated_at": "2024-01-15T12:30:00Z"
}

Transaction Schema

FieldTypeRequiredDescription
idUUIDAutoUnique identifier
wallet_idUUIDYesAssociated wallet
category_idUUIDNoAssociated category
amountDecimalYesTransaction amount (positive)
typeEnumYesincome, expense, or transfer
descriptionStringNoTransaction description
dateDateYesTransaction date
created_atDateTimeAutoCreation timestamp
updated_atDateTimeAutoLast update timestamp