# Return Asset Part Unit API

API for managing returns of asset part units

**Version:** 1.0.0

## Overview

### Base URLs

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

- **Staging server**: `https://staging.sv.api.repzo.me`

### API Categories

- **Return Asset Part Unit**: Operations related to returning asset part units

## Authentication

This API uses the following authentication methods:

- **ApiKeyAuth**

## Endpoints

### `/return-asset-part-unit`

#### GET /return-asset-part-unit

**Summary:** Get all asset part unit returns

**Description:** Retrieve a list of all asset part unit returns with optional filtering and pagination

**Tags:** Return Asset Part Unit

##### Parameters

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

| `limit` | query | integer | No | Maximum number of records to return |

| `offset` | query | integer | No | Number of records to skip for pagination |

| `sort` | query | string | No | Field to sort by |

| `order` | query | string | No | Sort order (asc or desc) |

| `filter` | query | string | No | Filter conditions in JSON format |

| `search` | query | string | No | Search term for text fields |

##### Responses

**200** - List of asset part unit returns retrieved successfully

Content-Type: `application/json`

**400** - Bad request

**401** - Unauthorized

**500** - Internal server error

---

#### POST /return-asset-part-unit

**Summary:** Create a new asset part unit return

**Description:** Create a new asset part unit return with the provided data

**Tags:** Return Asset Part Unit

##### Request Body

**Content Types:**

- `application/json`

##### Responses

**201** - Asset part unit return created successfully

Content-Type: `application/json`

**400** - Bad request

**401** - Unauthorized

**500** - Internal server error

---

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

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

**Summary:** Get asset part unit return by ID

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

**Tags:** Return Asset Part Unit

##### Parameters

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

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

##### Responses

**200** - Asset part unit return retrieved successfully

Content-Type: `application/json`

**404** - Asset part unit return not found

**401** - Unauthorized

**500** - Internal server error

---

#### PUT /return-asset-part-unit/{id}

**Summary:** Update asset part unit return

**Description:** Update an existing asset part unit return with new data

**Tags:** Return Asset Part Unit

##### Parameters

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

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

##### Request Body

**Content Types:**

- `application/json`

##### Responses

**200** - Asset part unit return updated successfully

Content-Type: `application/json`

**400** - Bad request

**404** - Asset part unit return not found

**401** - Unauthorized

**500** - Internal server error

---

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

**Summary:** Delete asset part unit return

**Description:** Delete an existing asset part unit return

**Tags:** Return Asset Part Unit

##### Parameters

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

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

##### Responses

**200** - Asset part unit return deleted successfully

Content-Type: `application/json`

**404** - Asset part unit return not found

**401** - Unauthorized

**500** - Internal server error

---

## Data Models

### ReturnAssetPartUnit

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

| `_id` | string | No | Unique identifier for the return |

| `returnNumber` | string | Yes | Unique return number |

| `assetPartUnit` | string | Yes | Asset part unit ID being returned |

| `serialNumber` | string | No | Serial number of the part unit |

| `returnType` | string | Yes | Type of return |

| `returnReason` | string | Yes | Reason for return |

| `returnedBy` | string | Yes | User who initiated the return |

| `authorizedBy` | string | No | User who authorized the return |

| `returnDate` | string | No | Date when the return was processed |

| `requestDate` | string | No | Date when the return was requested |

| `originalInstallDate` | string | No | Original installation date |

| `originalWorkOrder` | string | No | Original work order ID |

| `originalAsset` | string | No | Original asset ID where it was installed |

| `status` | string | No | Status of the return |

| `condition` | string | No | Condition of the returned part |

| `returnLocation` | object | No | No description |

| `supplier` | string | No | Supplier ID if returning to supplier |

| `creditAmount` | number | No | Credit amount for the return |

| `currency` | string | No | Currency code |

| `replacementRequired` | boolean | No | Whether a replacement is required |

| `replacementPartUnit` | string | No | Replacement part unit ID if applicable |

| `warrantyStatus` | string | No | Warranty status at time of return |

| `qualityInspection` | object | No | No description |

| `documents` | array | No | No description |

| `notes` | string | No | Additional notes |

| `metadata` | object | No | Additional metadata |

| `createdAt` | string | No | Record creation timestamp |

| `updatedAt` | string | No | Record last update timestamp |

### ReturnAssetPartUnitInput

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

| `returnNumber` | string | Yes | Unique return number |

| `assetPartUnit` | string | Yes | Asset part unit ID being returned |

| `serialNumber` | string | No | Serial number of the part unit |

| `returnType` | string | Yes | Type of return |

| `returnReason` | string | Yes | Reason for return |

| `returnedBy` | string | Yes | User who initiated the return |

| `authorizedBy` | string | No | User who authorized the return |

| `returnDate` | string | No | Date when the return was processed |

| `requestDate` | string | No | Date when the return was requested |

| `originalInstallDate` | string | No | Original installation date |

| `originalWorkOrder` | string | No | Original work order ID |

| `originalAsset` | string | No | Original asset ID where it was installed |

| `status` | string | No | Status of the return |

| `condition` | string | No | Condition of the returned part |

| `returnLocation` | object | No | No description |

| `supplier` | string | No | Supplier ID if returning to supplier |

| `creditAmount` | number | No | Credit amount for the return |

| `currency` | string | No | Currency code |

| `replacementRequired` | boolean | No | Whether a replacement is required |

| `replacementPartUnit` | string | No | Replacement part unit ID if applicable |

| `warrantyStatus` | string | No | Warranty status at time of return |

| `qualityInspection` | object | No | No description |

| `documents` | array | No | No description |

| `notes` | string | No | Additional notes |

| `metadata` | object | No | Additional metadata |

## TypeScript Usage

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