# Asset Part Receival API

API for managing asset part receivals (receiving inventory)

**Version:** 1.0.0

## Overview

### Base URLs

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

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

### API Categories

- **Asset Part Receival**: Operations related to asset part receival management

## Authentication

This API uses the following authentication methods:

- **ApiKeyAuth**

## Endpoints

### `/asset-part-receival`

#### GET /asset-part-receival

**Summary:** Get all asset part receivals

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

**Tags:** Asset Part Receival

##### 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 receivals retrieved successfully

Content-Type: `application/json`

**400** - Bad request

**401** - Unauthorized

**500** - Internal server error

---

#### POST /asset-part-receival

**Summary:** Create a new asset part receival

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

**Tags:** Asset Part Receival

##### Request Body

**Content Types:**

- `application/json`

##### Responses

**201** - Asset part receival created successfully

Content-Type: `application/json`

**400** - Bad request

**401** - Unauthorized

**500** - Internal server error

---

### `/asset-part-receival/{id}`

#### GET /asset-part-receival/{id}

**Summary:** Get asset part receival by ID

**Description:** Retrieve a specific asset part receival by its ID

**Tags:** Asset Part Receival

##### Parameters

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

| `id` | path | string | Yes | Asset part receival ID |

##### Responses

**200** - Asset part receival retrieved successfully

Content-Type: `application/json`

**404** - Asset part receival not found

**401** - Unauthorized

**500** - Internal server error

---

#### PUT /asset-part-receival/{id}

**Summary:** Update asset part receival

**Description:** Update an existing asset part receival with new data

**Tags:** Asset Part Receival

##### Parameters

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

| `id` | path | string | Yes | Asset part receival ID |

##### Request Body

**Content Types:**

- `application/json`

##### Responses

**200** - Asset part receival updated successfully

Content-Type: `application/json`

**400** - Bad request

**404** - Asset part receival not found

**401** - Unauthorized

**500** - Internal server error

---

#### DELETE /asset-part-receival/{id}

**Summary:** Delete asset part receival

**Description:** Delete an existing asset part receival

**Tags:** Asset Part Receival

##### Parameters

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

| `id` | path | string | Yes | Asset part receival ID |

##### Responses

**200** - Asset part receival deleted successfully

Content-Type: `application/json`

**404** - Asset part receival not found

**401** - Unauthorized

**500** - Internal server error

---

## Data Models

### AssetPartReceival

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

| `_id` | string | No | Unique identifier for the asset part receival |

| `receivalNumber` | string | Yes | Unique receival number |

| `purchaseOrder` | string | No | Purchase order reference |

| `supplier` | string | Yes | Supplier ID |

| `receivalDate` | string | Yes | Date and time of receival |

| `expectedDate` | string | No | Expected delivery date |

| `receivedBy` | string | No | User who received the parts |

| `warehouse` | string | No | Warehouse ID where parts were received |

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

| `items` | array | Yes | No description |

| `totalValue` | number | No | Total value of the receival |

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

| `shippingCost` | number | No | Shipping cost |

| `taxAmount` | number | No | Tax amount |

| `discountAmount` | number | No | Discount amount |

| `invoice` | object | No | No description |

| `qualityCheck` | object | No | No description |

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

| `notes` | string | No | General notes |

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

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

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

### AssetPartReceivalInput

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

| `receivalNumber` | string | Yes | Unique receival number |

| `purchaseOrder` | string | No | Purchase order reference |

| `supplier` | string | Yes | Supplier ID |

| `receivalDate` | string | Yes | Date and time of receival |

| `expectedDate` | string | No | Expected delivery date |

| `receivedBy` | string | No | User who received the parts |

| `warehouse` | string | No | Warehouse ID where parts were received |

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

| `items` | array | Yes | No description |

| `totalValue` | number | No | Total value of the receival |

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

| `shippingCost` | number | No | Shipping cost |

| `taxAmount` | number | No | Tax amount |

| `discountAmount` | number | No | Discount amount |

| `invoice` | object | No | No description |

| `qualityCheck` | object | No | No description |

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

| `notes` | string | No | General notes |

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

## TypeScript Usage

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