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

# Assets API

> API endpoints for managing customer equipment and assets

## Overview

The Assets API allows you to manage customer equipment records. Assets track equipment installed at customer sites, including service history, warranty information, and maintenance requirements.

***

## Endpoints

### List Assets

Retrieve a list of assets.

```
GET /api/v1/assets
```

**Query Parameters:**

| Parameter       | Type    | Description             |
| --------------- | ------- | ----------------------- |
| `page`          | integer | Page number             |
| `per_page`      | integer | Results per page        |
| `customer_id`   | string  | Filter by customer      |
| `product_id`    | string  | Filter by product type  |
| `status`        | string  | Filter by status        |
| `serial_number` | string  | Search by serial number |
| `location_id`   | string  | Filter by location      |

**Example Request:**

```bash theme={null}
curl -X GET "https://api.fentu.io/v1/assets?customer_id=cust-001" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

**Example Response:**

```json theme={null}
{
  "data": [
    {
      "id": "asset-001",
      "name": "Rooftop Machine Unit #1",
      "serial_number": "MACH-2023-001234",
      "product": {
        "id": "prod-001",
        "name": "Commercial Machine 10-Ton"
      },
      "customer": {
        "id": "cust-001",
        "name": "Acme Corporation"
      },
      "location": "Building A - Roof",
      "status": "active",
      "warranty_expiry": "2026-06-15",
      "last_service": "2024-01-15T10:00:00Z"
    }
  ],
  "meta": {
    "current_page": 1,
    "total_pages": 3,
    "total_count": 52
  }
}
```

***

### Get Asset

Retrieve a single asset with full details.

```
GET /api/v1/assets/{id}
```

**Example Response:**

```json theme={null}
{
  "data": {
    "id": "asset-001",
    "name": "Rooftop Machine Unit #1",
    "asset_tag": "A-10001",
    "serial_number": "MACH-2023-001234",
    "model_number": "RMACH-10T-2023",
    "product": {
      "id": "prod-001",
      "name": "Commercial Machine 10-Ton",
      "manufacturer": "CoolAir Inc"
    },
    "customer": {
      "id": "cust-001",
      "name": "Acme Corporation"
    },
    "object": {
      "id": "obj-001",
      "name": "Building A",
      "address": "123 Main Street"
    },
    "location": "Roof - Northwest Corner",
    "status": "active",
    "install_date": "2023-06-15",
    "warranty_start": "2023-06-15",
    "warranty_expiry": "2026-06-15",
    "warranty_type": "standard",
    "service_contract": {
      "id": "contract-001",
      "name": "Annual Maintenance"
    },
    "specifications": {
      "capacity": "10 tons",
      "voltage": "480V",
      "refrigerant": "R-410A"
    },
    "service_history": [
      {
        "work_order_id": "wo-123",
        "date": "2024-01-15T10:00:00Z",
        "type": "maintenance",
        "description": "Quarterly maintenance"
      }
    ],
    "custom_fields": {
      "floor": "Roof",
      "zone": "A1"
    },
    "notes": "Access via northwest stairwell",
    "created_at": "2023-06-15T14:30:00Z",
    "updated_at": "2024-01-15T10:30:00Z"
  }
}
```

***

### Create Asset

Create a new asset record.

```
POST /api/v1/assets
```

**Request Body:**

```json theme={null}
{
  "name": "New Machine Unit",
  "customer_id": "cust-001",
  "object_id": "obj-001",
  "product_id": "prod-001",
  "serial_number": "MACH-2024-005678",
  "model_number": "RMACH-5T-2024",
  "location": "Building B - Roof",
  "install_date": "2024-01-27",
  "warranty_start": "2024-01-27",
  "warranty_expiry": "2027-01-27",
  "specifications": {
    "capacity": "5 tons",
    "voltage": "208V"
  },
  "notes": "Installed during expansion project"
}
```

***

### Update Asset

Update an existing asset.

```
PUT /api/v1/assets/{id}
```

**Request Body:**

```json theme={null}
{
  "location": "Building B - Roof (relocated)",
  "notes": "Moved during renovation",
  "warranty_expiry": "2028-01-27"
}
```

***

### Delete Asset

Delete an asset (moves to trash).

```
DELETE /api/v1/assets/{id}
```

***

## Asset Service History

### Get Service History

```
GET /api/v1/assets/{id}/service-history
```

Returns all work orders and service records for the asset.

**Example Response:**

```json theme={null}
{
  "data": [
    {
      "work_order_id": "wo-123",
      "work_order_number": "WO-2024-001",
      "date": "2024-01-15T10:00:00Z",
      "type": "maintenance",
      "status": "completed",
      "technician": "Jane Doe",
      "description": "Quarterly maintenance",
      "parts_used": [
        {
          "part": "Air Filter",
          "quantity": 2
        }
      ],
      "notes": "All readings normal"
    }
  ]
}
```

***

## Asset Parts

### List Asset Parts

```
GET /api/v1/assets/{id}/parts
```

Returns parts associated with the asset.

### Add Part to Asset

```
POST /api/v1/assets/{id}/parts
```

**Request Body:**

```json theme={null}
{
  "part_id": "part-001",
  "serial_number": "COMP-12345",
  "install_date": "2024-01-27",
  "warranty_expiry": "2025-01-27"
}
```

***

## Asset Statuses

| Status            | Description          |
| ----------------- | -------------------- |
| `active`          | In operation         |
| `inactive`        | Not currently in use |
| `under_repair`    | Being serviced       |
| `retired`         | No longer in service |
| `pending_install` | Not yet installed    |

***

## Warranty Information

### Check Warranty Status

```
GET /api/v1/assets/{id}/warranty
```

**Example Response:**

```json theme={null}
{
  "data": {
    "asset_id": "asset-001",
    "warranty_type": "standard",
    "warranty_start": "2023-06-15",
    "warranty_expiry": "2026-06-15",
    "is_active": true,
    "days_remaining": 870,
    "coverage": {
      "parts": true,
      "labor": true,
      "extended_hours": false
    }
  }
}
```

***

## Error Responses

| Code  | Description             |
| ----- | ----------------------- |
| `400` | Bad request             |
| `401` | Unauthorized            |
| `403` | Forbidden               |
| `404` | Asset not found         |
| `409` | Duplicate serial number |
| `422` | Validation error        |

***

## Related Documentation

<CardGroup cols={2}>
  <Card title="Customers API" icon="users" href="/api-reference/endpoints/customers">
    Customer endpoints
  </Card>

  <Card title="Work Orders API" icon="clipboard-list" href="/api-reference/endpoints/work-orders">
    Work order endpoints
  </Card>

  <Card title="Assets" icon="barcode" href="/customers/assets">
    Asset user guide
  </Card>

  <Card title="Products" icon="box" href="/inventory/products">
    Product management
  </Card>
</CardGroup>
