# Asset Unit API

API for managing asset units

**Version:** 1.0.0

## Overview

### Base URLs

- **Production server**: `https://api.repzo.me/v1`

### API Categories

- **Asset Unit**: Asset unit management operations

## Authentication

This API uses the following authentication methods:

- **ApiKeyAuth**

## Endpoints

### `/asset-unit`

#### GET /asset-unit

**Summary:** Get all asset units

**Description:** Retrieve a list of all asset units with optional filtering and pagination

**Tags:** Asset Unit

##### Parameters

| Name | Location | Type | Required | Description |
| ---- | -------- | ---- | -------- | ----------- |

| `page` | query | integer | No | Page number for pagination |

| `per_page` | query | integer | No | Number of items per page |

| `sort` | query | string | No | Sort field |

| `company_namespace` | query | array | No | Company namespace for filtering |

| `asset` | query | string | No | Filter by asset ID |

| `status` | query | string | No | Filter by status |

| `location` | query | string | No | Filter by location |

| `_id` | query | array | No | Filter by ID |

##### Responses

**200** - Successful response

Content-Type: `application/json`

**400** - No description

**401** - No description

**403** - No description

**500** - No description

---

#### POST /asset-unit

**Summary:** Create a new asset unit

**Description:** Create a new asset unit entry

**Tags:** Asset Unit

##### Request Body

**Content Types:**

- `application/json`

##### Responses

**201** - Asset unit created successfully

Content-Type: `application/json`

**400** - No description

**401** - No description

**403** - No description

**422** - No description

**500** - No description

---

### `/asset-unit/{id}`

#### GET /asset-unit/{id}

**Summary:** Get asset unit by ID

**Description:** Retrieve a specific asset unit by its ID

**Tags:** Asset Unit

##### Parameters

| Name | Location | Type | Required | Description |
| ---- | -------- | ---- | -------- | ----------- |

| `id` | path | string | Yes | Asset unit ID |

##### Responses

**200** - Successful response

Content-Type: `application/json`

**400** - No description

**401** - No description

**403** - No description

**404** - No description

**500** - No description

---

#### PATCH /asset-unit/{id}

**Summary:** Update asset unit

**Description:** Update an existing asset unit

**Tags:** Asset Unit

##### Parameters

| Name | Location | Type | Required | Description |
| ---- | -------- | ---- | -------- | ----------- |

| `id` | path | string | Yes | Asset unit ID |

##### Request Body

**Content Types:**

- `application/json`

##### Responses

**200** - Asset unit updated successfully

Content-Type: `application/json`

**400** - No description

**401** - No description

**403** - No description

**404** - No description

**422** - No description

**500** - No description

---

#### DELETE /asset-unit/{id}

**Summary:** Delete asset unit

**Description:** Delete an asset unit by ID

**Tags:** Asset Unit

##### Parameters

| Name | Location | Type | Required | Description |
| ---- | -------- | ---- | -------- | ----------- |

| `id` | path | string | Yes | Asset unit ID |

##### Responses

**200** - Asset unit deleted successfully

Content-Type: `application/json`

**400** - No description

**401** - No description

**403** - No description

**404** - No description

**500** - No description

---

### `/asset-unit/remove`

#### POST /asset-unit/remove

**Summary:** Bulk delete asset units

**Description:** Delete multiple asset units by their IDs

**Tags:** Asset Unit

##### Request Body

**Content Types:**

- `application/json`

##### Responses

**200** - Asset units deleted successfully

Content-Type: `application/json`

**400** - No description

**401** - No description

**403** - No description

**500** - No description

---

### `/asset-unit/{id}/status`

#### PATCH /asset-unit/{id}/status

**Summary:** Update asset unit status

**Description:** Update the status of an asset unit

**Tags:** Asset Unit

##### Parameters

| Name | Location | Type | Required | Description |
| ---- | -------- | ---- | -------- | ----------- |

| `id` | path | string | Yes | Asset unit ID |

##### Request Body

**Content Types:**

- `application/json`

