# Safe Invoice Serial Counter API

API for managing safe invoice serial counters

**Version:** 1.0.0

## Overview

### Base URLs

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

### API Categories

- **Safe Invoice Serial Counter**: Safe invoice serial counter management operations

## Authentication

This API uses the following authentication methods:

- **ApiKeyAuth**

## Endpoints

### `/safe-invoice-serial-counter`

#### GET /safe-invoice-serial-counter

**Summary:** Get all safe invoice serial counters

**Description:** Retrieve a list of all safe invoice serial counters with optional filtering and pagination

**Tags:** Safe Invoice Serial Counter

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

| `rep` | query | string | No | Filter by representative ID |

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

| `_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 /safe-invoice-serial-counter

**Summary:** Create a new safe invoice serial counter

**Description:** Create a new safe invoice serial counter entry

**Tags:** Safe Invoice Serial Counter

##### Request Body

**Content Types:**

- `application/json`

##### Responses

**201** - Safe invoice serial counter created successfully

Content-Type: `application/json`

**400** - No description

**401** - No description

**403** - No description

**422** - No description

**500** - No description

---

### `/safe-invoice-serial-counter/{id}`

#### GET /safe-invoice-serial-counter/{id}

**Summary:** Get safe invoice serial counter by ID

**Description:** Retrieve a specific safe invoice serial counter by its ID

**Tags:** Safe Invoice Serial Counter

##### Parameters

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

| `id` | path | string | Yes | Safe invoice serial counter 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 /safe-invoice-serial-counter/{id}

**Summary:** Update safe invoice serial counter

**Description:** Update an existing safe invoice serial counter

**Tags:** Safe Invoice Serial Counter

##### Parameters

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

| `id` | path | string | Yes | Safe invoice serial counter ID |

##### Request Body

**Content Types:**

- `application/json`

##### Responses

**200** - Safe invoice serial counter 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 /safe-invoice-serial-counter/{id}

**Summary:** Delete safe invoice serial counter

**Description:** Delete a safe invoice serial counter by ID

**Tags:** Safe Invoice Serial Counter

##### Parameters

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

| `id` | path | string | Yes | Safe invoice serial counter ID |

##### Responses

**200** - Safe invoice serial counter deleted successfully

Content-Type: `application/json`

**400** - No description

**401** - No description

**403** - No description

**404** - No description

**500** - No description

---

### `/safe-invoice-serial-counter/next`

#### POST /safe-invoice-serial-counter/next

**Summary:** Get next serial number

**Description:** Get the next available serial number for invoice generation

**Tags:** Safe Invoice Serial Counter

##### Request Body

**Content Types:**

- `application/json`

##### Responses

**200** - Next serial number retrieved successfully

Content-Type: `application/json`

**400** - No description

**401** - No description

**403** - No description

**500** - No description

---

## Data Models

### SafeInvoiceSerialCounter

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

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

| `rep` | string | Yes | Representative ID |

| `warehouse` | string | Yes | Warehouse ID |

| `invoice_type` | string | Yes | Type of invoice |

| `current_serial` | integer | Yes | Current serial number |

| `last_used_date` | string | No | Date when serial was last used |

| `prefix` | string | No | Serial number prefix |

| `suffix` | string | No | Serial number suffix |

| `pad_length` | integer | No | Length to pad the serial number |

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

### CreateSafeInvoiceSerialCounterRequest

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

| `rep` | string | Yes | Representative ID |

| `warehouse` | string | Yes | Warehouse ID |

| `invoice_type` | string | Yes | Type of invoice |

| `current_serial` | integer | No | Starting serial number |

| `prefix` | string | No | Serial number prefix |

| `suffix` | string | No | Serial number suffix |

| `pad_length` | integer | No | Length to pad the serial number |

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

### UpdateSafeInvoiceSerialCounterRequest

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

| `current_serial` | integer | No | Current serial number |

| `prefix` | string | No | Serial number prefix |

| `suffix` | string | No | Serial number suffix |

| `pad_length` | integer | No | Length to pad the serial number |

| `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 [safe-invoice-serial-counter-examples.md](./safe-invoice-serial-counter-examples.md) for detailed TypeScript usage examples.
