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

# Transactions API

> Transaction management endpoints

## Endpoints

| Method | Endpoint            | Description            |
| ------ | ------------------- | ---------------------- |
| GET    | `/transactions`     | List all transactions  |
| POST   | `/transactions`     | Create new transaction |
| GET    | `/transactions/:id` | Get transaction by ID  |
| PUT    | `/transactions/:id` | Update transaction     |
| DELETE | `/transactions/:id` | Delete transaction     |

## List Transactions

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

Query parameters:

| Parameter     | Type | Description         |
| ------------- | ---- | ------------------- |
| `wallet_id`   | UUID | Filter by wallet    |
| `category_id` | UUID | Filter by category  |
| `start_date`  | Date | Start of date range |
| `end_date`    | Date | End of date range   |

**Response:**

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

```http theme={null}
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):**

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

| Field         | Type     | Required | Description                        |
| ------------- | -------- | -------- | ---------------------------------- |
| `id`          | UUID     | Auto     | Unique identifier                  |
| `wallet_id`   | UUID     | Yes      | Associated wallet                  |
| `category_id` | UUID     | No       | Associated category                |
| `amount`      | Decimal  | Yes      | Transaction amount (positive)      |
| `type`        | Enum     | Yes      | `income`, `expense`, or `transfer` |
| `description` | String   | No       | Transaction description            |
| `date`        | Date     | Yes      | Transaction date                   |
| `created_at`  | DateTime | Auto     | Creation timestamp                 |
| `updated_at`  | DateTime | Auto     | Last update timestamp              |
