> ## Documentation Index
> Fetch the complete documentation index at: https://docs.zeus.ttr.gg/llms.txt
> Use this file to discover all available pages before exploring further.

# Wallets API

> Wallet management endpoints

## 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

```http theme={null}
GET /wallets
Authorization: Bearer <token>
```

**Response:**

```json theme={null}
[
  {
    "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

```http theme={null}
POST /wallets
Authorization: Bearer <token>
Content-Type: application/json

{
  "name": "Savings",
  "currency": "USD",
  "balance": 5000.00
}
```

**Response (201):**

```json theme={null}
{
  "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"
}
```

**Validation Errors (422):**

```json theme={null}
{
  "error": "Validation failed",
  "fields": {
    "name": "Name is required",
    "currency": "Invalid currency code"
  }
}
```

## Get Wallet

```http theme={null}
GET /wallets/550e8400-e29b-41d4-a716-446655440000
Authorization: Bearer <token>
```

**Response:**

```json theme={null}
{
  "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"
}
```

**Not Found (404):**

```json theme={null}
{
  "error": "Not found",
  "message": "Wallet not found"
}
```

## Update Wallet

```http theme={null}
PUT /wallets/550e8400-e29b-41d4-a716-446655440000
Authorization: Bearer <token>
Content-Type: application/json

{
  "name": "Updated Name",
  "balance": 200.00
}
```

**Response:**

```json theme={null}
{
  "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

```http theme={null}
DELETE /wallets/550e8400-e29b-41d4-a716-446655440000
Authorization: Bearer <token>
```

**Response (204):**

No content.

## 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        |
