# Contract Installment API

API for managing contract installments

**Version:** 1.0.0

## Overview

### Base URLs

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

### API Categories

- **Contract Installment**: Contract installment management operations

## Authentication

This API uses the following authentication methods:

- **ApiKeyAuth**

## Endpoints

### `/contract-installment`

#### GET /contract-installment

**Summary:** Get all contract installments

**Description:** Retrieve a list of all contract installments with optional filtering and pagination

**Tags:** Contract Installment

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

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

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

| `due_date_from` | query | string | No | Filter by due date from |

| `due_date_to` | query | string | No | Filter by due date to |

| `_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 /contract-installment

**Summary:** Create a new contract installment

**Description:** Create a new contract installment

**Tags:** Contract Installment

##### Request Body

**Content Types:**

- `application/json`

##### Responses

**201** - Contract installment created successfully

Content-Type: `application/json`

**400** - No description

**401** - No description

**403** - No description

**422** - No description

**500** - No description

---

### `/contract-installment/{id}`

#### GET /contract-installment/{id}

**Summary:** Get contract installment by ID

**Description:** Retrieve a specific contract installment by its ID

**Tags:** Contract Installment

##### Parameters

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

| `id` | path | string | Yes | Contract installment 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 /contract-installment/{id}

**Summary:** Update contract installment

**Description:** Update an existing contract installment

**Tags:** Contract Installment

##### Parameters

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

| `id` | path | string | Yes | Contract installment ID |

##### Request Body

**Content Types:**

- `application/json`

##### Responses

**200** - Contract installment 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 /contract-installment/{id}

**Summary:** Delete contract installment

**Description:** Delete a contract installment by ID

**Tags:** Contract Installment

##### Parameters

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

| `id` | path | string | Yes | Contract installment ID |

##### Responses

**200** - Contract installment deleted successfully

Content-Type: `application/json`

**400** - No description

**401** - No description

**403** - No description

**404** - No description

**500** - No description

---

### `/contract-installment/{id}/pay`

#### POST /contract-installment/{id}/pay

**Summary:** Mark installment as paid

**Description:** Mark a contract installment as paid

**Tags:** Contract Installment

##### Parameters

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

| `id` | path | string | Yes | Contract installment ID |

##### Request Body

**Content Types:**

- `application/json`

##### Responses

**200** - Installment marked as paid successfully

Content-Type: `application/json`

**400** - No description

**401** - No description

**403** - No description

**404** - No description

**500** - No description

---

### `/contract-installment/overdue`

#### GET /contract-installment/overdue

**Summary:** Get overdue installments

**Description:** Get all overdue contract installments

**Tags:** Contract Installment

##### Parameters

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

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

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

| `days_overdue` | query | integer | No | Minimum days overdue |

##### Responses

**200** - Overdue installments retrieved successfully

Content-Type: `application/json`

**400** - No description

**401** - No description

**403** - No description

**500** - No description

---

## Data Models

### ContractInstallment

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

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

| `contract` | string | Yes | Contract ID reference |

| `installment_number` | integer | Yes | Installment sequence number |

| `due_date` | string | Yes | Due date for this installment |

| `amount` | number | Yes | Installment amount |

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

| `status` | string | Yes | Payment status |

| `payment_date` | string | No | Date when payment was made (if paid) |

| `payment_amount` | number | No | Amount actually paid |

| `payment_method` | string | No | Payment method used |

| `payment_reference` | string | No | Payment reference number |

| `late_fee` | number | No | Late fee charged if overdue |

| `discount_applied` | number | No | Discount applied to this installment |

| `interest_rate` | number | No | Interest rate for this installment |

| `grace_period_days` | integer | No | Grace period in days before marking overdue |

| `reminder_sent` | boolean | No | Whether payment reminder has been sent |

| `reminder_dates` | array | No | Dates when reminders were sent |

| `auto_pay_enabled` | boolean | No | Whether auto-pay is enabled for this installment |

| `payment_history` | array | No | History of payment attempts |

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

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

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

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

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

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

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

### CreateContractInstallmentRequest

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

| `contract` | string | Yes | Contract ID reference |

| `installment_number` | integer | Yes | Installment sequence number |

| `due_date` | string | Yes | Due date for this installment |

| `amount` | number | Yes | Installment amount |

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

| `late_fee` | number | No | Late fee charged if overdue |

| `discount_applied` | number | No | Discount applied to this installment |

| `interest_rate` | number | No | Interest rate for this installment |

| `grace_period_days` | integer | No | Grace period in days before marking overdue |

| `auto_pay_enabled` | boolean | No | Whether auto-pay is enabled for this installment |

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

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

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

### UpdateContractInstallmentRequest

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

| `due_date` | string | No | Due date for this installment |

| `amount` | number | No | Installment amount |

| `status` | string | No | Payment status |

| `payment_date` | string | No | Date when payment was made |

| `payment_amount` | number | No | Amount actually paid |

| `payment_method` | string | No | Payment method used |

| `payment_reference` | string | No | Payment reference number |

| `late_fee` | number | No | Late fee charged if overdue |

| `discount_applied` | number | No | Discount applied to this installment |

| `interest_rate` | number | No | Interest rate for this installment |

| `grace_period_days` | integer | No | Grace period in days before marking overdue |

| `auto_pay_enabled` | boolean | No | Whether auto-pay is enabled for this installment |

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

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

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

### 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 [contract-installment-examples.md](./contract-installment-examples.md) for detailed TypeScript usage examples.
