Endpoints
| Method | Endpoint | Description |
|---|---|---|
| GET | /wallets | List all wallets |
| POST | /wallets | Create new wallet |
| GET | /wallets/:id | Get wallet by ID |
| PUT | /wallets/:id | Update wallet |
| DELETE | /wallets/:id | Delete wallet |
List Wallets
GET /wallets
Authorization: Bearer <token>
[
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Cash",
"currency": "USD",
"balance": 150.00,
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z"
},
{
"id": "550e8400-e29b-41d4-a716-446655440001",
"name": "Chase Checking",
"currency": "USD",
"balance": 2500.50,
"created_at": "2024-01-14T09:00:00Z",
"updated_at": "2024-01-15T11:00:00Z"
}
]
Create Wallet
POST /wallets
Authorization: Bearer <token>
Content-Type: application/json
{
"name": "Savings",
"currency": "USD",
"balance": 5000.00
}
{
"id": "550e8400-e29b-41d4-a716-446655440002",
"name": "Savings",
"currency": "USD",
"balance": 5000.00,
"created_at": "2024-01-15T12:00:00Z",
"updated_at": "2024-01-15T12:00:00Z"
}
{
"error": "Validation failed",
"fields": {
"name": "Name is required",
"currency": "Invalid currency code"
}
}
Get Wallet
GET /wallets/550e8400-e29b-41d4-a716-446655440000
Authorization: Bearer <token>
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Cash",
"currency": "USD",
"balance": 150.00,
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z"
}
{
"error": "Not found",
"message": "Wallet not found"
}
Update Wallet
PUT /wallets/550e8400-e29b-41d4-a716-446655440000
Authorization: Bearer <token>
Content-Type: application/json
{
"name": "Updated Name",
"balance": 200.00
}
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Updated Name",
"currency": "USD",
"balance": 200.00,
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T13:00:00Z"
}
Delete Wallet
DELETE /wallets/550e8400-e29b-41d4-a716-446655440000
Authorization: Bearer <token>
Wallet Schema
| Field | Type | Required | Description |
|---|---|---|---|
id | UUID | Auto | Unique identifier |
name | String | Yes | Wallet name (2-100 chars) |
currency | String | Yes | ISO 4217 code |
balance | Decimal | No | Current balance (default: 0) |
created_at | DateTime | Auto | Creation timestamp |
updated_at | DateTime | Auto | Last update timestamp |

