# Repzo API - Settlement

OpenAPI specification for Repzo Settlement endpoints.

**Version:** 1.0.0

## Overview

### Base URLs

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

## Authentication

No authentication required.

## Endpoints

### `/settlement`

#### GET /settlement

**Summary:** Find settlements

##### Parameters

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

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

##### Responses

**200** - A list of settlements

Content-Type: `application/json`

---

#### POST /settlement

**Summary:** Create a settlement

##### Request Body

**Content Types:**

- `application/json`

##### Responses

**201** - Settlement created

Content-Type: `application/json`

---

### `/settlement/{id}`

#### GET /settlement/{id}

**Summary:** Get a settlement by ID

##### Parameters

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

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

##### Responses

**200** - Settlement details

Content-Type: `application/json`

---

## Data Models

### SettlementFindResult

Result of finding settlements

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

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

| `total_result` | number | No | Total number of settlements |

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

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

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

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

### SettlementSchema

Settlement schema

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

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

| `client` | string | No | Client ID associated with the settlement |

| `rep` | string | No | Representative ID who processed the settlement |

| `invoices` | array | No | List of invoices included in settlement |

| `payments` | array | No | List of payments included in settlement |

| `totalAmount` | number | No | Total settlement amount |

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

| `settlementDate` | string | No | Date when settlement was completed |

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

| `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 |

### SettlementCreateBody

Body for creating a settlement

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

| `client` | string | Yes | Client ID associated with the settlement |

| `rep` | string | No | Representative ID who processed the settlement |

| `invoices` | array | Yes | List of invoices included in settlement |

| `payments` | array | Yes | List of payments included in settlement |

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

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

### SettlementCreateResult

Result of creating a settlement

### SettlementGetResult

Result of getting a settlement

## TypeScript Usage

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