{
  "openapi": "3.0.3",
  "info": {
    "title": "AllRent-CRM API",
    "version": "1.0",
    "description": "Публичный API проката. Токен: меню пользователя → «Доступ по API»."
  },
  "servers": [
    {
      "url": "https://allrent-crm.ru/api/v1"
    }
  ],
  "components": {
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  },
  "paths": {
    "/ping": {
      "get": {
        "tags": [
          "Профиль"
        ],
        "summary": "Проверка токена",
        "description": "Возвращает организацию и пользователя, от имени которых работает токен. Удобно первым запросом: если ответ 200, авторизация настроена верно.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "tenant": {
                      "id": 1,
                      "name": "Мой прокат",
                      "timezone": "Asia/Yekaterinburg"
                    },
                    "user": {
                      "id": 1,
                      "login": "admin",
                      "role": "admin"
                    },
                    "version": "1.0"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        }
      }
    },
    "/customers": {
      "get": {
        "tags": [
          "Клиенты"
        ],
        "summary": "Список клиентов",
        "description": "Клиенты организации. `phone` ищет точное совпадение по цифрам в любом формате записи (8 и +7 равны), `email` — без учёта регистра; так удобно проверять, есть ли клиент, перед созданием.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Номер страницы, с 1",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "description": "Размер страницы, 1…1000 (по умолчанию 10)",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "updated_since",
            "in": "query",
            "required": false,
            "description": "Только изменённые после этого момента, ISO 8601 со смещением",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Поиск по подстроке",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "phone",
            "in": "query",
            "required": false,
            "description": "Точное совпадение по телефону",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "email",
            "in": "query",
            "required": false,
            "description": "Точное совпадение по e-mail",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": [
                    {
                      "id": 1,
                      "number": 1,
                      "fio": "Иванов Иван",
                      "last_name": "Иванов",
                      "first_name": "Иван",
                      "middle_name": null,
                      "phone": "+7 (900) 123-45-67",
                      "email": null,
                      "category": "new",
                      "rental_discount": "0.00",
                      "product_discount": "0.00",
                      "source": null,
                      "is_legal_entity": false,
                      "org_name": null,
                      "inn": null,
                      "kpp": null,
                      "birth_date": null,
                      "passport_series": "",
                      "passport_number": "",
                      "passport_issued_by": "",
                      "passport_issue_date": "",
                      "passport_dept_code": "",
                      "registration_address": "",
                      "additional_info": null,
                      "created_at": "2026-04-28T14:54:44+0000",
                      "updated_at": "2026-08-24T05:40:59+0000"
                    }
                  ],
                  "links": {
                    "next": "/customers?page=2&per_page=10",
                    "prev": null
                  },
                  "meta": {
                    "current_page": 1,
                    "last_page": 3,
                    "per_page": 10,
                    "total": 25,
                    "version": "1.0"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        }
      },
      "post": {
        "tags": [
          "Клиенты"
        ],
        "summary": "Создать клиента",
        "description": "Создаёт клиента. Обязательны фамилия, имя и телефон. Перед созданием найдите клиента по `phone`/`email`, чтобы не плодить дубли.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [],
        "responses": {
          "201": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": 1,
                    "number": 1,
                    "fio": "Иванов Иван",
                    "last_name": "Иванов",
                    "first_name": "Иван",
                    "middle_name": null,
                    "phone": "+7 (900) 123-45-67",
                    "email": null,
                    "category": "new",
                    "rental_discount": "0.00",
                    "product_discount": "0.00",
                    "source": null,
                    "is_legal_entity": false,
                    "org_name": null,
                    "inn": null,
                    "kpp": null,
                    "birth_date": null,
                    "passport_series": "",
                    "passport_number": "",
                    "passport_issued_by": "",
                    "passport_issue_date": "",
                    "passport_dept_code": "",
                    "registration_address": "",
                    "additional_info": null,
                    "created_at": "2026-04-28T14:54:44+0000",
                    "updated_at": "2026-08-24T05:40:59+0000"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "last_name": "Петров",
                "first_name": "Пётр",
                "phone": "+79991112233",
                "email": "petrov@example.com"
              }
            }
          }
        }
      }
    },
    "/customers/{id}": {
      "get": {
        "tags": [
          "Клиенты"
        ],
        "summary": "Получить клиента",
        "description": "Карточка клиента по идентификатору.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Идентификатор (поле `id` из ответов API): записи",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": 1,
                    "number": 1,
                    "fio": "Иванов Иван",
                    "last_name": "Иванов",
                    "first_name": "Иван",
                    "middle_name": null,
                    "phone": "+7 (900) 123-45-67",
                    "email": null,
                    "category": "new",
                    "rental_discount": "0.00",
                    "product_discount": "0.00",
                    "source": null,
                    "is_legal_entity": false,
                    "org_name": null,
                    "inn": null,
                    "kpp": null,
                    "birth_date": null,
                    "passport_series": "",
                    "passport_number": "",
                    "passport_issued_by": "",
                    "passport_issue_date": "",
                    "passport_dept_code": "",
                    "registration_address": "",
                    "additional_info": null,
                    "created_at": "2026-04-28T14:54:44+0000",
                    "updated_at": "2026-08-24T05:40:59+0000"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        }
      },
      "patch": {
        "tags": [
          "Клиенты"
        ],
        "summary": "Изменить клиента",
        "description": "Частичное изменение: передайте только те поля, которые нужно поменять. `PUT` принимает те же поля.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Идентификатор (поле `id` из ответов API): клиент",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": 1,
                    "number": 1,
                    "fio": "Иванов Иван",
                    "last_name": "Иванов",
                    "first_name": "Иван",
                    "middle_name": null,
                    "phone": "+7 (900) 123-45-67",
                    "email": null,
                    "category": "new",
                    "rental_discount": "0.00",
                    "product_discount": "0.00",
                    "source": null,
                    "is_legal_entity": false,
                    "org_name": null,
                    "inn": null,
                    "kpp": null,
                    "birth_date": null,
                    "passport_series": "",
                    "passport_number": "",
                    "passport_issued_by": "",
                    "passport_issue_date": "",
                    "passport_dept_code": "",
                    "registration_address": "",
                    "additional_info": null,
                    "created_at": "2026-04-28T14:54:44+0000",
                    "updated_at": "2026-08-24T05:40:59+0000"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "email": "new@example.com"
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Клиенты"
        ],
        "summary": "Удалить клиента",
        "description": "Удаляет клиента без аренд. Если у клиента есть аренды, ответ 409 `HAS_DEPENDENCIES` (в отличие от сайта, API не удаляет аренды каскадом).",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Идентификатор (поле `id` из ответов API): клиент",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Успех, тела нет"
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        }
      }
    },
    "/inventory": {
      "get": {
        "tags": [
          "Инвентарь"
        ],
        "summary": "Список инвентаря",
        "description": "Единицы инвентаря. `stock_quantity` — сколько одинаковых единиц в наличии (пул).",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Номер страницы, с 1",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "description": "Размер страницы, 1…1000 (по умолчанию 10)",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "updated_since",
            "in": "query",
            "required": false,
            "description": "Только изменённые после этого момента, ISO 8601 со смещением",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Поиск по подстроке",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "category",
            "in": "query",
            "required": false,
            "description": "Идентификатор категории",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "point_id",
            "in": "query",
            "required": false,
            "description": "Идентификатор пункта проката",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "available, in_rental, booked, broken",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": [
                    {
                      "id": 5,
                      "number": 5,
                      "title": "Велосипед 1",
                      "description": "",
                      "article": "V-001",
                      "serial_number": "",
                      "status": "available",
                      "stock_quantity": 1,
                      "category": {
                        "id": 2,
                        "name": "Велосипеды",
                        "parent": null,
                        "updated_at": "2026-08-01T00:00:00+0000"
                      },
                      "point": {
                        "id": 1,
                        "name": "Центр"
                      },
                      "tariffs": [
                        {
                          "id": 3,
                          "name": "Сутки"
                        }
                      ],
                      "price_per_hour": "100.00",
                      "price_per_day": "500.00",
                      "price_per_week": "2500.00",
                      "deposit_amount": "1000.00",
                      "purchase_price": "20000.00",
                      "estimated_value": "15000.00",
                      "purchase_date": "2025-04-01",
                      "location": "Склад А",
                      "additional_params": null,
                      "photo": null,
                      "updated_at": "2026-08-24T05:40:59+0000"
                    }
                  ],
                  "links": {
                    "next": "/inventory?page=2&per_page=10",
                    "prev": null
                  },
                  "meta": {
                    "current_page": 1,
                    "last_page": 3,
                    "per_page": 10,
                    "total": 25,
                    "version": "1.0"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        }
      },
      "post": {
        "tags": [
          "Инвентарь"
        ],
        "summary": "Создать товар",
        "description": "Создаёт товар. Обязательно только название. Артикул уникален в организации (повтор — 422). Фото через API пока не загружается.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [],
        "responses": {
          "201": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": 5,
                    "number": 5,
                    "title": "Велосипед 1",
                    "description": "",
                    "article": "V-001",
                    "serial_number": "",
                    "status": "available",
                    "stock_quantity": 1,
                    "category": {
                      "id": 2,
                      "name": "Велосипеды",
                      "parent": null,
                      "updated_at": "2026-08-01T00:00:00+0000"
                    },
                    "point": {
                      "id": 1,
                      "name": "Центр"
                    },
                    "tariffs": [
                      {
                        "id": 3,
                        "name": "Сутки"
                      }
                    ],
                    "price_per_hour": "100.00",
                    "price_per_day": "500.00",
                    "price_per_week": "2500.00",
                    "deposit_amount": "1000.00",
                    "purchase_price": "20000.00",
                    "estimated_value": "15000.00",
                    "purchase_date": "2025-04-01",
                    "location": "Склад А",
                    "additional_params": null,
                    "photo": null,
                    "updated_at": "2026-08-24T05:40:59+0000"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "title": "Велосипед 2",
                "article": "V-002",
                "category_id": 2,
                "point_id": 1,
                "tariff_ids": [
                  3
                ],
                "price_per_day": "500",
                "deposit_amount": "1000",
                "stock_quantity": 1
              }
            }
          }
        }
      }
    },
    "/inventory/{id}": {
      "get": {
        "tags": [
          "Инвентарь"
        ],
        "summary": "Получить позицию",
        "description": "Одна единица инвентаря.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Идентификатор (поле `id` из ответов API): записи",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": 5,
                    "number": 5,
                    "title": "Велосипед 1",
                    "description": "",
                    "article": "V-001",
                    "serial_number": "",
                    "status": "available",
                    "stock_quantity": 1,
                    "category": {
                      "id": 2,
                      "name": "Велосипеды",
                      "parent": null,
                      "updated_at": "2026-08-01T00:00:00+0000"
                    },
                    "point": {
                      "id": 1,
                      "name": "Центр"
                    },
                    "tariffs": [
                      {
                        "id": 3,
                        "name": "Сутки"
                      }
                    ],
                    "price_per_hour": "100.00",
                    "price_per_day": "500.00",
                    "price_per_week": "2500.00",
                    "deposit_amount": "1000.00",
                    "purchase_price": "20000.00",
                    "estimated_value": "15000.00",
                    "purchase_date": "2025-04-01",
                    "location": "Склад А",
                    "additional_params": null,
                    "photo": null,
                    "updated_at": "2026-08-24T05:40:59+0000"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        }
      },
      "patch": {
        "tags": [
          "Инвентарь"
        ],
        "summary": "Изменить товар",
        "description": "Частичное изменение: передайте только меняемые поля. `tariff_ids` заменяет список тарифов целиком. `PUT` принимает то же.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Идентификатор (поле `id` из ответов API): товар",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": 5,
                    "number": 5,
                    "title": "Велосипед 1",
                    "description": "",
                    "article": "V-001",
                    "serial_number": "",
                    "status": "available",
                    "stock_quantity": 1,
                    "category": {
                      "id": 2,
                      "name": "Велосипеды",
                      "parent": null,
                      "updated_at": "2026-08-01T00:00:00+0000"
                    },
                    "point": {
                      "id": 1,
                      "name": "Центр"
                    },
                    "tariffs": [
                      {
                        "id": 3,
                        "name": "Сутки"
                      }
                    ],
                    "price_per_hour": "100.00",
                    "price_per_day": "500.00",
                    "price_per_week": "2500.00",
                    "deposit_amount": "1000.00",
                    "purchase_price": "20000.00",
                    "estimated_value": "15000.00",
                    "purchase_date": "2025-04-01",
                    "location": "Склад А",
                    "additional_params": null,
                    "photo": null,
                    "updated_at": "2026-08-24T05:40:59+0000"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "price_per_day": "600",
                "stock_quantity": 2
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Инвентарь"
        ],
        "summary": "Удалить товар",
        "description": "Удаляет товар. Нельзя, если он есть в открытых арендах или входит в комплекты (409 `HAS_DEPENDENCIES`): сначала завершите аренды и уберите его из комплектов.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Идентификатор (поле `id` из ответов API): товар",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Успех, тела нет"
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        }
      }
    },
    "/availability": {
      "get": {
        "tags": [
          "Инвентарь"
        ],
        "summary": "Свободный остаток на период",
        "description": "Сколько единиц каждой позиции свободно на период: `stock_quantity` — всего, `busy` — занято открытыми арендами, `free` — свободно (закрытые аренды инвентарь не занимают). Для виджета бронирования на сайте и проверки перед созданием аренды. С `kit_id` отдаются позиции комплекта, а в `meta.kits_free` — сколько таких комплектов можно собрать.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Номер страницы, с 1",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "description": "Размер страницы, 1…1000 (по умолчанию 10)",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "start",
            "in": "query",
            "required": true,
            "description": "Начало периода: дата ГГГГ-ММ-ДД или время ISO 8601 со смещением",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "end",
            "in": "query",
            "required": true,
            "description": "Конец периода, позже начала",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "item_id",
            "in": "query",
            "required": false,
            "description": "Только эти позиции, через запятую: `5,8`",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "category",
            "in": "query",
            "required": false,
            "description": "Идентификатор категории",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "point_id",
            "in": "query",
            "required": false,
            "description": "Идентификатор пункта проката",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "kit_id",
            "in": "query",
            "required": false,
            "description": "Позиции комплекта",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Поиск по подстроке",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": [
                    {
                      "item_id": 5,
                      "title": "Велосипед 1",
                      "stock_quantity": 3,
                      "busy": 2,
                      "free": 1
                    }
                  ],
                  "links": {
                    "next": null,
                    "prev": null
                  },
                  "meta": {
                    "current_page": 1,
                    "last_page": 1,
                    "per_page": 10,
                    "total": 1,
                    "version": "1.0"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        }
      }
    },
    "/inventory/{id}/bookings": {
      "get": {
        "tags": [
          "Инвентарь"
        ],
        "summary": "Чем занята позиция",
        "description": "Открытые аренды, пересекающиеся с периодом `from`…`to` (по умолчанию от сейчас на 90 дней). Для календаря занятости.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Идентификатор (поле `id` из ответов API): позиция инвентаря",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "description": "Начало периода, по умолчанию сейчас",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "description": "Конец периода, по умолчанию +90 дней",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": [
                    {
                      "order_id": 81,
                      "number": "A-81",
                      "status": "active",
                      "quantity": 1,
                      "start_date": "2026-11-01",
                      "start_time": "10:00:00",
                      "end_date": "2026-11-02",
                      "end_time": "10:00:00"
                    }
                  ],
                  "meta": {
                    "stock_quantity": 1
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        }
      }
    },
    "/kits": {
      "get": {
        "tags": [
          "Комплекты"
        ],
        "summary": "Список комплектов",
        "description": "Комплекты из нескольких позиций. `deposit_amount` — сумма залогов позиций.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Номер страницы, с 1",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "description": "Размер страницы, 1…1000 (по умолчанию 10)",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "updated_since",
            "in": "query",
            "required": false,
            "description": "Только изменённые после этого момента, ISO 8601 со смещением",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Поиск по подстроке",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "point_id",
            "in": "query",
            "required": false,
            "description": "Идентификатор пункта проката",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": [
                    {
                      "id": 3,
                      "number": 1,
                      "name": "Набор туриста",
                      "article": "",
                      "serial_number": "",
                      "description": "",
                      "point": null,
                      "tariffs": [
                        {
                          "id": 3,
                          "name": "Сутки"
                        }
                      ],
                      "items": [
                        {
                          "item_id": 5,
                          "title": "Велосипед 1",
                          "quantity": 1
                        },
                        {
                          "item_id": 8,
                          "title": "Шлем",
                          "quantity": 2
                        }
                      ],
                      "deposit_amount": 1400.0,
                      "updated_at": "2026-08-24T05:40:59+0000"
                    }
                  ],
                  "links": {
                    "next": "/kits?page=2&per_page=10",
                    "prev": null
                  },
                  "meta": {
                    "current_page": 1,
                    "last_page": 3,
                    "per_page": 10,
                    "total": 25,
                    "version": "1.0"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        }
      },
      "post": {
        "tags": [
          "Комплекты"
        ],
        "summary": "Создать комплект",
        "description": "Создаёт комплект из товаров. Один товар указывайте один раз, количество — в `quantity`.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [],
        "responses": {
          "201": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": 3,
                    "number": 1,
                    "name": "Набор туриста",
                    "article": "",
                    "serial_number": "",
                    "description": "",
                    "point": null,
                    "tariffs": [
                      {
                        "id": 3,
                        "name": "Сутки"
                      }
                    ],
                    "items": [
                      {
                        "item_id": 5,
                        "title": "Велосипед 1",
                        "quantity": 1
                      },
                      {
                        "item_id": 8,
                        "title": "Шлем",
                        "quantity": 2
                      }
                    ],
                    "deposit_amount": 1400.0,
                    "updated_at": "2026-08-24T05:40:59+0000"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "name": "Набор туриста",
                "tariff_ids": [
                  3
                ],
                "items": [
                  {
                    "item_id": 5,
                    "quantity": 1
                  },
                  {
                    "item_id": 8,
                    "quantity": 2
                  }
                ]
              }
            }
          }
        }
      }
    },
    "/kits/{id}": {
      "get": {
        "tags": [
          "Комплекты"
        ],
        "summary": "Получить комплект",
        "description": "Один комплект с составом.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Идентификатор (поле `id` из ответов API): записи",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": 3,
                    "number": 1,
                    "name": "Набор туриста",
                    "article": "",
                    "serial_number": "",
                    "description": "",
                    "point": null,
                    "tariffs": [
                      {
                        "id": 3,
                        "name": "Сутки"
                      }
                    ],
                    "items": [
                      {
                        "item_id": 5,
                        "title": "Велосипед 1",
                        "quantity": 1
                      },
                      {
                        "item_id": 8,
                        "title": "Шлем",
                        "quantity": 2
                      }
                    ],
                    "deposit_amount": 1400.0,
                    "updated_at": "2026-08-24T05:40:59+0000"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        }
      },
      "patch": {
        "tags": [
          "Комплекты"
        ],
        "summary": "Изменить комплект",
        "description": "Частичное изменение. `items` заменяет состав целиком, `tariff_ids` — список тарифов. Уже созданные аренды не меняются.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Идентификатор (поле `id` из ответов API): комплект",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": 3,
                    "number": 1,
                    "name": "Набор туриста",
                    "article": "",
                    "serial_number": "",
                    "description": "",
                    "point": null,
                    "tariffs": [
                      {
                        "id": 3,
                        "name": "Сутки"
                      }
                    ],
                    "items": [
                      {
                        "item_id": 5,
                        "title": "Велосипед 1",
                        "quantity": 1
                      },
                      {
                        "item_id": 8,
                        "title": "Шлем",
                        "quantity": 2
                      }
                    ],
                    "deposit_amount": 1400.0,
                    "updated_at": "2026-08-24T05:40:59+0000"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "name": "Набор туриста+"
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Комплекты"
        ],
        "summary": "Удалить комплект",
        "description": "Удаляет комплект. Нельзя, если он есть в открытых арендах (409 `HAS_DEPENDENCIES`).",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Идентификатор (поле `id` из ответов API): комплект",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Успех, тела нет"
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        }
      }
    },
    "/categories": {
      "get": {
        "tags": [
          "Справочники"
        ],
        "summary": "Категории",
        "description": "Категории инвентаря (с родителем).",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Номер страницы, с 1",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "description": "Размер страницы, 1…1000 (по умолчанию 10)",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "updated_since",
            "in": "query",
            "required": false,
            "description": "Только изменённые после этого момента, ISO 8601 со смещением",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Поиск по подстроке",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": [
                    {
                      "id": 2,
                      "name": "Велосипеды",
                      "parent": null,
                      "updated_at": "2026-08-01T00:00:00+0000"
                    }
                  ],
                  "links": {
                    "next": "/categories?page=2&per_page=10",
                    "prev": null
                  },
                  "meta": {
                    "current_page": 1,
                    "last_page": 3,
                    "per_page": 10,
                    "total": 25,
                    "version": "1.0"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        }
      },
      "post": {
        "tags": [
          "Справочники"
        ],
        "summary": "Создать категорию",
        "description": "Создаёт категорию инвентаря. `parent_id` делает её вложенной.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [],
        "responses": {
          "201": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": 2,
                    "name": "Велосипеды",
                    "parent": null,
                    "updated_at": "2026-08-01T00:00:00+0000"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "name": "Велосипеды",
                "parent_id": null
              }
            }
          }
        }
      }
    },
    "/categories/{id}": {
      "get": {
        "tags": [
          "Справочники"
        ],
        "summary": "Категория",
        "description": "Одна категория.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Идентификатор (поле `id` из ответов API): записи",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": 2,
                    "name": "Велосипеды",
                    "parent": null,
                    "updated_at": "2026-08-01T00:00:00+0000"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        }
      },
      "patch": {
        "tags": [
          "Справочники"
        ],
        "summary": "Изменить категорию",
        "description": "Переименование и перенос. Вложить категорию в саму себя или в потомка нельзя (422).",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Идентификатор (поле `id` из ответов API): категория",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": 2,
                    "name": "Велосипеды",
                    "parent": null,
                    "updated_at": "2026-08-01T00:00:00+0000"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "name": "Горные велосипеды"
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Справочники"
        ],
        "summary": "Удалить категорию",
        "description": "Нельзя, если в категории есть товары или вложенные категории (409 `HAS_DEPENDENCIES`).",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Идентификатор (поле `id` из ответов API): категория",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Успех, тела нет"
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        }
      }
    },
    "/tariffs": {
      "get": {
        "tags": [
          "Справочники"
        ],
        "summary": "Тарифы",
        "description": "Тарифы проката. В `POST /rents` передаются как `tariff_id`.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Номер страницы, с 1",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "description": "Размер страницы, 1…1000 (по умолчанию 10)",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "updated_since",
            "in": "query",
            "required": false,
            "description": "Только изменённые после этого момента, ISO 8601 со смещением",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Поиск по подстроке",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": [
                    {
                      "id": 3,
                      "name": "Сутки",
                      "is_active": true,
                      "pricings": [
                        {
                          "from_days": 0,
                          "from_hours": 0,
                          "duration_days": 1,
                          "duration_hours": 0,
                          "duration_minutes": 0,
                          "price": "500.00",
                          "is_fixed": false,
                          "recalc_all": false
                        }
                      ],
                      "updated_at": "2026-08-01T00:00:00+0000"
                    }
                  ],
                  "links": {
                    "next": "/tariffs?page=2&per_page=10",
                    "prev": null
                  },
                  "meta": {
                    "current_page": 1,
                    "last_page": 3,
                    "per_page": 10,
                    "total": 25,
                    "version": "1.0"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        }
      },
      "post": {
        "tags": [
          "Справочники"
        ],
        "summary": "Создать тариф",
        "description": "Создаёт тариф с расценками. Расценки считаются как в форме аренды; фиксированной может быть только одна.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [],
        "responses": {
          "201": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": 3,
                    "name": "Сутки",
                    "is_active": true,
                    "pricings": [
                      {
                        "from_days": 0,
                        "from_hours": 0,
                        "duration_days": 1,
                        "duration_hours": 0,
                        "duration_minutes": 0,
                        "price": "500.00",
                        "is_fixed": false,
                        "recalc_all": false
                      }
                    ],
                    "updated_at": "2026-08-01T00:00:00+0000"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "name": "Сутки",
                "pricings": [
                  {
                    "duration_days": 1,
                    "price": "500"
                  }
                ]
              }
            }
          }
        }
      }
    },
    "/tariffs/{id}": {
      "get": {
        "tags": [
          "Справочники"
        ],
        "summary": "Тариф",
        "description": "Один тариф.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Идентификатор (поле `id` из ответов API): записи",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": 3,
                    "name": "Сутки",
                    "is_active": true,
                    "pricings": [
                      {
                        "from_days": 0,
                        "from_hours": 0,
                        "duration_days": 1,
                        "duration_hours": 0,
                        "duration_minutes": 0,
                        "price": "500.00",
                        "is_fixed": false,
                        "recalc_all": false
                      }
                    ],
                    "updated_at": "2026-08-01T00:00:00+0000"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        }
      },
      "patch": {
        "tags": [
          "Справочники"
        ],
        "summary": "Изменить тариф",
        "description": "Частичное изменение. `pricings` заменяет все расценки целиком. Уже созданные аренды не пересчитываются.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Идентификатор (поле `id` из ответов API): тариф",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": 3,
                    "name": "Сутки",
                    "is_active": true,
                    "pricings": [
                      {
                        "from_days": 0,
                        "from_hours": 0,
                        "duration_days": 1,
                        "duration_hours": 0,
                        "duration_minutes": 0,
                        "price": "500.00",
                        "is_fixed": false,
                        "recalc_all": false
                      }
                    ],
                    "updated_at": "2026-08-01T00:00:00+0000"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "pricings": [
                  {
                    "duration_days": 1,
                    "price": "600"
                  }
                ]
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Справочники"
        ],
        "summary": "Удалить тариф",
        "description": "Нельзя, если тариф назначен товарам или комплектам (409 `HAS_DEPENDENCIES`).",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Идентификатор (поле `id` из ответов API): тариф",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Успех, тела нет"
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        }
      }
    },
    "/points": {
      "get": {
        "tags": [
          "Справочники"
        ],
        "summary": "Пункты проката",
        "description": "Точки проката организации.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Номер страницы, с 1",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "description": "Размер страницы, 1…1000 (по умолчанию 10)",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "updated_since",
            "in": "query",
            "required": false,
            "description": "Только изменённые после этого момента, ISO 8601 со смещением",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Поиск по подстроке",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": [
                    {
                      "id": 1,
                      "number": 1,
                      "name": "Центр",
                      "address": "ул. Ленина, 1",
                      "phone": "+7 (343) 000-00-00",
                      "email": null,
                      "description": "",
                      "updated_at": "2026-08-01T00:00:00+0000"
                    }
                  ],
                  "links": {
                    "next": "/points?page=2&per_page=10",
                    "prev": null
                  },
                  "meta": {
                    "current_page": 1,
                    "last_page": 3,
                    "per_page": 10,
                    "total": 25,
                    "version": "1.0"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        }
      },
      "post": {
        "tags": [
          "Справочники"
        ],
        "summary": "Создать пункт проката",
        "description": "Создаёт пункт проката.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [],
        "responses": {
          "201": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": 1,
                    "number": 1,
                    "name": "Центр",
                    "address": "ул. Ленина, 1",
                    "phone": "+7 (343) 000-00-00",
                    "email": null,
                    "description": "",
                    "updated_at": "2026-08-01T00:00:00+0000"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "name": "Центр",
                "address": "ул. Ленина, 1",
                "phone": "+79990000000"
              }
            }
          }
        }
      }
    },
    "/points/{id}": {
      "get": {
        "tags": [
          "Справочники"
        ],
        "summary": "Пункт проката",
        "description": "Один пункт проката.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Идентификатор (поле `id` из ответов API): записи",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": 1,
                    "number": 1,
                    "name": "Центр",
                    "address": "ул. Ленина, 1",
                    "phone": "+7 (343) 000-00-00",
                    "email": null,
                    "description": "",
                    "updated_at": "2026-08-01T00:00:00+0000"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        }
      },
      "patch": {
        "tags": [
          "Справочники"
        ],
        "summary": "Изменить пункт проката",
        "description": "Частичное изменение.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Идентификатор (поле `id` из ответов API): пункт проката",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": 1,
                    "number": 1,
                    "name": "Центр",
                    "address": "ул. Ленина, 1",
                    "phone": "+7 (343) 000-00-00",
                    "email": null,
                    "description": "",
                    "updated_at": "2026-08-01T00:00:00+0000"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "phone": "+79990001122"
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Справочники"
        ],
        "summary": "Удалить пункт проката",
        "description": "Нельзя, если к пункту привязаны товары или комплекты либо он указан в открытых арендах (409 `HAS_DEPENDENCIES`).",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Идентификатор (поле `id` из ответов API): пункт проката",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Успех, тела нет"
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        }
      }
    },
    "/payment-types": {
      "get": {
        "tags": [
          "Справочники"
        ],
        "summary": "Способы оплаты",
        "description": "Способы оплаты; `id` нужен в `payment_type_id` при приёме оплаты.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Номер страницы, с 1",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "description": "Размер страницы, 1…1000 (по умолчанию 10)",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "updated_since",
            "in": "query",
            "required": false,
            "description": "Только изменённые после этого момента, ISO 8601 со смещением",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": [
                    {
                      "id": 1,
                      "name": "Наличные",
                      "updated_at": "2026-08-01T00:00:00+0000"
                    }
                  ],
                  "links": {
                    "next": "/payment-types?page=2&per_page=10",
                    "prev": null
                  },
                  "meta": {
                    "current_page": 1,
                    "last_page": 3,
                    "per_page": 10,
                    "total": 25,
                    "version": "1.0"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        }
      }
    },
    "/payment-types/{id}": {
      "get": {
        "tags": [
          "Справочники"
        ],
        "summary": "Способ оплаты",
        "description": "Один способ оплаты.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Идентификатор (поле `id` из ответов API): записи",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": 1,
                    "name": "Наличные",
                    "updated_at": "2026-08-01T00:00:00+0000"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        }
      }
    },
    "/rents": {
      "get": {
        "tags": [
          "Аренды"
        ],
        "summary": "Список аренд",
        "description": "Аренды организации с позициями и платежами. В ответе `number` — номер из интерфейса, `id` — идентификатор для адресов `/rents/{id}`. Период: `period_from` и `period_to` (даты ГГГГ-ММ-ДД) — возвращаются аренды, пересекающиеся с ним.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Номер страницы, с 1",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "description": "Размер страницы, 1…1000 (по умолчанию 10)",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "updated_since",
            "in": "query",
            "required": false,
            "description": "Только изменённые после этого момента, ISO 8601 со смещением",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "period_from",
            "in": "query",
            "required": false,
            "description": "Начало периода, ГГГГ-ММ-ДД",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "period_to",
            "in": "query",
            "required": false,
            "description": "Конец периода, ГГГГ-ММ-ДД",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Статус аренды, например active, completed, cancelled",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "customer_id",
            "in": "query",
            "required": false,
            "description": "Идентификатор клиента",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "number",
            "in": "query",
            "required": false,
            "description": "Номер аренды, как он виден в интерфейсе (не `id`): `79` или `A-79`, если у организации номера с префиксом",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": [
                    {
                      "id": 81,
                      "number": "81",
                      "status": "active",
                      "customer": {
                        "id": 1,
                        "fio": "Иванов Иван",
                        "phone": "+7 (900) 123-45-67"
                      },
                      "point": {
                        "id": 1,
                        "name": "Центр"
                      },
                      "start_date": "2026-09-01",
                      "start_time": "10:00:00",
                      "end_date": "2026-09-02",
                      "end_time": "10:00:00",
                      "total_price": "500.00",
                      "discount_value": "0.00",
                      "discount_type": "percent",
                      "discount_scope": "rent",
                      "deposit_amount": "1000.00",
                      "deposit_paid": "0.00",
                      "deposit_returned": false,
                      "payment_status": "pending",
                      "paid": "0.00",
                      "delivery_type": "pickup",
                      "delivery_address": "",
                      "notes": "",
                      "items": [
                        {
                          "id": 90,
                          "item": {
                            "id": 5,
                            "title": "Велосипед 1"
                          },
                          "kit": null,
                          "quantity": 1,
                          "unit_price": "500.00",
                          "line_total": "500.00"
                        }
                      ],
                      "services": [
                        {
                          "id": 4,
                          "name": "Доставка",
                          "price": "300.00",
                          "quantity": 1
                        }
                      ],
                      "payments": [],
                      "created_at": "2026-08-30T08:00:00+0000",
                      "updated_at": "2026-08-30T08:00:00+0000"
                    }
                  ],
                  "links": {
                    "next": "/rents?page=2&per_page=10",
                    "prev": null
                  },
                  "meta": {
                    "current_page": 1,
                    "last_page": 3,
                    "per_page": 10,
                    "total": 25,
                    "version": "1.0"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        }
      },
      "post": {
        "tags": [
          "Аренды"
        ],
        "summary": "Создать аренду",
        "description": "Создаёт аренду. Цену, залог и итог API считает сам. В каждой позиции укажите ровно одно: `item_id` (инвентарь) или `kit_id` (комплект). Если инвентарь занят на период — 409 `INVENTORY_BUSY`.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [],
        "responses": {
          "201": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": 81,
                    "number": "81",
                    "status": "active",
                    "customer": {
                      "id": 1,
                      "fio": "Иванов Иван",
                      "phone": "+7 (900) 123-45-67"
                    },
                    "point": {
                      "id": 1,
                      "name": "Центр"
                    },
                    "start_date": "2026-09-01",
                    "start_time": "10:00:00",
                    "end_date": "2026-09-02",
                    "end_time": "10:00:00",
                    "total_price": "500.00",
                    "discount_value": "0.00",
                    "discount_type": "percent",
                    "discount_scope": "rent",
                    "deposit_amount": "1000.00",
                    "deposit_paid": "0.00",
                    "deposit_returned": false,
                    "payment_status": "pending",
                    "paid": "0.00",
                    "delivery_type": "pickup",
                    "delivery_address": "",
                    "notes": "",
                    "items": [
                      {
                        "id": 90,
                        "item": {
                          "id": 5,
                          "title": "Велосипед 1"
                        },
                        "kit": null,
                        "quantity": 1,
                        "unit_price": "500.00",
                        "line_total": "500.00"
                      }
                    ],
                    "services": [
                      {
                        "id": 4,
                        "name": "Доставка",
                        "price": "300.00",
                        "quantity": 1
                      }
                    ],
                    "payments": [],
                    "created_at": "2026-08-30T08:00:00+0000",
                    "updated_at": "2026-08-30T08:00:00+0000"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "customer_id": 1,
                "start": "2026-11-01T10:00:00+05:00",
                "end": "2026-11-02T10:00:00+05:00",
                "items": [
                  {
                    "item_id": 5,
                    "quantity": 1
                  }
                ],
                "notify": false
              }
            }
          }
        }
      }
    },
    "/rents/{id}": {
      "get": {
        "tags": [
          "Аренды"
        ],
        "summary": "Получить аренду",
        "description": "Одна аренда. Итог — `total_price`; `unit_price` и `line_total` позиций справочные: у аренд, созданных формой на сайте, они хранятся как ввёл оператор и не обязаны давать итог в сумме. В адресе нужен внутренний `id`, а не номер из интерфейса: они разные (аренда №81 может иметь `id` 503). Если известен только номер из интерфейса, найдите аренду через `GET /rents?number=81` и возьмите `id` из ответа.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Идентификатор (поле `id` из ответов API): аренды, не номер из интерфейса",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": 81,
                    "number": "81",
                    "status": "active",
                    "customer": {
                      "id": 1,
                      "fio": "Иванов Иван",
                      "phone": "+7 (900) 123-45-67"
                    },
                    "point": {
                      "id": 1,
                      "name": "Центр"
                    },
                    "start_date": "2026-09-01",
                    "start_time": "10:00:00",
                    "end_date": "2026-09-02",
                    "end_time": "10:00:00",
                    "total_price": "500.00",
                    "discount_value": "0.00",
                    "discount_type": "percent",
                    "discount_scope": "rent",
                    "deposit_amount": "1000.00",
                    "deposit_paid": "0.00",
                    "deposit_returned": false,
                    "payment_status": "pending",
                    "paid": "0.00",
                    "delivery_type": "pickup",
                    "delivery_address": "",
                    "notes": "",
                    "items": [
                      {
                        "id": 90,
                        "item": {
                          "id": 5,
                          "title": "Велосипед 1"
                        },
                        "kit": null,
                        "quantity": 1,
                        "unit_price": "500.00",
                        "line_total": "500.00"
                      }
                    ],
                    "services": [
                      {
                        "id": 4,
                        "name": "Доставка",
                        "price": "300.00",
                        "quantity": 1
                      }
                    ],
                    "payments": [],
                    "created_at": "2026-08-30T08:00:00+0000",
                    "updated_at": "2026-08-30T08:00:00+0000"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        }
      },
      "patch": {
        "tags": [
          "Аренды"
        ],
        "summary": "Изменить аренду",
        "description": "Частичное изменение: передайте только то, что нужно поменять. Если меняются период, позиции, тариф, клиент, услуги или скидка, итог и залог пересчитываются заново по тарифам (как при создании), а занятость проверяется без учёта самой этой аренды (409 `INVENTORY_BUSY`). Позиции и услуги заменяются списком целиком. Оплаты не трогаются, статус оплаты пересчитывается. Закрытую аренду править нельзя (409). `PUT` принимает то же самое.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Идентификатор (поле `id` из ответов API): аренда, не номер из интерфейса",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": 81,
                    "number": "81",
                    "status": "active",
                    "customer": {
                      "id": 1,
                      "fio": "Иванов Иван",
                      "phone": "+7 (900) 123-45-67"
                    },
                    "point": {
                      "id": 1,
                      "name": "Центр"
                    },
                    "start_date": "2026-09-01",
                    "start_time": "10:00:00",
                    "end_date": "2026-09-02",
                    "end_time": "10:00:00",
                    "total_price": "500.00",
                    "discount_value": "0.00",
                    "discount_type": "percent",
                    "discount_scope": "rent",
                    "deposit_amount": "1000.00",
                    "deposit_paid": "0.00",
                    "deposit_returned": false,
                    "payment_status": "pending",
                    "paid": "0.00",
                    "delivery_type": "pickup",
                    "delivery_address": "",
                    "notes": "",
                    "items": [
                      {
                        "id": 90,
                        "item": {
                          "id": 5,
                          "title": "Велосипед 1"
                        },
                        "kit": null,
                        "quantity": 1,
                        "unit_price": "500.00",
                        "line_total": "500.00"
                      }
                    ],
                    "services": [
                      {
                        "id": 4,
                        "name": "Доставка",
                        "price": "300.00",
                        "quantity": 1
                      }
                    ],
                    "payments": [],
                    "created_at": "2026-08-30T08:00:00+0000",
                    "updated_at": "2026-08-30T08:00:00+0000"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "end": "2026-11-03T10:00:00+05:00",
                "notes": "Продлили на сутки"
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Аренды"
        ],
        "summary": "Удалить аренду",
        "description": "Удаляет аренду, как кнопка «Удалить» на сайте: бонусные движения по ней отменяются, инвентарь освобождается. Если нужно сохранить историю, используйте «Отменить аренду».",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Идентификатор (поле `id` из ответов API): аренда",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Успех, тела нет"
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        }
      }
    },
    "/rents/{id}/comments": {
      "get": {
        "tags": [
          "Аренды"
        ],
        "summary": "Комментарии аренды",
        "description": "Лента комментариев к аренде.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Идентификатор (поле `id` из ответов API): записи",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": [
                    {
                      "id": 1,
                      "text": "Клиент просил позвонить за час",
                      "author": "admin",
                      "created_at": "2026-09-01T05:10:00+0000"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        }
      },
      "post": {
        "tags": [
          "Аренды"
        ],
        "summary": "Добавить комментарий",
        "description": "Добавляет комментарий к аренде от имени пользователя токена. Возвращает ленту комментариев.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Идентификатор (поле `id` из ответов API): аренда",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": [
                    {
                      "id": 1,
                      "text": "Клиент просил позвонить за час",
                      "author": "admin",
                      "created_at": "2026-09-01T05:10:00+0000"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "text": "Клиент просил позвонить за час"
              }
            }
          }
        }
      }
    },
    "/rents/{id}/cancel": {
      "post": {
        "tags": [
          "Аренды"
        ],
        "summary": "Отменить аренду",
        "description": "Отменяет аренду и освобождает инвентарь. Повторная отмена — 409 `CONFLICT`.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Идентификатор (поле `id` из ответов API): аренда",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": 81,
                    "number": "81",
                    "status": "active",
                    "customer": {
                      "id": 1,
                      "fio": "Иванов Иван",
                      "phone": "+7 (900) 123-45-67"
                    },
                    "point": {
                      "id": 1,
                      "name": "Центр"
                    },
                    "start_date": "2026-09-01",
                    "start_time": "10:00:00",
                    "end_date": "2026-09-02",
                    "end_time": "10:00:00",
                    "total_price": "500.00",
                    "discount_value": "0.00",
                    "discount_type": "percent",
                    "discount_scope": "rent",
                    "deposit_amount": "1000.00",
                    "deposit_paid": "0.00",
                    "deposit_returned": false,
                    "payment_status": "pending",
                    "paid": "0.00",
                    "delivery_type": "pickup",
                    "delivery_address": "",
                    "notes": "",
                    "items": [
                      {
                        "id": 90,
                        "item": {
                          "id": 5,
                          "title": "Велосипед 1"
                        },
                        "kit": null,
                        "quantity": 1,
                        "unit_price": "500.00",
                        "line_total": "500.00"
                      }
                    ],
                    "services": [
                      {
                        "id": 4,
                        "name": "Доставка",
                        "price": "300.00",
                        "quantity": 1
                      }
                    ],
                    "payments": [],
                    "created_at": "2026-08-30T08:00:00+0000",
                    "updated_at": "2026-08-30T08:00:00+0000"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        }
      }
    },
    "/rents/{id}/close": {
      "post": {
        "tags": [
          "Аренды"
        ],
        "summary": "Завершить аренду",
        "description": "Завершает прокат как кнопка «Завершить» на сайте: статус «выполнена», дата окончания — сегодня, инвентарь свободен. Уже закрытая — 409 `CONFLICT`.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Идентификатор (поле `id` из ответов API): аренда",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": 81,
                    "number": "81",
                    "status": "active",
                    "customer": {
                      "id": 1,
                      "fio": "Иванов Иван",
                      "phone": "+7 (900) 123-45-67"
                    },
                    "point": {
                      "id": 1,
                      "name": "Центр"
                    },
                    "start_date": "2026-09-01",
                    "start_time": "10:00:00",
                    "end_date": "2026-09-02",
                    "end_time": "10:00:00",
                    "total_price": "500.00",
                    "discount_value": "0.00",
                    "discount_type": "percent",
                    "discount_scope": "rent",
                    "deposit_amount": "1000.00",
                    "deposit_paid": "0.00",
                    "deposit_returned": false,
                    "payment_status": "pending",
                    "paid": "0.00",
                    "delivery_type": "pickup",
                    "delivery_address": "",
                    "notes": "",
                    "items": [
                      {
                        "id": 90,
                        "item": {
                          "id": 5,
                          "title": "Велосипед 1"
                        },
                        "kit": null,
                        "quantity": 1,
                        "unit_price": "500.00",
                        "line_total": "500.00"
                      }
                    ],
                    "services": [
                      {
                        "id": 4,
                        "name": "Доставка",
                        "price": "300.00",
                        "quantity": 1
                      }
                    ],
                    "payments": [],
                    "created_at": "2026-08-30T08:00:00+0000",
                    "updated_at": "2026-08-30T08:00:00+0000"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "notify": false
              }
            }
          }
        }
      }
    },
    "/rents/{id}/payments": {
      "get": {
        "tags": [
          "Оплаты"
        ],
        "summary": "История платежей аренды",
        "description": "Все платежи по аренде.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Идентификатор (поле `id` из ответов API): записи",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": [
                    {
                      "id": 12,
                      "purpose": "rental",
                      "amount": "500.00",
                      "method": "cash",
                      "payment_type": {
                        "id": 1,
                        "name": "Наличные"
                      },
                      "status": "success",
                      "note": "",
                      "paid_at": "2026-09-01T05:10:00+0000"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        }
      },
      "post": {
        "tags": [
          "Оплаты"
        ],
        "summary": "Принять оплату",
        "description": "Фиксирует платёж: оплату аренды, залог, возврат залога и т.д. Касса подбирается по способу оплаты и пункту проката, как на сайте; суммы и статус оплаты пересчитываются. Оплата аренды больше остатка — 422 `OVERPAYMENT`.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Идентификатор (поле `id` из ответов API): аренда",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": 81,
                    "number": "81",
                    "status": "active",
                    "customer": {
                      "id": 1,
                      "fio": "Иванов Иван",
                      "phone": "+7 (900) 123-45-67"
                    },
                    "point": {
                      "id": 1,
                      "name": "Центр"
                    },
                    "start_date": "2026-09-01",
                    "start_time": "10:00:00",
                    "end_date": "2026-09-02",
                    "end_time": "10:00:00",
                    "total_price": "500.00",
                    "discount_value": "0.00",
                    "discount_type": "percent",
                    "discount_scope": "rent",
                    "deposit_amount": "1000.00",
                    "deposit_paid": "0.00",
                    "deposit_returned": false,
                    "payment_status": "pending",
                    "paid": "0.00",
                    "delivery_type": "pickup",
                    "delivery_address": "",
                    "notes": "",
                    "items": [
                      {
                        "id": 90,
                        "item": {
                          "id": 5,
                          "title": "Велосипед 1"
                        },
                        "kit": null,
                        "quantity": 1,
                        "unit_price": "500.00",
                        "line_total": "500.00"
                      }
                    ],
                    "services": [
                      {
                        "id": 4,
                        "name": "Доставка",
                        "price": "300.00",
                        "quantity": 1
                      }
                    ],
                    "payments": [],
                    "created_at": "2026-08-30T08:00:00+0000",
                    "updated_at": "2026-08-30T08:00:00+0000"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "amount": "500",
                "purpose": "rental",
                "payment_type_id": 1
              }
            }
          }
        }
      }
    },
    "/webhooks": {
      "get": {
        "tags": [
          "Вебхуки"
        ],
        "summary": "Список вебхуков",
        "description": "Подписки организации на события. Секрет в списке не показывается.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Номер страницы, с 1",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "description": "Размер страницы, 1…1000 (по умолчанию 10)",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "updated_since",
            "in": "query",
            "required": false,
            "description": "Только изменённые после этого момента, ISO 8601 со смещением",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": [
                    {
                      "id": 1,
                      "url": "https://example.com/hooks/allrent",
                      "events": [
                        "rent.created",
                        "payment.created"
                      ],
                      "description": "1С",
                      "is_active": true,
                      "consecutive_failures": 0,
                      "disabled_reason": "",
                      "created_at": "2026-09-01T05:10:00+0000",
                      "updated_at": "2026-09-01T05:10:00+0000"
                    }
                  ],
                  "links": {
                    "next": "/webhooks?page=2&per_page=10",
                    "prev": null
                  },
                  "meta": {
                    "current_page": 1,
                    "last_page": 3,
                    "per_page": 10,
                    "total": 25,
                    "version": "1.0"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        }
      },
      "post": {
        "tags": [
          "Вебхуки"
        ],
        "summary": "Создать вебхук",
        "description": "Создаёт подписку. В ответе единственный раз приходит `secret` — им подписываются запросы; сохраните его. Адрес только `https://` и публичный.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [],
        "responses": {
          "201": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": 1,
                    "url": "https://example.com/hooks/allrent",
                    "events": [
                      "rent.created",
                      "payment.created"
                    ],
                    "description": "1С",
                    "is_active": true,
                    "consecutive_failures": 0,
                    "disabled_reason": "",
                    "created_at": "2026-09-01T05:10:00+0000",
                    "updated_at": "2026-09-01T05:10:00+0000",
                    "secret": "whsec_..."
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "url": "https://example.com/hooks/allrent",
                "events": [
                  "rent.created",
                  "payment.created"
                ],
                "description": "1С"
              }
            }
          }
        }
      }
    },
    "/webhooks/{id}": {
      "get": {
        "tags": [
          "Вебхуки"
        ],
        "summary": "Получить вебхук",
        "description": "Один вебхук: адрес, события, состояние (`consecutive_failures`, `disabled_reason`).",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Идентификатор (поле `id` из ответов API): вебхука",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": 1,
                    "url": "https://example.com/hooks/allrent",
                    "events": [
                      "rent.created",
                      "payment.created"
                    ],
                    "description": "1С",
                    "is_active": true,
                    "consecutive_failures": 0,
                    "disabled_reason": "",
                    "created_at": "2026-09-01T05:10:00+0000",
                    "updated_at": "2026-09-01T05:10:00+0000"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        }
      },
      "patch": {
        "tags": [
          "Вебхуки"
        ],
        "summary": "Изменить вебхук",
        "description": "Меняет адрес, события или описание. `\"is_active\": true` включает отключённый вебхук и сбрасывает счётчик неудач.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Идентификатор (поле `id` из ответов API): вебхук",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": 1,
                    "url": "https://example.com/hooks/allrent",
                    "events": [
                      "rent.created",
                      "payment.created"
                    ],
                    "description": "1С",
                    "is_active": true,
                    "consecutive_failures": 0,
                    "disabled_reason": "",
                    "created_at": "2026-09-01T05:10:00+0000",
                    "updated_at": "2026-09-01T05:10:00+0000"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "events": [
                  "*"
                ]
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Вебхуки"
        ],
        "summary": "Удалить вебхук",
        "description": "Удаляет подписку. События в очереди для неё больше не отправляются.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Идентификатор (поле `id` из ответов API): вебхук",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Успех, тела нет"
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        }
      }
    },
    "/webhooks/{id}/test": {
      "post": {
        "tags": [
          "Вебхуки"
        ],
        "summary": "Проверить вебхук",
        "description": "Сразу отправляет событие `ping` на адрес и возвращает результат: код ответа вашего сервера и ошибку, если она была.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Идентификатор (поле `id` из ответов API): вебхук",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": "0b1f5c3e-6a0b-4b8c-9d6a-2d8f2f4a0e11",
                    "event": "rent.created",
                    "status": "success",
                    "attempts": 1,
                    "response_code": 200,
                    "error": "",
                    "response": "ok",
                    "next_attempt_at": null,
                    "created_at": "2026-09-01T05:10:00+0000",
                    "delivered_at": "2026-09-01T05:10:30+0000"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        }
      }
    },
    "/webhooks/{id}/rotate-secret": {
      "post": {
        "tags": [
          "Вебхуки"
        ],
        "summary": "Новый секрет",
        "description": "Выпускает новый секрет подписи (старый перестаёт работать); показывается один раз.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Идентификатор (поле `id` из ответов API): вебхук",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": 1,
                    "url": "https://example.com/hooks/allrent",
                    "events": [
                      "rent.created",
                      "payment.created"
                    ],
                    "description": "1С",
                    "is_active": true,
                    "consecutive_failures": 0,
                    "disabled_reason": "",
                    "created_at": "2026-09-01T05:10:00+0000",
                    "updated_at": "2026-09-01T05:10:00+0000",
                    "secret": "whsec_..."
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        }
      }
    },
    "/webhooks/{id}/deliveries": {
      "get": {
        "tags": [
          "Вебхуки"
        ],
        "summary": "Журнал доставок",
        "description": "Последние 50 доставок: статус, число попыток, код ответа, ошибка.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Идентификатор (поле `id` из ответов API): вебхука",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": [
                    {
                      "id": "0b1f5c3e-6a0b-4b8c-9d6a-2d8f2f4a0e11",
                      "event": "rent.created",
                      "status": "success",
                      "attempts": 1,
                      "response_code": 200,
                      "error": "",
                      "response": "ok",
                      "next_attempt_at": null,
                      "created_at": "2026-09-01T05:10:00+0000",
                      "delivered_at": "2026-09-01T05:10:30+0000"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        }
      }
    },
    "/expenses": {
      "get": {
        "tags": [
          "Расходы"
        ],
        "summary": "Список расходов",
        "description": "Расходы организации. Период — `period_from`, `period_to` (даты ГГГГ-ММ-ДД).",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Номер страницы, с 1",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "description": "Размер страницы, 1…1000 (по умолчанию 10)",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "updated_since",
            "in": "query",
            "required": false,
            "description": "Только изменённые после этого момента, ISO 8601 со смещением",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Поиск по подстроке",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "period_from",
            "in": "query",
            "required": false,
            "description": "С даты, ГГГГ-ММ-ДД",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "period_to",
            "in": "query",
            "required": false,
            "description": "По дату включительно",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "category",
            "in": "query",
            "required": false,
            "description": "Идентификатор категории",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "point_id",
            "in": "query",
            "required": false,
            "description": "Идентификатор пункта проката",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": [
                    {
                      "id": 12,
                      "category": {
                        "id": 3,
                        "name": "Хозяйственные нужды"
                      },
                      "amount": "1500.00",
                      "description": "Замена цепи",
                      "date": "2026-09-01",
                      "time": "12:30:00",
                      "point": {
                        "id": 1,
                        "name": "Центр"
                      },
                      "cash_account": {
                        "id": 2,
                        "name": "Касса Центр"
                      },
                      "order": null,
                      "created_by": "admin",
                      "updated_at": "2026-09-01T07:31:00+0000"
                    }
                  ],
                  "links": {
                    "next": "/expenses?page=2&per_page=10",
                    "prev": null
                  },
                  "meta": {
                    "current_page": 1,
                    "last_page": 3,
                    "per_page": 10,
                    "total": 25,
                    "version": "1.0"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        }
      },
      "post": {
        "tags": [
          "Расходы"
        ],
        "summary": "Создать расход",
        "description": "Записывает расход. Если касса не указана, она подбирается по пункту проката, как на сайте (неоднозначно — расход без кассы). Остаток кассы уменьшается на сумму расхода.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [],
        "responses": {
          "201": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": 12,
                    "category": {
                      "id": 3,
                      "name": "Хозяйственные нужды"
                    },
                    "amount": "1500.00",
                    "description": "Замена цепи",
                    "date": "2026-09-01",
                    "time": "12:30:00",
                    "point": {
                      "id": 1,
                      "name": "Центр"
                    },
                    "cash_account": {
                      "id": 2,
                      "name": "Касса Центр"
                    },
                    "order": null,
                    "created_by": "admin",
                    "updated_at": "2026-09-01T07:31:00+0000"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "category_id": 3,
                "amount": "1500",
                "date": "2026-09-01",
                "description": "Замена цепи",
                "point_id": 1
              }
            }
          }
        }
      }
    },
    "/expenses/{id}": {
      "get": {
        "tags": [
          "Расходы"
        ],
        "summary": "Получить расход",
        "description": "Один расход.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Идентификатор (поле `id` из ответов API): расхода",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": 12,
                    "category": {
                      "id": 3,
                      "name": "Хозяйственные нужды"
                    },
                    "amount": "1500.00",
                    "description": "Замена цепи",
                    "date": "2026-09-01",
                    "time": "12:30:00",
                    "point": {
                      "id": 1,
                      "name": "Центр"
                    },
                    "cash_account": {
                      "id": 2,
                      "name": "Касса Центр"
                    },
                    "order": null,
                    "created_by": "admin",
                    "updated_at": "2026-09-01T07:31:00+0000"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        }
      },
      "patch": {
        "tags": [
          "Расходы"
        ],
        "summary": "Изменить расход",
        "description": "Частичное изменение. `\"cash_account_id\": null` убирает привязку к кассе.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Идентификатор (поле `id` из ответов API): расход",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": 12,
                    "category": {
                      "id": 3,
                      "name": "Хозяйственные нужды"
                    },
                    "amount": "1500.00",
                    "description": "Замена цепи",
                    "date": "2026-09-01",
                    "time": "12:30:00",
                    "point": {
                      "id": 1,
                      "name": "Центр"
                    },
                    "cash_account": {
                      "id": 2,
                      "name": "Касса Центр"
                    },
                    "order": null,
                    "created_by": "admin",
                    "updated_at": "2026-09-01T07:31:00+0000"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "amount": "1600"
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Расходы"
        ],
        "summary": "Удалить расход",
        "description": "Удаляет расход; остаток кассы пересчитывается.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Идентификатор (поле `id` из ответов API): расход",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Успех, тела нет"
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        }
      }
    },
    "/expense-categories": {
      "get": {
        "tags": [
          "Расходы"
        ],
        "summary": "Категории расходов",
        "description": "Справочник категорий расходов.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Номер страницы, с 1",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "description": "Размер страницы, 1…1000 (по умолчанию 10)",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "updated_since",
            "in": "query",
            "required": false,
            "description": "Только изменённые после этого момента, ISO 8601 со смещением",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Поиск по подстроке",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": [
                    {
                      "id": 3,
                      "name": "Хозяйственные нужды",
                      "updated_at": "2026-08-01T00:00:00+0000"
                    }
                  ],
                  "links": {
                    "next": "/expense-categories?page=2&per_page=10",
                    "prev": null
                  },
                  "meta": {
                    "current_page": 1,
                    "last_page": 3,
                    "per_page": 10,
                    "total": 25,
                    "version": "1.0"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        }
      },
      "post": {
        "tags": [
          "Расходы"
        ],
        "summary": "Создать категорию расходов",
        "description": "Создаёт категорию.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [],
        "responses": {
          "201": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": 3,
                    "name": "Хозяйственные нужды",
                    "updated_at": "2026-08-01T00:00:00+0000"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "name": "Хозяйственные нужды"
              }
            }
          }
        }
      }
    },
    "/expense-categories/{id}": {
      "get": {
        "tags": [
          "Расходы"
        ],
        "summary": "Категория расходов",
        "description": "Одна категория.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Идентификатор (поле `id` из ответов API): категории",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": 3,
                    "name": "Хозяйственные нужды",
                    "updated_at": "2026-08-01T00:00:00+0000"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        }
      },
      "patch": {
        "tags": [
          "Расходы"
        ],
        "summary": "Изменить категорию расходов",
        "description": "Переименование.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Идентификатор (поле `id` из ответов API): категория",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": 3,
                    "name": "Хозяйственные нужды",
                    "updated_at": "2026-08-01T00:00:00+0000"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "name": "Хозяйственные"
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Расходы"
        ],
        "summary": "Удалить категорию расходов",
        "description": "Нельзя, если есть расходы этой категории (409 `HAS_DEPENDENCIES`).",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Идентификатор (поле `id` из ответов API): категория",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Успех, тела нет"
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        }
      }
    },
    "/cash-accounts": {
      "get": {
        "tags": [
          "Кассы"
        ],
        "summary": "Список касс",
        "description": "Кассы, доступные пользователю токена. `balance` — остаток (считается из движений); если у пользователя нет права видеть остатки, там `null`. `active=1` — только активные.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Номер страницы, с 1",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "description": "Размер страницы, 1…1000 (по умолчанию 10)",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "updated_since",
            "in": "query",
            "required": false,
            "description": "Только изменённые после этого момента, ISO 8601 со смещением",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Поиск по подстроке",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "active",
            "in": "query",
            "required": false,
            "description": "1 — только активные",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": [
                    {
                      "id": 2,
                      "name": "Касса Центр",
                      "kind": "cash",
                      "point": {
                        "id": 1,
                        "name": "Центр"
                      },
                      "is_active": true,
                      "balance": "25400.00",
                      "updated_at": "2026-08-01T00:00:00+0000"
                    }
                  ],
                  "links": {
                    "next": "/cash-accounts?page=2&per_page=10",
                    "prev": null
                  },
                  "meta": {
                    "current_page": 1,
                    "last_page": 3,
                    "per_page": 10,
                    "total": 25,
                    "version": "1.0"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        }
      }
    },
    "/cash-accounts/{id}": {
      "get": {
        "tags": [
          "Кассы"
        ],
        "summary": "Получить кассу",
        "description": "Одна касса с остатком.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Идентификатор (поле `id` из ответов API): кассы",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": 2,
                    "name": "Касса Центр",
                    "kind": "cash",
                    "point": {
                      "id": 1,
                      "name": "Центр"
                    },
                    "is_active": true,
                    "balance": "25400.00",
                    "updated_at": "2026-08-01T00:00:00+0000"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        }
      }
    },
    "/cash-accounts/{id}/movements": {
      "get": {
        "tags": [
          "Кассы"
        ],
        "summary": "Движения по кассе",
        "description": "Лента движений: оплаты аренд (возврат залога — со знаком минус), продажи, ремонты, расходы, внесения, изъятия и перемещения. По умолчанию последние 30 дней.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Идентификатор (поле `id` из ответов API): кассы",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "description": "С даты, ГГГГ-ММ-ДД",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "description": "По дату включительно",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Сколько записей вернуть, до 2000 (по умолчанию 500)",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": [
                    {
                      "date": "2026-09-01",
                      "time": "12:30:00",
                      "kind": "Аренда",
                      "title": "Аренда по аренде №A-81",
                      "client": "Иванов Иван",
                      "employee": "",
                      "point": "Центр",
                      "payment_type": "Наличные",
                      "description": "",
                      "amount": "500.00"
                    }
                  ],
                  "meta": {
                    "total": 1,
                    "from": "2026-08-02",
                    "to": "2026-09-01"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        }
      }
    },
    "/cash-transactions": {
      "get": {
        "tags": [
          "Кассы"
        ],
        "summary": "Операции по кассам",
        "description": "Внесения, изъятия и перемещения между кассами.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Номер страницы, с 1",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "description": "Размер страницы, 1…1000 (по умолчанию 10)",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "updated_since",
            "in": "query",
            "required": false,
            "description": "Только изменённые после этого момента, ISO 8601 со смещением",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "account_id",
            "in": "query",
            "required": false,
            "description": "Касса",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "operation",
            "in": "query",
            "required": false,
            "description": "income, outcome, transfer",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "period_from",
            "in": "query",
            "required": false,
            "description": "С даты",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "period_to",
            "in": "query",
            "required": false,
            "description": "По дату",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": [
                    {
                      "id": 7,
                      "operation": "income",
                      "account": {
                        "id": 2,
                        "name": "Касса Центр"
                      },
                      "target_account": null,
                      "amount": "5000.00",
                      "date": "2026-09-01",
                      "time": null,
                      "note": "Разменные деньги",
                      "created_by": "admin",
                      "updated_at": "2026-09-01T07:31:00+0000"
                    }
                  ],
                  "links": {
                    "next": "/cash-transactions?page=2&per_page=10",
                    "prev": null
                  },
                  "meta": {
                    "current_page": 1,
                    "last_page": 3,
                    "per_page": 10,
                    "total": 25,
                    "version": "1.0"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        }
      },
      "post": {
        "tags": [
          "Кассы"
        ],
        "summary": "Создать операцию по кассе",
        "description": "Внесение, изъятие или перемещение между кассами (для перемещения нужна `target_account_id`). Касса должна быть доступна пользователю токена. Операции не редактируются: ошибочную удалите и создайте заново.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [],
        "responses": {
          "201": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": 7,
                    "operation": "income",
                    "account": {
                      "id": 2,
                      "name": "Касса Центр"
                    },
                    "target_account": null,
                    "amount": "5000.00",
                    "date": "2026-09-01",
                    "time": null,
                    "note": "Разменные деньги",
                    "created_by": "admin",
                    "updated_at": "2026-09-01T07:31:00+0000"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "operation": "income",
                "account_id": 2,
                "amount": "5000",
                "note": "Разменные деньги"
              }
            }
          }
        }
      }
    },
    "/cash-transactions/{id}": {
      "get": {
        "tags": [
          "Кассы"
        ],
        "summary": "Получить операцию",
        "description": "Одна операция.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Идентификатор (поле `id` из ответов API): операции",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": 7,
                    "operation": "income",
                    "account": {
                      "id": 2,
                      "name": "Касса Центр"
                    },
                    "target_account": null,
                    "amount": "5000.00",
                    "date": "2026-09-01",
                    "time": null,
                    "note": "Разменные деньги",
                    "created_by": "admin",
                    "updated_at": "2026-09-01T07:31:00+0000"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        }
      },
      "delete": {
        "tags": [
          "Кассы"
        ],
        "summary": "Удалить операцию по кассе",
        "description": "Удаляет операцию; остатки касс пересчитываются.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Идентификатор (поле `id` из ответов API): операции",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Успех, тела нет"
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        }
      }
    },
    "/product-categories": {
      "get": {
        "tags": [
          "Магазин"
        ],
        "summary": "Список категорий товаров",
        "description": "Категории товаров для продажи.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Номер страницы, с 1",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "description": "Размер страницы, 1…1000 (по умолчанию 10)",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "updated_since",
            "in": "query",
            "required": false,
            "description": "Только изменённые после этого момента, ISO 8601 со смещением",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Поиск по подстроке",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": [
                    {
                      "id": 2,
                      "name": "Аксессуары",
                      "parent": null,
                      "sort_order": 0,
                      "updated_at": "2026-09-01T07:31:00+0000"
                    }
                  ],
                  "links": {
                    "next": "/product-categories?page=2&per_page=10",
                    "prev": null
                  },
                  "meta": {
                    "current_page": 1,
                    "last_page": 3,
                    "per_page": 10,
                    "total": 25,
                    "version": "1.0"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        }
      },
      "post": {
        "tags": [
          "Магазин"
        ],
        "summary": "Создать категорию товаров",
        "description": "Создаёт категорию; `parent_id` — вложенность.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [],
        "responses": {
          "201": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": 2,
                    "name": "Аксессуары",
                    "parent": null,
                    "sort_order": 0,
                    "updated_at": "2026-09-01T07:31:00+0000"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "name": "Аксессуары"
              }
            }
          }
        }
      }
    },
    "/product-categories/{id}": {
      "get": {
        "tags": [
          "Магазин"
        ],
        "summary": "Получить категорию товаров",
        "description": "Одна категория.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Идентификатор (поле `id` из ответов API): категории",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": 2,
                    "name": "Аксессуары",
                    "parent": null,
                    "sort_order": 0,
                    "updated_at": "2026-09-01T07:31:00+0000"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        }
      },
      "patch": {
        "tags": [
          "Магазин"
        ],
        "summary": "Изменить категорию товаров",
        "description": "Меняет только переданные поля.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Идентификатор (поле `id` из ответов API): категории",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": 2,
                    "name": "Аксессуары",
                    "parent": null,
                    "sort_order": 0,
                    "updated_at": "2026-09-01T07:31:00+0000"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "name": "Экипировка"
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Магазин"
        ],
        "summary": "Удалить категорию товаров",
        "description": "Нельзя удалить категорию с вложенными категориями или товарами (409 `HAS_DEPENDENCIES`).",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Идентификатор (поле `id` из ответов API): категории",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Успех, тела нет"
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        }
      }
    },
    "/products": {
      "get": {
        "tags": [
          "Магазин"
        ],
        "summary": "Список товаров",
        "description": "Товары для продажи с остатками.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Номер страницы, с 1",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "description": "Размер страницы, 1…1000 (по умолчанию 10)",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "updated_since",
            "in": "query",
            "required": false,
            "description": "Только изменённые после этого момента, ISO 8601 со смещением",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Поиск по подстроке",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "category",
            "in": "query",
            "required": false,
            "description": "Категория",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "active",
            "in": "query",
            "required": false,
            "description": "1 — только активные",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "in_stock",
            "in": "query",
            "required": false,
            "description": "1 — только с остатком",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": [
                    {
                      "id": 5,
                      "number": 5,
                      "name": "Шлем",
                      "description": "",
                      "article": "SH-1",
                      "price": "1500.00",
                      "purchase_price": "900.00",
                      "quantity": 12,
                      "is_active": true,
                      "category": {
                        "id": 2,
                        "name": "Аксессуары"
                      },
                      "points": [
                        {
                          "id": 1,
                          "name": "Центр"
                        }
                      ],
                      "updated_at": "2026-09-01T07:31:00+0000"
                    }
                  ],
                  "links": {
                    "next": "/products?page=2&per_page=10",
                    "prev": null
                  },
                  "meta": {
                    "current_page": 1,
                    "last_page": 3,
                    "per_page": 10,
                    "total": 25,
                    "version": "1.0"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        }
      },
      "post": {
        "tags": [
          "Магазин"
        ],
        "summary": "Создать товар",
        "description": "Создаёт товар для продажи.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [],
        "responses": {
          "201": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": 5,
                    "number": 5,
                    "name": "Шлем",
                    "description": "",
                    "article": "SH-1",
                    "price": "1500.00",
                    "purchase_price": "900.00",
                    "quantity": 12,
                    "is_active": true,
                    "category": {
                      "id": 2,
                      "name": "Аксессуары"
                    },
                    "points": [
                      {
                        "id": 1,
                        "name": "Центр"
                      }
                    ],
                    "updated_at": "2026-09-01T07:31:00+0000"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "name": "Шлем",
                "price": "1500",
                "quantity": 12
              }
            }
          }
        }
      }
    },
    "/products/{id}": {
      "get": {
        "tags": [
          "Магазин"
        ],
        "summary": "Получить товар",
        "description": "Один товар.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Идентификатор (поле `id` из ответов API): товара",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": 5,
                    "number": 5,
                    "name": "Шлем",
                    "description": "",
                    "article": "SH-1",
                    "price": "1500.00",
                    "purchase_price": "900.00",
                    "quantity": 12,
                    "is_active": true,
                    "category": {
                      "id": 2,
                      "name": "Аксессуары"
                    },
                    "points": [
                      {
                        "id": 1,
                        "name": "Центр"
                      }
                    ],
                    "updated_at": "2026-09-01T07:31:00+0000"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        }
      },
      "patch": {
        "tags": [
          "Магазин"
        ],
        "summary": "Изменить товар магазина",
        "description": "Меняет только переданные поля.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Идентификатор (поле `id` из ответов API): товара",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": 5,
                    "number": 5,
                    "name": "Шлем",
                    "description": "",
                    "article": "SH-1",
                    "price": "1500.00",
                    "purchase_price": "900.00",
                    "quantity": 12,
                    "is_active": true,
                    "category": {
                      "id": 2,
                      "name": "Аксессуары"
                    },
                    "points": [
                      {
                        "id": 1,
                        "name": "Центр"
                      }
                    ],
                    "updated_at": "2026-09-01T07:31:00+0000"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "price": "1600"
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Магазин"
        ],
        "summary": "Удалить товар магазина",
        "description": "Удаляет товар (мягко, прошлые продажи сохраняются).",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Идентификатор (поле `id` из ответов API): товара",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Успех, тела нет"
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        }
      }
    },
    "/sales": {
      "get": {
        "tags": [
          "Магазин"
        ],
        "summary": "Список продаж",
        "description": "Продажи товаров.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Номер страницы, с 1",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "description": "Размер страницы, 1…1000 (по умолчанию 10)",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "updated_since",
            "in": "query",
            "required": false,
            "description": "Только изменённые после этого момента, ISO 8601 со смещением",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "customer_id",
            "in": "query",
            "required": false,
            "description": "Клиент",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "payment_status",
            "in": "query",
            "required": false,
            "description": "pending, partial, paid",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "period_from",
            "in": "query",
            "required": false,
            "description": "С даты",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "period_to",
            "in": "query",
            "required": false,
            "description": "По дату",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": [
                    {
                      "id": 9,
                      "number": 9,
                      "customer": {
                        "id": 1,
                        "fio": "Иванов Иван"
                      },
                      "point": {
                        "id": 1,
                        "name": "Центр"
                      },
                      "employee": null,
                      "total_price": "3000.00",
                      "payment_status": "partial",
                      "payment_amount": "1000.00",
                      "payment_type": {
                        "id": 1,
                        "name": "Наличные"
                      },
                      "cash_account": {
                        "id": 2,
                        "name": "Касса Центр"
                      },
                      "comment": "",
                      "items": [
                        {
                          "product": {
                            "id": 5,
                            "name": "Шлем"
                          },
                          "quantity": 2,
                          "unit_price": "1500.00"
                        }
                      ],
                      "created_at": "2026-09-01T12:30:00+0000",
                      "updated_at": "2026-09-01T12:30:00+0000"
                    }
                  ],
                  "links": {
                    "next": "/sales?page=2&per_page=10",
                    "prev": null
                  },
                  "meta": {
                    "current_page": 1,
                    "last_page": 3,
                    "per_page": 10,
                    "total": 25,
                    "version": "1.0"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        }
      },
      "post": {
        "tags": [
          "Магазин"
        ],
        "summary": "Создать продажу",
        "description": "Оформляет продажу: списывает остатки, применяет скидку клиента на товары, при `paid_amount` фиксирует оплату в кассе. Не хватает товара — 422 `OUT_OF_STOCK` с перечнем позиций. Продажи не редактируются (409): ошибочную удалите и создайте заново.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [],
        "responses": {
          "201": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": 9,
                    "number": 9,
                    "customer": {
                      "id": 1,
                      "fio": "Иванов Иван"
                    },
                    "point": {
                      "id": 1,
                      "name": "Центр"
                    },
                    "employee": null,
                    "total_price": "3000.00",
                    "payment_status": "partial",
                    "payment_amount": "1000.00",
                    "payment_type": {
                      "id": 1,
                      "name": "Наличные"
                    },
                    "cash_account": {
                      "id": 2,
                      "name": "Касса Центр"
                    },
                    "comment": "",
                    "items": [
                      {
                        "product": {
                          "id": 5,
                          "name": "Шлем"
                        },
                        "quantity": 2,
                        "unit_price": "1500.00"
                      }
                    ],
                    "created_at": "2026-09-01T12:30:00+0000",
                    "updated_at": "2026-09-01T12:30:00+0000"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "items": [
                  {
                    "product_id": 5,
                    "quantity": 2
                  }
                ],
                "customer_id": 1,
                "paid_amount": "1000",
                "payment_type_id": 1
              }
            }
          }
        }
      }
    },
    "/sales/{id}": {
      "get": {
        "tags": [
          "Магазин"
        ],
        "summary": "Получить продажу",
        "description": "Одна продажа.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Идентификатор (поле `id` из ответов API): продажи",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": 9,
                    "number": 9,
                    "customer": {
                      "id": 1,
                      "fio": "Иванов Иван"
                    },
                    "point": {
                      "id": 1,
                      "name": "Центр"
                    },
                    "employee": null,
                    "total_price": "3000.00",
                    "payment_status": "partial",
                    "payment_amount": "1000.00",
                    "payment_type": {
                      "id": 1,
                      "name": "Наличные"
                    },
                    "cash_account": {
                      "id": 2,
                      "name": "Касса Центр"
                    },
                    "comment": "",
                    "items": [
                      {
                        "product": {
                          "id": 5,
                          "name": "Шлем"
                        },
                        "quantity": 2,
                        "unit_price": "1500.00"
                      }
                    ],
                    "created_at": "2026-09-01T12:30:00+0000",
                    "updated_at": "2026-09-01T12:30:00+0000"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        }
      },
      "delete": {
        "tags": [
          "Магазин"
        ],
        "summary": "Удалить продажу",
        "description": "Удаляет продажу и возвращает товары на склад.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Идентификатор (поле `id` из ответов API): продажи",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Успех, тела нет"
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        }
      }
    },
    "/sales/{id}/payments": {
      "post": {
        "tags": [
          "Магазин"
        ],
        "summary": "Принять оплату по продаже",
        "description": "Доплата по продаже. Сумма больше остатка — 422 `OVERPAYMENT`.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Идентификатор (поле `id` из ответов API): продажи",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": 9,
                    "number": 9,
                    "customer": {
                      "id": 1,
                      "fio": "Иванов Иван"
                    },
                    "point": {
                      "id": 1,
                      "name": "Центр"
                    },
                    "employee": null,
                    "total_price": "3000.00",
                    "payment_status": "partial",
                    "payment_amount": "1000.00",
                    "payment_type": {
                      "id": 1,
                      "name": "Наличные"
                    },
                    "cash_account": {
                      "id": 2,
                      "name": "Касса Центр"
                    },
                    "comment": "",
                    "items": [
                      {
                        "product": {
                          "id": 5,
                          "name": "Шлем"
                        },
                        "quantity": 2,
                        "unit_price": "1500.00"
                      }
                    ],
                    "created_at": "2026-09-01T12:30:00+0000",
                    "updated_at": "2026-09-01T12:30:00+0000"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "amount": "2000",
                "payment_type_id": 1
              }
            }
          }
        }
      }
    },
    "/service-categories": {
      "get": {
        "tags": [
          "Сервис"
        ],
        "summary": "Список категорий услуг",
        "description": "Категории услуг ремонта.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Номер страницы, с 1",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "description": "Размер страницы, 1…1000 (по умолчанию 10)",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "updated_since",
            "in": "query",
            "required": false,
            "description": "Только изменённые после этого момента, ISO 8601 со смещением",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Поиск по подстроке",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": [
                    {
                      "id": 1,
                      "name": "Велосипеды",
                      "updated_at": "2026-09-01T07:31:00+0000"
                    }
                  ],
                  "links": {
                    "next": "/service-categories?page=2&per_page=10",
                    "prev": null
                  },
                  "meta": {
                    "current_page": 1,
                    "last_page": 3,
                    "per_page": 10,
                    "total": 25,
                    "version": "1.0"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        }
      },
      "post": {
        "tags": [
          "Сервис"
        ],
        "summary": "Создать категорию услуг",
        "description": "Создаёт категорию услуг.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [],
        "responses": {
          "201": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": 1,
                    "name": "Велосипеды",
                    "updated_at": "2026-09-01T07:31:00+0000"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "name": "Велосипеды"
              }
            }
          }
        }
      }
    },
    "/service-categories/{id}": {
      "get": {
        "tags": [
          "Сервис"
        ],
        "summary": "Получить категорию услуг",
        "description": "Одна категория.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Идентификатор (поле `id` из ответов API): категории",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": 1,
                    "name": "Велосипеды",
                    "updated_at": "2026-09-01T07:31:00+0000"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        }
      },
      "patch": {
        "tags": [
          "Сервис"
        ],
        "summary": "Изменить категорию услуг",
        "description": "Меняет название.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Идентификатор (поле `id` из ответов API): категории",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": 1,
                    "name": "Велосипеды",
                    "updated_at": "2026-09-01T07:31:00+0000"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "name": "Самокаты"
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Сервис"
        ],
        "summary": "Удалить категорию услуг",
        "description": "Нельзя удалить категорию, в которой есть услуги (409 `HAS_DEPENDENCIES`).",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Идентификатор (поле `id` из ответов API): категории",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Успех, тела нет"
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        }
      }
    },
    "/services": {
      "get": {
        "tags": [
          "Сервис"
        ],
        "summary": "Список услуг",
        "description": "Прайс услуг ремонта.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Номер страницы, с 1",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "description": "Размер страницы, 1…1000 (по умолчанию 10)",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "updated_since",
            "in": "query",
            "required": false,
            "description": "Только изменённые после этого момента, ISO 8601 со смещением",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Поиск по подстроке",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "category",
            "in": "query",
            "required": false,
            "description": "Категория",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": [
                    {
                      "id": 3,
                      "number": 3,
                      "name": "Замена цепи",
                      "price": "500.00",
                      "description": "",
                      "category": {
                        "id": 1,
                        "name": "Велосипеды"
                      },
                      "updated_at": "2026-09-01T07:31:00+0000"
                    }
                  ],
                  "links": {
                    "next": "/services?page=2&per_page=10",
                    "prev": null
                  },
                  "meta": {
                    "current_page": 1,
                    "last_page": 3,
                    "per_page": 10,
                    "total": 25,
                    "version": "1.0"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        }
      },
      "post": {
        "tags": [
          "Сервис"
        ],
        "summary": "Создать услугу",
        "description": "Создаёт услугу в прайсе.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [],
        "responses": {
          "201": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": 3,
                    "number": 3,
                    "name": "Замена цепи",
                    "price": "500.00",
                    "description": "",
                    "category": {
                      "id": 1,
                      "name": "Велосипеды"
                    },
                    "updated_at": "2026-09-01T07:31:00+0000"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "name": "Замена цепи",
                "price": "500"
              }
            }
          }
        }
      }
    },
    "/services/{id}": {
      "get": {
        "tags": [
          "Сервис"
        ],
        "summary": "Получить услугу",
        "description": "Одна услуга.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Идентификатор (поле `id` из ответов API): услуги",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": 3,
                    "number": 3,
                    "name": "Замена цепи",
                    "price": "500.00",
                    "description": "",
                    "category": {
                      "id": 1,
                      "name": "Велосипеды"
                    },
                    "updated_at": "2026-09-01T07:31:00+0000"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        }
      },
      "patch": {
        "tags": [
          "Сервис"
        ],
        "summary": "Изменить услугу",
        "description": "Меняет только переданные поля.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Идентификатор (поле `id` из ответов API): услуги",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": 3,
                    "number": 3,
                    "name": "Замена цепи",
                    "price": "500.00",
                    "description": "",
                    "category": {
                      "id": 1,
                      "name": "Велосипеды"
                    },
                    "updated_at": "2026-09-01T07:31:00+0000"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "price": "600"
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Сервис"
        ],
        "summary": "Удалить услугу",
        "description": "Нельзя удалить услугу, которая используется в заказах на ремонт (409 `HAS_DEPENDENCIES`).",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Идентификатор (поле `id` из ответов API): услуги",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Успех, тела нет"
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        }
      }
    },
    "/repairs": {
      "get": {
        "tags": [
          "Сервис"
        ],
        "summary": "Список ремонтов",
        "description": "Заказы на ремонт. Номер из интерфейса — фильтром `number`.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Номер страницы, с 1",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "description": "Размер страницы, 1…1000 (по умолчанию 10)",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "updated_since",
            "in": "query",
            "required": false,
            "description": "Только изменённые после этого момента, ISO 8601 со смещением",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "new, in_progress, done, closed",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "customer_id",
            "in": "query",
            "required": false,
            "description": "Клиент",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "payment_status",
            "in": "query",
            "required": false,
            "description": "pending, partial, paid",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "number",
            "in": "query",
            "required": false,
            "description": "Номер ремонта как в интерфейсе",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": [
                    {
                      "id": 4,
                      "number": 4,
                      "customer": {
                        "id": 1,
                        "fio": "Иванов Иван"
                      },
                      "item_name": "Велосипед Stels",
                      "item_details": "SN123",
                      "description": "Не крутятся педали",
                      "comment": "",
                      "status": "in_progress",
                      "due_date": "2026-09-05",
                      "total_price": "1300.00",
                      "payment_status": "partial",
                      "payment_amount": "500.00",
                      "payment_type": {
                        "id": 1,
                        "name": "Наличные"
                      },
                      "cash_account": {
                        "id": 2,
                        "name": "Касса Центр"
                      },
                      "point": {
                        "id": 1,
                        "name": "Центр"
                      },
                      "employee": null,
                      "services": [
                        {
                          "service": {
                            "id": 3,
                            "name": "Замена цепи"
                          },
                          "price": "500.00"
                        }
                      ],
                      "products": [
                        {
                          "product": {
                            "id": 5,
                            "name": "Цепь"
                          },
                          "quantity": 1,
                          "price": "800.00"
                        }
                      ],
                      "created_at": "2026-09-01T12:30:00+0000",
                      "updated_at": "2026-09-01T12:30:00+0000"
                    }
                  ],
                  "links": {
                    "next": "/repairs?page=2&per_page=10",
                    "prev": null
                  },
                  "meta": {
                    "current_page": 1,
                    "last_page": 3,
                    "per_page": 10,
                    "total": 25,
                    "version": "1.0"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        }
      },
      "post": {
        "tags": [
          "Сервис"
        ],
        "summary": "Создать ремонт",
        "description": "Создаёт заказ на ремонт. Стоимость считает сервер: услуги по прайсу (или переданной `price`) плюс товары со скидкой клиента на товары. Не хватает товара — 422 `OUT_OF_STOCK` (как и на сайте, остаток при ремонте не списывается). `paid_amount` фиксирует оплату в кассе.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [],
        "responses": {
          "201": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": 4,
                    "number": 4,
                    "customer": {
                      "id": 1,
                      "fio": "Иванов Иван"
                    },
                    "item_name": "Велосипед Stels",
                    "item_details": "SN123",
                    "description": "Не крутятся педали",
                    "comment": "",
                    "status": "in_progress",
                    "due_date": "2026-09-05",
                    "total_price": "1300.00",
                    "payment_status": "partial",
                    "payment_amount": "500.00",
                    "payment_type": {
                      "id": 1,
                      "name": "Наличные"
                    },
                    "cash_account": {
                      "id": 2,
                      "name": "Касса Центр"
                    },
                    "point": {
                      "id": 1,
                      "name": "Центр"
                    },
                    "employee": null,
                    "services": [
                      {
                        "service": {
                          "id": 3,
                          "name": "Замена цепи"
                        },
                        "price": "500.00"
                      }
                    ],
                    "products": [
                      {
                        "product": {
                          "id": 5,
                          "name": "Цепь"
                        },
                        "quantity": 1,
                        "price": "800.00"
                      }
                    ],
                    "created_at": "2026-09-01T12:30:00+0000",
                    "updated_at": "2026-09-01T12:30:00+0000"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "customer_id": 1,
                "item_name": "Велосипед Stels",
                "description": "Не крутятся педали",
                "due_date": "2026-09-05",
                "services": [
                  {
                    "service_id": 3
                  }
                ],
                "products": [
                  {
                    "product_id": 5,
                    "quantity": 1
                  }
                ],
                "paid_amount": "500"
              }
            }
          }
        }
      }
    },
    "/repairs/{id}": {
      "get": {
        "tags": [
          "Сервис"
        ],
        "summary": "Получить ремонт",
        "description": "Один заказ на ремонт с услугами и товарами.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Идентификатор (поле `id` из ответов API): ремонта",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": 4,
                    "number": 4,
                    "customer": {
                      "id": 1,
                      "fio": "Иванов Иван"
                    },
                    "item_name": "Велосипед Stels",
                    "item_details": "SN123",
                    "description": "Не крутятся педали",
                    "comment": "",
                    "status": "in_progress",
                    "due_date": "2026-09-05",
                    "total_price": "1300.00",
                    "payment_status": "partial",
                    "payment_amount": "500.00",
                    "payment_type": {
                      "id": 1,
                      "name": "Наличные"
                    },
                    "cash_account": {
                      "id": 2,
                      "name": "Касса Центр"
                    },
                    "point": {
                      "id": 1,
                      "name": "Центр"
                    },
                    "employee": null,
                    "services": [
                      {
                        "service": {
                          "id": 3,
                          "name": "Замена цепи"
                        },
                        "price": "500.00"
                      }
                    ],
                    "products": [
                      {
                        "product": {
                          "id": 5,
                          "name": "Цепь"
                        },
                        "quantity": 1,
                        "price": "800.00"
                      }
                    ],
                    "created_at": "2026-09-01T12:30:00+0000",
                    "updated_at": "2026-09-01T12:30:00+0000"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        }
      },
      "patch": {
        "tags": [
          "Сервис"
        ],
        "summary": "Изменить ремонт",
        "description": "Меняет только переданные поля. Если передан `services` или `products`, этот список заменяется целиком, а итог пересчитывается; второй список остаётся как был. Оплата меняется только через `/repairs/{id}/payments`.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Идентификатор (поле `id` из ответов API): ремонта",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": 4,
                    "number": 4,
                    "customer": {
                      "id": 1,
                      "fio": "Иванов Иван"
                    },
                    "item_name": "Велосипед Stels",
                    "item_details": "SN123",
                    "description": "Не крутятся педали",
                    "comment": "",
                    "status": "in_progress",
                    "due_date": "2026-09-05",
                    "total_price": "1300.00",
                    "payment_status": "partial",
                    "payment_amount": "500.00",
                    "payment_type": {
                      "id": 1,
                      "name": "Наличные"
                    },
                    "cash_account": {
                      "id": 2,
                      "name": "Касса Центр"
                    },
                    "point": {
                      "id": 1,
                      "name": "Центр"
                    },
                    "employee": null,
                    "services": [
                      {
                        "service": {
                          "id": 3,
                          "name": "Замена цепи"
                        },
                        "price": "500.00"
                      }
                    ],
                    "products": [
                      {
                        "product": {
                          "id": 5,
                          "name": "Цепь"
                        },
                        "quantity": 1,
                        "price": "800.00"
                      }
                    ],
                    "created_at": "2026-09-01T12:30:00+0000",
                    "updated_at": "2026-09-01T12:30:00+0000"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "status": "done"
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Сервис"
        ],
        "summary": "Удалить ремонт",
        "description": "Удаляет заказ на ремонт.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Идентификатор (поле `id` из ответов API): ремонта",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Успех, тела нет"
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        }
      }
    },
    "/repairs/{id}/payments": {
      "post": {
        "tags": [
          "Сервис"
        ],
        "summary": "Принять оплату по ремонту",
        "description": "Доплата по ремонту. Сумма больше остатка — 422 `OVERPAYMENT`.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Идентификатор (поле `id` из ответов API): ремонта",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": 4,
                    "number": 4,
                    "customer": {
                      "id": 1,
                      "fio": "Иванов Иван"
                    },
                    "item_name": "Велосипед Stels",
                    "item_details": "SN123",
                    "description": "Не крутятся педали",
                    "comment": "",
                    "status": "in_progress",
                    "due_date": "2026-09-05",
                    "total_price": "1300.00",
                    "payment_status": "partial",
                    "payment_amount": "500.00",
                    "payment_type": {
                      "id": 1,
                      "name": "Наличные"
                    },
                    "cash_account": {
                      "id": 2,
                      "name": "Касса Центр"
                    },
                    "point": {
                      "id": 1,
                      "name": "Центр"
                    },
                    "employee": null,
                    "services": [
                      {
                        "service": {
                          "id": 3,
                          "name": "Замена цепи"
                        },
                        "price": "500.00"
                      }
                    ],
                    "products": [
                      {
                        "product": {
                          "id": 5,
                          "name": "Цепь"
                        },
                        "quantity": 1,
                        "price": "800.00"
                      }
                    ],
                    "created_at": "2026-09-01T12:30:00+0000",
                    "updated_at": "2026-09-01T12:30:00+0000"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "amount": "800",
                "payment_type_id": 1
              }
            }
          }
        }
      }
    },
    "/employees": {
      "get": {
        "tags": [
          "Сотрудники"
        ],
        "summary": "Список сотрудников",
        "description": "Сотрудники организации. Паспортные данные через API не отдаются.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Номер страницы, с 1",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "description": "Размер страницы, 1…1000 (по умолчанию 10)",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "updated_since",
            "in": "query",
            "required": false,
            "description": "Только изменённые после этого момента, ISO 8601 со смещением",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Поиск по подстроке",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "active",
            "in": "query",
            "required": false,
            "description": "1 — только работающие",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "point_id",
            "in": "query",
            "required": false,
            "description": "Точка проката",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": [
                    {
                      "id": 2,
                      "full_name": "Петров Пётр",
                      "phone": "+79991112233",
                      "point": {
                        "id": 1,
                        "name": "Центр"
                      },
                      "salary_type": "fixed",
                      "salary": "2000.00",
                      "monthly_salary": "0.00",
                      "rental_percent": "0.00",
                      "repair_percent": "0.00",
                      "parts_percent": "0.00",
                      "schedule_template": "5/2",
                      "hire_date": "2026-01-10",
                      "is_active": true,
                      "fired_at": null,
                      "updated_at": "2026-09-01T07:31:00+0000"
                    }
                  ],
                  "links": {
                    "next": "/employees?page=2&per_page=10",
                    "prev": null
                  },
                  "meta": {
                    "current_page": 1,
                    "last_page": 3,
                    "per_page": 10,
                    "total": 25,
                    "version": "1.0"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        }
      },
      "post": {
        "tags": [
          "Сотрудники"
        ],
        "summary": "Создать сотрудника",
        "description": "Создаёт карточку сотрудника.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [],
        "responses": {
          "201": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": 2,
                    "full_name": "Петров Пётр",
                    "phone": "+79991112233",
                    "point": {
                      "id": 1,
                      "name": "Центр"
                    },
                    "salary_type": "fixed",
                    "salary": "2000.00",
                    "monthly_salary": "0.00",
                    "rental_percent": "0.00",
                    "repair_percent": "0.00",
                    "parts_percent": "0.00",
                    "schedule_template": "5/2",
                    "hire_date": "2026-01-10",
                    "is_active": true,
                    "fired_at": null,
                    "updated_at": "2026-09-01T07:31:00+0000"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "full_name": "Петров Пётр",
                "phone": "+79991112233",
                "point_id": 1,
                "salary": "2000"
              }
            }
          }
        }
      }
    },
    "/employees/{id}": {
      "get": {
        "tags": [
          "Сотрудники"
        ],
        "summary": "Получить сотрудника",
        "description": "Один сотрудник.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Идентификатор (поле `id` из ответов API): сотрудника",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": 2,
                    "full_name": "Петров Пётр",
                    "phone": "+79991112233",
                    "point": {
                      "id": 1,
                      "name": "Центр"
                    },
                    "salary_type": "fixed",
                    "salary": "2000.00",
                    "monthly_salary": "0.00",
                    "rental_percent": "0.00",
                    "repair_percent": "0.00",
                    "parts_percent": "0.00",
                    "schedule_template": "5/2",
                    "hire_date": "2026-01-10",
                    "is_active": true,
                    "fired_at": null,
                    "updated_at": "2026-09-01T07:31:00+0000"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        }
      },
      "patch": {
        "tags": [
          "Сотрудники"
        ],
        "summary": "Изменить сотрудника",
        "description": "Меняет только переданные поля. Сотрудников не удаляют: для увольнения передайте `is_active=false` и `fired_at`.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Идентификатор (поле `id` из ответов API): сотрудника",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": 2,
                    "full_name": "Петров Пётр",
                    "phone": "+79991112233",
                    "point": {
                      "id": 1,
                      "name": "Центр"
                    },
                    "salary_type": "fixed",
                    "salary": "2000.00",
                    "monthly_salary": "0.00",
                    "rental_percent": "0.00",
                    "repair_percent": "0.00",
                    "parts_percent": "0.00",
                    "schedule_template": "5/2",
                    "hire_date": "2026-01-10",
                    "is_active": true,
                    "fired_at": null,
                    "updated_at": "2026-09-01T07:31:00+0000"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "is_active": false,
                "fired_at": "2026-09-30"
              }
            }
          }
        }
      }
    },
    "/work-days": {
      "get": {
        "tags": [
          "Сотрудники"
        ],
        "summary": "График работы",
        "description": "Рабочие дни сотрудников.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Номер страницы, с 1",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "description": "Размер страницы, 1…1000 (по умолчанию 10)",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "updated_since",
            "in": "query",
            "required": false,
            "description": "Только изменённые после этого момента, ISO 8601 со смещением",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "employee_id",
            "in": "query",
            "required": false,
            "description": "Сотрудник",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "period_from",
            "in": "query",
            "required": false,
            "description": "С даты",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "period_to",
            "in": "query",
            "required": false,
            "description": "По дату",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": [
                    {
                      "id": 8,
                      "employee": {
                        "id": 2,
                        "fio": "Петров Пётр"
                      },
                      "date": "2026-09-02",
                      "start_time": "10:00:00",
                      "end_time": "20:00:00",
                      "is_scheduled": true,
                      "attendance": "",
                      "updated_at": "2026-09-01T07:31:00+0000"
                    }
                  ],
                  "links": {
                    "next": "/work-days?page=2&per_page=10",
                    "prev": null
                  },
                  "meta": {
                    "current_page": 1,
                    "last_page": 3,
                    "per_page": 10,
                    "total": 25,
                    "version": "1.0"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        }
      },
      "post": {
        "tags": [
          "Сотрудники"
        ],
        "summary": "Задать рабочий день",
        "description": "Один день на сотрудника: повторная отправка той же даты обновляет запись.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [],
        "responses": {
          "201": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": 8,
                    "employee": {
                      "id": 2,
                      "fio": "Петров Пётр"
                    },
                    "date": "2026-09-02",
                    "start_time": "10:00:00",
                    "end_time": "20:00:00",
                    "is_scheduled": true,
                    "attendance": "",
                    "updated_at": "2026-09-01T07:31:00+0000"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "employee_id": 2,
                "date": "2026-09-02",
                "start_time": "10:00",
                "end_time": "20:00"
              }
            }
          }
        }
      }
    },
    "/work-days/{id}": {
      "get": {
        "tags": [
          "Сотрудники"
        ],
        "summary": "Получить рабочий день",
        "description": "Один день графика.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Идентификатор (поле `id` из ответов API): дня графика",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": 8,
                    "employee": {
                      "id": 2,
                      "fio": "Петров Пётр"
                    },
                    "date": "2026-09-02",
                    "start_time": "10:00:00",
                    "end_time": "20:00:00",
                    "is_scheduled": true,
                    "attendance": "",
                    "updated_at": "2026-09-01T07:31:00+0000"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        }
      },
      "delete": {
        "tags": [
          "Сотрудники"
        ],
        "summary": "Удалить рабочий день",
        "description": "Убирает день из графика.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Идентификатор (поле `id` из ответов API): дня графика",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Успех, тела нет"
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        }
      }
    },
    "/shifts": {
      "get": {
        "tags": [
          "Сотрудники"
        ],
        "summary": "Смены",
        "description": "Открытие и закрытие смен. Читается только.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Номер страницы, с 1",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "description": "Размер страницы, 1…1000 (по умолчанию 10)",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "updated_since",
            "in": "query",
            "required": false,
            "description": "Только изменённые после этого момента, ISO 8601 со смещением",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "employee_id",
            "in": "query",
            "required": false,
            "description": "Сотрудник",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "open",
            "in": "query",
            "required": false,
            "description": "1 — только незакрытые",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "period_from",
            "in": "query",
            "required": false,
            "description": "С даты",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "period_to",
            "in": "query",
            "required": false,
            "description": "По дату",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": [
                    {
                      "id": 5,
                      "employee": {
                        "id": 2,
                        "fio": "Петров Пётр"
                      },
                      "start_time": "2026-09-02T10:02:00+0000",
                      "end_time": null,
                      "updated_at": "2026-09-02T10:02:00+0000"
                    }
                  ],
                  "links": {
                    "next": "/shifts?page=2&per_page=10",
                    "prev": null
                  },
                  "meta": {
                    "current_page": 1,
                    "last_page": 3,
                    "per_page": 10,
                    "total": 25,
                    "version": "1.0"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        }
      }
    },
    "/shifts/{id}": {
      "get": {
        "tags": [
          "Сотрудники"
        ],
        "summary": "Получить смену",
        "description": "Одна смена.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Идентификатор (поле `id` из ответов API): смены",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": 5,
                    "employee": {
                      "id": 2,
                      "fio": "Петров Пётр"
                    },
                    "start_time": "2026-09-02T10:02:00+0000",
                    "end_time": null,
                    "updated_at": "2026-09-02T10:02:00+0000"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        }
      }
    },
    "/salaries": {
      "get": {
        "tags": [
          "Сотрудники"
        ],
        "summary": "Выплаты зарплаты",
        "description": "Выплаты и начисления. Читается только: проводятся на сайте.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Номер страницы, с 1",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "description": "Размер страницы, 1…1000 (по умолчанию 10)",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "updated_since",
            "in": "query",
            "required": false,
            "description": "Только изменённые после этого момента, ISO 8601 со смещением",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "employee_id",
            "in": "query",
            "required": false,
            "description": "Сотрудник",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "paid",
            "in": "query",
            "required": false,
            "description": "1 — только выплаченные",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": [
                    {
                      "id": 3,
                      "employee": {
                        "id": 2,
                        "fio": "Петров Пётр"
                      },
                      "amount": "20000.00",
                      "date": "2026-09-05",
                      "period": "Август 2026",
                      "date_from": "2026-08-01",
                      "date_to": "2026-08-31",
                      "is_paid": true,
                      "cash_account": {
                        "id": 2,
                        "name": "Касса Центр"
                      },
                      "note": "",
                      "updated_at": "2026-09-05T07:31:00+0000"
                    }
                  ],
                  "links": {
                    "next": "/salaries?page=2&per_page=10",
                    "prev": null
                  },
                  "meta": {
                    "current_page": 1,
                    "last_page": 3,
                    "per_page": 10,
                    "total": 25,
                    "version": "1.0"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        }
      }
    },
    "/salaries/{id}": {
      "get": {
        "tags": [
          "Сотрудники"
        ],
        "summary": "Получить выплату",
        "description": "Одна выплата.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Идентификатор (поле `id` из ответов API): выплаты",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": 3,
                    "employee": {
                      "id": 2,
                      "fio": "Петров Пётр"
                    },
                    "amount": "20000.00",
                    "date": "2026-09-05",
                    "period": "Август 2026",
                    "date_from": "2026-08-01",
                    "date_to": "2026-08-31",
                    "is_paid": true,
                    "cash_account": {
                      "id": 2,
                      "name": "Касса Центр"
                    },
                    "note": "",
                    "updated_at": "2026-09-05T07:31:00+0000"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        }
      }
    },
    "/loyalty-programs": {
      "get": {
        "tags": [
          "Лояльность"
        ],
        "summary": "Список акций",
        "description": "Акции программы лояльности.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Номер страницы, с 1",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "description": "Размер страницы, 1…1000 (по умолчанию 10)",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "updated_since",
            "in": "query",
            "required": false,
            "description": "Только изменённые после этого момента, ISO 8601 со смещением",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Поиск по подстроке",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "active",
            "in": "query",
            "required": false,
            "description": "1 — только активные",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": [
                    {
                      "id": 1,
                      "name": "Кэшбэк 5%",
                      "bonus_type": "fixed",
                      "percent": "5.00",
                      "tiers": null,
                      "apply_items": null,
                      "apply_services": null,
                      "apply_products": null,
                      "apply_points": null,
                      "reset_enabled": false,
                      "reset_value": 0,
                      "reset_unit": "year",
                      "pay_percent": 30,
                      "is_perpetual": true,
                      "date_start": null,
                      "date_end": null,
                      "is_active": true,
                      "updated_at": "2026-09-01T07:31:00+0000"
                    }
                  ],
                  "links": {
                    "next": "/loyalty-programs?page=2&per_page=10",
                    "prev": null
                  },
                  "meta": {
                    "current_page": 1,
                    "last_page": 3,
                    "per_page": 10,
                    "total": 25,
                    "version": "1.0"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        }
      },
      "post": {
        "tags": [
          "Лояльность"
        ],
        "summary": "Создать акцию",
        "description": "Создаёт акцию. `bonus_type`: fixed (единый `percent`), count / sum / within_rental (ступени `tiers`: `[{\"threshold\": 1000, \"percent\": 5}]`). Пустые `apply_*` — на всё.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [],
        "responses": {
          "201": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": 1,
                    "name": "Кэшбэк 5%",
                    "bonus_type": "fixed",
                    "percent": "5.00",
                    "tiers": null,
                    "apply_items": null,
                    "apply_services": null,
                    "apply_products": null,
                    "apply_points": null,
                    "reset_enabled": false,
                    "reset_value": 0,
                    "reset_unit": "year",
                    "pay_percent": 30,
                    "is_perpetual": true,
                    "date_start": null,
                    "date_end": null,
                    "is_active": true,
                    "updated_at": "2026-09-01T07:31:00+0000"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "name": "Кэшбэк 5%",
                "bonus_type": "fixed",
                "percent": "5",
                "pay_percent": 30
              }
            }
          }
        }
      }
    },
    "/loyalty-programs/{id}": {
      "get": {
        "tags": [
          "Лояльность"
        ],
        "summary": "Получить акцию",
        "description": "Одна акция.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Идентификатор (поле `id` из ответов API): акции",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": 1,
                    "name": "Кэшбэк 5%",
                    "bonus_type": "fixed",
                    "percent": "5.00",
                    "tiers": null,
                    "apply_items": null,
                    "apply_services": null,
                    "apply_products": null,
                    "apply_points": null,
                    "reset_enabled": false,
                    "reset_value": 0,
                    "reset_unit": "year",
                    "pay_percent": 30,
                    "is_perpetual": true,
                    "date_start": null,
                    "date_end": null,
                    "is_active": true,
                    "updated_at": "2026-09-01T07:31:00+0000"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        }
      },
      "patch": {
        "tags": [
          "Лояльность"
        ],
        "summary": "Изменить акцию",
        "description": "Меняет только переданные поля. Уже начисленные бонусы не пересчитываются.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Идентификатор (поле `id` из ответов API): акции",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": 1,
                    "name": "Кэшбэк 5%",
                    "bonus_type": "fixed",
                    "percent": "5.00",
                    "tiers": null,
                    "apply_items": null,
                    "apply_services": null,
                    "apply_products": null,
                    "apply_points": null,
                    "reset_enabled": false,
                    "reset_value": 0,
                    "reset_unit": "year",
                    "pay_percent": 30,
                    "is_perpetual": true,
                    "date_start": null,
                    "date_end": null,
                    "is_active": true,
                    "updated_at": "2026-09-01T07:31:00+0000"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "is_active": false
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Лояльность"
        ],
        "summary": "Удалить акцию",
        "description": "Удаляет акцию; история бонусов клиентов сохраняется.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Идентификатор (поле `id` из ответов API): акции",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Успех, тела нет"
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        }
      }
    },
    "/bonus-transactions": {
      "get": {
        "tags": [
          "Лояльность"
        ],
        "summary": "История бонусов",
        "description": "Начисления, списания, обнуления и ручные корректировки.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Номер страницы, с 1",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "description": "Размер страницы, 1…1000 (по умолчанию 10)",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "updated_since",
            "in": "query",
            "required": false,
            "description": "Только изменённые после этого момента, ISO 8601 со смещением",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "customer_id",
            "in": "query",
            "required": false,
            "description": "Клиент",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "description": "accrual, spend, reset, manual",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": [
                    {
                      "id": 11,
                      "customer": {
                        "id": 1,
                        "fio": "Иванов Иван"
                      },
                      "program": {
                        "id": 1,
                        "name": "Кэшбэк 5%"
                      },
                      "kind": "accrual",
                      "amount": "75.00",
                      "note": "Начисление по акции «Кэшбэк 5%» · аренда №A-81",
                      "ref": "order:185",
                      "created_at": "2026-09-01T12:30:00+0000",
                      "updated_at": "2026-09-01T12:30:00+0000"
                    }
                  ],
                  "links": {
                    "next": "/bonus-transactions?page=2&per_page=10",
                    "prev": null
                  },
                  "meta": {
                    "current_page": 1,
                    "last_page": 3,
                    "per_page": 10,
                    "total": 25,
                    "version": "1.0"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        }
      },
      "post": {
        "tags": [
          "Лояльность"
        ],
        "summary": "Скорректировать бонусы",
        "description": "Ручная корректировка: плюс — начисление, минус — списание (не больше баланса, иначе 422). Записи не редактируются и не удаляются — исправляйте обратной корректировкой.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [],
        "responses": {
          "201": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": 11,
                    "customer": {
                      "id": 1,
                      "fio": "Иванов Иван"
                    },
                    "program": {
                      "id": 1,
                      "name": "Кэшбэк 5%"
                    },
                    "kind": "accrual",
                    "amount": "75.00",
                    "note": "Начисление по акции «Кэшбэк 5%» · аренда №A-81",
                    "ref": "order:185",
                    "created_at": "2026-09-01T12:30:00+0000",
                    "updated_at": "2026-09-01T12:30:00+0000"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "customer_id": 1,
                "amount": "100",
                "note": "Подарок ко дню рождения"
              }
            }
          }
        }
      }
    },
    "/bonus-transactions/{id}": {
      "get": {
        "tags": [
          "Лояльность"
        ],
        "summary": "Получить движение бонусов",
        "description": "Одна запись истории.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Идентификатор (поле `id` из ответов API): движения",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": 11,
                    "customer": {
                      "id": 1,
                      "fio": "Иванов Иван"
                    },
                    "program": {
                      "id": 1,
                      "name": "Кэшбэк 5%"
                    },
                    "kind": "accrual",
                    "amount": "75.00",
                    "note": "Начисление по акции «Кэшбэк 5%» · аренда №A-81",
                    "ref": "order:185",
                    "created_at": "2026-09-01T12:30:00+0000",
                    "updated_at": "2026-09-01T12:30:00+0000"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        }
      }
    },
    "/bonus-balances/{id}": {
      "get": {
        "tags": [
          "Лояльность"
        ],
        "summary": "Баланс бонусов клиента",
        "description": "Текущий баланс с учётом сгорания. В пути — id клиента.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Идентификатор (поле `id` из ответов API): клиента",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "customer": {
                      "id": 1,
                      "fio": "Иванов Иван"
                    },
                    "balance": "175.00"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        }
      }
    },
    "/reports/summary": {
      "get": {
        "tags": [
          "Аналитика"
        ],
        "summary": "Сводка за период",
        "description": "Сводка по документам: аренды (по дате начала, без отменённых), продажи и ремонты (по дате создания), расходы (по дате расхода). `paid` — сумма оплат по документам. Это не копия отчётов сайта: детальные отчёты собирайте из списков с фильтрами по периоду. По умолчанию — последние 30 дней.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "period_from",
            "in": "query",
            "required": false,
            "description": "С даты ГГГГ-ММ-ДД",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "period_to",
            "in": "query",
            "required": false,
            "description": "По дату ГГГГ-ММ-ДД",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "point_id",
            "in": "query",
            "required": false,
            "description": "Только продажи, ремонты и расходы этой точки",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "period": {
                      "from": "2026-08-02",
                      "to": "2026-09-01"
                    },
                    "rents": {
                      "count": 40,
                      "total": "120000.00",
                      "paid": "110000.00"
                    },
                    "sales": {
                      "count": 5,
                      "total": "9000.00",
                      "paid": "9000.00"
                    },
                    "repairs": {
                      "count": 3,
                      "total": "4500.00",
                      "paid": "2000.00"
                    },
                    "expenses": {
                      "count": 7,
                      "total": "15000.00"
                    },
                    "income_total": "133500.00",
                    "profit": "118500.00"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        }
      }
    },
    "/document-templates": {
      "get": {
        "tags": [
          "Печатные формы"
        ],
        "summary": "Список шаблонов документов",
        "description": "Шаблоны договоров и актов из «Настроек». Только чтение.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Номер страницы, с 1",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "description": "Размер страницы, 1…1000 (по умолчанию 10)",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "updated_since",
            "in": "query",
            "required": false,
            "description": "Только изменённые после этого момента, ISO 8601 со смещением",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": [
                    {
                      "id": 2,
                      "name": "Договор проката",
                      "type": "contract",
                      "is_default": true,
                      "updated_at": "2026-09-01T07:31:00+0000"
                    }
                  ],
                  "links": {
                    "next": "/document-templates?page=2&per_page=10",
                    "prev": null
                  },
                  "meta": {
                    "current_page": 1,
                    "last_page": 3,
                    "per_page": 10,
                    "total": 25,
                    "version": "1.0"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        }
      }
    },
    "/document-templates/{id}": {
      "get": {
        "tags": [
          "Печатные формы"
        ],
        "summary": "Получить шаблон",
        "description": "Один шаблон.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Идентификатор (поле `id` из ответов API): шаблона",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": 2,
                    "name": "Договор проката",
                    "type": "contract",
                    "is_default": true,
                    "updated_at": "2026-09-01T07:31:00+0000"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        }
      }
    },
    "/rents/{id}/document": {
      "get": {
        "tags": [
          "Печатные формы"
        ],
        "summary": "Документ по аренде",
        "description": "Шаблон с подставленными данными аренды. `output=html` (по умолчанию) возвращает JSON с HTML, `pdf` и `docx` — файл. Без `template_id` берётся шаблон по умолчанию. Если на сервере нет библиотеки выгрузки — 503.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Идентификатор (поле `id` из ответов API): аренды",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "template_id",
            "in": "query",
            "required": false,
            "description": "Шаблон; по умолчанию — основной",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "output",
            "in": "query",
            "required": false,
            "description": "html, pdf, docx",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "template": {
                      "id": 2,
                      "name": "Договор проката",
                      "type": "contract"
                    },
                    "html": "<p>Договор №A-81 …</p>"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        }
      }
    },
    "/customer-sources": {
      "get": {
        "tags": [
          "Клиенты"
        ],
        "summary": "Список источников клиентов",
        "description": "Откуда приходят клиенты (справочник).",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Номер страницы, с 1",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "description": "Размер страницы, 1…1000 (по умолчанию 10)",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "updated_since",
            "in": "query",
            "required": false,
            "description": "Только изменённые после этого момента, ISO 8601 со смещением",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Поиск по подстроке",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": [
                    {
                      "id": 1,
                      "name": "Instagram",
                      "updated_at": "2026-09-01T07:31:00+0000"
                    }
                  ],
                  "links": {
                    "next": "/customer-sources?page=2&per_page=10",
                    "prev": null
                  },
                  "meta": {
                    "current_page": 1,
                    "last_page": 3,
                    "per_page": 10,
                    "total": 25,
                    "version": "1.0"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        }
      },
      "post": {
        "tags": [
          "Клиенты"
        ],
        "summary": "Создать источник",
        "description": "Добавляет источник в справочник.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [],
        "responses": {
          "201": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": 1,
                    "name": "Instagram",
                    "updated_at": "2026-09-01T07:31:00+0000"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "name": "Instagram"
              }
            }
          }
        }
      }
    },
    "/customer-sources/{id}": {
      "get": {
        "tags": [
          "Клиенты"
        ],
        "summary": "Получить источник",
        "description": "Один источник.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Идентификатор (поле `id` из ответов API): источника",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": 1,
                    "name": "Instagram",
                    "updated_at": "2026-09-01T07:31:00+0000"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        }
      },
      "patch": {
        "tags": [
          "Клиенты"
        ],
        "summary": "Изменить источник",
        "description": "Меняет название.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Идентификатор (поле `id` из ответов API): источника",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Успех",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": 1,
                    "name": "Instagram",
                    "updated_at": "2026-09-01T07:31:00+0000"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "name": "ВКонтакте"
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Клиенты"
        ],
        "summary": "Удалить источник",
        "description": "Нельзя удалить источник, указанный у клиентов (409 `HAS_DEPENDENCIES`).",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Идентификатор (поле `id` из ответов API): источника",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Успех, тела нет"
          },
          "401": {
            "description": "Нет или неверный токен"
          },
          "403": {
            "description": "Нет прав на раздел"
          }
        }
      }
    }
  }
}