# Repzo API - SubCategory

OpenAPI specification for Repzo SubCategory endpoints.

**Version:** 1.0.0

## Overview

### Base URLs

- \*\*\*\*: `https://sv.api.repzo.me`

## Authentication

No authentication required.

## Endpoints

### `/product/sub-categories`

#### GET /product/sub-categories

**Summary:** Find subcategories

##### Parameters

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

| `params` | query | object | No | Query parameters for filtering subcategories |

##### Responses

**200** - A list of subcategories

Content-Type: `application/json`

---

#### POST /product/sub-categories

**Summary:** Create a subcategory

##### Request Body

**Content Types:**

- `application/json`

##### Responses

**201** - SubCategory created

Content-Type: `application/json`

---

### `/product/sub-categories/{id}`

#### GET /product/sub-categories/{id}

**Summary:** Get a subcategory by ID

##### Parameters

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

| `id` | path | string | Yes | No description |

| `params` | query | object | No | No description |

##### Responses

**200** - SubCategory details

Content-Type: `application/json`

---

#### PUT /product/sub-categories/{id}

**Summary:** Update a subcategory

##### Parameters

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

| `id` | path | string | Yes | No description |

##### Request Body

**Content Types:**

- `application/json`

##### Responses

**200** - SubCategory updated

Content-Type: `application/json`

---

#### DELETE /product/sub-categories/{id}

**Summary:** Remove a subcategory

##### Parameters

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

| `id` | path | string | Yes | No description |

##### Responses

**200** - SubCategory removed

Content-Type: `application/json`

---

## Data Models

### SubCategoryFindResult

Result of finding subcategories

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

| `data` | array | No | No description |

| `total_result` | number | No | Total number of subcategories |

| `current_count` | number | No | Count of subcategories in current page |

| `total_pages` | number | No | Total number of pages |

| `current_page` | number | No | Current page number |

| `per_page` | number | No | Number of subcategories per page |

| `first_page_url` | string | No | URL for the first page |

| `last_page_url` | string | No | URL for the last page |

| `next_page_url` | string | No | URL for the next page |

| `prev_page_url` | string | No | URL for the previous page |

| `path` | string | No | Base URL path |

### SubCategorySchema

SubCategory schema

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

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

| `name` | string | No | Name of the subcategory |

| `parent_id` | object | No | No description |

| `local_name` | string | No | Localized name of the subcategory |

| `disabled` | boolean | No | Whether the subcategory is disabled |

| `photo` | string | No | Photo URL of the subcategory |

| `position` | number | No | Position of the subcategory |

| `integration_meta` | object | No | Integration metadata |

| `company_namespace` | array | No | Company namespaces |

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

| `updatedAt` | string | No | Last update timestamp |

| `__v` | number | No | Version number |

### SubCategoryCreateBody

Body for creating a subcategory

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

| `name` | string | Yes | Name of the subcategory |

| `parent_id` | string | Yes | ID of the parent category |

| `local_name` | string | No | Localized name of the subcategory |

| `disabled` | boolean | No | Whether the subcategory is disabled |

| `photo` | string | No | Photo URL of the subcategory |

| `position` | number | No | Position of the subcategory |

| `company_namespace` | array | No | Company namespaces |

| `integration_meta` | object | No | Integration metadata |

### SubCategoryCreateResult

Result of creating a subcategory

### SubCategoryGetResult

Result of getting a subcategory

### SubCategoryUpdateBody

Body for updating a subcategory

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

| `name` | string | No | Name of the subcategory |

| `parent_id` | string | No | ID of the parent category |

| `local_name` | string | No | Localized name of the subcategory |

| `disabled` | boolean | No | Whether the subcategory is disabled |

| `photo` | string | No | Photo URL of the subcategory |

| `position` | number | No | Position of the subcategory |

| `company_namespace` | array | No | Company namespaces |

| `integration_meta` | object | No | Integration metadata |

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

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

| `updatedAt` | string | No | Last update timestamp |

| `__v` | number | No | Version number |

### SubCategoryUpdateResult

Result of updating a subcategory

### SubCategoryRemoveResult

Result of removing a subcategory

## TypeScript Usage

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