##### Responses

**200** - Asset unit status updated successfully

Content-Type: `application/json`

**400** - No description

**401** - No description

**403** - No description

**404** - No description

**500** - No description

---

## Data Models

### AssetUnit

| Property | Type | Required | Description |
| -------- | ---- | -------- | ----------- |

| `_id` | string | No | Unique identifier |

| `asset` | string | Yes | Asset ID reference |

| `serial_number` | string | Yes | Unique serial number for this unit |

| `barcode` | string | No | Barcode identifier |

| `status` | string | Yes | Current status of the asset unit |

| `condition` | string | No | Physical condition of the asset |

| `location` | string | No | Current location of the asset unit |

| `assigned_to` | string | No | User or department assigned to this asset |

| `purchase_date` | string | No | Date when the asset unit was purchased |

| `warranty_expiry` | string | No | Warranty expiration date |

| `last_maintenance` | string | No | Date of last maintenance |

| `next_maintenance` | string | No | Date of next scheduled maintenance |

| `purchase_cost` | number | No | Original purchase cost |

| `depreciation` | object | No | No description |

| `maintenance_history` | array | No | No description |

| `notes` | string | No | Additional notes about the asset unit |

| `custom_fields` | object | No | Custom fields for additional data |

| `company_namespace` | array | No | Company namespace |

| `disabled` | boolean | No | Whether the asset unit is disabled |

| `createdAt` | string | No | Creation timestamp |

| `modifiedAt` | string | No | Last modification timestamp |

| `SVClient` | integer | No | Client version |

| `__v` | integer | No | Document version |

### CreateAssetUnitRequest

| Property | Type | Required | Description |
| -------- | ---- | -------- | ----------- |

| `asset` | string | Yes | Asset ID reference |

| `serial_number` | string | Yes | Unique serial number for this unit |

| `barcode` | string | No | Barcode identifier |

| `status` | string | No | Initial status of the asset unit |

| `condition` | string | No | Physical condition of the asset |

| `location` | string | No | Current location of the asset unit |

| `assigned_to` | string | No | User or department assigned to this asset |

| `purchase_date` | string | No | Date when the asset unit was purchased |

| `warranty_expiry` | string | No | Warranty expiration date |

| `purchase_cost` | number | No | Original purchase cost |

| `depreciation` | object | No | No description |

| `notes` | string | No | Additional notes about the asset unit |

| `custom_fields` | object | No | Custom fields for additional data |

| `company_namespace` | array | No | Company namespace |

| `disabled` | boolean | No | Whether the asset unit is disabled |

### UpdateAssetUnitRequest

| Property | Type | Required | Description |
| -------- | ---- | -------- | ----------- |

| `serial_number` | string | No | Unique serial number for this unit |

| `barcode` | string | No | Barcode identifier |

| `status` | string | No | Status of the asset unit |

| `condition` | string | No | Physical condition of the asset |

| `location` | string | No | Current location of the asset unit |

| `assigned_to` | string | No | User or department assigned to this asset |

| `purchase_date` | string | No | Date when the asset unit was purchased |

| `warranty_expiry` | string | No | Warranty expiration date |

| `last_maintenance` | string | No | Date of last maintenance |

| `next_maintenance` | string | No | Date of next scheduled maintenance |

| `purchase_cost` | number | No | Original purchase cost |

| `depreciation` | object | No | No description |

| `notes` | string | No | Additional notes about the asset unit |

| `custom_fields` | object | No | Custom fields for additional data |

| `company_namespace` | array | No | Company namespace |

| `disabled` | boolean | No | Whether the asset unit is disabled |

### PagingInfo

| Property | Type | Required | Description |
| -------- | ---- | -------- | ----------- |

| `total` | integer | No | Total number of items |

| `page` | integer | No | Current page number |

| `per_page` | integer | No | Items per page |

| `pages` | integer | No | Total number of pages |

## TypeScript Usage

See [asset-unit-examples.md](./asset-unit-examples.md) for detailed TypeScript usage examples.
