# Сгенерировано tools/openapi из shared/openapi/seller-v1 — не редактировать вручную.
openapi: 3.1.0
info:
  title: TILUNA Seller API
  version: '2026-05-08'
  summary: Публичный API продавцов и интеграторов маркетплейса Тилуна.
  description: |
    API для продавцов Тилуны и сервисов, которые работают от их имени: товары,
    остатки и цены, заказы, возвраты, отзывы, аналитика и финансы.

    ## Адреса

    - Боевое окружение: `https://api.tiluna.ru/v1` — ключи `tl_live_…` и ранее
      выпущенные `vnt_sk_live_…`.
    - Песочница: `https://sandbox-api.tiluna.ru/v1` — только тестовые ключи
      `tl_test_…` (раздел «Песочница» ниже).
    - Устаревший адрес `https://seller.tiluna.ru/api/seller-api/v1` отвечает теми же
      маршрутами без перенаправлений и будет работать до выхода v2. Пока
      `api.tiluna.ru` не запущен, используйте его.

    ## Аутентификация

    Каждый запрос, кроме `GET /ping` и `GET /openapi`, передаёт ключ в заголовке
    `Authorization: Bearer <ключ>`. Ключ в строке запроса не принимается.

    Боевой ключ `tl_live_…` выпускает владелец кабинета продавца в разделе
    «Настройки → API и интеграции» и передаёт его сервису, который работает от
    имени продавца. Ранее выпущенные ключи `vnt_sk_live_…` работают до
    окончания срока действия. Права ключа задаются scopes: какой scope нужен
    операции, указано в поле `x-tiluna-scope` и в описании операции.

    ## Песочница

    Песочница — отдельное окружение с вымышленными данными для разработки и
    проверки интеграций. Тестовый доступ выдаётся только интеграторам —
    разработчикам сервисов и учётных систем. В кабинете продавца тестовые
    ключи не выпускаются.

    Чтобы получить доступ, напишите на support@tiluna.ru: название компании,
    контактное лицо, email и цель подключения. Для каждого интегратора Тилуна
    создаёт отдельный тестовый кабинет продавца и присылает ссылку на ключ
    `tl_test_…`: ссылка открывается один раз и действует 72 часа. Через
    поддержку ключ можно перевыпустить или отозвать, а данные тестового
    кабинета — сбросить.

    Тестовый кабинет заполнен заранее: юрлицо с вымышленными реквизитами,
    товары разных категорий с вариантами, остатками и ценами, заказы во всех
    статусах, возвраты, отзывы, выплаты и отчёты агента. Сбросить данные
    можно и самостоятельно запросом `POST /test_helpers/reset`; кабинет без
    активности 30 дней сбрасывается сам. После сброса исходные записи
    возвращаются с теми же идентификаторами и данными, записи, созданные
    через API и тестовые действия, удаляются, ключ продолжает работать.

    Оплата, доставка, возвраты и выплаты в песочнице симулируются: настоящие
    деньги, чеки и перевозчики не участвуют. События песочницы приходят с
    `livemode: false` и читаются лентой `GET /events`; адрес для вебхуков к
    тестовому кабинету пока не подключается. Образец события любого типа
    создаёт `POST /test_helpers/events`: в ленте он отмечен `source: sandbox`
    и `data.object.sample: true`. Боевой ключ в песочнице и тестовый ключ в
    боевом окружении отклоняются ответом `401`
    (`live_key_on_sandbox_environment`, `test_key_on_live_environment`).

    ## Форматы

    - Деньги — целые копейки (`249000` = 2 490 ₽), валюта — рубли.
    - Дата и время — ISO 8601 в UTC (`2026-10-01T09:00:00.000Z`); даты без
      времени (`dateFrom`, `dateTo`) — `YYYY-MM-DD`, сутки по московскому времени.
    - Идентификаторы — UUID; номер заказа — непрозрачная строка.

    ## Мутации и идемпотентность

    Все изменяющие запросы требуют заголовок `Idempotency-Key` (8–255 символов
    `A-Z a-z 0-9 . _ : -`). Повтор с тем же ключом и тем же телом в течение
    24 часов возвращает сохранённый ответ; тот же ключ с другим телом даёт
    `409 idempotency_key_reused`. Тело — `application/json`, не больше 256 КБ.

    ## Ошибки

    Ответ с ошибкой всегда имеет вид `{"error": {...}}` с машиночитаемым `code`
    и текстом `message`. Для поддержки сообщайте значение заголовка
    `X-Request-Id` — его можно передать и в запросе (8–128 символов
    `A-Z a-z 0-9 . _ : -`). Ключ API в обращения в поддержку не присылайте.

    ## Лимиты

    Лимиты считаются на кабинет и на ключ. Аутентифицированные ответы содержат
    `X-RateLimit-Limit`, `X-RateLimit-Remaining` и `X-RateLimit-Reset`; при
    превышении — `429` с заголовком `Retry-After`.

    ## Версии

    Путь `/v1` и заголовок ответа `X-Venets-API-Version: 2026-05-08` не меняются
    до v2. Внутри v1 изменения только совместимые: новые поля и маршруты.
    Устаревшие поля и маршруты отмечаются заголовками `Deprecation` и `Sunset`.
  contact:
    name: Поддержка Тилуны
    email: support@tiluna.ru
servers:
  - url: https://api.tiluna.ru/v1
    description: Боевое окружение, ключи tl_live_…. Адрес ещё не запущен — до запуска используйте https://seller.tiluna.ru/api/seller-api/v1
  - url: https://sandbox-api.tiluna.ru/v1
    description: Песочница, только ключи tl_test_…; доступ интеграторам — по запросу на support@tiluna.ru. Адрес ещё не запущен
  - url: https://seller.tiluna.ru/api/seller-api/v1
    description: Устаревший адрес боевого окружения, работает до v2; действует уже сейчас
security:
  - sellerApiToken: []
tags:
  - name: Service
    x-displayName: Служебное
    description: Проверка доступности API и получение этой спецификации.
  - name: Products
    x-displayName: Товары
    description: Карточки товаров продавца. Цены и остатки меняются отдельными пакетными запросами.
  - name: Inventory
    x-displayName: Остатки
    description: Остатки товаров на складе продавца.
  - name: Prices
    x-displayName: Цены
    description: Цены товаров в копейках.
  - name: Orders
    x-displayName: Заказы
    description: Заказы с позициями продавца, их приём и отмена.
  - name: Returns
    x-displayName: Возвраты
    description: Заявки покупателей на возврат и решения продавца по ним.
  - name: Reviews
    x-displayName: Отзывы
    description: Отзывы покупателей о товарах продавца и ответы на них.
  - name: Analytics
    x-displayName: Аналитика
    description: Агрегированные показатели продаж за период.
  - name: Finance
    x-displayName: Финансы
    description: Баланс, операции, выплаты и график поступлений. Банковские реквизиты через API не выдаются.
  - name: Account
    x-displayName: Аккаунт
    description: Сведения о ключе запроса и юрлица кабинета.
  - name: Reports
    x-displayName: Отчёты
    description: Асинхронные отчёты XLSX, CSV и JSON и их строки для учётных систем.
  - name: TestHelpers
    x-displayName: Песочница — тестовые действия
    description: Только на sandbox-api.tiluna.ru и только с тестовым ключом tl_test_ (scope test_helpers:write). Симулируют покупателя, оплату, перевозчика, возвраты и финансы; банк, касса и перевозчики не вызываются. В боевом API — 404 not_found.
  - name: Webhooks
    x-displayName: Вебхуки
    description: Исходящие уведомления о событиях на адрес, настроенный в кабинете продавца.
  - name: WebhookEvents
    x-displayName: События вебхуков
    description: |
      Тело вебхука и снимок ресурса для каждого типа события. Те же объекты
      выдаёт лента GET /events. Доставка, подпись и повторы — «Уведомление о
      событии» в разделе «Вебхуки».
paths:
  /ping:
    get:
      tags:
        - Service
      operationId: ping
      summary: Проверить доступность API
      description: |
        Отвечает без ключа, без обращения к базе данных и без лимитов кабинета.
        Подходит для мониторинга и проверки сетевого доступа из вашей
        инфраструктуры. Ответ не кэшируется.
      security: []
      responses:
        '200':
          description: API доступен.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-Venets-API-Version:
              $ref: '#/components/headers/XVenetsApiVersion'
            Cache-Control:
              description: Ответ не кэшируется.
              schema:
                type: string
                example: no-store
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Ping'
              example:
                object: ping
                environment: live
                time: '2026-09-24T12:00:00.000Z'
        '429':
          description: Слишком много запросов с одного IP-адреса; ограничение сетевой границы, тело ответа не в JSON.
          content:
            text/html:
              schema:
                type: string
                description: Страница ошибки сетевой границы; не разбирайте её, повторите запрос позже.
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /openapi:
    get:
      tags:
        - Service
      operationId: getOpenApiSpec
      summary: Получить спецификацию OpenAPI
      description: |
        Возвращает эту спецификацию в формате YAML для импорта в Postman,
        Insomnia или генератор клиентов. Ответ кэшируется на 5 минут. Если файл
        спецификации недоступен — 503 spec_unavailable.
      security: []
      responses:
        '200':
          description: Спецификация OpenAPI 3.1 в YAML.
          headers:
            Cache-Control:
              description: Ответ можно кэшировать 5 минут.
              schema:
                type: string
                example: public, max-age=300
          content:
            application/yaml:
              schema:
                type: string
              example: |
                openapi: 3.1.0
                info:
                  title: TILUNA Seller API
                  version: "2026-05-08"
        '429':
          description: Слишком много запросов с одного IP-адреса; ограничение сетевой границы, тело ответа не в JSON.
          content:
            text/html:
              schema:
                type: string
                description: Страница ошибки сетевой границы; не разбирайте её, повторите запрос позже.
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /products:
    get:
      tags:
        - Products
      operationId: listProducts
      summary: Список товаров
      description: |
        Товары юрлица ключа во всех статусах. По умолчанию — курсорная выдача
        от новых к старым; с updated_since или order_by=updated_at — лента
        синхронизации по времени изменения. Параметр page включает прежний
        постраничный режим.
      x-tiluna-scope: products:read
      parameters:
        - name: cursor
          in: query
          description: |
            Курсор следующей страницы из next_cursor предыдущего ответа. Действует
            30 дней и только с теми же фильтрами (иначе 400 cursor_mismatch).
          schema:
            type: string
            maxLength: 1024
        - $ref: '#/components/parameters/Limit'
        - name: status
          in: query
          description: Статус товара.
          schema:
            type: string
            enum:
              - draft
              - pending
              - active
              - rejected
              - archived
        - name: search
          in: query
          description: Поиск по названию, артикулу, коду товара и штрихкоду; не длиннее 100 символов (в режиме page — 120).
          schema:
            type: string
            maxLength: 120
        - name: updated_since
          in: query
          description: |
            Синхронизация: изменения начиная с этого момента (ISO 8601 с зоной), по
            возрастанию времени изменения. Дальше — по next_cursor. Изменения
            вариантов, остатков и цен тоже поднимают товар в ленте.
          schema:
            type: string
            format: date-time
            maxLength: 35
        - name: order_by
          in: query
          description: updated_at — режим синхронизации без начальной точки.
          schema:
            type: string
            enum:
              - updated_at
        - name: external_id
          in: query
          description: Товар с этим external_id (1–128 символов).
          schema:
            type: string
            maxLength: 128
        - name: seller_sku
          in: query
          description: Артикул продавца (без учёта регистра).
          schema:
            type: string
            maxLength: 100
        - name: ids
          in: query
          description: Идентификаторы товаров через запятую, не больше 100.
          schema:
            type: string
        - name: category_id
          in: query
          description: Категория товара.
          schema:
            type: string
            format: uuid
        - name: page
          in: query
          deprecated: true
          description: |
            Прежний постраничный режим: ответ содержит pagination. Несовместим с
            cursor, updated_since, order_by и фильтрами external_id, seller_sku, ids.
          schema:
            type: integer
            minimum: 1
            maximum: 10000
        - name: sortBy
          in: query
          deprecated: true
          description: Порядок сортировки в режиме page.
          schema:
            type: string
            enum:
              - newest
              - oldest
              - price_asc
              - price_desc
              - popular
              - rating
            default: newest
      responses:
        '200':
          description: Страница товаров.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-Venets-API-Version:
              $ref: '#/components/headers/XVenetsApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              examples:
                productListPage:
                  $ref: '#/components/examples/ProductListPage'
              schema:
                type: object
                required:
                  - object
                  - url
                  - data
                  - has_more
                properties:
                  object:
                    type: string
                    enum:
                      - list
                  url:
                    type: string
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Product'
                  has_more:
                    type: boolean
                  next_cursor:
                    type:
                      - string
                      - 'null'
                    description: Курсор следующей страницы; null — страниц больше нет.
                  pagination:
                    $ref: '#/components/schemas/Pagination'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '410':
          $ref: '#/components/responses/Gone'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    post:
      tags:
        - Products
      operationId: createProduct
      summary: Создать товар
      description: |
        Создаёт черновик товара для юрлица ключа. Отправка на модерацию —
        POST /products/{productId}/submit. external_id уникален среди
        неархивных товаров юрлица: занятый — 409 external_id_conflict с
        details.existing_id. Дополнительные коды: 403 brand_not_authorized,
        legal_entity_required и feature_not_enabled; 409 seller_sku_conflict;
        400 catalog_inventory_plan_denied и 502 catalog_inventory_plan_unavailable
        (правила каталога).
      x-tiluna-scope: products:write
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProductCreate'
      responses:
        '201':
          description: Товар создан.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-Venets-API-Version:
              $ref: '#/components/headers/XVenetsApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              examples:
                productCreated:
                  $ref: '#/components/examples/ProductCreated'
              schema:
                type: object
                required:
                  - product
                properties:
                  product:
                    $ref: '#/components/schemas/Product'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '409':
          $ref: '#/components/responses/Conflict'
        '413':
          $ref: '#/components/responses/PayloadTooLarge'
        '415':
          $ref: '#/components/responses/UnsupportedMediaType'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /products/{productId}:
    parameters:
      - $ref: '#/components/parameters/ProductId'
    get:
      tags:
        - Products
      operationId: getProduct
      summary: Получить товар
      description: Товар с фотографиями и вариантами.
      x-tiluna-scope: products:read
      responses:
        '200':
          description: Товар.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-Venets-API-Version:
              $ref: '#/components/headers/XVenetsApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              examples:
                productWithDetails:
                  $ref: '#/components/examples/ProductWithDetails'
              schema:
                type: object
                required:
                  - product
                  - images
                  - variants
                properties:
                  product:
                    $ref: '#/components/schemas/Product'
                  images:
                    type: array
                    items:
                      $ref: '#/components/schemas/ProductImage'
                  variants:
                    type: array
                    items:
                      $ref: '#/components/schemas/ProductVariant'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    patch:
      tags:
        - Products
      operationId: updateProduct
      summary: Изменить товар
      description: |
        Меняет поля товара, кроме цен и остатков. Правка опубликованного или
        отправленного на модерацию товара — по правилам кабинета: кроме
        описаний и SEO-полей, итоговая карточка проходит проверки публикации
        (400 validation_failed с details.reason). external_id: null снимает
        привязку, занятый — 409 external_id_conflict. Дополнительные коды: 403
        brand_not_authorized, legal_entity_required и feature_not_enabled;
        409 seller_sku_conflict; 400 catalog_inventory_plan_denied и 502
        catalog_inventory_plan_unavailable (правила каталога).
      x-tiluna-scope: products:write
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProductUpdate'
      responses:
        '200':
          description: Товар изменён.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-Venets-API-Version:
              $ref: '#/components/headers/XVenetsApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              examples:
                productUpdated:
                  $ref: '#/components/examples/ProductUpdated'
              schema:
                type: object
                required:
                  - product
                properties:
                  product:
                    $ref: '#/components/schemas/Product'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '413':
          $ref: '#/components/responses/PayloadTooLarge'
        '415':
          $ref: '#/components/responses/UnsupportedMediaType'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /products/{productId}/archive:
    parameters:
      - $ref: '#/components/parameters/ProductId'
    post:
      tags:
        - Products
      operationId: archiveProduct
      summary: Перенести товар в архив
      description: |
        Снимает товар с продажи. Недоступно, пока по товару есть незавершённые
        заказы: 400 catalog_inventory_plan_denied. Сервис правил каталога
        недоступен — 502 catalog_inventory_plan_unavailable. Тело — пустой
        JSON-объект.
      x-tiluna-scope: products:write
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EmptyObject'
      responses:
        '200':
          description: Товар в архиве.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-Venets-API-Version:
              $ref: '#/components/headers/XVenetsApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              examples:
                productArchived:
                  $ref: '#/components/examples/ProductArchived'
              schema:
                type: object
                required:
                  - success
                  - product
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                  product:
                    $ref: '#/components/schemas/Product'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '413':
          $ref: '#/components/responses/PayloadTooLarge'
        '415':
          $ref: '#/components/responses/UnsupportedMediaType'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /products/{productId}/submit:
    parameters:
      - $ref: '#/components/parameters/ProductId'
    post:
      tags:
        - Products
      operationId: submitProduct
      summary: Отправить товар на модерацию
      description: |
        Отправляет черновик или отклонённый товар на модерацию — те же проверки,
        что при отправке из кабинета. Другой статус — 409 invalid_state;
        незавершённая настройка продавца (реквизиты, доставка) — 409
        invalid_state с details.reason = seller_setup_incomplete; неполная
        карточка — 400 validation_failed с details.reason. Тело — пустой
        JSON-объект.
      x-tiluna-scope: products:write
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EmptyObject'
      responses:
        '200':
          description: Товар на модерации.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-Venets-API-Version:
              $ref: '#/components/headers/XVenetsApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              examples:
                productSubmitted:
                  $ref: '#/components/examples/ProductSubmitted'
              schema:
                type: object
                required:
                  - success
                  - product
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                  product:
                    $ref: '#/components/schemas/Product'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '413':
          $ref: '#/components/responses/PayloadTooLarge'
        '415':
          $ref: '#/components/responses/UnsupportedMediaType'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /products/{productId}/variants:
    parameters:
      - $ref: '#/components/parameters/ProductId'
    get:
      tags:
        - Products
      operationId: listProductVariants
      summary: Варианты товара
      description: Варианты товара юрлица ключа в порядке витрины, курсором.
      x-tiluna-scope: products:read
      parameters:
        - name: cursor
          in: query
          description: |
            Курсор следующей страницы из next_cursor предыдущего ответа. Действует
            30 дней и только с теми же фильтрами (иначе 400 cursor_mismatch).
          schema:
            type: string
            maxLength: 1024
        - $ref: '#/components/parameters/Limit'
      responses:
        '200':
          description: Страница вариантов.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-Venets-API-Version:
              $ref: '#/components/headers/XVenetsApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              examples:
                variantListPage:
                  $ref: '#/components/examples/VariantListPage'
              schema:
                type: object
                required:
                  - object
                  - url
                  - data
                  - has_more
                  - next_cursor
                properties:
                  object:
                    type: string
                    enum:
                      - list
                  url:
                    type: string
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/ProductVariant'
                  has_more:
                    type: boolean
                  next_cursor:
                    type:
                      - string
                      - 'null'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '410':
          $ref: '#/components/responses/Gone'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    post:
      tags:
        - Products
      operationId: createProductVariant
      summary: Создать вариант
      description: |
        Создаёт вариант товара той же операцией, что кабинет. Остаток — только
        ключом с inventory:write, цена варианта — с prices:write (иначе 403
        insufficient_scope). Занятый в товаре external_id — 409
        external_id_conflict с details.existing_id.
      x-tiluna-scope: products:write
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProductVariantCreate'
      responses:
        '201':
          description: Вариант создан.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-Venets-API-Version:
              $ref: '#/components/headers/XVenetsApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              examples:
                variantCreated:
                  $ref: '#/components/examples/VariantCreated'
              schema:
                $ref: '#/components/schemas/ProductVariant'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '413':
          $ref: '#/components/responses/PayloadTooLarge'
        '415':
          $ref: '#/components/responses/UnsupportedMediaType'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /products/{productId}/variants/{variantId}:
    parameters:
      - $ref: '#/components/parameters/ProductId'
      - name: variantId
        in: path
        required: true
        description: Идентификатор варианта.
        schema:
          type: string
          format: uuid
    patch:
      tags:
        - Products
      operationId: updateProductVariant
      summary: Изменить вариант
      description: |
        Меняет вариант: поля кабинета — той же операцией, что кабинет;
        external_id, штрихкод и артикул — отдельно. Остаток варианта,
        продающегося из остатка товара, не меняется (409 invalid_state).
        Остаток изменился после expected_stock — 409 inventory_conflict.
      x-tiluna-scope: products:write
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProductVariantUpdate'
      responses:
        '200':
          description: Вариант изменён.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-Venets-API-Version:
              $ref: '#/components/headers/XVenetsApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              examples:
                variantUpdated:
                  $ref: '#/components/examples/VariantUpdated'
              schema:
                $ref: '#/components/schemas/ProductVariant'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '413':
          $ref: '#/components/responses/PayloadTooLarge'
        '415':
          $ref: '#/components/responses/UnsupportedMediaType'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /categories:
    get:
      tags:
        - Products
      operationId: listCategories
      summary: Категории каталога
      description: |
        Все активные категории плоским списком без пагинации: дерево строится
        по parent_id. Ответ содержит ETag; повторный запрос с If-None-Match
        получает 304, если справочник не менялся.
      x-tiluna-scope: products:read
      parameters:
        - name: If-None-Match
          in: header
          description: ETag из прошлого ответа.
          schema:
            type: string
            maxLength: 1024
      responses:
        '200':
          description: Категории.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-Venets-API-Version:
              $ref: '#/components/headers/XVenetsApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
            ETag:
              description: |
                Версия справочника. Передайте её в If-None-Match: если справочник не
                менялся, ответ — 304 без тела.
              schema:
                type: string
          content:
            application/json:
              examples:
                categoryList:
                  $ref: '#/components/examples/CategoryList'
              schema:
                type: object
                required:
                  - object
                  - url
                  - data
                  - has_more
                  - next_cursor
                properties:
                  object:
                    type: string
                    enum:
                      - list
                  url:
                    type: string
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Category'
                  has_more:
                    type: boolean
                    enum:
                      - false
                  next_cursor:
                    type: 'null'
        '304':
          description: Справочник не изменился.
          headers:
            ETag:
              description: Версия справочника.
              schema:
                type: string
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /categories/{categoryId}/attributes:
    parameters:
      - name: categoryId
        in: path
        required: true
        description: Идентификатор категории.
        schema:
          type: string
          format: uuid
    get:
      tags:
        - Products
      operationId: listCategoryAttributes
      summary: Характеристики категории
      description: |
        Характеристики товаров категории (по ней или ближайшему родителю) из
        того же справочника, что шаблон импорта и форма товара в кабинете.
        Значения передаются в attributes_jsonb товара. Категория без
        характеристик — пустой список. Ответ содержит ETag.
      x-tiluna-scope: products:read
      parameters:
        - name: If-None-Match
          in: header
          description: ETag из прошлого ответа.
          schema:
            type: string
            maxLength: 1024
      responses:
        '200':
          description: Характеристики.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-Venets-API-Version:
              $ref: '#/components/headers/XVenetsApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
            ETag:
              description: |
                Версия справочника. Передайте её в If-None-Match: если справочник не
                менялся, ответ — 304 без тела.
              schema:
                type: string
          content:
            application/json:
              examples:
                categoryAttributeList:
                  $ref: '#/components/examples/CategoryAttributeList'
              schema:
                type: object
                required:
                  - object
                  - url
                  - category_id
                  - data
                  - has_more
                  - next_cursor
                properties:
                  object:
                    type: string
                    enum:
                      - list
                  url:
                    type: string
                  category_id:
                    type: string
                    format: uuid
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/CategoryAttribute'
                  has_more:
                    type: boolean
                    enum:
                      - false
                  next_cursor:
                    type: 'null'
        '304':
          description: Справочник не изменился.
          headers:
            ETag:
              description: Версия справочника.
              schema:
                type: string
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /inventory:
    get:
      tags:
        - Inventory
      operationId: listInventory
      summary: Список остатков
      description: |
        Остатки юрлица ключа: строка товара без вариантов (или с общим остатком
        для вариантов) и строка каждого варианта со своим остатком. По
        умолчанию — курсорная выдача от новых товаров к старым; с updated_since
        или order_by=updated_at — лента синхронизации.
      x-tiluna-scope: inventory:read
      parameters:
        - name: cursor
          in: query
          description: |
            Курсор следующей страницы из next_cursor предыдущего ответа. Действует
            30 дней и только с теми же фильтрами (иначе 400 cursor_mismatch).
          schema:
            type: string
            maxLength: 1024
        - $ref: '#/components/parameters/Limit'
        - name: search
          in: query
          description: Поиск по названию, артикулу, коду товара и штрихкоду; не длиннее 100 символов (в режиме page — 120).
          schema:
            type: string
            maxLength: 120
        - name: updated_since
          in: query
          description: |
            Синхронизация: строки товаров, изменённых начиная с этого момента
            (ISO 8601 с зоной), по возрастанию времени изменения; дальше — по
            next_cursor.
          schema:
            type: string
            format: date-time
            maxLength: 35
        - name: order_by
          in: query
          description: updated_at — режим синхронизации без начальной точки.
          schema:
            type: string
            enum:
              - updated_at
        - name: external_id
          in: query
          description: Строка товара или варианта с этим external_id.
          schema:
            type: string
            maxLength: 128
        - name: ids
          in: query
          description: Идентификаторы товаров через запятую, не больше 100.
          schema:
            type: string
        - name: page
          in: query
          deprecated: true
          description: |
            Прежний постраничный режим: только строки товаров, сначала недавно
            изменённые; ответ содержит pagination. Несовместим с cursor,
            updated_since, order_by, external_id и ids.
          schema:
            type: integer
            minimum: 1
            maximum: 10000
      responses:
        '200':
          description: Страница остатков.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-Venets-API-Version:
              $ref: '#/components/headers/XVenetsApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              examples:
                stockListPage:
                  $ref: '#/components/examples/StockListPage'
              schema:
                type: object
                required:
                  - object
                  - url
                  - data
                  - has_more
                properties:
                  object:
                    type: string
                    enum:
                      - list
                  url:
                    type: string
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/InventoryItem'
                  has_more:
                    type: boolean
                  next_cursor:
                    type:
                      - string
                      - 'null'
                    description: Курсор следующей страницы; null — страниц больше нет.
                  pagination:
                    type: object
                    description: Только в режиме page.
                    required:
                      - page
                      - limit
                    properties:
                      page:
                        type: integer
                      limit:
                        type: integer
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '410':
          $ref: '#/components/responses/Gone'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /inventory/batch:
    post:
      tags:
        - Inventory
      operationId: batchUpdateInventory
      summary: Изменить остатки пакетом
      description: |
        Меняет остатки до 1000 товаров и вариантов за запрос (тело до 1 МБ).
        В режиме atomic ошибка любой позиции отменяет весь пакет: ответ — код
        первой ошибки (например, 404 not_found, 409 inventory_conflict), в
        details.results — все ошибочные позиции. В режиме partial ответ 200,
        ошибки — в results. Больше 1000 позиций — 400 batch_too_large.
        Дополнительные коды: 400 catalog_inventory_plan_denied и 502
        catalog_inventory_plan_unavailable (правила каталога).
      x-tiluna-scope: inventory:write
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InventoryBatchRequest'
      responses:
        '200':
          description: Остатки изменены.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-Venets-API-Version:
              $ref: '#/components/headers/XVenetsApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              examples:
                stockBatchUpdated:
                  $ref: '#/components/examples/StockBatchUpdated'
                stockBatchPartial:
                  $ref: '#/components/examples/StockBatchPartial'
              schema:
                $ref: '#/components/schemas/InventoryBatchResult'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '413':
          $ref: '#/components/responses/PayloadTooLarge'
        '415':
          $ref: '#/components/responses/UnsupportedMediaType'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /prices:
    get:
      tags:
        - Prices
      operationId: listPrices
      summary: Список цен
      description: |
        Цены юрлица ключа в копейках: строка товара и строка каждого варианта
        (price_override). По умолчанию — курсорная выдача от новых товаров к
        старым; с updated_since или order_by=updated_at — лента синхронизации.
      x-tiluna-scope: prices:read
      parameters:
        - name: cursor
          in: query
          description: |
            Курсор следующей страницы из next_cursor предыдущего ответа. Действует
            30 дней и только с теми же фильтрами (иначе 400 cursor_mismatch).
          schema:
            type: string
            maxLength: 1024
        - $ref: '#/components/parameters/Limit'
        - name: search
          in: query
          description: Поиск по названию, артикулу, коду товара и штрихкоду; не длиннее 100 символов (в режиме page — 120).
          schema:
            type: string
            maxLength: 120
        - name: updated_since
          in: query
          description: |
            Синхронизация: строки товаров, изменённых начиная с этого момента
            (ISO 8601 с зоной), по возрастанию времени изменения; дальше — по
            next_cursor.
          schema:
            type: string
            format: date-time
            maxLength: 35
        - name: order_by
          in: query
          description: updated_at — режим синхронизации без начальной точки.
          schema:
            type: string
            enum:
              - updated_at
        - name: external_id
          in: query
          description: Строка товара или варианта с этим external_id.
          schema:
            type: string
            maxLength: 128
        - name: ids
          in: query
          description: Идентификаторы товаров через запятую, не больше 100.
          schema:
            type: string
        - name: page
          in: query
          deprecated: true
          description: |
            Прежний постраничный режим: только строки товаров, сначала недавно
            изменённые; ответ содержит pagination. Несовместим с cursor,
            updated_since, order_by, external_id и ids.
          schema:
            type: integer
            minimum: 1
            maximum: 10000
      responses:
        '200':
          description: Страница цен.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-Venets-API-Version:
              $ref: '#/components/headers/XVenetsApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              examples:
                priceListPage:
                  $ref: '#/components/examples/PriceListPage'
              schema:
                type: object
                required:
                  - object
                  - url
                  - data
                  - has_more
                properties:
                  object:
                    type: string
                    enum:
                      - list
                  url:
                    type: string
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/PriceItem'
                  has_more:
                    type: boolean
                  next_cursor:
                    type:
                      - string
                      - 'null'
                    description: Курсор следующей страницы; null — страниц больше нет.
                  pagination:
                    type: object
                    description: Только в режиме page.
                    required:
                      - page
                      - limit
                    properties:
                      page:
                        type: integer
                      limit:
                        type: integer
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '410':
          $ref: '#/components/responses/Gone'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /prices/batch:
    post:
      tags:
        - Prices
      operationId: batchUpdatePrices
      summary: Изменить цены пакетом
      description: |
        Меняет цены до 1000 товаров и вариантов за запрос (тело до 1 МБ). В
        режиме atomic ошибка любой позиции отменяет весь пакет (код первой
        ошибки, в details.results — все ошибочные позиции); в режиме partial
        ответ 200, ошибки — в results. Нарушение правил цен — ошибка позиции
        validation_failed. Снижение цены покупателя больше чем на 70 % у больше
        чем 50 позиций без confirm_large_price_drop: true — 409
        price_drop_confirmation_required, ни одна цена не меняется.
      x-tiluna-scope: prices:write
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PriceBatchRequest'
      responses:
        '200':
          description: Цены изменены.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-Venets-API-Version:
              $ref: '#/components/headers/XVenetsApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              examples:
                priceBatchUpdated:
                  $ref: '#/components/examples/PriceBatchUpdated'
              schema:
                $ref: '#/components/schemas/PriceBatchResult'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '413':
          $ref: '#/components/responses/PayloadTooLarge'
        '415':
          $ref: '#/components/responses/UnsupportedMediaType'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /orders:
    get:
      tags:
        - Orders
      operationId: listOrders
      summary: Список заказов
      description: |
        Заказы, в которых есть позиции юрлица ключа. Каждый заказ показан в части
        продавца: только его позиции и суммы.

        Режимы: без page и cursor — первая страница обзора (новые сверху) с
        next_cursor и прежним объектом pagination; cursor — следующие страницы;
        updated_since или order_by=updated_at — лента изменений для
        синхронизации; page — прежняя постраничная выдача (устарело).
        sortBy и sortOrder действуют только в постраничной выдаче.
      x-tiluna-scope: orders:read
      parameters:
        - $ref: '#/components/parameters/Page'
        - $ref: '#/components/parameters/Limit'
        - name: cursor
          in: query
          description: |
            Непрозрачный курсор из next_cursor предыдущей страницы. Передаётся с
            теми же фильтрами; другие фильтры — 400 cursor_mismatch, курсор старше
            30 дней — 410 cursor_expired. Нельзя вместе с page.
          schema:
            type: string
            maxLength: 1024
        - name: updated_since
          in: query
          description: |
            Лента изменений: объекты стороны, изменённые начиная с этого момента
            (ISO 8601 с зоной), по возрастанию порядка изменений. Изменение,
            закоммиченное позже соседнего, не теряется. Дальше — по next_cursor;
            на последней странице next_cursor тоже выдаётся для следующего опроса.
            Лента доступна после включения синхронизации на площадке; до этого —
            403 feature_not_enabled (param — updated_since или order_by). Лента
            ведётся с момента включения: изменения до него в неё не попадают.
            Поэтому сначала загрузите все объекты обзором (без updated_since), а
            ленту начинайте с момента начала этой загрузки.
          schema:
            type: string
            format: date-time
        - name: order_by
          in: query
          description: |
            updated_at — лента изменений без начальной точки. Доступна на тех же
            условиях, что updated_since.
          schema:
            type: string
            enum:
              - created_at
              - updated_at
            default: created_at
        - name: created_from
          in: query
          description: Начало периода создания включительно, `YYYY-MM-DD`, сутки по московскому времени.
          schema:
            type: string
            format: date
        - name: created_to
          in: query
          description: Конец периода создания включительно, `YYYY-MM-DD`, сутки по московскому времени.
          schema:
            type: string
            format: date
        - name: fulfillment_status
          in: query
          description: Статусы исполнения стороны через запятую (не больше 20).
          schema:
            type: string
            maxLength: 420
          example: awaiting_acceptance
        - name: status
          in: query
          description: Статусы заказа через запятую (не больше 20); устаревший фильтр.
          schema:
            type: string
            maxLength: 420
        - name: number
          in: query
          description: Номер заказа целиком.
          schema:
            type: string
            maxLength: 64
        - name: ids
          in: query
          description: Идентификаторы заказов через запятую, не больше 100.
          schema:
            type: string
            maxLength: 3700
        - name: search
          in: query
          description: Часть номера заказа, не длиннее 120 символов.
          schema:
            type: string
            maxLength: 120
        - $ref: '#/components/parameters/DateFrom'
        - $ref: '#/components/parameters/DateTo'
        - name: sortBy
          in: query
          description: Поле сортировки постраничной выдачи; total — сумма позиций продавца в заказе.
          schema:
            type: string
            enum:
              - created_at
              - total
            default: created_at
        - name: sortOrder
          in: query
          description: Направление сортировки постраничной выдачи.
          schema:
            type: string
            enum:
              - asc
              - desc
            default: desc
      responses:
        '200':
          description: Страница заказов.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-Venets-API-Version:
              $ref: '#/components/headers/XVenetsApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              examples:
                orderListPage:
                  $ref: '#/components/examples/OrderListPage'
              schema:
                type: object
                required:
                  - object
                  - url
                  - data
                  - has_more
                properties:
                  object:
                    type: string
                    const: list
                  url:
                    type: string
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Order'
                  has_more:
                    type: boolean
                  next_cursor:
                    type:
                      - string
                      - 'null'
                    description: Курсор следующей страницы; нет в постраничной выдаче.
                  pagination:
                    $ref: '#/components/schemas/Pagination'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '410':
          $ref: '#/components/responses/Gone'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /orders/{orderId}:
    parameters:
      - $ref: '#/components/parameters/OrderId'
    get:
      tags:
        - Orders
      operationId: getOrder
      summary: Получить заказ
      description: |
        Заказ в части продавца с доставкой, отправлениями и историей статусов.
      x-tiluna-scope: orders:read
      responses:
        '200':
          description: Заказ.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-Venets-API-Version:
              $ref: '#/components/headers/XVenetsApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              examples:
                orderDetail:
                  $ref: '#/components/examples/OrderDetail'
              schema:
                type: object
                required:
                  - order
                properties:
                  order:
                    $ref: '#/components/schemas/OrderDetail'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /orders/{orderId}/accept:
    parameters:
      - $ref: '#/components/parameters/OrderId'
    post:
      tags:
        - Orders
      operationId: acceptOrder
      summary: Принять заказ
      description: |
        Принимает позиции юрлица ключа в оплаченном заказе — так же, как кнопка
        «Принять» в кабинете. В заказе нескольких продавцов принимаются только
        позиции стороны ключа, остальные стороны принимают свои сами. Сторона
        не в статусе awaiting_acceptance — 409 invalid_state (статус — в
        details.fulfillment_status). Заказ, который исполняется в кабинете
        продавца, — 409 order_managed_in_cabinet. Тело — пустой JSON-объект.
      x-tiluna-scope: orders:fulfill
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EmptyObject'
      responses:
        '200':
          description: Позиции стороны приняты.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-Venets-API-Version:
              $ref: '#/components/headers/XVenetsApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              examples:
                orderAccepted:
                  $ref: '#/components/examples/OrderAccepted'
              schema:
                $ref: '#/components/schemas/OrderCommandResult'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '413':
          $ref: '#/components/responses/PayloadTooLarge'
        '415':
          $ref: '#/components/responses/UnsupportedMediaType'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /orders/{orderId}/cancel:
    parameters:
      - $ref: '#/components/parameters/OrderId'
    post:
      tags:
        - Orders
      operationId: cancelOrder
      summary: Отменить заказ
      description: |
        Отменяет позиции юрлица ключа тем же способом, что и кабинет, с возвратом
        денег покупателю. В заказе нескольких продавцов отменяется только часть
        юрлица ключа. Через API отмена доступна, только когда возврат денег
        выполняется автоматически и однозначно: заказ оплачен картой,
        возвратов по нему ещё не было, доля доставки стороны известна.
        Иначе — 409 без обращения к банку, причина — в details.reason:
        cancellation_requires_cabinet (card_hold, card_hold_not_captured,
        sbp_refund_contract_unconfirmed, delivery_split_unavailable,
        refund_scope_inexact, side_spans_multiple_entities) — отмените в
        кабинете; money_command_unavailable (payment_provider_not_supported,
        payment_state_not_settled, refund_in_progress, payment_type_unconfirmed,
        nominal_refund_unavailable, refund_plan_blocked,
        refund_plan_unavailable). Заказ в статусе, который не допускает
        отмену, — 409 invalid_state; другая причина отказа — 400
        cancellation_failed. Ссылка в причине, которую нельзя публиковать, —
        400 unsafe_link.
      x-tiluna-scope: orders:cancel
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrderCancelRequest'
      responses:
        '200':
          description: Позиции отменены.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-Venets-API-Version:
              $ref: '#/components/headers/XVenetsApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              examples:
                orderCancelled:
                  $ref: '#/components/examples/OrderCancelled'
              schema:
                $ref: '#/components/schemas/OrderCancelResult'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '413':
          $ref: '#/components/responses/PayloadTooLarge'
        '415':
          $ref: '#/components/responses/UnsupportedMediaType'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /returns:
    get:
      tags:
        - Returns
      operationId: listReturns
      summary: Список возвратов
      description: |
        Заявки на возврат по позициям юрлица ключа. Фото претензии не выдаются.

        Режимы: без page и cursor — первая страница обзора (новые сверху) с
        next_cursor и прежним объектом pagination; cursor — следующие страницы;
        updated_since или order_by=updated_at — лента изменений для
        синхронизации; page — прежняя постраничная выдача (устарело).
      x-tiluna-scope: returns:read
      parameters:
        - $ref: '#/components/parameters/Page'
        - $ref: '#/components/parameters/Limit'
        - name: cursor
          in: query
          description: |
            Непрозрачный курсор из next_cursor предыдущей страницы. Передаётся с
            теми же фильтрами; другие фильтры — 400 cursor_mismatch, курсор старше
            30 дней — 410 cursor_expired. Нельзя вместе с page.
          schema:
            type: string
            maxLength: 1024
        - name: updated_since
          in: query
          description: |
            Лента изменений: заявки, изменённые начиная с этого момента (ISO 8601
            с зоной), по возрастанию порядка изменений. Дальше — по next_cursor.
            Лента доступна после включения синхронизации на площадке; до этого —
            403 feature_not_enabled. Изменения до включения в ленту не попадают:
            сначала загрузите заявки обзором (без updated_since), а ленту
            начинайте с момента начала этой загрузки.
          schema:
            type: string
            format: date-time
        - name: order_by
          in: query
          description: |
            updated_at — лента изменений без начальной точки. Доступна на тех же
            условиях, что updated_since.
          schema:
            type: string
            enum:
              - created_at
              - updated_at
            default: created_at
        - name: created_from
          in: query
          description: Начало периода создания включительно, `YYYY-MM-DD`, сутки по московскому времени.
          schema:
            type: string
            format: date
        - name: created_to
          in: query
          description: Конец периода создания включительно, `YYYY-MM-DD`, сутки по московскому времени.
          schema:
            type: string
            format: date
        - name: order_id
          in: query
          description: Только заявки по этому заказу.
          schema:
            type: string
            format: uuid
        - name: status
          in: query
          description: Статусы заявки через запятую (не больше 20), значения ReturnStatus.
          schema:
            type: string
            maxLength: 420
          example: pending
      responses:
        '200':
          description: Страница заявок.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-Venets-API-Version:
              $ref: '#/components/headers/XVenetsApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              examples:
                returnListPage:
                  $ref: '#/components/examples/ReturnListPage'
              schema:
                type: object
                required:
                  - object
                  - url
                  - data
                  - has_more
                properties:
                  object:
                    type: string
                    const: list
                  url:
                    type: string
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Return'
                  has_more:
                    type: boolean
                  next_cursor:
                    type:
                      - string
                      - 'null'
                    description: Курсор следующей страницы; нет в постраничной выдаче.
                  pagination:
                    $ref: '#/components/schemas/Pagination'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '410':
          $ref: '#/components/responses/Gone'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /returns/{returnId}:
    parameters:
      - $ref: '#/components/parameters/ReturnId'
    get:
      tags:
        - Returns
      operationId: getReturn
      summary: Получить возврат
      description: |
        Заявка на возврат по позиции юрлица ключа: статус, сроки ответа, сумма
        возврата и отправление возврата. Фото претензии не выдаются.
      x-tiluna-scope: returns:read
      responses:
        '200':
          description: Заявка на возврат.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-Venets-API-Version:
              $ref: '#/components/headers/XVenetsApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              examples:
                returnDetail:
                  $ref: '#/components/examples/ReturnDetail'
              schema:
                type: object
                required:
                  - return
                properties:
                  return:
                    $ref: '#/components/schemas/Return'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /returns/{returnId}/approve:
    parameters:
      - $ref: '#/components/parameters/ReturnId'
    post:
      tags:
        - Returns
      operationId: approveReturn
      summary: Согласиться с возвратом
      description: |
        Подтверждает инструкции по возврату для покупателя. Заявка не в статусе,
        допускающем решение, — 409 invalid_state. Ссылка в ответе покупателю,
        которую нельзя публиковать, — 400 unsafe_link. Правила возвратов: 400
        returns_disputes_plan_denied, 502 returns_disputes_plan_unavailable.
      x-tiluna-scope: returns:decide
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReturnApproveRequest'
      responses:
        '200':
          description: Решение сохранено.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-Venets-API-Version:
              $ref: '#/components/headers/XVenetsApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              examples:
                returnApproved:
                  $ref: '#/components/examples/ReturnApproved'
              schema:
                $ref: '#/components/schemas/ReturnCommandResult'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '413':
          $ref: '#/components/responses/PayloadTooLarge'
        '415':
          $ref: '#/components/responses/UnsupportedMediaType'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /returns/{returnId}/reject:
    parameters:
      - $ref: '#/components/parameters/ReturnId'
    post:
      tags:
        - Returns
      operationId: rejectReturn
      summary: Возразить по возврату
      description: |
        Сохраняет возражение продавца; покупатель получает обоснование. Заявка
        не в статусе, допускающем решение, — 409 invalid_state. Ссылка в
        обосновании, которую нельзя публиковать, — 400 unsafe_link. Правила
        возвратов: 400 returns_disputes_plan_denied, 502
        returns_disputes_plan_unavailable.
      x-tiluna-scope: returns:decide
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReturnRejectRequest'
      responses:
        '200':
          description: Возражение сохранено.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-Venets-API-Version:
              $ref: '#/components/headers/XVenetsApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              examples:
                returnRejected:
                  $ref: '#/components/examples/ReturnRejected'
              schema:
                $ref: '#/components/schemas/ReturnCommandResult'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '413':
          $ref: '#/components/responses/PayloadTooLarge'
        '415':
          $ref: '#/components/responses/UnsupportedMediaType'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /returns/{returnId}/escalate:
    parameters:
      - $ref: '#/components/parameters/ReturnId'
    post:
      tags:
        - Returns
      operationId: escalateReturn
      summary: Передать возврат в арбитраж
      description: |
        Передаёт спор по заявке на рассмотрение Тилуны. Если передача в текущем
        статусе невозможна — 409 invalid_state. Правила возвратов: 400
        returns_disputes_plan_denied, 502 returns_disputes_plan_unavailable.
        Тело — пустой JSON-объект.
      x-tiluna-scope: returns:decide
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EmptyObject'
      responses:
        '200':
          description: Заявка передана в арбитраж.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-Venets-API-Version:
              $ref: '#/components/headers/XVenetsApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              examples:
                returnEscalated:
                  $ref: '#/components/examples/ReturnEscalated'
              schema:
                $ref: '#/components/schemas/ReturnCommandResult'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '413':
          $ref: '#/components/responses/PayloadTooLarge'
        '415':
          $ref: '#/components/responses/UnsupportedMediaType'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /reviews:
    get:
      tags:
        - Reviews
      operationId: listReviews
      summary: Список отзывов
      description: |
        Отзывы покупателей о товарах юрлица ключа. Отдаются только
        опубликованные отзывы. По умолчанию — курсорная выдача от новых к старым; с
        updated_since — по возрастанию времени изменения (ответ продавца тоже
        меняет отзыв). Параметр page включает прежний постраничный режим.
      x-tiluna-scope: reviews:read
      parameters:
        - name: cursor
          in: query
          description: |
            Курсор следующей страницы из next_cursor предыдущего ответа. Действует
            30 дней и только с теми же фильтрами (иначе 400 cursor_mismatch).
          schema:
            type: string
            maxLength: 1024
        - $ref: '#/components/parameters/Limit'
        - name: updated_since
          in: query
          description: Изменения начиная с этого момента (ISO 8601 с зоной); несовместим с page.
          schema:
            type: string
            format: date-time
            maxLength: 35
        - name: page
          in: query
          deprecated: true
          description: Прежний постраничный режим; ответ содержит pagination.
          schema:
            type: integer
            minimum: 1
            maximum: 10000
        - name: sortBy
          in: query
          deprecated: true
          description: Порядок сортировки в режиме page.
          schema:
            type: string
            enum:
              - newest
              - oldest
              - rating_high
              - rating_low
            default: newest
        - name: rating
          in: query
          description: Оценка.
          schema:
            type: integer
            minimum: 1
            maximum: 5
        - name: status
          in: query
          description: Статус модерации. Через API доступны только опубликованные отзывы.
          schema:
            type: string
            enum:
              - approved
            default: approved
        - name: replyStatus
          in: query
          description: Наличие ответа продавца.
          schema:
            type: string
            enum:
              - all
              - unreplied
              - replied
            default: all
        - name: hasImages
          in: query
          description: Только отзывы с фотографиями (true) или без них (false).
          schema:
            type: boolean
        - name: productId
          in: query
          description: Отзывы одного товара.
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Страница отзывов.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-Venets-API-Version:
              $ref: '#/components/headers/XVenetsApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              examples:
                reviewListPage:
                  $ref: '#/components/examples/ReviewListPage'
              schema:
                type: object
                required:
                  - object
                  - url
                  - data
                  - has_more
                properties:
                  object:
                    type: string
                    enum:
                      - list
                  url:
                    type: string
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Review'
                  has_more:
                    type: boolean
                  next_cursor:
                    type:
                      - string
                      - 'null'
                    description: Курсор следующей страницы; null — страниц больше нет.
                  pagination:
                    $ref: '#/components/schemas/Pagination'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '410':
          $ref: '#/components/responses/Gone'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /reviews/stats:
    get:
      tags:
        - Reviews
      operationId: getReviewStats
      summary: Сводка по отзывам
      description: Средняя оценка, распределение оценок и число опубликованных отзывов без ответа.
      x-tiluna-scope: reviews:read
      responses:
        '200':
          description: Сводка.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-Venets-API-Version:
              $ref: '#/components/headers/XVenetsApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              examples:
                reviewStatsSummary:
                  $ref: '#/components/examples/ReviewStatsSummary'
              schema:
                $ref: '#/components/schemas/ReviewStats'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /reviews/{reviewId}/reply:
    parameters:
      - $ref: '#/components/parameters/ReviewId'
    post:
      tags:
        - Reviews
      operationId: replyToReview
      summary: Ответить на отзыв
      description: |
        Публикует ответ продавца или меняет существующий, пока открыто окно
        правки; после него — 409 edit_window_expired. Ответ проверяется по
        правилам отзывов кабинета: 400 review_plan_denied, 502
        review_plan_unavailable. Ссылка, которую нельзя публиковать, — 400
        unsafe_link. Отзыв о товаре другого продавца — 403 forbidden.
      x-tiluna-scope: reviews:reply
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReviewReplyRequest'
      responses:
        '200':
          description: Ответ сохранён.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-Venets-API-Version:
              $ref: '#/components/headers/XVenetsApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              examples:
                reviewReplied:
                  $ref: '#/components/examples/ReviewReplied'
              schema:
                type: object
                required:
                  - success
                  - review
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                  review:
                    oneOf:
                      - $ref: '#/components/schemas/Review'
                      - type: 'null'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '413':
          $ref: '#/components/responses/PayloadTooLarge'
        '415':
          $ref: '#/components/responses/UnsupportedMediaType'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /analytics:
    get:
      tags:
        - Analytics
      operationId: getAnalytics
      summary: Показатели продаж
      description: Выручка, заказы, просмотры и конверсия юрлица ключа за период.
      x-tiluna-scope: analytics:read
      parameters:
        - name: period
          in: query
          description: Период расчёта.
          schema:
            type: string
            enum:
              - today
              - 7days
              - 30days
              - 90days
              - 365days
              - all
            default: 30days
      responses:
        '200':
          description: Показатели за период.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-Venets-API-Version:
              $ref: '#/components/headers/XVenetsApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              examples:
                analyticsLast30Days:
                  $ref: '#/components/examples/AnalyticsLast30Days'
              schema:
                type: object
                required:
                  - stats
                  - period
                properties:
                  stats:
                    $ref: '#/components/schemas/AnalyticsStats'
                  period:
                    type: string
                    enum:
                      - today
                      - 7days
                      - 30days
                      - 90days
                      - 365days
                      - all
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /finance:
    get:
      tags:
        - Finance
      operationId: getFinance
      summary: Финансовые данные
      description: |
        Одна операция с выбором представления параметром view:

        - `transactions` (по умолчанию) — операции постранично, с фильтрами;
        - `balance` — баланс;
        - `payouts` — выплаты;
        - `withdrawals` — заявки на вывод;
        - `schedule` — график поступлений.

        Параметры page, limit, type, status, dateFrom, dateTo и search
        действуют только для view=transactions. Банковские реквизиты и
        печатные формы отчётов через API не выдаются.
      x-tiluna-scope: finance:read
      parameters:
        - name: view
          in: query
          description: Представление.
          schema:
            type: string
            enum:
              - transactions
              - balance
              - payouts
              - withdrawals
              - schedule
            default: transactions
        - $ref: '#/components/parameters/Page'
        - $ref: '#/components/parameters/Limit'
        - name: type
          in: query
          description: Тип операции.
          schema:
            type: string
            enum:
              - sale
              - commission
              - refund
              - withdrawal
              - adjustment
              - clawback
              - delivery_income
              - delivery_charge
              - acquiring_fee
              - chargeback
              - fee
        - name: status
          in: query
          description: Статус операции.
          schema:
            type: string
            enum:
              - pending
              - available
              - paid
              - cancelled
        - $ref: '#/components/parameters/DateFrom'
        - $ref: '#/components/parameters/DateTo'
        - $ref: '#/components/parameters/Search'
      responses:
        '200':
          description: Данные выбранного представления.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-Venets-API-Version:
              $ref: '#/components/headers/XVenetsApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              schema:
                anyOf:
                  - title: Операции (view=transactions)
                    type: object
                    required:
                      - data
                      - pagination
                    properties:
                      data:
                        type: array
                        items:
                          $ref: '#/components/schemas/FinanceTransaction'
                      pagination:
                        $ref: '#/components/schemas/Pagination'
                  - title: Баланс (view=balance)
                    type: object
                    required:
                      - balance
                    properties:
                      balance:
                        $ref: '#/components/schemas/FinanceBalance'
                  - title: Выплаты или заявки на вывод (view=payouts, view=withdrawals)
                    type: object
                    required:
                      - data
                    properties:
                      data:
                        type: array
                        items:
                          $ref: '#/components/schemas/FinancePayout'
                  - title: График поступлений (view=schedule)
                    type: object
                    required:
                      - schedule
                    properties:
                      schedule:
                        type: array
                        items:
                          $ref: '#/components/schemas/FinanceScheduleEntry'
              examples:
                transactions:
                  summary: view=transactions
                  value:
                    data:
                      - id: 4c6e8a0c-2e4a-4c6e-9a0c-2e4a6c8e0a2c
                        seller_id: 0b2d4f6b-8d0f-4b2d-a4f6-8b0d2f4b6d8f
                        legal_entity_id: 5a7c9e1a-3c5e-4a7c-b9e1-3a5c7e9a1c3e
                        order_id: 6d1f3a5b-7c9e-4b2d-8f0a-1c3e5a7b9d2f
                        order_item_id: 2b4d6f8a-0c1e-4a3b-9d5f-7e9a1b3c5d7f
                        type: sale
                        amount: 158000
                        commission_amount: 15800
                        net_amount: 142200
                        balance_after: 995400
                        status: pending
                        description: Продажа по заказу 50001234-0007
                        available_at: '2026-10-15T00:00:00.000Z'
                        paid_at: null
                        withdrawal_id: null
                        created_at: '2026-09-24T08:05:00.000Z'
                    pagination:
                      page: 1
                      limit: 50
                      total: 1
                balance:
                  summary: view=balance
                  value:
                    balance:
                      totalEarned: 1422000
                      grossSales: 1580000
                      commissionPaid: 158000
                      onHold: 284400
                      available: 853200
                      debt: 0
                      paid: 284400
                      pendingPayout: 0
                schedule:
                  summary: view=schedule
                  value:
                    schedule:
                      - available_at: '2026-10-15'
                        amount: 142200
                        transaction_count: 1
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /balance:
    get:
      tags:
        - Finance
      operationId: getBalance
      summary: Баланс
      description: Баланс юрлица ключа в копейках — тот же расчёт, что в кабинете.
      x-tiluna-scope: finance:read
      responses:
        '200':
          description: Баланс.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-Venets-API-Version:
              $ref: '#/components/headers/XVenetsApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Balance'
              example:
                object: balance
                legal_entity_id: 5a7c9e1a-3c5e-4a7c-b9e1-3a5c7e9a1c3e
                on_hold: 284400
                available: 853200
                requested: 0
                currency: RUB
                as_of: '2026-10-01T09:00:00.000Z'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /transactions:
    get:
      tags:
        - Finance
      operationId: listTransactions
      summary: Операции леджера
      description: |
        Операции юрлица ключа: продажи, вознаграждение, возмещения, выплаты,
        корректировки. Курсорный список; created_from/created_to — сутки по
        Москве включительно.
      x-tiluna-scope: finance:read
      parameters:
        - name: limit
          in: query
          description: Количество записей на странице.
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 50
        - name: cursor
          in: query
          description: Непрозрачный курсор next_cursor предыдущей страницы; действует 30 дней и только с теми же фильтрами.
          schema:
            type: string
            maxLength: 1024
        - name: updated_since
          in: query
          description: Изменённые начиная с момента (ISO 8601 с зоной); список идёт по updated_at по возрастанию. Рекомендуемое перекрытие — 5 минут.
          schema:
            type: string
            format: date-time
        - name: order_by
          in: query
          description: Порядок списка; по умолчанию created_at по убыванию.
          schema:
            type: string
            enum:
              - created_at
              - updated_at
        - name: created_from
          in: query
          description: Начало периода создания включительно, `YYYY-MM-DD`, сутки по московскому времени.
          schema:
            type: string
            format: date
        - name: created_to
          in: query
          description: Конец периода создания включительно, `YYYY-MM-DD`, сутки по московскому времени.
          schema:
            type: string
            format: date
        - name: type
          in: query
          description: Виды операций через запятую.
          schema:
            type: string
      responses:
        '200':
          description: Страница операций.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-Venets-API-Version:
              $ref: '#/components/headers/XVenetsApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              examples:
                transactionListPage:
                  $ref: '#/components/examples/TransactionListPage'
              schema:
                type: object
                required:
                  - object
                  - url
                  - data
                  - has_more
                  - next_cursor
                properties:
                  object:
                    type: string
                    const: list
                  url:
                    type: string
                  has_more:
                    type: boolean
                  next_cursor:
                    type:
                      - string
                      - 'null'
                    description: Курсор следующей страницы; null — страниц больше нет.
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Transaction'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '410':
          $ref: '#/components/responses/Gone'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /payouts:
    get:
      tags:
        - Finance
      operationId: listPayouts
      summary: Выплаты
      description: |
        Выплаты юрлица ключа: за отчётный период, по заказам и прежние.
        paid_from/paid_to выбирают только подтверждённые выплаты по дате
        исполнения (Москва).
      x-tiluna-scope: finance:read
      parameters:
        - name: limit
          in: query
          description: Количество записей на странице.
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 50
        - name: cursor
          in: query
          description: Непрозрачный курсор next_cursor предыдущей страницы; действует 30 дней и только с теми же фильтрами.
          schema:
            type: string
            maxLength: 1024
        - name: updated_since
          in: query
          description: Изменённые начиная с момента (ISO 8601 с зоной); список идёт по updated_at по возрастанию. Рекомендуемое перекрытие — 5 минут.
          schema:
            type: string
            format: date-time
        - name: order_by
          in: query
          description: Порядок списка; по умолчанию created_at по убыванию.
          schema:
            type: string
            enum:
              - created_at
              - updated_at
        - name: paid_from
          in: query
          description: Начало периода исполнения выплаты включительно, `YYYY-MM-DD`, по московскому времени.
          schema:
            type: string
            format: date
        - name: paid_to
          in: query
          description: Конец периода исполнения выплаты включительно, `YYYY-MM-DD`, по московскому времени.
          schema:
            type: string
            format: date
        - name: status
          in: query
          description: Статусы через запятую (pending, paid, unconfirmed, in_review, failed, cancelled).
          schema:
            type: string
      responses:
        '200':
          description: Страница выплат.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-Venets-API-Version:
              $ref: '#/components/headers/XVenetsApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              examples:
                payoutListPage:
                  $ref: '#/components/examples/PayoutListPage'
              schema:
                type: object
                required:
                  - object
                  - url
                  - data
                  - has_more
                  - next_cursor
                properties:
                  object:
                    type: string
                    const: list
                  url:
                    type: string
                  has_more:
                    type: boolean
                  next_cursor:
                    type:
                      - string
                      - 'null'
                    description: Курсор следующей страницы; null — страниц больше нет.
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Payout'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '410':
          $ref: '#/components/responses/Gone'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /payouts/{id}:
    parameters:
      - name: id
        in: path
        required: true
        description: Идентификатор выплаты или отчёта агента — поле id из списка.
        schema:
          type: string
          format: uuid
    get:
      tags:
        - Finance
      operationId: getPayout
      summary: Получить выплату
      description: |
        Выплата юрлица ключа: сумма, удержания, статус, платёжный документ и
        число заказов в ней. Выплата другого юрлица — 404.
      x-tiluna-scope: finance:read
      responses:
        '200':
          description: Выплата.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-Venets-API-Version:
              $ref: '#/components/headers/XVenetsApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              examples:
                payoutDetail:
                  $ref: '#/components/examples/PayoutDetail'
              schema:
                $ref: '#/components/schemas/Payout'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /payouts/{id}/sources:
    parameters:
      - name: id
        in: path
        required: true
        description: Идентификатор выплаты или отчёта агента — поле id из списка.
        schema:
          type: string
          format: uuid
    get:
      tags:
        - Finance
      operationId: listPayoutSources
      summary: Заказы выплаты
      description: Заказы, из которых собрана выплата, и суммы по ним. У прежних выплат разбивки нет — список пуст.
      x-tiluna-scope: finance:read
      parameters:
        - name: limit
          in: query
          description: Количество записей на странице.
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 50
        - name: cursor
          in: query
          description: Непрозрачный курсор next_cursor предыдущей страницы; действует 30 дней и только с теми же фильтрами.
          schema:
            type: string
            maxLength: 1024
      responses:
        '200':
          description: Страница заказов выплаты.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-Venets-API-Version:
              $ref: '#/components/headers/XVenetsApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              examples:
                payoutSourceListPage:
                  $ref: '#/components/examples/PayoutSourceListPage'
              schema:
                type: object
                required:
                  - object
                  - url
                  - data
                  - has_more
                  - next_cursor
                properties:
                  object:
                    type: string
                    const: list
                  url:
                    type: string
                  has_more:
                    type: boolean
                  next_cursor:
                    type:
                      - string
                      - 'null'
                    description: Курсор следующей страницы; null — страниц больше нет.
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/PayoutSource'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '410':
          $ref: '#/components/responses/Gone'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /deductions:
    get:
      tags:
        - Finance
      operationId: listDeductions
      summary: Услуги и удержания
      description: |
        Вознаграждение агента, возмещение расходов на доставку и эквайринг,
        скидки за счёт продавца, корректировки и их сторно. Сумма со знаком
        для продавца. Штрафов как отдельной сущности нет.
      x-tiluna-scope: finance:read
      parameters:
        - name: limit
          in: query
          description: Количество записей на странице.
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 50
        - name: cursor
          in: query
          description: Непрозрачный курсор next_cursor предыдущей страницы; действует 30 дней и только с теми же фильтрами.
          schema:
            type: string
            maxLength: 1024
        - name: updated_since
          in: query
          description: Изменённые начиная с момента (ISO 8601 с зоной); список идёт по updated_at по возрастанию. Рекомендуемое перекрытие — 5 минут.
          schema:
            type: string
            format: date-time
        - name: order_by
          in: query
          description: Порядок списка; по умолчанию created_at по убыванию.
          schema:
            type: string
            enum:
              - created_at
              - updated_at
        - name: created_from
          in: query
          description: Начало периода создания включительно, `YYYY-MM-DD`, сутки по московскому времени.
          schema:
            type: string
            format: date
        - name: created_to
          in: query
          description: Конец периода создания включительно, `YYYY-MM-DD`, сутки по московскому времени.
          schema:
            type: string
            format: date
        - name: service_code
          in: query
          description: Коды услуг через запятую.
          schema:
            type: string
      responses:
        '200':
          description: Страница удержаний.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-Venets-API-Version:
              $ref: '#/components/headers/XVenetsApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              examples:
                deductionListPage:
                  $ref: '#/components/examples/DeductionListPage'
              schema:
                type: object
                required:
                  - object
                  - url
                  - data
                  - has_more
                  - next_cursor
                properties:
                  object:
                    type: string
                    const: list
                  url:
                    type: string
                  has_more:
                    type: boolean
                  next_cursor:
                    type:
                      - string
                      - 'null'
                    description: Курсор следующей страницы; null — страниц больше нет.
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Deduction'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '410':
          $ref: '#/components/responses/Gone'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /agent_reports:
    get:
      tags:
        - Finance
      operationId: listAgentReports
      summary: Отчёты агента
      description: Отчёты агента юрлица ключа; period_from/period_to — пересечение с периодом отчёта.
      x-tiluna-scope: finance:read
      parameters:
        - name: limit
          in: query
          description: Количество записей на странице.
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 50
        - name: cursor
          in: query
          description: Непрозрачный курсор next_cursor предыдущей страницы; действует 30 дней и только с теми же фильтрами.
          schema:
            type: string
            maxLength: 1024
        - name: updated_since
          in: query
          description: Изменённые начиная с момента (ISO 8601 с зоной); список идёт по updated_at по возрастанию. Рекомендуемое перекрытие — 5 минут.
          schema:
            type: string
            format: date-time
        - name: order_by
          in: query
          description: Порядок списка; по умолчанию created_at по убыванию.
          schema:
            type: string
            enum:
              - created_at
              - updated_at
        - name: period_from
          in: query
          description: Отчёты, период которых пересекается с периодом начиная с этой даты, `YYYY-MM-DD`.
          schema:
            type: string
            format: date
        - name: period_to
          in: query
          description: Отчёты, период которых пересекается с периодом до этой даты включительно, `YYYY-MM-DD`.
          schema:
            type: string
            format: date
      responses:
        '200':
          description: Страница отчётов агента.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-Venets-API-Version:
              $ref: '#/components/headers/XVenetsApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              examples:
                agentReportListPage:
                  $ref: '#/components/examples/AgentReportListPage'
              schema:
                type: object
                required:
                  - object
                  - url
                  - data
                  - has_more
                  - next_cursor
                properties:
                  object:
                    type: string
                    const: list
                  url:
                    type: string
                  has_more:
                    type: boolean
                  next_cursor:
                    type:
                      - string
                      - 'null'
                    description: Курсор следующей страницы; null — страниц больше нет.
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/AgentReport'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '410':
          $ref: '#/components/responses/Gone'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /agent_reports/{id}:
    parameters:
      - name: id
        in: path
        required: true
        description: Идентификатор выплаты или отчёта агента — поле id из списка.
        schema:
          type: string
          format: uuid
    get:
      tags:
        - Finance
      operationId: getAgentReport
      summary: Получить отчёт агента
      description: |
        Отчёт агента юрлица ключа: период, статус, итоги в копейках и ссылки на
        строки и PDF. preliminary: true — период ещё не закрыт.
      x-tiluna-scope: finance:read
      responses:
        '200':
          description: Отчёт агента.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-Venets-API-Version:
              $ref: '#/components/headers/XVenetsApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              examples:
                agentReportDetail:
                  $ref: '#/components/examples/AgentReportDetail'
              schema:
                $ref: '#/components/schemas/AgentReport'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /agent_reports/{id}/lines:
    parameters:
      - name: id
        in: path
        required: true
        description: Идентификатор выплаты или отчёта агента — поле id из списка.
        schema:
          type: string
          format: uuid
    get:
      tags:
        - Finance
      operationId: listAgentReportLines
      summary: Строки отчёта агента
      description: |
        Строки листа отчёта агента (деньги — копейки). Период документа
        совпадает с закрытым отчётным периодом — строки отчёта периода
        (source: tl_snapshot); иначе — строки документа «АГ» (source:
        ag_legacy), листы receipts и payouts у него пусты. preliminary — как
        у отчёта агента: false, когда период закрыт целиком.
      x-tiluna-scope: finance:read
      parameters:
        - name: sheet
          in: query
          description: Лист отчёта — продажи, возвраты, поступления, услуги или выплаты.
          schema:
            type: string
            enum:
              - sales
              - returns
              - receipts
              - services
              - payouts
            default: sales
        - name: limit
          in: query
          description: Количество строк на странице.
          schema:
            type: integer
            minimum: 1
            maximum: 1000
            default: 500
        - name: cursor
          in: query
          description: Непрозрачный курсор next_cursor предыдущей страницы; действует 30 дней и только с тем же листом.
          schema:
            type: string
            maxLength: 1024
      responses:
        '200':
          description: Страница строк.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-Venets-API-Version:
              $ref: '#/components/headers/XVenetsApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              examples:
                agentReportSalesLines:
                  $ref: '#/components/examples/AgentReportSalesLines'
              schema:
                type: object
                required:
                  - object
                  - url
                  - data
                  - has_more
                  - next_cursor
                  - sheet
                  - source
                  - preliminary
                properties:
                  object:
                    type: string
                    const: list
                  url:
                    type: string
                  has_more:
                    type: boolean
                  next_cursor:
                    type:
                      - string
                      - 'null'
                    description: Курсор следующей страницы; null — страниц больше нет.
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/ReportRow'
                  sheet:
                    type: string
                  source:
                    type: string
                    enum:
                      - tl_snapshot
                      - ag_legacy
                  preliminary:
                    type: boolean
                  agent_report:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
                      number:
                        type: string
                  currency:
                    type: string
                    const: RUB
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '410':
          $ref: '#/components/responses/Gone'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /agent_reports/{id}/file:
    parameters:
      - name: id
        in: path
        required: true
        description: Идентификатор выплаты или отчёта агента — поле id из списка.
        schema:
          type: string
          format: uuid
    get:
      tags:
        - Finance
      operationId: getAgentReportFile
      summary: PDF отчёта агента
      description: Файл документа тем же ключом; содержимое сверяется с контрольной суммой реестра.
      x-tiluna-scope: finance:read
      responses:
        '200':
          description: PDF документа.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            Content-Disposition:
              description: Имя файла.
              schema:
                type: string
          content:
            application/pdf:
              schema:
                type: string
                format: binary
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /me:
    get:
      tags:
        - Account
      operationId: getCurrentApiKey
      summary: Ключ запроса
      description: Сведения о ключе, которым сделан запрос, без секрета и следов использования. Доступен любому действующему ключу, право account:read для этого запроса не требуется.
      x-tiluna-scope: account:read
      responses:
        '200':
          description: Ключ.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-Venets-API-Version:
              $ref: '#/components/headers/XVenetsApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              examples:
                currentApiKey:
                  $ref: '#/components/examples/CurrentApiKey'
              schema:
                $ref: '#/components/schemas/ApiKey'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /legal_entities:
    get:
      tags:
        - Account
      operationId: listLegalEntities
      summary: Юрлица
      description: Юрлицо ключа; для ключа без юрлица список пуст.
      x-tiluna-scope: account:read
      responses:
        '200':
          description: Юрлица.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-Venets-API-Version:
              $ref: '#/components/headers/XVenetsApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              examples:
                legalEntityListPage:
                  $ref: '#/components/examples/LegalEntityListPage'
              schema:
                type: object
                required:
                  - object
                  - url
                  - data
                  - has_more
                  - next_cursor
                properties:
                  object:
                    type: string
                    const: list
                  url:
                    type: string
                  has_more:
                    type: boolean
                  next_cursor:
                    type: 'null'
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/LegalEntity'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /legal_entities/{id}:
    parameters:
      - name: id
        in: path
        required: true
        description: Идентификатор юрлица.
        schema:
          type: string
          format: uuid
    get:
      tags:
        - Account
      operationId: getLegalEntity
      summary: Получить юрлицо
      description: |
        Реквизиты юрлица, доступного ключу: вид, названия, ИНН, КПП, ОГРН,
        налоговый режим, НДС, статус и принятая версия оферты. Юрлицо, к
        которому у ключа нет доступа, — 404.
      x-tiluna-scope: account:read
      responses:
        '200':
          description: Юрлицо.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-Venets-API-Version:
              $ref: '#/components/headers/XVenetsApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              examples:
                legalEntityDetail:
                  $ref: '#/components/examples/LegalEntityDetail'
              schema:
                $ref: '#/components/schemas/LegalEntity'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /reports:
    post:
      tags:
        - Reports
      operationId: createReport
      summary: Заказать отчёт
      description: |
        Ставит отчёт в очередь и сразу отвечает 202 со статусом queued; готовность —
        GET /reports/{id} или событие report.ready. Кроме reports:create нужен
        scope типа отчёта: agent_sales, payouts, deductions — finance:read,
        orders — orders:read. Не больше 3 отчётов в работе и 20 созданий в час
        на юрлицо (409 report_limit_reached). Отчёт agent_sales — только для
        ключа юрлица. Пока отчёты не включены для кабинета — 403
        feature_not_enabled.
      x-tiluna-scope: reports:create
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReportCreateRequest'
            example:
              type: agent_sales
              formats:
                - xlsx
                - json
              period:
                from: '2026-09-01'
                to: '2026-09-30'
      responses:
        '202':
          description: Отчёт поставлен в очередь.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-Venets-API-Version:
              $ref: '#/components/headers/XVenetsApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              examples:
                reportQueued:
                  $ref: '#/components/examples/ReportQueued'
              schema:
                $ref: '#/components/schemas/Report'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '409':
          $ref: '#/components/responses/Conflict'
        '413':
          $ref: '#/components/responses/PayloadTooLarge'
        '415':
          $ref: '#/components/responses/UnsupportedMediaType'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    get:
      tags:
        - Reports
      operationId: listReports
      summary: Список отчётов
      description: Отчёты юрлица ключа тех типов, которые разрешены scopes ключа.
      x-tiluna-scope: reports:read
      parameters:
        - name: limit
          in: query
          description: Количество записей на странице.
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 50
        - name: cursor
          in: query
          description: Непрозрачный курсор next_cursor предыдущей страницы; действует 30 дней и только с теми же фильтрами.
          schema:
            type: string
            maxLength: 1024
        - name: type
          in: query
          description: Типы отчётов через запятую.
          schema:
            type: string
        - name: status
          in: query
          description: Статусы через запятую.
          schema:
            type: string
      responses:
        '200':
          description: Страница отчётов.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-Venets-API-Version:
              $ref: '#/components/headers/XVenetsApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              examples:
                reportListPage:
                  $ref: '#/components/examples/ReportListPage'
              schema:
                type: object
                required:
                  - object
                  - url
                  - data
                  - has_more
                  - next_cursor
                properties:
                  object:
                    type: string
                    const: list
                  url:
                    type: string
                  has_more:
                    type: boolean
                  next_cursor:
                    type:
                      - string
                      - 'null'
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Report'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '410':
          $ref: '#/components/responses/Gone'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /reports/{id}:
    parameters:
      - name: id
        in: path
        required: true
        description: Идентификатор отчёта.
        schema:
          type: string
          format: uuid
    get:
      tags:
        - Reports
      operationId: getReport
      summary: Статус отчёта
      description: |
        Отчёт и его статус. Когда status = succeeded, в files — файлы с размером,
        контрольной суммой SHA-256 и адресом скачивания; failed — причина в
        error. Файлы хранятся 7 дней (expires_at).
      x-tiluna-scope: reports:read
      responses:
        '200':
          description: Отчёт и его файлы.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-Venets-API-Version:
              $ref: '#/components/headers/XVenetsApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              examples:
                reportSucceeded:
                  $ref: '#/components/examples/ReportSucceeded'
                reportFailed:
                  $ref: '#/components/examples/ReportFailed'
              schema:
                $ref: '#/components/schemas/Report'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /reports/{id}/download:
    parameters:
      - name: id
        in: path
        required: true
        description: Идентификатор отчёта.
        schema:
          type: string
          format: uuid
    get:
      tags:
        - Reports
      operationId: downloadReport
      summary: Скачать файл отчёта
      description: |
        Поток файла тем же ключом: xlsx — книга Excel, csv — ZIP с файлом на лист
        (UTF-8 с BOM, разделитель «;», суммы в рублях), json — gzip со строками в
        копейках. Пока отчёт формируется — 425 report_not_ready; после 7 дней —
        410 report_expired.
      x-tiluna-scope: reports:read
      parameters:
        - name: format
          in: query
          required: true
          description: Формат файла — один из заказанных в formats.
          schema:
            type: string
            enum:
              - xlsx
              - csv
              - json
      responses:
        '200':
          description: Файл отчёта.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            Content-Disposition:
              description: Имя файла.
              schema:
                type: string
          content:
            application/vnd.openxmlformats-officedocument.spreadsheetml.sheet:
              schema:
                type: string
                format: binary
            application/zip:
              schema:
                type: string
                format: binary
            application/gzip:
              schema:
                type: string
                format: binary
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '410':
          $ref: '#/components/responses/Gone'
        '425':
          $ref: '#/components/responses/TooEarly'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /reports/{id}/rows:
    parameters:
      - name: id
        in: path
        required: true
        description: Идентификатор отчёта.
        schema:
          type: string
          format: uuid
    get:
      tags:
        - Reports
      operationId: listReportRows
      summary: Строки отчёта
      description: |
        Строки листа готового отчёта постранично — те же, что в файле; деньги —
        целые копейки. Лист по умолчанию — первый лист отчёта.
      x-tiluna-scope: reports:read
      parameters:
        - name: sheet
          in: query
          description: Лист отчёта; по умолчанию — первый лист. Имена листов — ключи row_counts отчёта.
          schema:
            type: string
            maxLength: 32
        - name: limit
          in: query
          description: Количество строк на странице.
          schema:
            type: integer
            minimum: 1
            maximum: 1000
            default: 500
        - name: cursor
          in: query
          description: Непрозрачный курсор next_cursor предыдущей страницы; действует 30 дней и только с теми же фильтрами.
          schema:
            type: string
            maxLength: 1024
      responses:
        '200':
          description: Страница строк.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-Venets-API-Version:
              $ref: '#/components/headers/XVenetsApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              examples:
                reportSalesRows:
                  $ref: '#/components/examples/ReportSalesRows'
              schema:
                type: object
                required:
                  - object
                  - url
                  - data
                  - has_more
                  - next_cursor
                  - sheet
                properties:
                  object:
                    type: string
                    const: list
                  url:
                    type: string
                  has_more:
                    type: boolean
                  next_cursor:
                    type:
                      - string
                      - 'null'
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/ReportRow'
                  sheet:
                    type: string
                  report:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
                      type:
                        type: string
                      preliminary:
                        type: boolean
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '410':
          $ref: '#/components/responses/Gone'
        '425':
          $ref: '#/components/responses/TooEarly'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /events:
    get:
      tags:
        - Webhooks
      operationId: listEvents
      summary: Лента событий
      description: |
        События продавца в порядке записи в журнал: способ надёжно получить всё,
        что произошло, без вебхуков или для сверки после сбоя доставки.

        Первый запрос без `after` начинается с самого старого доступного события
        (журнал хранит 30 дней) или с `created_since`. Каждый ответ содержит
        `next_cursor`, в том числе последняя страница: сохраните его и повторяйте
        запрос с `after=<next_cursor>` — придут только новые события. Порядок
        устойчив к параллельным записям: событие, записанное позже соседнего,
        не будет пропущено.

        Ключ юрлица видит события своего юрлица; ключ без юрлица — только
        события без юрлица. Тип события выдаётся, только если у ключа есть scope этого
        типа (см. `GET /event_types`); недоступные типы пропускаются без ошибки.
        Без `types` выдаются типы подписки по умолчанию; `shipment.tracking_updated`
        приходит только по точному имени в `types`.

        Курсор, указывающий на события старше срока хранения, отклоняется с
        `410 cursor_expired`: пересинхронизируйте данные через `updated_since`
        списков и начните ленту заново.
      x-tiluna-scope: events:read
      parameters:
        - name: after
          in: query
          description: Курсор из `next_cursor` предыдущего ответа.
          schema:
            type: string
            maxLength: 1024
        - name: limit
          in: query
          description: Количество событий на странице.
          schema:
            type: integer
            minimum: 1
            maximum: 500
            default: 100
        - name: types
          in: query
          description: |
            Типы через запятую (не больше 20): точное имя (`order.paid`) или
            маска (`order.*`, `*`).
          schema:
            type: string
            maxLength: 1300
          example: order.*,return.created
        - name: created_since
          in: query
          description: Начало первой страницы (ISO 8601 с зоной); игнорируется вместе с `after`.
          schema:
            type: string
            format: date-time
      responses:
        '200':
          description: Страница событий.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-Venets-API-Version:
              $ref: '#/components/headers/XVenetsApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              examples:
                eventListPage:
                  $ref: '#/components/examples/EventListPage'
              schema:
                $ref: '#/components/schemas/EventList'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '410':
          $ref: '#/components/responses/Gone'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /events/{eventId}:
    get:
      tags:
        - Webhooks
      operationId: getEvent
      summary: Событие
      description: |
        Одно событие журнала по `id` (например, из вебхука) — для проверки,
        что уведомление настоящее. Событие другого юрлица или типа без scope у
        ключа — `404`.
      x-tiluna-scope: events:read
      parameters:
        - name: eventId
          in: path
          required: true
          description: Идентификатор события.
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Событие.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-Venets-API-Version:
              $ref: '#/components/headers/XVenetsApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              examples:
                eventDetail:
                  $ref: '#/components/examples/EventDetail'
              schema:
                $ref: '#/components/schemas/Event'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /event_types:
    get:
      tags:
        - Webhooks
      operationId: listEventTypes
      summary: Типы событий
      description: |
        Каталог типов событий: ресурс, scope, нужный для получения через ленту,
        и признак подписки по умолчанию. Новые типы появляются без смены версии.
      x-tiluna-scope: events:read
      responses:
        '200':
          description: Каталог типов.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-Venets-API-Version:
              $ref: '#/components/headers/XVenetsApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              examples:
                eventTypeCatalog:
                  $ref: '#/components/examples/EventTypeCatalog'
              schema:
                $ref: '#/components/schemas/EventTypeList'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /webhook_endpoints:
    get:
      tags:
        - Webhooks
      operationId: listWebhookEndpoints
      summary: Адреса вебхуков
      description: |
        Адреса для уведомлений, настроенные в кабинете продавца, — только
        чтение. Создать, изменить, сменить секрет или отключить адрес можно
        только в кабинете. Ключ юрлица видит адреса своего юрлица; ключ без
        юрлица — только адреса без юрлица. Секреты не выдаются.
      x-tiluna-scope: webhooks:read
      parameters:
        - name: cursor
          in: query
          description: Курсор из `next_cursor` предыдущего ответа.
          schema:
            type: string
            maxLength: 1024
        - $ref: '#/components/parameters/Limit'
      responses:
        '200':
          description: Страница адресов, новые сверху.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-Venets-API-Version:
              $ref: '#/components/headers/XVenetsApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              examples:
                webhookEndpointListPage:
                  $ref: '#/components/examples/WebhookEndpointListPage'
              schema:
                $ref: '#/components/schemas/WebhookEndpointList'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '410':
          $ref: '#/components/responses/Gone'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /test_helpers/orders:
    servers:
      - url: https://sandbox-api.tiluna.ru/v1
        description: Песочница
    post:
      tags:
        - TestHelpers
      operationId: testHelpersCreateOrder
      summary: Создать тестовый заказ
      description: |
        Создаёт заказ синтетического покупателя с товарами юрлица ключа — как
        оформление на витрине: цена товара, комиссия по правилам площадки,
        резерв остатка. Товар указывается `product_id` или `external_id`; у
        товара с вариантами нужен `variant_id`. Без `pay` заказ ждёт оплаты,
        с `pay: true` сразу оплачивается симулятором (без банка и без чека).
        Покупатели и адреса вымышленные. Нехватка остатка — 409
        inventory_conflict, неопубликованный товар — 409 invalid_state.
      x-tiluna-scope: test_helpers:write
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              required:
                - items
              properties:
                items:
                  type: array
                  minItems: 1
                  maxItems: 20
                  items:
                    type: object
                    additionalProperties: false
                    properties:
                      product_id:
                        type: string
                        format: uuid
                      external_id:
                        type: string
                        minLength: 1
                        maxLength: 128
                      variant_id:
                        type: string
                        format: uuid
                      quantity:
                        type: integer
                        minimum: 1
                        maximum: 20
                        default: 1
                delivery:
                  type: object
                  additionalProperties: false
                  required:
                    - method
                  properties:
                    method:
                      type: string
                      enum:
                        - cdek_pvz
                        - cdek_courier
                      default: cdek_pvz
                pay:
                  type: boolean
                  default: false
            example:
              items:
                - external_id: EXT-TSHIRT-BASIC
                  variant_id: 7f1c2a4e-1b2c-8d3e-9f40-5a6b7c8d9e0f
                  quantity: 2
              delivery:
                method: cdek_pvz
              pay: true
      responses:
        '201':
          description: Заказ создан (`awaiting_payment` или `awaiting_acceptance`).
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-Venets-API-Version:
              $ref: '#/components/headers/XVenetsApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              examples:
                sandboxOrderPaid:
                  $ref: '#/components/examples/SandboxOrderPaid'
              schema:
                $ref: '#/components/schemas/Order'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '413':
          $ref: '#/components/responses/PayloadTooLarge'
        '415':
          $ref: '#/components/responses/UnsupportedMediaType'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /test_helpers/orders/{orderId}/pay:
    servers:
      - url: https://sandbox-api.tiluna.ru/v1
        description: Песочница
    parameters:
      - $ref: '#/components/parameters/OrderId'
    post:
      tags:
        - TestHelpers
      operationId: testHelpersPayOrder
      summary: Оплатить тестовый заказ
      description: |
        Симулирует подтверждённую оплату заказа в статусе awaiting_payment:
        заказ переходит в awaiting_acceptance, приходит событие `order.paid`,
        в леджере появляются строки продажи. Банк не вызывается, чек не
        создаётся. Повтор для оплаченного заказа — 409 invalid_state. Тело —
        пустой JSON-объект.
      x-tiluna-scope: test_helpers:write
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EmptyObject'
      responses:
        '200':
          description: Заказ оплачен.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-Venets-API-Version:
              $ref: '#/components/headers/XVenetsApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              examples:
                sandboxOrderPaid:
                  $ref: '#/components/examples/SandboxOrderPaid'
              schema:
                $ref: '#/components/schemas/Order'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '413':
          $ref: '#/components/responses/PayloadTooLarge'
        '415':
          $ref: '#/components/responses/UnsupportedMediaType'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /test_helpers/orders/{orderId}/advance:
    servers:
      - url: https://sandbox-api.tiluna.ru/v1
        description: Песочница
    parameters:
      - $ref: '#/components/parameters/OrderId'
    post:
      tags:
        - TestHelpers
      operationId: testHelpersAdvanceOrder
      summary: Продвинуть заказ у перевозчика
      description: |
        Симулирует СДЭК: `shipped` — перевозчик принял принятые позиции
        (сначала примите заказ командой POST /orders/{orderId}/accept), трек-номер
        можно передать в `tracking_number`, иначе он будет вымышленным;
        `delivered` — покупатель получил отгруженные позиции; `completed` —
        срок возврата истёк (ускорено). События: `order.shipped`,
        `shipment.tracking_updated`, `order.delivered`, `order.status_changed`.
        Недопустимый переход — 409 invalid_state.
      x-tiluna-scope: test_helpers:write
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              required:
                - to
              properties:
                to:
                  type: string
                  enum:
                    - shipped
                    - delivered
                    - completed
                tracking_number:
                  type: string
                  minLength: 4
                  maxLength: 40
                  pattern: ^[A-Za-z0-9-]+$
            example:
              to: shipped
      responses:
        '200':
          description: Заказ продвинут.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-Venets-API-Version:
              $ref: '#/components/headers/XVenetsApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              examples:
                sandboxOrderShipped:
                  $ref: '#/components/examples/SandboxOrderShipped'
              schema:
                $ref: '#/components/schemas/Order'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '413':
          $ref: '#/components/responses/PayloadTooLarge'
        '415':
          $ref: '#/components/responses/UnsupportedMediaType'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /test_helpers/orders/{orderId}/cancel_by_buyer:
    servers:
      - url: https://sandbox-api.tiluna.ru/v1
        description: Песочница
    parameters:
      - $ref: '#/components/parameters/OrderId'
    post:
      tags:
        - TestHelpers
      operationId: testHelpersCancelOrderByBuyer
      summary: Отменить заказ от имени покупателя
      description: |
        Отмена покупателем неоплаченного заказа или оплаченного, но ещё не
        принятого. Остаток возвращается; за оплаченный заказ покупателю
        возвращаются деньги симулятором (событие `order.refunded`). Событие
        `order.cancelled` с `cancelled_by: buyer`. Тело — пустой JSON-объект.

        Ограничение песочницы: отмена продавцом (`POST /orders/{id}/cancel`)
        оплаченного заказа отвечает 409 `money_command_unavailable` и заказ не
        меняет — возврат денег по отмене продавца проводит только боевой
        платёжный провайдер. События `order.cancelled` и `order.refunded`
        проверяйте этим методом; отмену продавцом — на неоплаченном заказе.
      x-tiluna-scope: test_helpers:write
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EmptyObject'
      responses:
        '200':
          description: Заказ отменён.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-Venets-API-Version:
              $ref: '#/components/headers/XVenetsApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              examples:
                sandboxOrderCancelledByBuyer:
                  $ref: '#/components/examples/SandboxOrderCancelledByBuyer'
              schema:
                $ref: '#/components/schemas/Order'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '413':
          $ref: '#/components/responses/PayloadTooLarge'
        '415':
          $ref: '#/components/responses/UnsupportedMediaType'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /test_helpers/returns:
    servers:
      - url: https://sandbox-api.tiluna.ru/v1
        description: Песочница
    post:
      tags:
        - TestHelpers
      operationId: testHelpersCreateReturn
      summary: Создать заявку на возврат
      description: |
        Заявка покупателя на возврат доставленной позиции заказа юрлица ключа.
        Решение принимается штатными командами POST /returns/{returnId}/approve,
        /reject и /escalate. По позиции может быть одна активная заявка.
        Событие `return.created`.
      x-tiluna-scope: test_helpers:write
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              required:
                - order_id
                - order_item_id
              properties:
                order_id:
                  type: string
                  format: uuid
                order_item_id:
                  type: string
                  format: uuid
                kind:
                  type: string
                  enum:
                    - quality
                    - defect
                  default: quality
                reason:
                  type: string
                  enum:
                    - wrong_size
                    - defective
                    - not_as_described
                    - changed_mind
                    - other
                  default: wrong_size
            example:
              order_id: 9e1a3c5e-7a9c-4e1a-8c5e-7a9c1e3a5c7e
              order_item_id: 5a7c9e1a-3c5e-4a7c-9e1a-3c5e7a9c1e3d
              kind: quality
              reason: wrong_size
      responses:
        '201':
          description: Заявка создана.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-Venets-API-Version:
              $ref: '#/components/headers/XVenetsApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              examples:
                sandboxReturnCreated:
                  $ref: '#/components/examples/SandboxReturnCreated'
              schema:
                $ref: '#/components/schemas/Return'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '413':
          $ref: '#/components/responses/PayloadTooLarge'
        '415':
          $ref: '#/components/responses/UnsupportedMediaType'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /test_helpers/returns/{returnId}/advance:
    servers:
      - url: https://sandbox-api.tiluna.ru/v1
        description: Песочница
    parameters:
      - $ref: '#/components/parameters/ReturnId'
    post:
      tags:
        - TestHelpers
      operationId: testHelpersAdvanceReturn
      summary: Продвинуть возврат
      description: |
        Для согласованного возврата: `received` — продавец получил посылку
        (событие `return.shipment_updated`); `refunded` — покупателю возвращены
        деньги симулятором, без банка и без чека (события `return.refunded`,
        `order.refunded`; в леджере — строка возврата). До согласования и до
        получения посылки — 409 invalid_state.
      x-tiluna-scope: test_helpers:write
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              required:
                - to
              properties:
                to:
                  type: string
                  enum:
                    - received
                    - refunded
            example:
              to: refunded
      responses:
        '200':
          description: Возврат продвинут.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-Venets-API-Version:
              $ref: '#/components/headers/XVenetsApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              examples:
                sandboxReturnRefunded:
                  $ref: '#/components/examples/SandboxReturnRefunded'
              schema:
                $ref: '#/components/schemas/Return'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '413':
          $ref: '#/components/responses/PayloadTooLarge'
        '415':
          $ref: '#/components/responses/UnsupportedMediaType'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /test_helpers/agent_reports:
    servers:
      - url: https://sandbox-api.tiluna.ru/v1
        description: Песочница
    post:
      tags:
        - TestHelpers
      operationId: testHelpersCreateAgentReport
      summary: Сформировать отчёт агента
      description: |
        Предварительный отчёт агента за период на тестовых данных: продажи
        доставленных позиций, возвраты, вознаграждение и итог к перечислению.
        По умолчанию — с 1-го числа текущего месяца по сегодня (Москва), не
        больше 62 дней, только после последнего закрытого периода. Отчёт того
        же месяца, созданный раньше, замещается. Событие `agent_report.ready`.
        Файл PDF в песочнице не формируется.
      x-tiluna-scope: test_helpers:write
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              properties:
                period:
                  type: object
                  additionalProperties: false
                  properties:
                    from:
                      type: string
                      format: date
                    to:
                      type: string
                      format: date
            example:
              period:
                from: '2026-10-01'
                to: '2026-10-09'
      responses:
        '201':
          description: Отчёт сформирован.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-Venets-API-Version:
              $ref: '#/components/headers/XVenetsApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              examples:
                sandboxAgentReportPreliminary:
                  $ref: '#/components/examples/SandboxAgentReportPreliminary'
              schema:
                $ref: '#/components/schemas/AgentReport'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '413':
          $ref: '#/components/responses/PayloadTooLarge'
        '415':
          $ref: '#/components/responses/UnsupportedMediaType'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /test_helpers/payouts:
    servers:
      - url: https://sandbox-api.tiluna.ru/v1
        description: Песочница
    post:
      tags:
        - TestHelpers
      operationId: testHelpersCreatePayout
      summary: Создать тестовую выплату
      description: |
        Синтетическая выплата по доставленным заказам юрлица ключа без
        возвратов, которые ещё не вошли в выплату или закрытый период.
        Выплата сразу в статусе `paid`; события `payout.created` и
        `payout.paid`; строки продажи в леджере отмечаются выплаченными. Банк
        не вызывается. Нет подходящих заказов — 409 invalid_state. Тело —
        пустой JSON-объект.
      x-tiluna-scope: test_helpers:write
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EmptyObject'
      responses:
        '201':
          description: Выплата создана.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-Venets-API-Version:
              $ref: '#/components/headers/XVenetsApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              examples:
                sandboxPayoutPaid:
                  $ref: '#/components/examples/SandboxPayoutPaid'
              schema:
                $ref: '#/components/schemas/Payout'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '413':
          $ref: '#/components/responses/PayloadTooLarge'
        '415':
          $ref: '#/components/responses/UnsupportedMediaType'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /test_helpers/events:
    servers:
      - url: https://sandbox-api.tiluna.ru/v1
        description: Песочница
    post:
      tags:
        - TestHelpers
      operationId: testHelpersSendEvent
      summary: Отправить образец события
      description: |
        Записывает событие выбранного типа по последнему ресурсу тестового
        аккаунта (`source: sandbox`, в данных `sample: true`). Воркер доставит
        его на адреса вебхуков, подписанные на этот тип. Неизвестный тип —
        400 validation_failed.
      x-tiluna-scope: test_helpers:write
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              required:
                - type
              properties:
                type:
                  type: string
                  maxLength: 64
            example:
              type: order.paid
      responses:
        '201':
          description: Событие записано.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-Venets-API-Version:
              $ref: '#/components/headers/XVenetsApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              examples:
                sandboxSampleEvent:
                  $ref: '#/components/examples/SandboxSampleEvent'
              schema:
                $ref: '#/components/schemas/Event'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '413':
          $ref: '#/components/responses/PayloadTooLarge'
        '415':
          $ref: '#/components/responses/UnsupportedMediaType'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /test_helpers/reset:
    servers:
      - url: https://sandbox-api.tiluna.ru/v1
        description: Песочница
    post:
      tags:
        - TestHelpers
      operationId: testHelpersReset
      summary: Сбросить тестовый аккаунт
      description: |
        Возвращает данные тестового аккаунта к исходному наполнению: удаляет
        созданные заказы, товары, возвраты, выплаты, отчёты и события и
        восстанавливает исходные. Ключи, адреса вебхуков и журнал запросов
        сохраняются. Без активности 30 дней аккаунт сбрасывается сам. Тело —
        пустой JSON-объект.
      x-tiluna-scope: test_helpers:write
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EmptyObject'
      responses:
        '200':
          description: Аккаунт сброшен.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-Venets-API-Version:
              $ref: '#/components/headers/XVenetsApiVersion'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
          content:
            application/json:
              examples:
                sandboxReset:
                  $ref: '#/components/examples/SandboxReset'
              schema:
                type: object
                additionalProperties: false
                required:
                  - object
                  - completed_at
                properties:
                  object:
                    type: string
                    const: reset
                  completed_at:
                    type: string
                    format: date-time
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '413':
          $ref: '#/components/responses/PayloadTooLarge'
        '415':
          $ref: '#/components/responses/UnsupportedMediaType'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
webhooks:
  sellerEvent:
    post:
      tags:
        - Webhooks
      operationId: receiveSellerEvent
      summary: Уведомление о событии
      description: |
        Тилуна отправляет POST на HTTPS-адрес, настроенный в кабинете продавца,
        по каждому событию подписки. Тот же конверт выдаёт `GET /events`.

        ## Проверка подписи

        Заголовок `Tiluna-Signature: t=<unix-время>,v1=<hex>[,v1=<hex>]`.
        Вычислите `HMAC-SHA256(секрет, "{t}.{сырое тело запроса}")` в hex и
        сравните за постоянное время с каждым `v1`: подходит любой. Две
        подписи `v1` приходят во время смены секрета с перекрытием (сутки или
        неделя) — одна новым секретом, другая прежним. Отклоняйте `t` старше
        5 минут и повторные `Tiluna-Event-Id`. Секрет показывается один раз при
        создании адреса или смене секрета.

        ## Ответ и повторы

        Любой ответ 2xx подтверждает доставку; отвечайте быстро (таймаут
        соединения 5 с, всего запроса — 10 с) и обрабатывайте событие
        асинхронно. Любой другой ответ, включая 3xx (перенаправления не
        выполняются) и все 4xx, и сетевые ошибки приводят к повторам: 13 попыток
        за 72 часа от события (сразу, через 1, 5, 15, 30 минут, 1, 2, 4, 8, 16,
        24, 48 и 72 часа, с разбросом ±10 %). `Retry-After` в ответах 429 и 503
        учитывается, но не дольше часа. Ответ `410 Gone` сразу отключает адрес.

        После 5 неудач подряд адрес ставится на паузу (от 1 минуты до часа):
        события копятся и отправляются после паузы. Адрес без успешных доставок
        трое суток и с пятью окончательно не доставленными событиями
        отключается — владелец получает уведомление и может включить адрес
        снова и повторить неотправленные события за 30 дней.

        Порядок доставки не гарантирован: дедуплицируйте по `Tiluna-Event-Id` и
        сверяйте `data.object.updated_at`; пропуски восстанавливайте через
        `GET /events`.

        Схема тела и пример для каждого типа события — в разделе «События
        вебхуков». Тестовое событие, отправленное кнопкой проверки адреса,
        приходит с `sequence: 0`, нулевым идентификатором ресурса и
        `data.object.test: true`.

        ## Прежний формат

        Адреса, подключённые до перехода на v1, получают прежнее тело
        (`WebhookEvent`, версия 2026-05-08) и заголовки `X-Venets-*` с подписью
        `X-Venets-Signature: sha256=HMAC-SHA256(секрет, "{X-Venets-Timestamp}.{тело}")`,
        а также `Tiluna-Signature` над тем же телом. Такие адреса получают только
        13 прежних типов событий. `X-Venets-Signature` подписывается одним,
        текущим секретом, поэтому секрет такого адреса меняется сразу, без
        перекрытия: обновите его у получателя сразу после смены (неудачные
        доставки повторятся по расписанию). Перевести адрес на v1 можно кнопкой
        «Обновить формат» в кабинете; прежний формат поддерживается до
        2027-04-01.
      security: []
      parameters:
        - $ref: '#/components/parameters/TilunaSignature'
        - $ref: '#/components/parameters/TilunaEventId'
        - $ref: '#/components/parameters/TilunaEventType'
        - $ref: '#/components/parameters/TilunaDeliveryId'
        - $ref: '#/components/parameters/TilunaDeliveryAttempt'
        - $ref: '#/components/parameters/TilunaApiVersion'
        - name: X-Venets-Event-Id
          in: header
          required: false
          description: Только прежний формат. Идентификатор события.
          schema:
            type: string
            format: uuid
        - name: X-Venets-Event-Type
          in: header
          required: false
          description: Только прежний формат. Тип события.
          schema:
            $ref: '#/components/schemas/WebhookEventType'
        - name: X-Venets-Delivery-Id
          in: header
          required: false
          description: Только прежний формат. Идентификатор доставки.
          schema:
            type: string
            format: uuid
        - name: X-Venets-Timestamp
          in: header
          required: false
          description: Только прежний формат. Время отправки, unix-время в секундах.
          schema:
            type: string
            pattern: ^[0-9]{1,12}$
        - name: X-Venets-Signature
          in: header
          required: false
          description: Только прежний формат. Подпись `sha256=<hex>`.
          schema:
            type: string
            pattern: ^sha256=[0-9a-f]{64}$
        - name: X-Venets-API-Version
          in: header
          required: false
          description: Только прежний формат. Версия формата события (2026-05-08).
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - $ref: '#/components/schemas/Event'
                - $ref: '#/components/schemas/WebhookEvent'
            examples:
              orderPaid:
                summary: Оплата заказа (формат v1)
                value:
                  id: 0f5c2f8e-5f7a-4c1b-9a3e-2d4f6b8c0e1a
                  object: event
                  type: order.paid
                  api_version: '2026-10-01'
                  created: '2026-10-01T09:00:00.123Z'
                  occurred_at: '2026-10-01T08:59:59.800Z'
                  livemode: true
                  sequence: 1048576
                  legal_entity: 1e9a1000-0000-4000-8000-000000000001
                  source: buyer
                  resource:
                    type: order
                    id: 6d1f3a5b-7c9e-4b2d-8f0a-1c3e5a7b9d2f
                    url: /v1/orders/6d1f3a5b-7c9e-4b2d-8f0a-1c3e5a7b9d2f
                  data:
                    object:
                      object: order
                      id: 6d1f3a5b-7c9e-4b2d-8f0a-1c3e5a7b9d2f
                      number: TL-2026-000123
                      fulfillment_status: awaiting_acceptance
                      updated_at: '2026-10-01T08:59:59.800Z'
                    previous_attributes:
                      fulfillment_status: awaiting_payment
                  request:
                    id: null
                    idempotency_key: null
              orderShippedLegacy:
                summary: Отгрузка заказа (прежний формат)
                value:
                  id: 9f1b3d5f-7a9c-4e1b-8d3f-5a7c9e1b3d5f
                  type: order.shipped
                  api_version: '2026-05-08'
                  created_at: '2026-09-24T12:00:00.000Z'
                  data:
                    order_id: 6d1f3a5b-7c9e-4b2d-8f0a-1c3e5a7b9d2f
                    object: order
                    id: 6d1f3a5b-7c9e-4b2d-8f0a-1c3e5a7b9d2f
                    fulfillment_status: shipped
              ping:
                summary: Проверка из кабинета
                value:
                  id: 0e2a4c6e-8a0c-4e2a-9c6e-8a0c2e4a6c8e
                  object: event
                  type: ping
                  api_version: '2026-10-01'
                  created: '2026-10-01T09:00:00.000Z'
                  occurred_at: '2026-10-01T09:00:00.000Z'
                  livemode: true
                  sequence: 0
                  legal_entity: null
                  source: platform
                  resource:
                    type: ping
                    id: null
                    url: null
                  data:
                    object:
                      object: ping
                      message: Тестовое событие Тилуны. Ответьте статусом 2xx — интеграция настроена.
                    previous_attributes: null
                  request:
                    id: null
                    idempotency_key: null
      responses:
        '200':
          description: Доставка принята. Подходит любой код 2xx.
        '410':
          description: Адрес больше не принимает события — Тилуна отключает его.
        '429':
          description: Получатель перегружен; событие будет отправлено повторно с учётом Retry-After.
        '500':
          description: Ошибка получателя; событие будет отправлено повторно.
  order.paid:
    post:
      tags:
        - WebhookEvents
      operationId: receiveOrderPaid
      summary: Заказ оплачен
      description: |
        Покупатель оплатил заказ, позиции стороны ждут принятия — примите их
        (`POST /orders/{orderId}/accept`). Срок принятия в API пока не
        передаётся: `acceptance_deadline` в `GET /orders/{orderId}` равен `null`.
        `payment_status: authorized` — сумма заблокирована на карте покупателя и
        ещё не списана. Такие позиции можно принять и собрать, но отгрузка до
        списания отвечает `409 invalid_state`. Списание запрашивается при
        оформлении отправления в кабинете или автоматически до окончания
        блокировки. Отдельного события о списании пока нет: признак списания —
        `paid_at` в `GET /orders/{orderId}` (до списания `null`); заказ в
        статусе `pending` при этом переходит в `paid_pending_release`. Позиции,
        не принятые до окончания блокировки, система отменяет (событие
        `order.items_cancelled` или `order.cancelled` с `reason_code:
        acceptance_timeout`). Событие приходит один раз на сторону заказа.

        Лента событий выдаёт этот тип ключу со scope `orders:read`.
        Входит в подписку нового адреса по умолчанию.
        Адресам прежнего формата не отправляется.
      security: []
      parameters:
        - $ref: '#/components/parameters/TilunaSignature'
        - $ref: '#/components/parameters/TilunaEventId'
        - $ref: '#/components/parameters/TilunaEventType'
        - $ref: '#/components/parameters/TilunaDeliveryId'
        - $ref: '#/components/parameters/TilunaDeliveryAttempt'
        - $ref: '#/components/parameters/TilunaApiVersion'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrderPaidEvent'
            examples:
              orderPaid:
                $ref: '#/components/examples/OrderPaidWebhook'
              testOrderPaid:
                $ref: '#/components/examples/TestOrderPaidWebhook'
      responses:
        '200':
          description: Доставка принята. Подходит любой код 2xx; тело ответа не читается.
        '410':
          description: Адрес больше не принимает события — Тилуна отключает его.
        '429':
          description: Получатель перегружен; событие будет отправлено повторно с учётом Retry-After (не дольше часа).
        '500':
          description: Ошибка получателя; событие будет отправлено повторно по расписанию.
  order.accepted:
    post:
      tags:
        - WebhookEvents
      operationId: receiveOrderAccepted
      summary: Заказ принят
      description: |
        Позиции стороны приняты — кнопкой «Принять» в кабинете или запросом
        `POST /orders/{orderId}/accept`. `accepted_item_ids` — позиции, принятые
        этим действием. Событие приходит и на приём через API: такие события
        отличаются `source: seller_api` и `request.idempotency_key`.

        Лента событий выдаёт этот тип ключу со scope `orders:read`.
        Входит в подписку нового адреса по умолчанию.
        Адреса прежнего формата получают этот тип в прежнем теле `WebhookEvent` (см. «Уведомление о событии»).
      security: []
      parameters:
        - $ref: '#/components/parameters/TilunaSignature'
        - $ref: '#/components/parameters/TilunaEventId'
        - $ref: '#/components/parameters/TilunaEventType'
        - $ref: '#/components/parameters/TilunaDeliveryId'
        - $ref: '#/components/parameters/TilunaDeliveryAttempt'
        - $ref: '#/components/parameters/TilunaApiVersion'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrderAcceptedEvent'
            examples:
              orderAccepted:
                $ref: '#/components/examples/OrderAcceptedWebhook'
      responses:
        '200':
          description: Доставка принята. Подходит любой код 2xx; тело ответа не читается.
        '410':
          description: Адрес больше не принимает события — Тилуна отключает его.
        '429':
          description: Получатель перегружен; событие будет отправлено повторно с учётом Retry-After (не дольше часа).
        '500':
          description: Ошибка получателя; событие будет отправлено повторно по расписанию.
  order.shipped:
    post:
      tags:
        - WebhookEvents
      operationId: receiveOrderShipped
      summary: Заказ отгружен
      description: |
        Отгружены все неотменённые позиции стороны. Перевозчик и трек-номер —
        `carrier`, `tracking_number`, `tracking_url`; `shipped_item_ids` —
        позиции, отгруженные этим действием.

        Лента событий выдаёт этот тип ключу со scope `orders:read`.
        Входит в подписку нового адреса по умолчанию.
        Адреса прежнего формата получают этот тип в прежнем теле `WebhookEvent` (см. «Уведомление о событии»).
      security: []
      parameters:
        - $ref: '#/components/parameters/TilunaSignature'
        - $ref: '#/components/parameters/TilunaEventId'
        - $ref: '#/components/parameters/TilunaEventType'
        - $ref: '#/components/parameters/TilunaDeliveryId'
        - $ref: '#/components/parameters/TilunaDeliveryAttempt'
        - $ref: '#/components/parameters/TilunaApiVersion'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrderShippedEvent'
            examples:
              orderShipped:
                $ref: '#/components/examples/OrderShippedWebhook'
      responses:
        '200':
          description: Доставка принята. Подходит любой код 2xx; тело ответа не читается.
        '410':
          description: Адрес больше не принимает события — Тилуна отключает его.
        '429':
          description: Получатель перегружен; событие будет отправлено повторно с учётом Retry-After (не дольше часа).
        '500':
          description: Ошибка получателя; событие будет отправлено повторно по расписанию.
  order.partially_shipped:
    post:
      tags:
        - WebhookEvents
      operationId: receiveOrderPartiallyShipped
      summary: Заказ отгружен частично
      description: |
        Отгружена часть позиций стороны, остальные ещё в работе. Поля отгрузки —
        как в `order.shipped`.

        Лента событий выдаёт этот тип ключу со scope `orders:read`.
        Входит в подписку нового адреса по умолчанию.
        Адреса прежнего формата получают этот тип в прежнем теле `WebhookEvent` (см. «Уведомление о событии»).
      security: []
      parameters:
        - $ref: '#/components/parameters/TilunaSignature'
        - $ref: '#/components/parameters/TilunaEventId'
        - $ref: '#/components/parameters/TilunaEventType'
        - $ref: '#/components/parameters/TilunaDeliveryId'
        - $ref: '#/components/parameters/TilunaDeliveryAttempt'
        - $ref: '#/components/parameters/TilunaApiVersion'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrderPartiallyShippedEvent'
            examples:
              orderPartiallyShipped:
                $ref: '#/components/examples/OrderPartiallyShippedWebhook'
      responses:
        '200':
          description: Доставка принята. Подходит любой код 2xx; тело ответа не читается.
        '410':
          description: Адрес больше не принимает события — Тилуна отключает его.
        '429':
          description: Получатель перегружен; событие будет отправлено повторно с учётом Retry-After (не дольше часа).
        '500':
          description: Ошибка получателя; событие будет отправлено повторно по расписанию.
  order.cancelled:
    post:
      tags:
        - WebhookEvents
      operationId: receiveOrderCancelled
      summary: Заказ отменён
      description: |
        Отменены все позиции стороны: покупателем, продавцом, Тилуной или системой
        (заказ не оплачен или не принят вовремя). Кто и почему — `cancelled_by` и
        `reason_code`. Снимите резерв и остановите сборку. Если деньги уже были
        списаны, их возврат покупателю придёт событием `order.refunded`.

        Лента событий выдаёт этот тип ключу со scope `orders:read`.
        Входит в подписку нового адреса по умолчанию.
        Адреса прежнего формата получают этот тип в прежнем теле `WebhookEvent` (см. «Уведомление о событии»).
      security: []
      parameters:
        - $ref: '#/components/parameters/TilunaSignature'
        - $ref: '#/components/parameters/TilunaEventId'
        - $ref: '#/components/parameters/TilunaEventType'
        - $ref: '#/components/parameters/TilunaDeliveryId'
        - $ref: '#/components/parameters/TilunaDeliveryAttempt'
        - $ref: '#/components/parameters/TilunaApiVersion'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrderCancelledEvent'
            examples:
              orderCancelled:
                $ref: '#/components/examples/OrderCancelledWebhook'
      responses:
        '200':
          description: Доставка принята. Подходит любой код 2xx; тело ответа не читается.
        '410':
          description: Адрес больше не принимает события — Тилуна отключает его.
        '429':
          description: Получатель перегружен; событие будет отправлено повторно с учётом Retry-After (не дольше часа).
        '500':
          description: Ошибка получателя; событие будет отправлено повторно по расписанию.
  order.items_cancelled:
    post:
      tags:
        - WebhookEvents
      operationId: receiveOrderItemsCancelled
      summary: Отменена часть позиций
      description: |
        Отменена часть позиций стороны (`partial: true`), остальные остаются в
        работе. Позиции, отменённые этим действием, — `cancelled_item_ids`.

        Лента событий выдаёт этот тип ключу со scope `orders:read`.
        Входит в подписку нового адреса по умолчанию.
        Адресам прежнего формата не отправляется.
      security: []
      parameters:
        - $ref: '#/components/parameters/TilunaSignature'
        - $ref: '#/components/parameters/TilunaEventId'
        - $ref: '#/components/parameters/TilunaEventType'
        - $ref: '#/components/parameters/TilunaDeliveryId'
        - $ref: '#/components/parameters/TilunaDeliveryAttempt'
        - $ref: '#/components/parameters/TilunaApiVersion'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrderItemsCancelledEvent'
            examples:
              orderItemsCancelled:
                $ref: '#/components/examples/OrderItemsCancelledWebhook'
      responses:
        '200':
          description: Доставка принята. Подходит любой код 2xx; тело ответа не читается.
        '410':
          description: Адрес больше не принимает события — Тилуна отключает его.
        '429':
          description: Получатель перегружен; событие будет отправлено повторно с учётом Retry-After (не дольше часа).
        '500':
          description: Ошибка получателя; событие будет отправлено повторно по расписанию.
  order.status_changed:
    post:
      tags:
        - WebhookEvents
      operationId: receiveOrderStatusChanged
      summary: Изменился статус заказа
      description: |
        Изменился статус заказа целиком: новый — `status`, прежний —
        `previous_attributes.status`. Для решений по своей части заказа
        ориентируйтесь на `fulfillment_status` и статусы позиций.

        Лента событий выдаёт этот тип ключу со scope `orders:read`.
        Входит в подписку нового адреса по умолчанию.
        Адресам прежнего формата не отправляется.
      security: []
      parameters:
        - $ref: '#/components/parameters/TilunaSignature'
        - $ref: '#/components/parameters/TilunaEventId'
        - $ref: '#/components/parameters/TilunaEventType'
        - $ref: '#/components/parameters/TilunaDeliveryId'
        - $ref: '#/components/parameters/TilunaDeliveryAttempt'
        - $ref: '#/components/parameters/TilunaApiVersion'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrderStatusChangedEvent'
            examples:
              orderStatusChanged:
                $ref: '#/components/examples/OrderStatusChangedWebhook'
      responses:
        '200':
          description: Доставка принята. Подходит любой код 2xx; тело ответа не читается.
        '410':
          description: Адрес больше не принимает события — Тилуна отключает его.
        '429':
          description: Получатель перегружен; событие будет отправлено повторно с учётом Retry-After (не дольше часа).
        '500':
          description: Ошибка получателя; событие будет отправлено повторно по расписанию.
  order.delivered:
    post:
      tags:
        - WebhookEvents
      operationId: receiveOrderDelivered
      summary: Заказ доставлен
      description: |
        Все неотменённые позиции стороны доставлены покупателю по данным
        перевозчика.

        Лента событий выдаёт этот тип ключу со scope `orders:read`.
        Входит в подписку нового адреса по умолчанию.
        Адресам прежнего формата не отправляется.
      security: []
      parameters:
        - $ref: '#/components/parameters/TilunaSignature'
        - $ref: '#/components/parameters/TilunaEventId'
        - $ref: '#/components/parameters/TilunaEventType'
        - $ref: '#/components/parameters/TilunaDeliveryId'
        - $ref: '#/components/parameters/TilunaDeliveryAttempt'
        - $ref: '#/components/parameters/TilunaApiVersion'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrderDeliveredEvent'
            examples:
              orderDelivered:
                $ref: '#/components/examples/OrderDeliveredWebhook'
      responses:
        '200':
          description: Доставка принята. Подходит любой код 2xx; тело ответа не читается.
        '410':
          description: Адрес больше не принимает события — Тилуна отключает его.
        '429':
          description: Получатель перегружен; событие будет отправлено повторно с учётом Retry-After (не дольше часа).
        '500':
          description: Ошибка получателя; событие будет отправлено повторно по расписанию.
  order.refunded:
    post:
      tags:
        - WebhookEvents
      operationId: receiveOrderRefunded
      summary: Деньги по заказу возвращены
      description: |
        Тилуна зафиксировала возврат денег покупателю по заказу. Возврат может
        быть частичным; сумма — `refund.amount` в копейках. Событие получает
        сторона, по позициям которой вернули деньги; при возврате по всему
        заказу — каждая сторона заказа.

        Если возврат оформлен решением Тилуны по заказу (спор, смена статуса
        заказа), `refund.id` равен `null`, а `refund.amount` — обычно тоже
        `null`: событие фиксирует решение, а не операцию возврата, и само по
        себе не подтверждает движение денег. По тому же возврату такое событие
        может прийти вдобавок к событию с `refund.id` — не считайте его вторым
        возвратом. Сумму возвращённого берите из событий с `refund.id`,
        состояние заказа — из `GET /orders/{orderId}`, движения денег стороны —
        из `GET /transactions`.

        Лента событий выдаёт этот тип ключу со scope `orders:read`.
        Входит в подписку нового адреса по умолчанию.
        Адресам прежнего формата не отправляется.
      security: []
      parameters:
        - $ref: '#/components/parameters/TilunaSignature'
        - $ref: '#/components/parameters/TilunaEventId'
        - $ref: '#/components/parameters/TilunaEventType'
        - $ref: '#/components/parameters/TilunaDeliveryId'
        - $ref: '#/components/parameters/TilunaDeliveryAttempt'
        - $ref: '#/components/parameters/TilunaApiVersion'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrderRefundedEvent'
            examples:
              orderRefunded:
                $ref: '#/components/examples/OrderRefundedWebhook'
              orderRefundedByDecision:
                $ref: '#/components/examples/OrderRefundedByDecisionWebhook'
      responses:
        '200':
          description: Доставка принята. Подходит любой код 2xx; тело ответа не читается.
        '410':
          description: Адрес больше не принимает события — Тилуна отключает его.
        '429':
          description: Получатель перегружен; событие будет отправлено повторно с учётом Retry-After (не дольше часа).
        '500':
          description: Ошибка получателя; событие будет отправлено повторно по расписанию.
  shipment.tracking_updated:
    post:
      tags:
        - WebhookEvents
      operationId: receiveShipmentTrackingUpdated
      summary: Обновилось отслеживание отправления
      description: |
        Перевозчик сообщил новый статус отправления заказа (`shipment`). Тип не
        входит в подписку по умолчанию: включите его в настройках адреса в
        кабинете, а в ленте запрашивайте точным именем в `types`. Повтор того же
        статуса нового события не создаёт.

        Лента событий выдаёт этот тип ключу со scope `orders:read`.
        В подписку по умолчанию не входит.
        Адресам прежнего формата не отправляется.
      security: []
      parameters:
        - $ref: '#/components/parameters/TilunaSignature'
        - $ref: '#/components/parameters/TilunaEventId'
        - $ref: '#/components/parameters/TilunaEventType'
        - $ref: '#/components/parameters/TilunaDeliveryId'
        - $ref: '#/components/parameters/TilunaDeliveryAttempt'
        - $ref: '#/components/parameters/TilunaApiVersion'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ShipmentTrackingUpdatedEvent'
            examples:
              shipmentTrackingUpdated:
                $ref: '#/components/examples/ShipmentTrackingUpdatedWebhook'
      responses:
        '200':
          description: Доставка принята. Подходит любой код 2xx; тело ответа не читается.
        '410':
          description: Адрес больше не принимает события — Тилуна отключает его.
        '429':
          description: Получатель перегружен; событие будет отправлено повторно с учётом Retry-After (не дольше часа).
        '500':
          description: Ошибка получателя; событие будет отправлено повторно по расписанию.
  return.created:
    post:
      tags:
        - WebhookEvents
      operationId: receiveReturnCreated
      summary: Оформлен возврат
      description: |
        Покупатель оформил заявку на возврат по позиции стороны. Ответьте до срока
        `seller_response_deadline` из `GET /returns/{returnId}`: согласитесь,
        возразите или передайте спор Тилуне. Причина покупателя и фото претензии в
        событие не попадают.

        Лента событий выдаёт этот тип ключу со scope `returns:read`.
        Входит в подписку нового адреса по умолчанию.
        Адресам прежнего формата не отправляется.
      security: []
      parameters:
        - $ref: '#/components/parameters/TilunaSignature'
        - $ref: '#/components/parameters/TilunaEventId'
        - $ref: '#/components/parameters/TilunaEventType'
        - $ref: '#/components/parameters/TilunaDeliveryId'
        - $ref: '#/components/parameters/TilunaDeliveryAttempt'
        - $ref: '#/components/parameters/TilunaApiVersion'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReturnCreatedEvent'
            examples:
              returnCreated:
                $ref: '#/components/examples/ReturnCreatedWebhook'
      responses:
        '200':
          description: Доставка принята. Подходит любой код 2xx; тело ответа не читается.
        '410':
          description: Адрес больше не принимает события — Тилуна отключает его.
        '429':
          description: Получатель перегружен; событие будет отправлено повторно с учётом Retry-After (не дольше часа).
        '500':
          description: Ошибка получателя; событие будет отправлено повторно по расписанию.
  return.approved:
    post:
      tags:
        - WebhookEvents
      operationId: receiveReturnApproved
      summary: Возврат одобрен
      description: |
        Продавец согласился с возвратом — в кабинете или запросом
        `POST /returns/{returnId}/approve`.

        Лента событий выдаёт этот тип ключу со scope `returns:read`.
        Входит в подписку нового адреса по умолчанию.
        Адреса прежнего формата получают этот тип в прежнем теле `WebhookEvent` (см. «Уведомление о событии»).
      security: []
      parameters:
        - $ref: '#/components/parameters/TilunaSignature'
        - $ref: '#/components/parameters/TilunaEventId'
        - $ref: '#/components/parameters/TilunaEventType'
        - $ref: '#/components/parameters/TilunaDeliveryId'
        - $ref: '#/components/parameters/TilunaDeliveryAttempt'
        - $ref: '#/components/parameters/TilunaApiVersion'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReturnApprovedEvent'
            examples:
              returnApproved:
                $ref: '#/components/examples/ReturnApprovedWebhook'
      responses:
        '200':
          description: Доставка принята. Подходит любой код 2xx; тело ответа не читается.
        '410':
          description: Адрес больше не принимает события — Тилуна отключает его.
        '429':
          description: Получатель перегружен; событие будет отправлено повторно с учётом Retry-After (не дольше часа).
        '500':
          description: Ошибка получателя; событие будет отправлено повторно по расписанию.
  return.rejected:
    post:
      tags:
        - WebhookEvents
      operationId: receiveReturnRejected
      summary: Возврат отклонён
      description: |
        Продавец возразил по заявке — в кабинете или запросом
        `POST /returns/{returnId}/reject`. Покупатель может передать спор Тилуне:
        тогда придёт `return.escalated`.

        Лента событий выдаёт этот тип ключу со scope `returns:read`.
        Входит в подписку нового адреса по умолчанию.
        Адреса прежнего формата получают этот тип в прежнем теле `WebhookEvent` (см. «Уведомление о событии»).
      security: []
      parameters:
        - $ref: '#/components/parameters/TilunaSignature'
        - $ref: '#/components/parameters/TilunaEventId'
        - $ref: '#/components/parameters/TilunaEventType'
        - $ref: '#/components/parameters/TilunaDeliveryId'
        - $ref: '#/components/parameters/TilunaDeliveryAttempt'
        - $ref: '#/components/parameters/TilunaApiVersion'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReturnRejectedEvent'
            examples:
              returnRejected:
                $ref: '#/components/examples/ReturnRejectedWebhook'
      responses:
        '200':
          description: Доставка принята. Подходит любой код 2xx; тело ответа не читается.
        '410':
          description: Адрес больше не принимает события — Тилуна отключает его.
        '429':
          description: Получатель перегружен; событие будет отправлено повторно с учётом Retry-After (не дольше часа).
        '500':
          description: Ошибка получателя; событие будет отправлено повторно по расписанию.
  return.escalated:
    post:
      tags:
        - WebhookEvents
      operationId: receiveReturnEscalated
      summary: Спор передан Тилуне
      description: |
        Заявка передана на рассмотрение Тилуны; кто передал — `escalated_by`.
        Решение придёт событием `return.resolved`.

        Лента событий выдаёт этот тип ключу со scope `returns:read`.
        Входит в подписку нового адреса по умолчанию.
        Адреса прежнего формата получают этот тип в прежнем теле `WebhookEvent` (см. «Уведомление о событии»).
      security: []
      parameters:
        - $ref: '#/components/parameters/TilunaSignature'
        - $ref: '#/components/parameters/TilunaEventId'
        - $ref: '#/components/parameters/TilunaEventType'
        - $ref: '#/components/parameters/TilunaDeliveryId'
        - $ref: '#/components/parameters/TilunaDeliveryAttempt'
        - $ref: '#/components/parameters/TilunaApiVersion'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReturnEscalatedEvent'
            examples:
              returnEscalated:
                $ref: '#/components/examples/ReturnEscalatedWebhook'
      responses:
        '200':
          description: Доставка принята. Подходит любой код 2xx; тело ответа не читается.
        '410':
          description: Адрес больше не принимает события — Тилуна отключает его.
        '429':
          description: Получатель перегружен; событие будет отправлено повторно с учётом Retry-After (не дольше часа).
        '500':
          description: Ошибка получателя; событие будет отправлено повторно по расписанию.
  return.shipment_updated:
    post:
      tags:
        - WebhookEvents
      operationId: receiveReturnShipmentUpdated
      summary: Обновилось отправление возврата
      description: |
        Изменилось отправление возврата: появился трек-номер или новый статус
        перевозчика (`return_shipment`).

        Лента событий выдаёт этот тип ключу со scope `returns:read`.
        Входит в подписку нового адреса по умолчанию.
        Адресам прежнего формата не отправляется.
      security: []
      parameters:
        - $ref: '#/components/parameters/TilunaSignature'
        - $ref: '#/components/parameters/TilunaEventId'
        - $ref: '#/components/parameters/TilunaEventType'
        - $ref: '#/components/parameters/TilunaDeliveryId'
        - $ref: '#/components/parameters/TilunaDeliveryAttempt'
        - $ref: '#/components/parameters/TilunaApiVersion'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReturnShipmentUpdatedEvent'
            examples:
              returnShipmentUpdated:
                $ref: '#/components/examples/ReturnShipmentUpdatedWebhook'
      responses:
        '200':
          description: Доставка принята. Подходит любой код 2xx; тело ответа не читается.
        '410':
          description: Адрес больше не принимает события — Тилуна отключает его.
        '429':
          description: Получатель перегружен; событие будет отправлено повторно с учётом Retry-After (не дольше часа).
        '500':
          description: Ошибка получателя; событие будет отправлено повторно по расписанию.
  return.refunded:
    post:
      tags:
        - WebhookEvents
      operationId: receiveReturnRefunded
      summary: Деньги по возврату отправлены
      description: |
        Деньги по заявке на возврат отправлены покупателю; сумма —
        `refund_amount` в копейках.

        Лента событий выдаёт этот тип ключу со scope `returns:read`.
        Входит в подписку нового адреса по умолчанию.
        Адресам прежнего формата не отправляется.
      security: []
      parameters:
        - $ref: '#/components/parameters/TilunaSignature'
        - $ref: '#/components/parameters/TilunaEventId'
        - $ref: '#/components/parameters/TilunaEventType'
        - $ref: '#/components/parameters/TilunaDeliveryId'
        - $ref: '#/components/parameters/TilunaDeliveryAttempt'
        - $ref: '#/components/parameters/TilunaApiVersion'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReturnRefundedEvent'
            examples:
              returnRefunded:
                $ref: '#/components/examples/ReturnRefundedWebhook'
      responses:
        '200':
          description: Доставка принята. Подходит любой код 2xx; тело ответа не читается.
        '410':
          description: Адрес больше не принимает события — Тилуна отключает его.
        '429':
          description: Получатель перегружен; событие будет отправлено повторно с учётом Retry-After (не дольше часа).
        '500':
          description: Ошибка получателя; событие будет отправлено повторно по расписанию.
  return.resolved:
    post:
      tags:
        - WebhookEvents
      operationId: receiveReturnResolved
      summary: Спор по возврату решён
      description: |
        Тилуна рассмотрела спор по возврату: `resolution: buyer` — в пользу
        покупателя (дальше — возврат денег), `seller` — в пользу продавца.
        `resolution: cancelled_by_buyer` · покупатель отменил заявку до передачи
        товара в доставку, заявка закрыта без возврата денег.
        `resolution: handover_expired` · покупатель не передал товар в доставку
        за 7 дней с одобрения, заявка закрыта без возврата денег.

        Лента событий выдаёт этот тип ключу со scope `returns:read`.
        Входит в подписку нового адреса по умолчанию.
        Адресам прежнего формата не отправляется.
      security: []
      parameters:
        - $ref: '#/components/parameters/TilunaSignature'
        - $ref: '#/components/parameters/TilunaEventId'
        - $ref: '#/components/parameters/TilunaEventType'
        - $ref: '#/components/parameters/TilunaDeliveryId'
        - $ref: '#/components/parameters/TilunaDeliveryAttempt'
        - $ref: '#/components/parameters/TilunaApiVersion'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReturnResolvedEvent'
            examples:
              returnResolved:
                $ref: '#/components/examples/ReturnResolvedWebhook'
      responses:
        '200':
          description: Доставка принята. Подходит любой код 2xx; тело ответа не читается.
        '410':
          description: Адрес больше не принимает события — Тилуна отключает его.
        '429':
          description: Получатель перегружен; событие будет отправлено повторно с учётом Retry-After (не дольше часа).
        '500':
          description: Ошибка получателя; событие будет отправлено повторно по расписанию.
  product.created:
    post:
      tags:
        - WebhookEvents
      operationId: receiveProductCreated
      summary: Создан товар
      description: |
        Создан товар — в кабинете, импортом или через API. Один товар — снимок
        товара и `resource.id`; пачка из кабинета или импорта — `object:
        product_batch` до 100 товаров и `resource.id: null`.

        Лента событий выдаёт этот тип ключу со scope `products:read`.
        Входит в подписку нового адреса по умолчанию.
        Адреса прежнего формата получают этот тип в прежнем теле `WebhookEvent` (см. «Уведомление о событии»).
      security: []
      parameters:
        - $ref: '#/components/parameters/TilunaSignature'
        - $ref: '#/components/parameters/TilunaEventId'
        - $ref: '#/components/parameters/TilunaEventType'
        - $ref: '#/components/parameters/TilunaDeliveryId'
        - $ref: '#/components/parameters/TilunaDeliveryAttempt'
        - $ref: '#/components/parameters/TilunaApiVersion'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProductCreatedEvent'
            examples:
              productCreated:
                $ref: '#/components/examples/ProductCreatedWebhook'
      responses:
        '200':
          description: Доставка принята. Подходит любой код 2xx; тело ответа не читается.
        '410':
          description: Адрес больше не принимает события — Тилуна отключает его.
        '429':
          description: Получатель перегружен; событие будет отправлено повторно с учётом Retry-After (не дольше часа).
        '500':
          description: Ошибка получателя; событие будет отправлено повторно по расписанию.
  product.updated:
    post:
      tags:
        - WebhookEvents
      operationId: receiveProductUpdated
      summary: Изменён товар
      description: |
        Изменён товар: карточка, варианты или статус (в том числе снятие с
        публикации Тилуной — `source: platform`). Один товар или пачка — как в
        `product.created`. Полную карточку получите через `GET resource.url` или
        `GET /products?ids=…`.

        Лента событий выдаёт этот тип ключу со scope `products:read`.
        Входит в подписку нового адреса по умолчанию.
        Адреса прежнего формата получают этот тип в прежнем теле `WebhookEvent` (см. «Уведомление о событии»).
      security: []
      parameters:
        - $ref: '#/components/parameters/TilunaSignature'
        - $ref: '#/components/parameters/TilunaEventId'
        - $ref: '#/components/parameters/TilunaEventType'
        - $ref: '#/components/parameters/TilunaDeliveryId'
        - $ref: '#/components/parameters/TilunaDeliveryAttempt'
        - $ref: '#/components/parameters/TilunaApiVersion'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProductUpdatedEvent'
            examples:
              productUpdatedBatch:
                $ref: '#/components/examples/ProductUpdatedBatchWebhook'
      responses:
        '200':
          description: Доставка принята. Подходит любой код 2xx; тело ответа не читается.
        '410':
          description: Адрес больше не принимает события — Тилуна отключает его.
        '429':
          description: Получатель перегружен; событие будет отправлено повторно с учётом Retry-After (не дольше часа).
        '500':
          description: Ошибка получателя; событие будет отправлено повторно по расписанию.
  product.archived:
    post:
      tags:
        - WebhookEvents
      operationId: receiveProductArchived
      summary: Товар в архиве
      description: |
        Товар перенесён в архив и снят с продажи. Один товар или пачка — как в
        `product.created`.

        Лента событий выдаёт этот тип ключу со scope `products:read`.
        Входит в подписку нового адреса по умолчанию.
        Адреса прежнего формата получают этот тип в прежнем теле `WebhookEvent` (см. «Уведомление о событии»).
      security: []
      parameters:
        - $ref: '#/components/parameters/TilunaSignature'
        - $ref: '#/components/parameters/TilunaEventId'
        - $ref: '#/components/parameters/TilunaEventType'
        - $ref: '#/components/parameters/TilunaDeliveryId'
        - $ref: '#/components/parameters/TilunaDeliveryAttempt'
        - $ref: '#/components/parameters/TilunaApiVersion'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProductArchivedEvent'
            examples:
              productArchived:
                $ref: '#/components/examples/ProductArchivedWebhook'
      responses:
        '200':
          description: Доставка принята. Подходит любой код 2xx; тело ответа не читается.
        '410':
          description: Адрес больше не принимает события — Тилуна отключает его.
        '429':
          description: Получатель перегружен; событие будет отправлено повторно с учётом Retry-After (не дольше часа).
        '500':
          description: Ошибка получателя; событие будет отправлено повторно по расписанию.
  product.moderation.approved:
    post:
      tags:
        - WebhookEvents
      operationId: receiveProductModerationApproved
      summary: Товар прошёл модерацию
      description: |
        Модерация одобрила товар.

        Лента событий выдаёт этот тип ключу со scope `products:read`.
        Входит в подписку нового адреса по умолчанию.
        Адресам прежнего формата не отправляется.
      security: []
      parameters:
        - $ref: '#/components/parameters/TilunaSignature'
        - $ref: '#/components/parameters/TilunaEventId'
        - $ref: '#/components/parameters/TilunaEventType'
        - $ref: '#/components/parameters/TilunaDeliveryId'
        - $ref: '#/components/parameters/TilunaDeliveryAttempt'
        - $ref: '#/components/parameters/TilunaApiVersion'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProductModerationApprovedEvent'
            examples:
              productModerationApproved:
                $ref: '#/components/examples/ProductModerationApprovedWebhook'
      responses:
        '200':
          description: Доставка принята. Подходит любой код 2xx; тело ответа не читается.
        '410':
          description: Адрес больше не принимает события — Тилуна отключает его.
        '429':
          description: Получатель перегружен; событие будет отправлено повторно с учётом Retry-After (не дольше часа).
        '500':
          description: Ошибка получателя; событие будет отправлено повторно по расписанию.
  product.moderation.rejected:
    post:
      tags:
        - WebhookEvents
      operationId: receiveProductModerationRejected
      summary: Товар отклонён модерацией
      description: |
        Модерация отклонила товар; причина — `moderation.reason`. Исправьте
        карточку и отправьте её снова (`POST /products/{productId}/submit`).

        Лента событий выдаёт этот тип ключу со scope `products:read`.
        Входит в подписку нового адреса по умолчанию.
        Адресам прежнего формата не отправляется.
      security: []
      parameters:
        - $ref: '#/components/parameters/TilunaSignature'
        - $ref: '#/components/parameters/TilunaEventId'
        - $ref: '#/components/parameters/TilunaEventType'
        - $ref: '#/components/parameters/TilunaDeliveryId'
        - $ref: '#/components/parameters/TilunaDeliveryAttempt'
        - $ref: '#/components/parameters/TilunaApiVersion'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProductModerationRejectedEvent'
            examples:
              productModerationRejected:
                $ref: '#/components/examples/ProductModerationRejectedWebhook'
      responses:
        '200':
          description: Доставка принята. Подходит любой код 2xx; тело ответа не читается.
        '410':
          description: Адрес больше не принимает события — Тилуна отключает его.
        '429':
          description: Получатель перегружен; событие будет отправлено повторно с учётом Retry-After (не дольше часа).
        '500':
          description: Ошибка получателя; событие будет отправлено повторно по расписанию.
  product.moderation.revision_requested:
    post:
      tags:
        - WebhookEvents
      operationId: receiveProductModerationRevisionRequested
      summary: Товар вернули на доработку
      description: |
        Модерация вернула товар в черновик на доработку; что исправить —
        `moderation.reason`. После правки отправьте товар снова
        (`POST /products/{productId}/submit`).

        Лента событий выдаёт этот тип ключу со scope `products:read`.
        Входит в подписку нового адреса по умолчанию.
        Адресам прежнего формата не отправляется.
      security: []
      parameters:
        - $ref: '#/components/parameters/TilunaSignature'
        - $ref: '#/components/parameters/TilunaEventId'
        - $ref: '#/components/parameters/TilunaEventType'
        - $ref: '#/components/parameters/TilunaDeliveryId'
        - $ref: '#/components/parameters/TilunaDeliveryAttempt'
        - $ref: '#/components/parameters/TilunaApiVersion'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProductModerationRevisionRequestedEvent'
            examples:
              productModerationRevisionRequested:
                $ref: '#/components/examples/ProductModerationRevisionRequestedWebhook'
      responses:
        '200':
          description: Доставка принята. Подходит любой код 2xx; тело ответа не читается.
        '410':
          description: Адрес больше не принимает события — Тилуна отключает его.
        '429':
          description: Получатель перегружен; событие будет отправлено повторно с учётом Retry-After (не дольше часа).
        '500':
          description: Ошибка получателя; событие будет отправлено повторно по расписанию.
  inventory.updated:
    post:
      tags:
        - WebhookEvents
      operationId: receiveInventoryUpdated
      summary: Изменились остатки
      description: |
        Изменились остатки. Снимок одного из двух видов: `object: inventory` —
        текущие остатки после изменения в кабинете, импортом или списания оплатой
        заказа (`order_id`); `object: inventory_update` — строки, записанные
        запросом через API. В событии до 500 строк: большое изменение приходит
        несколькими событиями.

        Лента событий выдаёт этот тип ключу со scope `inventory:read`.
        Входит в подписку нового адреса по умолчанию.
        Адреса прежнего формата получают этот тип в прежнем теле `WebhookEvent` (см. «Уведомление о событии»).
      security: []
      parameters:
        - $ref: '#/components/parameters/TilunaSignature'
        - $ref: '#/components/parameters/TilunaEventId'
        - $ref: '#/components/parameters/TilunaEventType'
        - $ref: '#/components/parameters/TilunaDeliveryId'
        - $ref: '#/components/parameters/TilunaDeliveryAttempt'
        - $ref: '#/components/parameters/TilunaApiVersion'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InventoryUpdatedEvent'
            examples:
              inventoryUpdated:
                $ref: '#/components/examples/InventoryUpdatedWebhook'
              inventoryUpdatedByApi:
                $ref: '#/components/examples/InventoryUpdatedByApiWebhook'
      responses:
        '200':
          description: Доставка принята. Подходит любой код 2xx; тело ответа не читается.
        '410':
          description: Адрес больше не принимает события — Тилуна отключает его.
        '429':
          description: Получатель перегружен; событие будет отправлено повторно с учётом Retry-After (не дольше часа).
        '500':
          description: Ошибка получателя; событие будет отправлено повторно по расписанию.
  price.updated:
    post:
      tags:
        - WebhookEvents
      operationId: receivePriceUpdated
      summary: Изменились цены
      description: |
        Изменились цены (копейки). Снимок одного из двух видов: `object: price` —
        текущие цены после изменения в кабинете или импортом; `object:
        price_update` — строки, записанные запросом через API. В событии до 500
        строк.

        Лента событий выдаёт этот тип ключу со scope `prices:read`.
        Входит в подписку нового адреса по умолчанию.
        Адреса прежнего формата получают этот тип в прежнем теле `WebhookEvent` (см. «Уведомление о событии»).
      security: []
      parameters:
        - $ref: '#/components/parameters/TilunaSignature'
        - $ref: '#/components/parameters/TilunaEventId'
        - $ref: '#/components/parameters/TilunaEventType'
        - $ref: '#/components/parameters/TilunaDeliveryId'
        - $ref: '#/components/parameters/TilunaDeliveryAttempt'
        - $ref: '#/components/parameters/TilunaApiVersion'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PriceUpdatedEvent'
            examples:
              priceUpdated:
                $ref: '#/components/examples/PriceUpdatedWebhook'
              priceUpdatedByApi:
                $ref: '#/components/examples/PriceUpdatedByApiWebhook'
      responses:
        '200':
          description: Доставка принята. Подходит любой код 2xx; тело ответа не читается.
        '410':
          description: Адрес больше не принимает события — Тилуна отключает его.
        '429':
          description: Получатель перегружен; событие будет отправлено повторно с учётом Retry-After (не дольше часа).
        '500':
          description: Ошибка получателя; событие будет отправлено повторно по расписанию.
  review.created:
    post:
      tags:
        - WebhookEvents
      operationId: receiveReviewCreated
      summary: Опубликован отзыв
      description: |
        Отзыв о товаре стороны прошёл модерацию и опубликован. Текст отзыва —
        в `GET /reviews`; ответить — `POST /reviews/{reviewId}/reply`.

        Лента событий выдаёт этот тип ключу со scope `reviews:read`.
        Входит в подписку нового адреса по умолчанию.
        Адресам прежнего формата не отправляется.
      security: []
      parameters:
        - $ref: '#/components/parameters/TilunaSignature'
        - $ref: '#/components/parameters/TilunaEventId'
        - $ref: '#/components/parameters/TilunaEventType'
        - $ref: '#/components/parameters/TilunaDeliveryId'
        - $ref: '#/components/parameters/TilunaDeliveryAttempt'
        - $ref: '#/components/parameters/TilunaApiVersion'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReviewCreatedEvent'
            examples:
              reviewCreated:
                $ref: '#/components/examples/ReviewCreatedWebhook'
      responses:
        '200':
          description: Доставка принята. Подходит любой код 2xx; тело ответа не читается.
        '410':
          description: Адрес больше не принимает события — Тилуна отключает его.
        '429':
          description: Получатель перегружен; событие будет отправлено повторно с учётом Retry-After (не дольше часа).
        '500':
          description: Ошибка получателя; событие будет отправлено повторно по расписанию.
  review.replied:
    post:
      tags:
        - WebhookEvents
      operationId: receiveReviewReplied
      summary: Продавец ответил на отзыв
      description: |
        Продавец ответил на отзыв или изменил ответ — в кабинете или через API.
        Каждая правка ответа — отдельное событие. Текст ответа в событие не
        попадает.

        Лента событий выдаёт этот тип ключу со scope `reviews:read`.
        Входит в подписку нового адреса по умолчанию.
        Адреса прежнего формата получают этот тип в прежнем теле `WebhookEvent` (см. «Уведомление о событии»).
      security: []
      parameters:
        - $ref: '#/components/parameters/TilunaSignature'
        - $ref: '#/components/parameters/TilunaEventId'
        - $ref: '#/components/parameters/TilunaEventType'
        - $ref: '#/components/parameters/TilunaDeliveryId'
        - $ref: '#/components/parameters/TilunaDeliveryAttempt'
        - $ref: '#/components/parameters/TilunaApiVersion'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReviewRepliedEvent'
            examples:
              reviewReplied:
                $ref: '#/components/examples/ReviewRepliedWebhook'
      responses:
        '200':
          description: Доставка принята. Подходит любой код 2xx; тело ответа не читается.
        '410':
          description: Адрес больше не принимает события — Тилуна отключает его.
        '429':
          description: Получатель перегружен; событие будет отправлено повторно с учётом Retry-After (не дольше часа).
        '500':
          description: Ошибка получателя; событие будет отправлено повторно по расписанию.
  payout.created:
    post:
      tags:
        - WebhookEvents
      operationId: receivePayoutCreated
      summary: Создана выплата
      description: |
        Создана выплата за отчётный период; сумма — `amount` в копейках. Заказы,
        из которых она собрана, — `GET /payouts/{id}/sources`.

        Лента событий выдаёт этот тип ключу со scope `finance:read`.
        Входит в подписку нового адреса по умолчанию.
        Адресам прежнего формата не отправляется.
      security: []
      parameters:
        - $ref: '#/components/parameters/TilunaSignature'
        - $ref: '#/components/parameters/TilunaEventId'
        - $ref: '#/components/parameters/TilunaEventType'
        - $ref: '#/components/parameters/TilunaDeliveryId'
        - $ref: '#/components/parameters/TilunaDeliveryAttempt'
        - $ref: '#/components/parameters/TilunaApiVersion'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PayoutCreatedEvent'
            examples:
              payoutCreated:
                $ref: '#/components/examples/PayoutCreatedWebhook'
      responses:
        '200':
          description: Доставка принята. Подходит любой код 2xx; тело ответа не читается.
        '410':
          description: Адрес больше не принимает события — Тилуна отключает его.
        '429':
          description: Получатель перегружен; событие будет отправлено повторно с учётом Retry-After (не дольше часа).
        '500':
          description: Ошибка получателя; событие будет отправлено повторно по расписанию.
  payout.paid:
    post:
      tags:
        - WebhookEvents
      operationId: receivePayoutPaid
      summary: Выплата проведена
      description: |
        Банк подтвердил выплату: дата — `paid_at`, номер платёжного документа —
        `document_number`.

        Лента событий выдаёт этот тип ключу со scope `finance:read`.
        Входит в подписку нового адреса по умолчанию.
        Адресам прежнего формата не отправляется.
      security: []
      parameters:
        - $ref: '#/components/parameters/TilunaSignature'
        - $ref: '#/components/parameters/TilunaEventId'
        - $ref: '#/components/parameters/TilunaEventType'
        - $ref: '#/components/parameters/TilunaDeliveryId'
        - $ref: '#/components/parameters/TilunaDeliveryAttempt'
        - $ref: '#/components/parameters/TilunaApiVersion'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PayoutPaidEvent'
            examples:
              payoutPaid:
                $ref: '#/components/examples/PayoutPaidWebhook'
      responses:
        '200':
          description: Доставка принята. Подходит любой код 2xx; тело ответа не читается.
        '410':
          description: Адрес больше не принимает события — Тилуна отключает его.
        '429':
          description: Получатель перегружен; событие будет отправлено повторно с учётом Retry-After (не дольше часа).
        '500':
          description: Ошибка получателя; событие будет отправлено повторно по расписанию.
  payout.failed:
    post:
      tags:
        - WebhookEvents
      operationId: receivePayoutFailed
      summary: Выплата не прошла
      description: |
        Выплата не прошла: `failure_reason: cancelled` — выплата отменена,
        `returned` — банк вернул платёж. Подробности — в разделе «Финансы»
        кабинета.

        Лента событий выдаёт этот тип ключу со scope `finance:read`.
        Входит в подписку нового адреса по умолчанию.
        Адресам прежнего формата не отправляется.
      security: []
      parameters:
        - $ref: '#/components/parameters/TilunaSignature'
        - $ref: '#/components/parameters/TilunaEventId'
        - $ref: '#/components/parameters/TilunaEventType'
        - $ref: '#/components/parameters/TilunaDeliveryId'
        - $ref: '#/components/parameters/TilunaDeliveryAttempt'
        - $ref: '#/components/parameters/TilunaApiVersion'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PayoutFailedEvent'
            examples:
              payoutFailed:
                $ref: '#/components/examples/PayoutFailedWebhook'
      responses:
        '200':
          description: Доставка принята. Подходит любой код 2xx; тело ответа не читается.
        '410':
          description: Адрес больше не принимает события — Тилуна отключает его.
        '429':
          description: Получатель перегружен; событие будет отправлено повторно с учётом Retry-After (не дольше часа).
        '500':
          description: Ошибка получателя; событие будет отправлено повторно по расписанию.
  agent_report.ready:
    post:
      tags:
        - WebhookEvents
      operationId: receiveAgentReportReady
      summary: Отчёт агента готов
      description: |
        Отчёт агента за период размещён в кабинете. Строки —
        `GET /agent_reports/{id}/lines`, PDF — `GET /agent_reports/{id}/file`;
        срок принятия — `accept_deadline_at`.

        Лента событий выдаёт этот тип ключу со scope `finance:read`.
        Входит в подписку нового адреса по умолчанию.
        Адресам прежнего формата не отправляется.
      security: []
      parameters:
        - $ref: '#/components/parameters/TilunaSignature'
        - $ref: '#/components/parameters/TilunaEventId'
        - $ref: '#/components/parameters/TilunaEventType'
        - $ref: '#/components/parameters/TilunaDeliveryId'
        - $ref: '#/components/parameters/TilunaDeliveryAttempt'
        - $ref: '#/components/parameters/TilunaApiVersion'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AgentReportReadyEvent'
            examples:
              agentReportReady:
                $ref: '#/components/examples/AgentReportReadyWebhook'
      responses:
        '200':
          description: Доставка принята. Подходит любой код 2xx; тело ответа не читается.
        '410':
          description: Адрес больше не принимает события — Тилуна отключает его.
        '429':
          description: Получатель перегружен; событие будет отправлено повторно с учётом Retry-After (не дольше часа).
        '500':
          description: Ошибка получателя; событие будет отправлено повторно по расписанию.
  report.ready:
    post:
      tags:
        - WebhookEvents
      operationId: receiveReportReady
      summary: Отчёт готов к скачиванию
      description: |
        Отчёт, заказанный через `POST /reports`, сформирован. Файлы — в
        `GET /reports/{id}`; они хранятся 7 дней.

        Лента событий выдаёт этот тип ключу со scope `reports:read`.
        Входит в подписку нового адреса по умолчанию.
        Адресам прежнего формата не отправляется.
      security: []
      parameters:
        - $ref: '#/components/parameters/TilunaSignature'
        - $ref: '#/components/parameters/TilunaEventId'
        - $ref: '#/components/parameters/TilunaEventType'
        - $ref: '#/components/parameters/TilunaDeliveryId'
        - $ref: '#/components/parameters/TilunaDeliveryAttempt'
        - $ref: '#/components/parameters/TilunaApiVersion'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReportReadyEvent'
            examples:
              reportReady:
                $ref: '#/components/examples/ReportReadyWebhook'
      responses:
        '200':
          description: Доставка принята. Подходит любой код 2xx; тело ответа не читается.
        '410':
          description: Адрес больше не принимает события — Тилуна отключает его.
        '429':
          description: Получатель перегружен; событие будет отправлено повторно с учётом Retry-After (не дольше часа).
        '500':
          description: Ошибка получателя; событие будет отправлено повторно по расписанию.
  ping:
    post:
      tags:
        - WebhookEvents
      operationId: receivePing
      summary: Проверка адреса
      description: |
        Тестовое событие: приходит по кнопке проверки адреса в кабинете. Ответьте
        любым 2xx. В журнал не записывается (`sequence: 0`) и в ленте событий не
        выдаётся.

        Тип без scope: в ленте событий не выдаётся.
        В подписку по умолчанию не входит.
        Адресам прежнего формата не отправляется.
      security: []
      parameters:
        - $ref: '#/components/parameters/TilunaSignature'
        - $ref: '#/components/parameters/TilunaEventId'
        - $ref: '#/components/parameters/TilunaEventType'
        - $ref: '#/components/parameters/TilunaDeliveryId'
        - $ref: '#/components/parameters/TilunaDeliveryAttempt'
        - $ref: '#/components/parameters/TilunaApiVersion'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PingEvent'
            examples:
              ping:
                $ref: '#/components/examples/PingWebhook'
      responses:
        '200':
          description: Доставка принята. Подходит любой код 2xx; тело ответа не читается.
        '410':
          description: Адрес больше не принимает события — Тилуна отключает его.
        '429':
          description: Получатель перегружен; событие будет отправлено повторно с учётом Retry-After (не дольше часа).
        '500':
          description: Ошибка получателя; событие будет отправлено повторно по расписанию.
components:
  securitySchemes:
    sellerApiToken:
      type: http
      scheme: bearer
      bearerFormat: tl_live_… | tl_test_… | vnt_sk_live_…
      description: |
        API-ключ продавца в заголовке `Authorization: Bearer <ключ>`.
        Ключ показывается один раз при выпуске; храните его в секретах сервиса
        и не передавайте в браузер. При утечке боевой ключ отзовите в кабинете
        продавца, а тестовый ключ `tl_test_…` — через поддержку support@tiluna.ru.
  parameters:
    Page:
      name: page
      in: query
      description: Номер страницы, начиная с 1.
      schema:
        type: integer
        minimum: 1
        maximum: 10000
        default: 1
    Limit:
      name: limit
      in: query
      description: Количество записей на странице.
      schema:
        type: integer
        minimum: 1
        maximum: 100
        default: 50
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      required: true
      description: |
        Уникальный ключ операции, обязателен для всех изменяющих запросов. Повтор с
        тем же ключом и тем же телом в течение 24 часов возвращает сохранённый ответ
        без повторного выполнения. Используйте UUID или другой уникальный идентификатор.
      schema:
        type: string
        minLength: 8
        maxLength: 255
        pattern: ^[A-Za-z0-9._:-]+$
      example: 5f0c2b7e-4d6a-4f1e-9a57-0d3c8e1b2a44
    ProductId:
      name: productId
      in: path
      required: true
      description: Идентификатор товара.
      schema:
        type: string
        format: uuid
    OrderId:
      name: orderId
      in: path
      required: true
      description: Идентификатор заказа.
      schema:
        type: string
        format: uuid
    ReturnId:
      name: returnId
      in: path
      required: true
      description: Идентификатор заявки на возврат.
      schema:
        type: string
        format: uuid
    ReviewId:
      name: reviewId
      in: path
      required: true
      description: Идентификатор отзыва.
      schema:
        type: string
        format: uuid
    Search:
      name: search
      in: query
      description: Строка поиска, не длиннее 120 символов.
      schema:
        type: string
        maxLength: 120
    DateFrom:
      name: dateFrom
      in: query
      description: Начало периода включительно, `YYYY-MM-DD`, сутки по московскому времени.
      schema:
        type: string
        format: date
      example: '2026-09-01'
    DateTo:
      name: dateTo
      in: query
      description: Конец периода включительно, `YYYY-MM-DD`, сутки по московскому времени.
      schema:
        type: string
        format: date
      example: '2026-09-30'
    TilunaSignature:
      name: Tiluna-Signature
      in: header
      required: true
      description: |
        `t=<unix-время>,v1=<hex>` — одна или две подписи `v1`. Подпись —
        HMAC-SHA256 секрета адреса от строки `{t}.{сырое тело запроса}` в hex;
        две подписи приходят во время смены секрета с перекрытием.
      schema:
        type: string
        maxLength: 1024
        pattern: ^t=[0-9]{1,12}(,v1=[0-9a-f]{64})+$
      example: t=1790150400,v1=0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef
    TilunaEventId:
      name: Tiluna-Event-Id
      in: header
      required: true
      description: Идентификатор события; одинаков во всех попытках и в `GET /events`. По нему отсеивайте повторы.
      schema:
        type: string
        format: uuid
    TilunaEventType:
      name: Tiluna-Event-Type
      in: header
      required: true
      description: Тип события — то же значение, что поле `type` тела.
      schema:
        $ref: '#/components/schemas/WebhookEventType'
    TilunaDeliveryId:
      name: Tiluna-Delivery-Id
      in: header
      required: true
      description: Идентификатор доставки события на этот адрес; одинаков во всех попытках.
      schema:
        type: string
        format: uuid
    TilunaDeliveryAttempt:
      name: Tiluna-Delivery-Attempt
      in: header
      required: true
      description: Номер попытки, начиная с 1.
      schema:
        type: string
        pattern: ^[0-9]{1,3}$
    TilunaApiVersion:
      name: Tiluna-Api-Version
      in: header
      required: true
      description: Версия формата тела события.
      schema:
        type: string
      example: '2026-10-01'
  headers:
    XRequestId:
      description: Идентификатор запроса. Сообщайте его в поддержку.
      schema:
        type: string
      example: V1StGXR8_Z5j
    XVenetsApiVersion:
      description: Версия формата ответов v1. Не меняется до v2.
      schema:
        type: string
        enum:
          - '2026-05-08'
    XRateLimitLimit:
      description: Лимит запросов в минуту для бакета с наименьшим остатком.
      schema:
        type: integer
      example: 120
    XRateLimitRemaining:
      description: Сколько запросов осталось в текущем окне.
      schema:
        type: integer
      example: 117
    XRateLimitReset:
      description: Момент сброса окна, unix-время в секундах.
      schema:
        type: integer
      example: 1790150460
    RetryAfter:
      description: Через сколько секунд можно повторить запрос.
      schema:
        type: integer
        minimum: 0
      example: 30
  responses:
    BadRequest:
      description: Некорректный запрос — параметры, заголовки или тело не прошли проверку.
      x-tiluna-status: 400
      x-tiluna-error-codes:
        - code: invalid_request
          type: invalid_request_error
          description: Параметр или поле тела не прошли проверку; подробности — в details.
        - code: invalid_json
          type: invalid_request_error
          description: Тело запроса не является корректным JSON в UTF-8.
        - code: idempotency_key_required
          type: invalid_request_error
          description: Изменяющий запрос без корректного заголовка Idempotency-Key.
        - code: invalid_cursor
          type: invalid_request_error
          description: Курсор повреждён или подделан.
        - code: cursor_mismatch
          type: invalid_request_error
          description: Курсор выдан для других фильтров или другого маршрута.
        - code: batch_too_large
          type: invalid_request_error
          description: В пакетном запросе слишком много позиций.
        - code: validation_failed
          type: invalid_request_error
          description: Значения противоречат правилам предметной области (например, цена со скидкой выше базовой).
        - code: external_tracking_number_invalid
          type: invalid_request_error
          description: Трек-номер перевозчика не прошёл проверку.
        - code: unsafe_link
          type: invalid_request_error
          description: Текст содержит небезопасную ссылку.
        - code: cancellation_failed
          type: invalid_request_error
          description: Отмену заказа не удалось выполнить; причина — в message.
          legacy: true
          replaced_by: cancellation_requires_cabinet
        - code: catalog_inventory_plan_denied
          type: invalid_request_error
          description: Операция с товаром или остатками недоступна по правилам каталога.
          legacy: true
          replaced_by: plan_denied
        - code: returns_disputes_plan_denied
          type: invalid_request_error
          description: Решение по возврату недоступно по правилам возвратов.
          legacy: true
          replaced_by: plan_denied
        - code: review_plan_denied
          type: invalid_request_error
          description: Ответ на отзыв недоступен по правилам отзывов.
          legacy: true
          replaced_by: plan_denied
      headers:
        X-Request-Id:
          $ref: '#/components/headers/XRequestId'
        X-Venets-API-Version:
          $ref: '#/components/headers/XVenetsApiVersion'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            invalidRequest:
              summary: Параметр вне допустимого диапазона
              value:
                error:
                  type: invalid_request_error
                  code: invalid_request
                  message: Параметр limit должен быть от 1 до 100
                  param: limit
                  request_id: V1StGXR8_Z5j
                  doc_url: https://docs.tiluna.ru/docs/errors#invalid_request
                  details:
                    - path: limit
                      message: Параметр limit должен быть от 1 до 100
            idempotencyKeyRequired:
              summary: Изменяющий запрос без Idempotency-Key
              value:
                error:
                  type: invalid_request_error
                  code: idempotency_key_required
                  message: Valid Idempotency-Key header is required for this request
                  request_id: V1StGXR8_Z5j
                  doc_url: https://docs.tiluna.ru/docs/errors#idempotency_key_required
            validationFailed:
              summary: Цена со скидкой выше базовой в пакете цен
              value:
                error:
                  type: invalid_request_error
                  code: validation_failed
                  message: Цена со скидкой не может быть выше базовой
                  param: items.0.sale_price
                  request_id: V1StGXR8_Z5j
                  doc_url: https://docs.tiluna.ru/docs/errors#validation_failed
                  details:
                    - path: items.0.sale_price
                      message: Цена со скидкой не может быть выше базовой
    Unauthorized:
      description: Ключ не передан, неверен, отозван, истёк или не подходит к окружению.
      x-tiluna-status: 401
      x-tiluna-error-codes:
        - code: missing_token
          type: authentication_error
          description: Нет заголовка Authorization с ключом.
        - code: invalid_token
          type: authentication_error
          description: Ключ не найден или повреждён.
        - code: token_revoked
          type: authentication_error
          description: Ключ отозван.
        - code: token_expired
          type: authentication_error
          description: Срок действия ключа истёк.
        - code: test_key_on_live_environment
          type: authentication_error
          description: Тестовый ключ tl_test_… передан в боевое окружение.
        - code: live_key_on_sandbox_environment
          type: authentication_error
          description: Боевой ключ передан в песочницу.
        - code: key_creator_lost_access
          type: authentication_error
          description: Пользователь, выпустивший ключ, больше не владеет кабинетом или заблокирован.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/XRequestId'
        X-Venets-API-Version:
          $ref: '#/components/headers/XVenetsApiVersion'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            invalidToken:
              summary: Ключ не найден или повреждён
              value:
                error:
                  type: authentication_error
                  code: invalid_token
                  message: Неверный API-ключ
                  request_id: V1StGXR8_Z5j
                  doc_url: https://docs.tiluna.ru/docs/errors#invalid_token
            testKeyOnLive:
              summary: Тестовый ключ в боевом окружении
              value:
                error:
                  type: authentication_error
                  code: test_key_on_live_environment
                  message: Тестовый ключ tl_test_ работает только в песочнице sandbox-api.tiluna.ru
                  request_id: V1StGXR8_Z5j
                  doc_url: https://docs.tiluna.ru/docs/errors#test_key_on_live_environment
            liveKeyOnSandbox:
              summary: Боевой ключ в песочнице
              value:
                error:
                  type: authentication_error
                  code: live_key_on_sandbox_environment
                  message: 'Боевой ключ не работает в песочнице: используйте тестовый ключ tl_test_'
                  request_id: V1StGXR8_Z5j
                  doc_url: https://docs.tiluna.ru/docs/errors#live_key_on_sandbox_environment
    Forbidden:
      description: Ключу не хватает прав или кабинет и юрлицо ключа не допускают операцию.
      x-tiluna-status: 403
      x-tiluna-error-codes:
        - code: insufficient_scope
          type: permission_error
          description: У ключа нет scope, который требует операция.
        - code: seller_api_disabled
          type: permission_error
          description: Кабинет продавца заблокирован или не допущен к API.
        - code: legal_entity_unavailable
          type: permission_error
          description: Юрлицо ключа приостановлено или отклонено.
        - code: legal_entity_not_verified
          type: permission_error
          description: Изменения недоступны, пока юрлицо не проверено.
        - code: legal_entity_sales_paused
          type: permission_error
          description: Продажи юрлица приостановлены, изменения недоступны.
        - code: feature_not_enabled
          type: permission_error
          description: Для кабинета не включена нужная возможность; в details.feature — какая.
        - code: brand_not_authorized
          type: permission_error
          description: Юрлицу не разрешено продавать товары этого бренда.
        - code: plan_denied
          type: permission_error
          description: Операция запрещена правилами кабинета для текущего состояния объекта.
        - code: forbidden
          type: permission_error
          description: Объект принадлежит другому продавцу.
          legacy: true
          replaced_by: not_found
        - code: legal_entity_required
          type: permission_error
          description: Для товара с брендом ключ должен быть привязан к юрлицу.
          legacy: true
        - code: legal_entity_not_found
          type: permission_error
          description: Юрлицо ключа не найдено.
          legacy: true
          replaced_by: legal_entity_unavailable
        - code: brand_already_active
          type: permission_error
          description: Бренд уже подтверждён для этого юрлица.
          legacy: true
      headers:
        X-Request-Id:
          $ref: '#/components/headers/XRequestId'
        X-Venets-API-Version:
          $ref: '#/components/headers/XVenetsApiVersion'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            insufficientScope:
              summary: У ключа нет нужного scope
              value:
                error:
                  type: permission_error
                  code: insufficient_scope
                  message: У ключа нет прав на эту операцию
                  request_id: V1StGXR8_Z5j
                  doc_url: https://docs.tiluna.ru/docs/errors#insufficient_scope
            salesPaused:
              summary: Продажи юрлица на паузе
              value:
                error:
                  type: permission_error
                  code: legal_entity_sales_paused
                  message: 'Продажи юрлица на паузе: изменения недоступны'
                  request_id: V1StGXR8_Z5j
                  doc_url: https://docs.tiluna.ru/docs/errors#legal_entity_sales_paused
    NotFound:
      description: Объект не найден или не принадлежит кабинету и юрлицу ключа.
      x-tiluna-status: 404
      x-tiluna-error-codes:
        - code: not_found
          type: not_found_error
          description: Объект не найден среди данных кабинета и юрлица ключа.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/XRequestId'
        X-Venets-API-Version:
          $ref: '#/components/headers/XVenetsApiVersion'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              type: not_found_error
              code: not_found
              message: Заказ не найден
              request_id: V1StGXR8_Z5j
              doc_url: https://docs.tiluna.ru/docs/errors#not_found
    MethodNotAllowed:
      description: HTTP-метод не поддерживается для этого адреса.
      x-tiluna-status: 405
      x-tiluna-error-codes:
        - code: method_not_allowed
          type: invalid_request_error
          description: Метод не поддерживается для этого адреса; допустимые методы — в заголовке Allow.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/XRequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              type: invalid_request_error
              code: method_not_allowed
              message: Метод не поддерживается для этого адреса
              request_id: V1StGXR8_Z5j
              doc_url: https://docs.tiluna.ru/docs/errors#method_not_allowed
    Conflict:
      description: Операция недопустима в текущем состоянии объекта или конфликтует с ключом идемпотентности.
      x-tiluna-status: 409
      x-tiluna-error-codes:
        - code: invalid_state
          type: conflict_error
          description: Объект в статусе, который не допускает операцию.
        - code: multi_seller_order
          type: conflict_error
          description: Операция над заказом нескольких продавцов доступна только в кабинете.
        - code: order_managed_in_cabinet
          type: conflict_error
          description: Заказ исполняется в кабинете продавца.
        - code: external_id_conflict
          type: conflict_error
          description: Объект с таким external_id уже существует.
        - code: seller_sku_conflict
          type: conflict_error
          description: Товар с таким seller_sku уже существует.
        - code: inventory_conflict
          type: conflict_error
          description: Остаток изменился параллельно; повторите запрос.
        - code: edit_window_expired
          type: conflict_error
          description: Срок изменения истёк.
        - code: external_tracking_conflict
          type: conflict_error
          description: Трек-номер уже привязан к другому отправлению.
        - code: cancellation_requires_cabinet
          type: conflict_error
          description: Отмену в этом состоянии можно оформить только в кабинете.
        - code: money_command_unavailable
          type: conflict_error
          description: Денежная операция сейчас недоступна через API.
        - code: price_drop_confirmation_required
          type: conflict_error
          description: Массовое снижение цен требует явного подтверждения.
        - code: report_limit_reached
          type: conflict_error
          description: Достигнут лимит отчётов.
        - code: idempotency_key_reused
          type: idempotency_error
          description: Ключ идемпотентности уже использован с другим телом запроса.
        - code: idempotency_key_in_progress
          type: idempotency_error
          description: Запрос с этим ключом идемпотентности ещё выполняется.
        - code: idempotency_key_other_legal_entity
          type: idempotency_error
          description: Ключ идемпотентности уже использован другим юрлицом.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/XRequestId'
        X-Venets-API-Version:
          $ref: '#/components/headers/XVenetsApiVersion'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            invalidState:
              summary: Заказ не ждёт принятия
              value:
                error:
                  type: conflict_error
                  code: invalid_state
                  message: Заказ нельзя принять в текущем статусе
                  request_id: V1StGXR8_Z5j
                  doc_url: https://docs.tiluna.ru/docs/errors#invalid_state
                  details:
                    fulfillment_status: shipped
            idempotencyKeyReused:
              summary: Тот же Idempotency-Key с другим телом
              value:
                error:
                  type: idempotency_error
                  code: idempotency_key_reused
                  message: Idempotency-Key was reused with different request parameters
                  request_id: V1StGXR8_Z5j
                  doc_url: https://docs.tiluna.ru/docs/errors#idempotency_key_reused
            externalIdConflict:
              summary: external_id уже занят другим вариантом
              value:
                error:
                  type: conflict_error
                  code: external_id_conflict
                  message: Вариант с таким external_id уже есть у этого товара
                  param: external_id
                  request_id: V1StGXR8_Z5j
                  doc_url: https://docs.tiluna.ru/docs/errors#external_id_conflict
                  details:
                    existing_id: 5e7a9b1d-3f5b-4d7f-9b1d-3f5b7d9f1b3d
    Gone:
      description: Курсор или отчёт больше недоступен.
      x-tiluna-status: 410
      x-tiluna-error-codes:
        - code: cursor_expired
          type: invalid_request_error
          description: Курсор старше 30 дней; начните выборку заново.
        - code: report_expired
          type: invalid_request_error
          description: Срок хранения файлов отчёта истёк.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/XRequestId'
        X-Venets-API-Version:
          $ref: '#/components/headers/XVenetsApiVersion'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            cursorExpired:
              summary: Курсор старше 30 дней
              value:
                error:
                  type: invalid_request_error
                  code: cursor_expired
                  message: Курсор устарел, начните выборку заново
                  param: cursor
                  request_id: V1StGXR8_Z5j
                  doc_url: https://docs.tiluna.ru/docs/errors#cursor_expired
            reportExpired:
              summary: Файлы отчёта больше не хранятся
              value:
                error:
                  type: invalid_request_error
                  code: report_expired
                  message: 'Файлы отчёта больше не хранятся: создайте отчёт заново'
                  request_id: V1StGXR8_Z5j
                  doc_url: https://docs.tiluna.ru/docs/errors#report_expired
    PayloadTooLarge:
      description: Тело запроса больше допустимого размера.
      x-tiluna-status: 413
      x-tiluna-error-codes:
        - code: payload_too_large
          type: invalid_request_error
          description: Тело запроса больше 256 КБ.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/XRequestId'
        X-Venets-API-Version:
          $ref: '#/components/headers/XVenetsApiVersion'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              type: invalid_request_error
              code: payload_too_large
              message: Тело запроса слишком большое
              request_id: V1StGXR8_Z5j
              doc_url: https://docs.tiluna.ru/docs/errors#payload_too_large
    UnsupportedMediaType:
      description: Тело передано не в формате application/json.
      x-tiluna-status: 415
      x-tiluna-error-codes:
        - code: unsupported_media_type
          type: invalid_request_error
          description: Заголовок Content-Type должен быть application/json.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/XRequestId'
        X-Venets-API-Version:
          $ref: '#/components/headers/XVenetsApiVersion'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              type: invalid_request_error
              code: unsupported_media_type
              message: Content-Type должен быть application/json
              request_id: V1StGXR8_Z5j
              doc_url: https://docs.tiluna.ru/docs/errors#unsupported_media_type
    TooEarly:
      description: Результат ещё не готов. Повторите запрос позже.
      x-tiluna-status: 425
      x-tiluna-error-codes:
        - code: report_not_ready
          type: conflict_error
          description: Отчёт ещё формируется; дождитесь события report.ready или проверьте статус отчёта.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/XRequestId'
        X-Venets-API-Version:
          $ref: '#/components/headers/XVenetsApiVersion'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              type: conflict_error
              code: report_not_ready
              message: Отчёт ещё формируется
              request_id: V1StGXR8_Z5j
              doc_url: https://docs.tiluna.ru/docs/errors#report_not_ready
    TooManyRequests:
      description: Превышен лимит запросов. Повторите запрос через Retry-After секунд.
      x-tiluna-status: 429
      x-tiluna-error-codes:
        - code: rate_limited
          type: rate_limit_error
          description: Превышен лимит запросов кабинета или ключа.
        - code: auth_rate_limited
          type: rate_limit_error
          description: Слишком много неудачных попыток аутентификации с этого IP.
        - code: concurrency_limited
          type: rate_limit_error
          description: Слишком много одновременных запросов по ключу.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/XRequestId'
        X-Venets-API-Version:
          $ref: '#/components/headers/XVenetsApiVersion'
        Retry-After:
          $ref: '#/components/headers/RetryAfter'
        X-RateLimit-Limit:
          $ref: '#/components/headers/XRateLimitLimit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/XRateLimitRemaining'
        X-RateLimit-Reset:
          $ref: '#/components/headers/XRateLimitReset'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              type: rate_limit_error
              code: rate_limited
              message: Слишком много запросов
              request_id: V1StGXR8_Z5j
              doc_url: https://docs.tiluna.ru/docs/errors#rate_limited
    InternalError:
      description: Внутренняя ошибка. Повторите запрос позже с тем же Idempotency-Key.
      x-tiluna-status: 500
      x-tiluna-error-codes:
        - code: internal_error
          type: api_error
          description: Внутренняя ошибка сервера.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/XRequestId'
        X-Venets-API-Version:
          $ref: '#/components/headers/XVenetsApiVersion'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              type: api_error
              code: internal_error
              message: Внутренняя ошибка сервера
              request_id: V1StGXR8_Z5j
              doc_url: https://docs.tiluna.ru/docs/errors#internal_error
    BadGateway:
      description: Не ответил внутренний сервис, от которого зависит операция. Повторите запрос позже.
      x-tiluna-status: 502
      x-tiluna-error-codes:
        - code: upstream_unavailable
          type: api_error
          description: Внутренний сервис временно недоступен.
        - code: catalog_inventory_plan_unavailable
          type: api_error
          description: Сервис правил каталога временно недоступен.
          legacy: true
          replaced_by: upstream_unavailable
        - code: returns_disputes_plan_unavailable
          type: api_error
          description: Сервис правил возвратов временно недоступен.
          legacy: true
          replaced_by: upstream_unavailable
        - code: review_plan_unavailable
          type: api_error
          description: Сервис правил отзывов временно недоступен.
          legacy: true
          replaced_by: upstream_unavailable
      headers:
        X-Request-Id:
          $ref: '#/components/headers/XRequestId'
        X-Venets-API-Version:
          $ref: '#/components/headers/XVenetsApiVersion'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              type: api_error
              code: upstream_unavailable
              message: Сервис временно недоступен
              request_id: V1StGXR8_Z5j
              doc_url: https://docs.tiluna.ru/docs/errors#upstream_unavailable
    ServiceUnavailable:
      description: API временно недоступен. Повторите запрос через Retry-After секунд.
      x-tiluna-status: 503
      x-tiluna-error-codes:
        - code: rate_limit_unavailable
          type: api_error
          description: Сервис лимитов недоступен; запрос не выполнен.
        - code: server_misconfigured
          type: api_error
          description: Ошибка конфигурации сервера.
        - code: maintenance
          type: api_error
          description: Технические работы.
        - code: spec_unavailable
          type: api_error
          description: Спецификация OpenAPI временно недоступна (GET /openapi).
          legacy: true
      headers:
        X-Request-Id:
          $ref: '#/components/headers/XRequestId'
        X-Venets-API-Version:
          $ref: '#/components/headers/XVenetsApiVersion'
        Retry-After:
          $ref: '#/components/headers/RetryAfter'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              type: api_error
              code: rate_limit_unavailable
              message: Сервис лимитов временно недоступен
              request_id: V1StGXR8_Z5j
              doc_url: https://docs.tiluna.ru/docs/errors#rate_limit_unavailable
  schemas:
    Error:
      type: object
      description: Ответ с ошибкой (SPEC §5.1).
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            type:
              type: string
              description: Класс ошибки.
              enum:
                - invalid_request_error
                - authentication_error
                - permission_error
                - not_found_error
                - conflict_error
                - idempotency_error
                - rate_limit_error
                - api_error
            code:
              type: string
              description: Машиночитаемый код ошибки. Список кодов — в описании ответа с нужным HTTP-статусом.
              example: invalid_request
            message:
              type: string
              description: Описание ошибки для человека. Не разбирайте его программно — используйте code.
            param:
              type:
                - string
                - 'null'
              description: Параметр или поле, к которому относится ошибка.
            request_id:
              type:
                - string
                - 'null'
              description: Значение заголовка X-Request-Id этого запроса.
            doc_url:
              type: string
              format: uri
              description: Ссылка на описание кода ошибки в документации.
            details:
              description: Подробности. Для ошибок проверки — список полей с сообщениями.
              anyOf:
                - type: array
                  items:
                    type: object
                    required:
                      - path
                      - message
                    properties:
                      path:
                        type: string
                        description: Путь к полю через точку, например items.0.stock.
                      message:
                        type: string
                - type: object
                  description: Подробности конкретной ошибки, например details.existing_id при external_id_conflict.
                  additionalProperties: true
    Pagination:
      type: object
      description: Постраничная выдача. Поле total возвращается не всеми списками.
      required:
        - page
        - limit
      properties:
        page:
          type: integer
          minimum: 1
        limit:
          type: integer
          minimum: 1
          maximum: 100
        total:
          type: integer
          minimum: 0
          description: Общее количество записей по фильтру.
    Success:
      type: object
      description: Операция выполнена.
      required:
        - success
      properties:
        success:
          type: boolean
          const: true
    EmptyObject:
      type: object
      description: Пустой JSON-объект `{}`.
      additionalProperties: false
      example: {}
    Ping:
      type: object
      description: Ответ проверки доступности.
      required:
        - object
        - environment
        - time
      properties:
        object:
          type: string
          const: ping
        environment:
          type: string
          enum:
            - live
            - sandbox
          description: Окружение, которое ответило на запрос.
        time:
          type: string
          format: date-time
          description: Время сервера в UTC.
    ProductClass:
      type: string
      description: |
        Класс товара. Определяет набор обязательных характеристик. Часть классов
        доступна только после включения возможности для кабинета, иначе запрос
        получает 403 feature_not_enabled.
      enum:
        - bijouterie
        - accessory
        - clothing
        - shoes
        - watch
        - vintage
      x-enumDescriptions:
        bijouterie: Бижутерия
        accessory: Аксессуар
        clothing: Одежда
        shoes: Обувь
        watch: Часы
        vintage: Винтаж / антиквариат
    MtoMode:
      type: string
      description: Режим изготовления на заказ.
      enum:
        - none
        - personalization
        - variant_mto
        - bespoke_request
      x-enumDescriptions:
        none: Готовый товар
        personalization: Персонализация
        variant_mto: Изготовление по выбранным параметрам
        bespoke_request: Индивидуальный заказ
    ProductAttributes:
      type: object
      description: |
        Характеристики товара: не больше 50 ключей. Значение — строка до 500
        символов, число, логическое значение, null или массив до 20 таких значений.
      maxProperties: 50
      propertyNames:
        type: string
        pattern: ^[A-Za-z0-9_.:-]{1,80}$
        not:
          enum:
            - __proto__
            - prototype
            - constructor
      additionalProperties:
        anyOf:
          - type: string
            maxLength: 500
          - type: number
          - type: boolean
          - type: 'null'
          - type: array
            maxItems: 20
            items:
              anyOf:
                - type: string
                  maxLength: 500
                - type: number
                - type: boolean
                - type: 'null'
      example:
        color: синий
        volume_ml: 350
        dishwasher_safe: true
    Product:
      type: object
      description: |
        Товар продавца. Себестоимость и внутренние идентификаторы кабинета не
        выдаются. Ответ может содержать и другие поля, не описанные здесь: они
        служебные, не используйте их.
      required:
        - id
        - name
        - slug
        - base_price
        - status
        - created_at
        - updated_at
      properties:
        object:
          type: string
          enum:
            - product
        id:
          type: string
          format: uuid
        external_id:
          type:
            - string
            - 'null'
          minLength: 1
          maxLength: 128
          description: |
            Идентификатор товара в учётной системе продавца (Ид 1С, externalCode
            МоегоСклада). Уникален среди неархивных товаров юрлица.
        product_code:
          type:
            - string
            - 'null'
          description: Код товара, присвоенный Тилуной (то же значение, что sku).
        legal_entity_id:
          type:
            - string
            - 'null'
          format: uuid
          description: Юрлицо продавца, которому принадлежит товар.
        variants_count:
          type:
            - integer
            - 'null'
          description: Число вариантов товара.
        category_id:
          type:
            - string
            - 'null'
          format: uuid
        name:
          type: string
        slug:
          type: string
          description: Часть адреса карточки на витрине.
        description:
          type:
            - string
            - 'null'
        short_description:
          type:
            - string
            - 'null'
        base_price:
          type: integer
          description: Базовая цена в копейках.
        sale_price:
          type:
            - integer
            - 'null'
          description: Цена со скидкой в копейках; не больше base_price.
        compare_at_price:
          type:
            - integer
            - 'null'
          description: Зачёркнутая цена в копейках; не меньше base_price.
        sku:
          type:
            - string
            - 'null'
          description: Код товара, присвоенный Тилуной.
        seller_sku:
          type:
            - string
            - 'null'
          description: Артикул продавца, уникален в кабинете.
        brand:
          type:
            - string
            - 'null'
        barcode:
          type:
            - string
            - 'null'
          description: Штрихкод строкой; ведущие нули сохраняются.
        country_of_origin:
          type:
            - string
            - 'null'
        product_class:
          type:
            - string
            - 'null'
          description: Класс товара, значения — в схеме ProductClass.
        attributes_jsonb:
          $ref: '#/components/schemas/ProductAttributes'
        mto_mode:
          $ref: '#/components/schemas/MtoMode'
        stock:
          type:
            - integer
            - 'null'
          description: Остаток; null — остаток не учитывается.
        material:
          type:
            - string
            - 'null'
        weight_grams:
          type:
            - number
            - 'null'
        length_cm:
          type:
            - number
            - 'null'
        width_cm:
          type:
            - number
            - 'null'
        height_cm:
          type:
            - number
            - 'null'
        package_length_cm:
          type:
            - integer
            - 'null'
        package_width_cm:
          type:
            - integer
            - 'null'
        package_height_cm:
          type:
            - integer
            - 'null'
        package_length_mm:
          type:
            - integer
            - 'null'
        package_width_mm:
          type:
            - integer
            - 'null'
        package_height_mm:
          type:
            - integer
            - 'null'
        package_weight_grams:
          type:
            - integer
            - 'null'
        gender:
          type:
            - string
            - 'null'
          enum:
            - women
            - men
            - unisex
            - children
            - null
        status:
          type: string
          enum:
            - draft
            - pending
            - active
            - rejected
            - archived
          x-enumDescriptions:
            draft: Черновик
            pending: На модерации
            active: Опубликован
            rejected: Отклонён модерацией
            archived: В архиве
        has_variants:
          type: boolean
        allow_multiple_variant_options:
          type: boolean
        preparation_days:
          type: integer
          description: Срок подготовки к отгрузке в днях.
        is_fragile:
          type: boolean
        is_made_to_order:
          type: boolean
        rejection_reason:
          type:
            - string
            - 'null'
          description: Причина отклонения модерацией.
        total_sales:
          type: integer
        total_reviews:
          type: integer
        average_rating:
          type: number
        seo_title:
          type:
            - string
            - 'null'
        seo_description:
          type:
            - string
            - 'null'
        seo_keywords:
          type: array
          items:
            type: string
        style_tags:
          type: array
          items:
            type: string
        color_tags:
          type: array
          items:
            type: string
        occasion_tags:
          type: array
          items:
            type: string
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
          description: |
            Время последнего изменения. В режиме синхронизации (updated_since) —
            время изменения из ленты, включая изменения вариантов, остатков и цен.
      example:
        object: product
        id: 3f6b1c2a-8d4e-4f7a-9b21-5c0e7d9a1b34
        external_id: '000012345'
        product_code: '100482'
        legal_entity_id: 5b8e2c1d-4f6a-4b7c-9d8e-1a2b3c4d5e6f
        variants_count: 0
        category_id: 9a1e5c7b-2d3f-4a6b-8c9d-0e1f2a3b4c5d
        name: Кружка керамическая 350 мл
        slug: kruzhka-keramicheskaya-350-ml
        description: Кружка ручной работы из белой глины.
        short_description: Керамика, 350 мл
        base_price: 89000
        sale_price: 79000
        compare_at_price: null
        sku: '100482'
        seller_sku: MUG-350-BLUE
        brand: Глина и огонь
        barcode: '04601234567890'
        country_of_origin: Россия
        product_class: null
        attributes_jsonb:
          color: синий
          volume_ml: 350
        mto_mode: none
        stock: 24
        material: керамика
        weight_grams: 420
        length_cm: 12
        width_cm: 9
        height_cm: 10
        package_length_cm: 14
        package_width_cm: 12
        package_height_cm: 12
        package_length_mm: null
        package_width_mm: null
        package_height_mm: null
        package_weight_grams: 600
        gender: null
        status: active
        has_variants: false
        allow_multiple_variant_options: true
        preparation_days: 2
        is_fragile: true
        is_made_to_order: false
        rejection_reason: null
        total_sales: 57
        total_reviews: 12
        average_rating: 4.8
        seo_title: null
        seo_description: null
        seo_keywords: []
        style_tags:
          - минимализм
        color_tags:
          - синий
        occasion_tags: []
        created_at: '2026-09-01T09:00:00.000Z'
        updated_at: '2026-09-20T14:30:00.000Z'
    ProductImage:
      type: object
      description: Фотография товара.
      required:
        - id
        - product_id
        - url
        - sort_order
        - is_main
        - created_at
      properties:
        id:
          type: string
          format: uuid
        product_id:
          type: string
          format: uuid
        url:
          type: string
          format: uri
        thumbnail_url:
          type:
            - string
            - 'null'
          format: uri
        blur_data_url:
          type:
            - string
            - 'null'
          description: Размытое превью для заглушки при загрузке (data URL).
        alt_text:
          type:
            - string
            - 'null'
        sort_order:
          type: integer
        is_main:
          type: boolean
          description: Главная фотография карточки.
        created_at:
          type: string
          format: date-time
    ProductVariant:
      type: object
      description: |
        Вариант товара (размер, цвет и другие параметры). Остаток варианта со
        stock_mode = product — остаток товара, в поле stock такого варианта null.
      required:
        - object
        - id
        - product_id
        - type
        - variant_type
        - value
        - stock_mode
        - is_available
        - sort_order
        - created_at
      properties:
        object:
          type: string
          enum:
            - variant
        id:
          type: string
          format: uuid
        product_id:
          type: string
          format: uuid
        external_id:
          type:
            - string
            - 'null'
          minLength: 1
          maxLength: 128
          description: Идентификатор варианта в учётной системе продавца; уникален в пределах товара.
        type:
          type: string
          description: Тип варианта, например size или color.
          example: size
        article:
          type:
            - string
            - 'null'
          description: Артикул варианта у продавца (то же значение, что source_article).
        name:
          type:
            - string
            - 'null'
          description: Название параметра для покупателя.
        variant_type:
          type: string
          description: Тип варианта (прежнее имя поля type).
          example: size
        value:
          type: string
          example: M
        price_override:
          type:
            - integer
            - 'null'
          description: Цена варианта в копейках; null — цена товара.
        stock:
          type:
            - integer
            - 'null'
          description: Свой остаток варианта; null — вариант продаётся из остатка товара.
        stock_mode:
          type: string
          enum:
            - own
            - product
          description: own — свой остаток варианта, product — общий остаток товара.
        sku_suffix:
          type:
            - string
            - 'null'
        image_url:
          type:
            - string
            - 'null'
          format: uri
        barcode:
          type:
            - string
            - 'null'
          description: Штрихкод строкой; ведущие нули сохраняются.
        source_article:
          type:
            - string
            - 'null'
          description: Артикул варианта у продавца.
        source_group:
          type:
            - string
            - 'null'
          description: Группа вариантов из файла импорта продавца.
        ros_size:
          type:
            - string
            - 'null'
          description: Российский размер.
        attributes_jsonb:
          type: object
          description: Характеристики варианта.
          additionalProperties: true
        buyer_note_required:
          type: boolean
          description: Дополнение требует текст покупателя (например, для персонализации).
        buyer_note_prompt:
          type:
            - string
            - 'null'
          description: Подсказка покупателю к тексту дополнения.
        buyer_note_max_len:
          type:
            - integer
            - 'null'
          description: Предельная длина текста покупателя; null — значение по умолчанию.
        is_available:
          type: boolean
        sort_order:
          type: integer
        created_at:
          type:
            - string
            - 'null'
          format: date-time
        updated_at:
          type:
            - string
            - 'null'
          format: date-time
    ProductCreate:
      type: object
      description: |
        Новый товар. Создаётся всегда черновиком (`status: draft`). Цена со скидкой
        не больше базовой, зачёркнутая цена не меньше базовой. Строки обрезаются по
        краям пробелов до проверки длины. Класс товара и режим изготовления
        проверяются по возможностям кабинета.
      required:
        - name
        - base_price
      additionalProperties: false
      properties:
        name:
          type: string
          minLength: 2
          maxLength: 200
        category_id:
          type:
            - string
            - 'null'
          format: uuid
        description:
          type:
            - string
            - 'null'
          maxLength: 10000
        short_description:
          type:
            - string
            - 'null'
          maxLength: 500
        base_price:
          type: integer
          minimum: 100
          maximum: 100000000
          description: Базовая цена в копейках.
        sale_price:
          type:
            - integer
            - 'null'
          minimum: 100
          maximum: 100000000
          description: Цена со скидкой в копейках.
        compare_at_price:
          type:
            - integer
            - 'null'
          minimum: 0
          maximum: 100000000
          description: Зачёркнутая цена в копейках.
        seller_sku:
          type:
            - string
            - 'null'
          maxLength: 100
          description: Артикул продавца, уникален в кабинете; иначе 409 seller_sku_conflict.
        sku:
          type:
            - string
            - 'null'
          maxLength: 100
          deprecated: true
          description: Устаревший синоним seller_sku; используется, если seller_sku не передан.
        brand:
          type:
            - string
            - 'null'
          maxLength: 120
          description: Бренд; юрлицу должно быть разрешено продавать этот бренд.
        barcode:
          type:
            - string
            - 'null'
          maxLength: 20
        stock:
          type:
            - integer
            - 'null'
          minimum: 0
          maximum: 999999
          description: Остаток; null — остаток не учитывается.
        material:
          type:
            - string
            - 'null'
          maxLength: 100
        weight_grams:
          type:
            - number
            - 'null'
          minimum: 0
          maximum: 100000
        length_cm:
          type:
            - number
            - 'null'
          minimum: 0
          maximum: 200
        width_cm:
          type:
            - number
            - 'null'
          minimum: 0
          maximum: 200
        height_cm:
          type:
            - number
            - 'null'
          minimum: 0
          maximum: 200
        package_length_cm:
          type:
            - integer
            - 'null'
          minimum: 1
          maximum: 200
        package_width_cm:
          type:
            - integer
            - 'null'
          minimum: 1
          maximum: 200
        package_height_cm:
          type:
            - integer
            - 'null'
          minimum: 1
          maximum: 200
        package_length_mm:
          type:
            - integer
            - 'null'
          minimum: 1
          maximum: 2000
        package_width_mm:
          type:
            - integer
            - 'null'
          minimum: 1
          maximum: 2000
        package_height_mm:
          type:
            - integer
            - 'null'
          minimum: 1
          maximum: 2000
        package_weight_grams:
          type:
            - integer
            - 'null'
          minimum: 1
          maximum: 50000
        gender:
          type:
            - string
            - 'null'
          enum:
            - women
            - men
            - unisex
            - children
            - null
        has_variants:
          type: boolean
        allow_multiple_variant_options:
          type: boolean
        preparation_days:
          type: integer
          minimum: 0
          maximum: 365
        is_fragile:
          type: boolean
        is_made_to_order:
          type: boolean
          const: false
        status:
          type: string
          const: draft
        style_tags:
          type: array
          maxItems: 20
          items:
            type: string
            minLength: 1
            maxLength: 50
        color_tags:
          type: array
          maxItems: 10
          items:
            type: string
            minLength: 1
            maxLength: 30
        occasion_tags:
          type: array
          maxItems: 10
          items:
            type: string
            minLength: 1
            maxLength: 50
        country_of_origin:
          type:
            - string
            - 'null'
          maxLength: 100
        product_class:
          oneOf:
            - $ref: '#/components/schemas/ProductClass'
            - type: 'null'
        attributes_jsonb:
          $ref: '#/components/schemas/ProductAttributes'
        mto_mode:
          type: string
          const: none
        seo_title:
          type:
            - string
            - 'null'
          maxLength: 200
        seo_description:
          type:
            - string
            - 'null'
          maxLength: 500
        seo_keywords:
          type: array
          maxItems: 20
          items:
            type: string
            minLength: 1
            maxLength: 50
      example:
        name: Кружка керамическая 350 мл
        category_id: 9a1e5c7b-2d3f-4a6b-8c9d-0e1f2a3b4c5d
        description: Кружка ручной работы из белой глины.
        base_price: 89000
        sale_price: 79000
        seller_sku: MUG-350-BLUE
        barcode: '04601234567890'
        stock: 24
        material: керамика
        weight_grams: 420
        package_length_cm: 14
        package_width_cm: 12
        package_height_cm: 12
        package_weight_grams: 600
        is_fragile: true
        attributes_jsonb:
          color: синий
          volume_ml: 350
    ProductUpdate:
      type: object
      description: |
        Изменение полей товара, кроме цен и остатков: их меняют запросы
        `POST /prices/batch` и `POST /inventory/batch`. Передавайте только
        изменяемые поля. Ограничения полей — как при создании товара.
      additionalProperties: false
      properties:
        name:
          type: string
          minLength: 2
          maxLength: 200
        category_id:
          type:
            - string
            - 'null'
          format: uuid
        description:
          type:
            - string
            - 'null'
          maxLength: 10000
        short_description:
          type:
            - string
            - 'null'
          maxLength: 500
        seller_sku:
          type:
            - string
            - 'null'
          maxLength: 100
        sku:
          type:
            - string
            - 'null'
          maxLength: 100
          deprecated: true
          description: Устаревший синоним seller_sku; используется, если seller_sku не передан.
        brand:
          type:
            - string
            - 'null'
          maxLength: 120
        barcode:
          type:
            - string
            - 'null'
          maxLength: 20
        material:
          type:
            - string
            - 'null'
          maxLength: 100
        weight_grams:
          type:
            - number
            - 'null'
          minimum: 0
          maximum: 100000
        length_cm:
          type:
            - number
            - 'null'
          minimum: 0
          maximum: 200
        width_cm:
          type:
            - number
            - 'null'
          minimum: 0
          maximum: 200
        height_cm:
          type:
            - number
            - 'null'
          minimum: 0
          maximum: 200
        package_length_cm:
          type:
            - integer
            - 'null'
          minimum: 1
          maximum: 200
        package_width_cm:
          type:
            - integer
            - 'null'
          minimum: 1
          maximum: 200
        package_height_cm:
          type:
            - integer
            - 'null'
          minimum: 1
          maximum: 200
        package_length_mm:
          type:
            - integer
            - 'null'
          minimum: 1
          maximum: 2000
        package_width_mm:
          type:
            - integer
            - 'null'
          minimum: 1
          maximum: 2000
        package_height_mm:
          type:
            - integer
            - 'null'
          minimum: 1
          maximum: 2000
        package_weight_grams:
          type:
            - integer
            - 'null'
          minimum: 1
          maximum: 50000
        gender:
          type:
            - string
            - 'null'
          enum:
            - women
            - men
            - unisex
            - children
            - null
        has_variants:
          type: boolean
        allow_multiple_variant_options:
          type: boolean
        preparation_days:
          type: integer
          minimum: 0
          maximum: 365
        is_fragile:
          type: boolean
        is_made_to_order:
          type: boolean
          const: false
        status:
          type: string
          const: draft
          description: Допустимо только значение draft; перевод в другие статусы — через модерацию.
        style_tags:
          type: array
          maxItems: 20
          items:
            type: string
            minLength: 1
            maxLength: 50
        color_tags:
          type: array
          maxItems: 10
          items:
            type: string
            minLength: 1
            maxLength: 30
        occasion_tags:
          type: array
          maxItems: 10
          items:
            type: string
            minLength: 1
            maxLength: 50
        country_of_origin:
          type:
            - string
            - 'null'
          maxLength: 100
        product_class:
          oneOf:
            - $ref: '#/components/schemas/ProductClass'
            - type: 'null'
        attributes_jsonb:
          $ref: '#/components/schemas/ProductAttributes'
        mto_mode:
          type: string
          const: none
        seo_title:
          type:
            - string
            - 'null'
          maxLength: 200
        seo_description:
          type:
            - string
            - 'null'
          maxLength: 500
        seo_keywords:
          type: array
          maxItems: 20
          items:
            type: string
            minLength: 1
            maxLength: 50
      example:
        name: Кружка керамическая 350 мл, синяя
        short_description: Керамика ручной работы, 350 мл
        preparation_days: 3
    InventoryItem:
      type: object
      description: |
        Остаток (Stock): строка по товару без вариантов со своим остатком и по
        каждому варианту со stock_mode = own. Поля id, sku, name и stock сохранены
        из прежнего формата: id — вариант или товар, stock совпадает с quantity.
      required:
        - object
        - id
        - product_id
        - variant_id
        - name
        - warehouse_id
        - quantity
        - stock
        - updated_at
      properties:
        object:
          type: string
          enum:
            - stock
        id:
          type: string
          format: uuid
          description: Идентификатор варианта для строки варианта, иначе товара.
        product_id:
          type: string
          format: uuid
        variant_id:
          type:
            - string
            - 'null'
          format: uuid
        external_id:
          type:
            - string
            - 'null'
          description: external_id варианта для строки варианта, товара — для строки товара.
        sku:
          type:
            - string
            - 'null'
          description: Код товара, присвоенный Тилуной.
        seller_sku:
          type:
            - string
            - 'null'
          description: Артикул продавца.
        name:
          type: string
        warehouse_id:
          type: string
          enum:
            - default
          description: Склад продавца; пока один.
        quantity:
          type:
            - integer
            - 'null'
          description: Остаток; null — остаток не учитывается.
        stock:
          type:
            - integer
            - 'null'
          description: То же значение, что quantity (прежнее имя поля).
        stock_mode:
          type:
            - string
            - 'null'
          enum:
            - own
            - product
            - null
          description: Режим остатка варианта; null для строки товара.
        updated_at:
          type:
            - string
            - 'null'
          format: date-time
      example:
        object: stock
        id: 3f6b1c2a-8d4e-4f7a-9b21-5c0e7d9a1b34
        product_id: 3f6b1c2a-8d4e-4f7a-9b21-5c0e7d9a1b34
        variant_id: null
        external_id: '000012345'
        sku: '100482'
        seller_sku: MUG-350-BLUE
        name: Кружка керамическая 350 мл
        warehouse_id: default
        quantity: 24
        stock: 24
        stock_mode: null
        updated_at: '2026-09-20T14:30:00.000Z'
    InventoryBatchRequest:
      type: object
      description: |
        Пакет остатков: до 1000 позиций, тело не больше 1 МБ. Позиция адресуется
        ровно одним из полей product_id, variant_id, external_id, seller_sku;
        остаток — в stock или quantity. Режим atomic (по умолчанию): при ошибке
        любой позиции ни один остаток не меняется. Режим partial: верные позиции
        применяются, ошибки — построчно в results.
      required:
        - items
      additionalProperties: false
      properties:
        mode:
          type: string
          enum:
            - atomic
            - partial
          default: atomic
        items:
          type: array
          minItems: 1
          maxItems: 1000
          description: Позиции; одна цель не повторяется.
          items:
            type: object
            additionalProperties: false
            properties:
              product_id:
                type: string
                format: uuid
                description: Товар без вариантов или с общим остатком.
              variant_id:
                type: string
                format: uuid
                description: Вариант со своим остатком (stock_mode = own).
              external_id:
                type: string
                minLength: 1
                maxLength: 128
                description: external_id товара или варианта.
              seller_sku:
                type: string
                minLength: 1
                maxLength: 100
                description: Артикул продавца (без учёта регистра).
              stock:
                type:
                  - integer
                  - 'null'
                minimum: 0
                maximum: 999999
                description: Новый остаток; null — не учитывать остаток товара. Остаток варианта — 0..999.
              quantity:
                type:
                  - integer
                  - 'null'
                minimum: 0
                maximum: 999999
                description: Синоним stock.
      example:
        mode: partial
        items:
          - product_id: 3f6b1c2a-8d4e-4f7a-9b21-5c0e7d9a1b34
            stock: 30
          - external_id: 000012345-M
            quantity: 4
          - seller_sku: MUG-350-BLUE
            stock: 0
    InventoryBatchResult:
      type: object
      description: |
        Итог пакета остатков. updated — прежнее поле: успешно обработанные позиции
        (изменённые и без изменений) в порядке items.
      required:
        - object
        - mode
        - results
        - updated
      properties:
        object:
          type: string
          enum:
            - batch_result
        mode:
          type: string
          enum:
            - atomic
            - partial
        results:
          type: array
          items:
            $ref: '#/components/schemas/CatalogBatchRowResult'
        updated:
          type: array
          items:
            type: object
            required:
              - id
              - product_id
              - variant_id
              - stock
              - updated_at
            properties:
              id:
                type: string
                format: uuid
                description: Вариант или товар.
              product_id:
                type: string
                format: uuid
              variant_id:
                type:
                  - string
                  - 'null'
                format: uuid
              stock:
                type:
                  - integer
                  - 'null'
              updated_at:
                type:
                  - string
                  - 'null'
                format: date-time
      example:
        object: batch_result
        mode: atomic
        results:
          - index: 0
            product_id: 3f6b1c2a-8d4e-4f7a-9b21-5c0e7d9a1b34
            variant_id: null
            status: updated
        updated:
          - id: 3f6b1c2a-8d4e-4f7a-9b21-5c0e7d9a1b34
            product_id: 3f6b1c2a-8d4e-4f7a-9b21-5c0e7d9a1b34
            variant_id: null
            stock: 30
            updated_at: '2026-09-24T10:15:00.000Z'
    PriceItem:
      type: object
      description: |
        Цена (Price) в копейках: строка товара — base_price, sale_price и
        compare_at_price; строка варианта — price_override (null — вариант
        продаётся по цене товара).
      required:
        - object
        - id
        - product_id
        - variant_id
        - name
        - base_price
        - currency
        - updated_at
      properties:
        object:
          type: string
          enum:
            - price
        id:
          type: string
          format: uuid
          description: Идентификатор варианта для строки варианта, иначе товара.
        product_id:
          type: string
          format: uuid
        variant_id:
          type:
            - string
            - 'null'
          format: uuid
        external_id:
          type:
            - string
            - 'null'
        sku:
          type:
            - string
            - 'null'
          description: Код товара, присвоенный Тилуной.
        seller_sku:
          type:
            - string
            - 'null'
          description: Артикул продавца.
        name:
          type: string
        base_price:
          type:
            - integer
            - 'null'
          description: Базовая цена в копейках; null для строки варианта.
        sale_price:
          type:
            - integer
            - 'null'
          description: Цена со скидкой в копейках.
        compare_at_price:
          type:
            - integer
            - 'null'
          description: Зачёркнутая цена в копейках.
        price_override:
          type:
            - integer
            - 'null'
          description: Цена варианта в копейках.
        currency:
          type: string
          enum:
            - RUB
        updated_at:
          type:
            - string
            - 'null'
          format: date-time
      example:
        object: price
        id: 3f6b1c2a-8d4e-4f7a-9b21-5c0e7d9a1b34
        product_id: 3f6b1c2a-8d4e-4f7a-9b21-5c0e7d9a1b34
        variant_id: null
        external_id: '000012345'
        sku: '100482'
        seller_sku: MUG-350-BLUE
        name: Кружка керамическая 350 мл
        base_price: 89000
        sale_price: 79000
        compare_at_price: null
        price_override: null
        currency: RUB
        updated_at: '2026-09-20T14:30:00.000Z'
    PriceBatchRequest:
      type: object
      description: |
        Пакет цен в копейках: до 1000 позиций, тело не больше 1 МБ. Адрес позиции —
        ровно одно из product_id, variant_id, external_id, seller_sku. У товара
        меняются base_price, sale_price и compare_at_price (sale_price ≤ base_price
        ≤ compare_at_price), у варианта — только price_override. Если цена
        покупателя снижается больше чем на 70 % у больше чем 50 позиций, нужен
        confirm_large_price_drop: true, иначе 409 price_drop_confirmation_required.
      required:
        - items
      additionalProperties: false
      properties:
        mode:
          type: string
          enum:
            - atomic
            - partial
          default: atomic
        confirm_large_price_drop:
          type: boolean
          default: false
        items:
          type: array
          minItems: 1
          maxItems: 1000
          items:
            type: object
            additionalProperties: false
            properties:
              product_id:
                type: string
                format: uuid
              variant_id:
                type: string
                format: uuid
              external_id:
                type: string
                minLength: 1
                maxLength: 128
              seller_sku:
                type: string
                minLength: 1
                maxLength: 100
              base_price:
                type: integer
                minimum: 100
                maximum: 100000000
                description: Базовая цена в копейках.
              sale_price:
                type:
                  - integer
                  - 'null'
                minimum: 100
                maximum: 100000000
                description: Цена со скидкой в копейках; null — убрать скидку.
              compare_at_price:
                type:
                  - integer
                  - 'null'
                minimum: 0
                maximum: 100000000
                description: Зачёркнутая цена в копейках; null — убрать.
              price_override:
                type:
                  - integer
                  - 'null'
                minimum: 100
                maximum: 100000000
                description: Цена варианта в копейках; null — цена товара.
      example:
        items:
          - product_id: 3f6b1c2a-8d4e-4f7a-9b21-5c0e7d9a1b34
            base_price: 95000
            sale_price: null
          - external_id: 000012345-M
            price_override: 99000
    PriceBatchResult:
      type: object
      description: |
        Итог пакета цен. updated — прежнее поле: успешно обработанные позиции
        (изменённые и без изменений) в порядке items.
      required:
        - object
        - mode
        - results
        - updated
      properties:
        object:
          type: string
          enum:
            - batch_result
        mode:
          type: string
          enum:
            - atomic
            - partial
        results:
          type: array
          items:
            $ref: '#/components/schemas/CatalogBatchRowResult'
        updated:
          type: array
          items:
            type: object
            required:
              - id
              - product_id
              - variant_id
              - updated_at
            properties:
              id:
                type: string
                format: uuid
              product_id:
                type: string
                format: uuid
              variant_id:
                type:
                  - string
                  - 'null'
                format: uuid
              base_price:
                type:
                  - integer
                  - 'null'
              sale_price:
                type:
                  - integer
                  - 'null'
              compare_at_price:
                type:
                  - integer
                  - 'null'
              price_override:
                type:
                  - integer
                  - 'null'
              updated_at:
                type:
                  - string
                  - 'null'
                format: date-time
      example:
        object: batch_result
        mode: atomic
        results:
          - index: 0
            product_id: 3f6b1c2a-8d4e-4f7a-9b21-5c0e7d9a1b34
            variant_id: null
            status: updated
        updated:
          - id: 3f6b1c2a-8d4e-4f7a-9b21-5c0e7d9a1b34
            product_id: 3f6b1c2a-8d4e-4f7a-9b21-5c0e7d9a1b34
            variant_id: null
            base_price: 95000
            sale_price: null
            compare_at_price: null
            price_override: null
            updated_at: '2026-09-24T10:15:00.000Z'
    OrderStatus:
      type: string
      description: Статус заказа целиком. Для решений по своей части заказа ориентируйтесь на статусы позиций.
      enum:
        - pending
        - paid
        - paid_pending_release
        - confirmed
        - processing
        - preparing
        - shipped
        - delivered
        - completed
        - return_requested
        - returned
        - cancelled
        - refunded
      x-enumDescriptions:
        pending: Ожидает оплаты
        paid: Оплачен
        paid_pending_release: Оплачен, ждёт принятия продавцом
        confirmed: Принят продавцом
        processing: В обработке
        preparing: Готовится к отгрузке
        shipped: Отправлен
        delivered: Доставлен
        completed: Завершён
        return_requested: Запрошен возврат
        returned: Возвращён
        cancelled: Отменён
        refunded: Деньги возвращены
    OrderItemStatus:
      type: string
      description: Статус позиции заказа.
      enum:
        - pending
        - processing
        - shipped
        - delivered
        - cancelled
      x-enumDescriptions:
        pending: Ожидает принятия
        processing: Принята, готовится к отгрузке
        shipped: Отгружена
        delivered: Доставлена
        cancelled: Отменена
    Order:
      type: object
      description: |
        Заказ в части продавца ключа: только позиции, суммы, доставка и
        отправления пары «кабинет + юрлицо» ключа. В заказе нескольких продавцов
        позиции и суммы других сторон не показываются. Поля order_number,
        items_total, commission, payout и status сохранены для совместимости.
      required:
        - object
        - id
        - number
        - order_number
        - legal_entity_id
        - fulfillment_status
        - status
        - has_cancelled_items
        - created_at
        - paid_at
        - accepted_at
        - updated_at
        - acceptance_deadline
        - currency
        - amounts
        - items_total
        - commission
        - payout
        - items
        - delivery
        - cancellation
      properties:
        object:
          type: string
          const: order
        id:
          type: string
          format: uuid
        number:
          type: string
          description: Номер заказа — непрозрачная строка (TL-… или VN-… у старых).
        order_number:
          type: string
          description: То же, что number; оставлено для совместимости.
        legal_entity_id:
          type:
            - string
            - 'null'
          format: uuid
          description: Юрлицо стороны ключа.
        fulfillment_status:
          $ref: '#/components/schemas/FulfillmentStatus'
        status:
          $ref: '#/components/schemas/OrderStatus'
        has_cancelled_items:
          type: boolean
          description: Среди позиций стороны есть отменённые.
        created_at:
          type: string
          format: date-time
        paid_at:
          type:
            - string
            - 'null'
          format: date-time
          description: |
            Когда деньги покупателя списаны. null, пока заказ не оплачен или сумма
            только заблокирована на карте (`order.paid` с `payment_status:
            authorized`): отгрузка таких позиций станет доступна, когда поле
            заполнится.
        accepted_at:
          type:
            - string
            - 'null'
          format: date-time
          description: |
            Когда сторона ключа приняла заказ; null, пока у стороны нет принятых
            позиций или есть позиции, ожидающие принятия. Известное ограничение:
            если в заказе несколько юрлиц одного кабинета, это момент первого
            принятия в кабинете (любым из его юрлиц).
        updated_at:
          type:
            - string
            - 'null'
          format: date-time
          description: |
            Момент последнего изменения заказа для стороны ключа. В ленте
            updated_since — момент отметки изменения.
        acceptance_deadline:
          type:
            - string
            - 'null'
          format: date-time
          description: Срок принятия заказа; пока не задаётся (null).
        currency:
          type: string
          const: RUB
        amounts:
          type: object
          description: Суммы стороны в копейках.
          required:
            - items_total
            - seller_discount
            - platform_discount
            - commission
            - delivery_share
            - pay_on_receipt
          properties:
            items_total:
              type: integer
              description: Сумма позиций стороны до скидок.
            seller_discount:
              type: integer
              description: Скидки по промокодам за счёт продавца.
            platform_discount:
              type: integer
              description: Скидки по промокодам за счёт Тилуны.
            commission:
              type: integer
              description: Вознаграждение Тилуны по позициям стороны.
            delivery_share:
              type:
                - integer
                - 'null'
              description: Цена доставки стороны; null — доля в заказе нескольких продавцов неизвестна.
            pay_on_receipt:
              type:
                - integer
                - 'null'
              description: Часть цены доставки, которую покупатель платит при получении.
        items_total:
          type: integer
          description: Сумма позиций продавца в копейках.
        commission:
          type: integer
          description: Комиссия Тилуны по позициям продавца в копейках.
        payout:
          type: integer
          deprecated: true
          description: |
            Оценка суммы к выплате в копейках. Устарело: точные суммы расчёта —
            в отчётах и удержаниях.
        items:
          type: array
          items:
            $ref: '#/components/schemas/OrderItem'
        delivery:
          type: object
          description: Доставка стороны ключа.
          required:
            - method
            - label
            - city
            - pickup_point
            - carrier
            - tracking_number
            - tracking_url
            - shipments
          properties:
            method:
              type:
                - string
                - 'null'
              description: Способ доставки стороны, например cdek.
            label:
              type:
                - string
                - 'null'
              description: Название способа доставки.
            city:
              type:
                - string
                - 'null'
              description: Населённый пункт доставки.
            pickup_point:
              oneOf:
                - type: object
                  required:
                    - code
                    - address
                  properties:
                    code:
                      type:
                        - string
                        - 'null'
                    address:
                      type:
                        - string
                        - 'null'
                - type: 'null'
            carrier:
              type:
                - string
                - 'null'
            tracking_number:
              type:
                - string
                - 'null'
            tracking_url:
              type:
                - string
                - 'null'
              format: uri
              description: Только https; иначе null.
            shipments:
              type: array
              items:
                $ref: '#/components/schemas/Shipment'
        cancellation:
          oneOf:
            - type: object
              required:
                - reason
                - cancelled_at
              properties:
                reason:
                  type:
                    - string
                    - 'null'
                cancelled_at:
                  type:
                    - string
                    - 'null'
                  format: date-time
            - type: 'null'
          description: Отмена позиций стороны; null, если сторона не отменена.
      example:
        object: order
        id: 6d1f3a5b-7c9e-4b2d-8f0a-1c3e5a7b9d2f
        number: TL-2026-00001234
        order_number: TL-2026-00001234
        legal_entity_id: 1c3e5a7b-9d2f-4b6d-8f1a-3c5e7a9b1d3f
        fulfillment_status: awaiting_acceptance
        status: paid_pending_release
        has_cancelled_items: false
        created_at: '2026-09-24T08:00:00.000Z'
        paid_at: '2026-09-24T08:02:00.000Z'
        accepted_at: null
        updated_at: '2026-09-24T08:02:00.000Z'
        acceptance_deadline: null
        currency: RUB
        amounts:
          items_total: 158000
          seller_discount: 0
          platform_discount: 0
          commission: 15800
          delivery_share: 0
          pay_on_receipt: 0
        items_total: 158000
        commission: 15800
        payout: 142200
        items:
          - object: order_item
            id: 2b4d6f8a-0c1e-4a3b-9d5f-7e9a1b3c5d7f
            product_id: 3f6b1c2a-8d4e-4f7a-9b21-5c0e7d9a1b34
            variant_id: null
            external_id: 1C-000482
            product_code: '100482'
            seller_sku: MUG-350
            variant_article: null
            barcode: '4600000000482'
            name: Кружка керамическая 350 мл
            variant: null
            quantity: 2
            unit_price: 79000
            total: 158000
            seller_discount: 0
            platform_discount: 0
            commission: 15800
            commission_bps: 1000
            status: pending
            shipped_at: null
            delivered_at: null
            cancelled_at: null
            marking:
              required: false
              status: null
              codes: []
            addons: []
            option_variant_ids: []
            price: 79000
            product_snapshot:
              name: Кружка керамическая 350 мл
              slug: kruzhka-keramicheskaya-350-ml
              image_url: null
              sku: '100482'
              variant_value: null
            tracking_number: null
            tracking_url: null
            carrier: null
            created_at: '2026-09-24T08:00:00.000Z'
        delivery:
          method: cdek
          label: СДЭК, пункт выдачи
          city: Казань
          pickup_point:
            code: KZN12
            address: Казань, ул. Баумана, 15
          carrier: null
          tracking_number: null
          tracking_url: null
          shipments: []
        cancellation: null
    OrderDetail:
      description: Заказ с доставкой и историей статусов.
      allOf:
        - $ref: '#/components/schemas/Order'
        - type: object
          required:
            - status_history
          properties:
            delivery_method:
              type:
                - string
                - 'null'
              description: Способ доставки.
            tracking_number:
              type:
                - string
                - 'null'
            carrier:
              type:
                - string
                - 'null'
            paid_at:
              type:
                - string
                - 'null'
              format: date-time
              description: Когда деньги покупателя списаны; null до оплаты и пока сумма только заблокирована на карте.
            cancel_reason:
              type:
                - string
                - 'null'
            payout_status:
              type:
                - string
                - 'null'
            payout_date:
              type:
                - string
                - 'null'
            status_history:
              type: array
              description: |
                История статусов заказа: записи своего кабинета и системные.
                Известное ограничение: если в заказе несколько юрлиц одного
                кабинета, в историю попадают и записи других юрлиц этого кабинета.
              items:
                $ref: '#/components/schemas/OrderStatusHistoryEntry'
    OrderItem:
      type: object
      description: |
        Позиция заказа, принадлежащая продавцу ключа. Поля price, product_snapshot,
        option_variant_ids, tracking_number, tracking_url и carrier сохранены для
        совместимости.
      required:
        - object
        - id
        - product_id
        - variant_id
        - external_id
        - product_code
        - seller_sku
        - variant_article
        - barcode
        - name
        - variant
        - quantity
        - unit_price
        - total
        - seller_discount
        - platform_discount
        - commission
        - commission_bps
        - status
        - shipped_at
        - delivered_at
        - cancelled_at
        - marking
        - addons
        - price
        - created_at
      properties:
        object:
          type: string
          const: order_item
        id:
          type: string
          format: uuid
        product_id:
          type: string
          format: uuid
        variant_id:
          type:
            - string
            - 'null'
          format: uuid
        external_id:
          type:
            - string
            - 'null'
          description: Идентификатор товара в учётной системе продавца.
        product_code:
          type:
            - string
            - 'null'
          description: Код товара Тилуны на момент заказа.
        seller_sku:
          type:
            - string
            - 'null'
          description: Артикул продавца.
        variant_article:
          type:
            - string
            - 'null'
          description: Артикул варианта в учётной системе продавца.
        barcode:
          type:
            - string
            - 'null'
          description: Штрихкод варианта или товара, строкой (ведущие нули сохраняются).
        name:
          type:
            - string
            - 'null'
          description: Название товара на момент заказа.
        variant:
          oneOf:
            - type: object
              required:
                - type
                - value
              properties:
                type:
                  type:
                    - string
                    - 'null'
                value:
                  type:
                    - string
                    - 'null'
            - type: 'null'
        quantity:
          type: integer
          minimum: 1
        unit_price:
          type: integer
          description: Цена единицы в копейках.
        total:
          type: integer
          description: Сумма позиции в копейках.
        seller_discount:
          type: integer
          description: Скидка по промокоду за счёт продавца в копейках.
        platform_discount:
          type: integer
          description: Скидка по промокоду за счёт Тилуны в копейках.
        commission:
          type: integer
          description: Вознаграждение Тилуны по позиции в копейках.
        commission_bps:
          type:
            - integer
            - 'null'
          description: Ставка вознаграждения в базисных пунктах (1000 = 10 %).
        status:
          $ref: '#/components/schemas/OrderItemStatus'
        shipped_at:
          type:
            - string
            - 'null'
          format: date-time
        delivered_at:
          type:
            - string
            - 'null'
          format: date-time
        cancelled_at:
          type:
            - string
            - 'null'
          format: date-time
        marking:
          type: object
          description: Маркировка «Честный знак» по позиции; коды — только проверенные.
          required:
            - required
            - status
            - codes
          properties:
            required:
              type: boolean
            status:
              type:
                - string
                - 'null'
            codes:
              type: array
              items:
                type: string
        addons:
          type: array
          description: Выбранные платные дополнения к товару.
          items:
            type: object
            required:
              - option_variant_id
              - label
              - price_delta
            properties:
              option_variant_id:
                type: string
                format: uuid
              label:
                type:
                  - string
                  - 'null'
              price_delta:
                type: integer
                description: Доплата за дополнение в копейках.
        option_variant_ids:
          type: array
          description: Выбранные дополнения к товару.
          items:
            type: string
            format: uuid
        price:
          type: integer
          description: Цена единицы в копейках; то же, что unit_price.
        product_snapshot:
          $ref: '#/components/schemas/OrderProductSnapshot'
        tracking_number:
          type:
            - string
            - 'null'
        tracking_url:
          type:
            - string
            - 'null'
          format: uri
          description: Ссылка на отслеживание, только https; иначе null.
        carrier:
          type:
            - string
            - 'null'
        created_at:
          type:
            - string
            - 'null'
          format: date-time
    OrderProductSnapshot:
      type:
        - object
        - 'null'
      description: |
        Снимок товара на момент заказа: так позиция выглядела для покупателя при
        оформлении. Поля, которых не было в снимке старого заказа, равны null.
      properties:
        pricing_policy:
          type:
            - string
            - 'null'
          description: Правило округления цен снимка; null — заказ до введения правила.
        product_id:
          type:
            - string
            - 'null'
          format: uuid
        name:
          type:
            - string
            - 'null'
        slug:
          type:
            - string
            - 'null'
        image_url:
          type:
            - string
            - 'null'
        product_code:
          type:
            - string
            - 'null'
          description: Код товара, присвоенный Тилуной.
        sku:
          type:
            - string
            - 'null'
        variant_value:
          type:
            - string
            - 'null'
        variant_type:
          type:
            - string
            - 'null'
        variant_label:
          type:
            - string
            - 'null'
        option_values:
          type: array
          description: Выбранные дополнения.
          items:
            type: object
            properties:
              id:
                type: string
              type:
                type: string
              label:
                type: string
              value:
                type: string
              price_delta:
                type: integer
                description: Доплата в копейках.
        material:
          type:
            - string
            - 'null'
        brand_name:
          type:
            - string
            - 'null'
        seller_legal_name:
          type:
            - string
            - 'null'
          description: Наименование юрлица продавца на момент заказа.
        seller_name:
          type:
            - string
            - 'null'
          description: Название магазина на момент заказа.
        seller_slug:
          type:
            - string
            - 'null'
        return_shipping_payer:
          type:
            - string
            - 'null'
          enum:
            - buyer
            - seller
            - null
          description: Кто оплачивает обратную доставку при возврате.
        legal_entity_id:
          type:
            - string
            - 'null'
          format: uuid
        is_made_to_order:
          type:
            - boolean
            - 'null'
        has_individual_properties:
          type:
            - boolean
            - 'null'
          description: Товар с индивидуальными свойствами (например, с персонализацией).
        mto_mode:
          type:
            - string
            - 'null'
    OrderStatusHistoryEntry:
      type: object
      description: Запись истории статусов заказа. Только изменения стороны продавца ключа и системные, без идентификаторов пользователей и комментариев.
      required:
        - status
        - at
        - actor
      properties:
        status:
          type: string
          description: Статус заказа после изменения; как правило, одно из значений OrderStatus.
        at:
          type:
            - string
            - 'null'
          format: date-time
        actor:
          type: string
          enum:
            - seller
            - buyer
            - platform
            - system
          x-enumDescriptions:
            seller: Продавец
            buyer: Покупатель
            platform: Сотрудник Тилуны
            system: Автоматически
      example:
        status: confirmed
        at: '2026-09-24T09:15:00.000Z'
        actor: seller
    OrderCancelRequest:
      type: object
      description: Отмена позиций продавца в заказе.
      additionalProperties: false
      properties:
        reason:
          type: string
          minLength: 1
          maxLength: 500
          description: Причина отмены для покупателя. Ссылки проверяются на безопасность.
      example:
        reason: Товар закончился на складе
    OrderCancelResult:
      type: object
      description: |
        Результат отмены. В заказе нескольких продавцов отменяются только позиции
        юрлица ключа (`partial: true`), остальные остаются в работе. `order` —
        заказ стороны после отмены.
      required:
        - success
        - partial
        - order_cancelled
        - cancelled_item_ids
        - refunded_minor
        - refunded
        - refund_failed
        - warning_code
        - message
        - order
      properties:
        success:
          type: boolean
          const: true
        partial:
          type: boolean
          description: Отменена только часть заказа, относящаяся к юрлицу ключа.
        order_cancelled:
          type: boolean
          description: Заказ отменён целиком.
        cancelled_item_ids:
          type: array
          items:
            type: string
            format: uuid
        refunded_minor:
          type: integer
          description: Сумма возврата покупателю в копейках.
        refunded:
          type: boolean
          description: Возврат денег покупателю выполнен.
        refund_failed:
          type: boolean
          description: Попытка вернуть деньги покупателю завершилась ошибкой.
        warning_code:
          type:
            - string
            - 'null'
          enum:
            - refund_failed
            - partial_cancellation
            - null
        message:
          type: string
        order:
          oneOf:
            - $ref: '#/components/schemas/Order'
            - type: 'null'
      example:
        success: true
        partial: false
        order_cancelled: true
        cancelled_item_ids:
          - 2b4d6f8a-0c1e-4a3b-9d5f-7e9a1b3c5d7f
        refunded_minor: 158000
        refunded: true
        refund_failed: false
        warning_code: null
        message: Order cancelled
        order: null
    ReturnStatus:
      type: string
      description: |
        Внутренний статус заявки на возврат. Для интеграций используйте
        `public_status`. `cancelled` · покупатель отменил заявку до передачи товара
        в доставку, заявка закрыта, `public_status` · `closed`.
      enum:
        - pending
        - seller_approved
        - seller_rejected
        - admin_review
        - refund_processing
        - refunded
        - rejected
        - cancelled
      x-enumDescriptions:
        pending: Заявление отправлено
        seller_approved: Инструкции подтверждены
        seller_rejected: Оспорен продавцом
        admin_review: Арбитраж
        refund_processing: Возврат средств
        refunded: Средства возвращены
        rejected: Требование не поддержано
        cancelled: Отменён покупателем
    Return:
      type: object
      description: |
        Заявка покупателя на возврат позиции заказа стороны ключа. Данные
        покупателя замаскированы; фото и вложения претензии через API не
        выдаются (`photos` — пустой список для совместимости).
      required:
        - object
        - id
        - order_id
        - order_number
        - order_item_id
        - kind
        - reason
        - status
        - public_status
        - created_at
        - updated_at
        - seller_response_deadline
        - seller_responded_at
        - currency
        - refund
        - return_shipment
      properties:
        object:
          type: string
          const: return
        id:
          type: string
          format: uuid
        kind:
          type:
            - string
            - 'null'
          enum:
            - quality
            - defect
            - handoff_refusal
            - null
          x-enumDescriptions:
            quality: Возврат товара надлежащего качества
            defect: Претензия к качеству
            handoff_refusal: Отказ при получении
        public_status:
          type: string
          enum:
            - requested
            - approved
            - rejected
            - in_review
            - refund_processing
            - refunded
            - closed
          x-enumDescriptions:
            requested: Ждёт решения продавца
            approved: Продавец согласился
            rejected: Продавец возразил
            in_review: На рассмотрении Тилуны
            refund_processing: Идёт возврат денег
            refunded: Деньги возвращены
            closed: Заявка закрыта · требование не поддержано или покупатель отменил заявку
          description: Стабильный статус для интеграций; status — внутренний статус заявки.
        seller_response_deadline:
          type:
            - string
            - 'null'
          format: date-time
          description: Срок ответа продавца (48 часов); null у исторических заявок.
        seller_response_due_at:
          type:
            - string
            - 'null'
          format: date-time
          description: То же значение срока ответа продавца.
        auto_approved_at:
          type:
            - string
            - 'null'
          format: date-time
        seller_reject_reason_code:
          type:
            - string
            - 'null'
          description: Код основания отказа продавца.
        currency:
          type: string
          const: RUB
        refund:
          type: object
          description: Возврат денег покупателю, копейки.
          required:
            - amount
            - goods
            - delivery
            - commission_reversal
            - refunded_at
          properties:
            amount:
              type:
                - integer
                - 'null'
            goods:
              type:
                - integer
                - 'null'
              description: Часть за товары по подтверждённым возвратам банка.
            delivery:
              type:
                - integer
                - 'null'
              description: Часть за доставку.
            commission_reversal:
              type:
                - integer
                - 'null'
              description: Сторно вознаграждения Тилуны.
            refunded_at:
              type:
                - string
                - 'null'
              format: date-time
        return_shipment:
          type: object
          description: Обратная отправка товара.
          required:
            - method
            - payer
            - cost
            - tracking_number
            - tracking_url
          properties:
            method:
              type:
                - string
                - 'null'
            payer:
              type:
                - string
                - 'null'
              description: Кто оплачивает обратную доставку.
            cost:
              type:
                - integer
                - 'null'
              description: Стоимость обратной доставки в копейках.
            tracking_number:
              type:
                - string
                - 'null'
            tracking_url:
              type:
                - string
                - 'null'
              format: uri
              description: Только https; иначе null.
        order_id:
          type: string
          format: uuid
        order_item_id:
          type: string
          format: uuid
        quantity:
          type:
            - integer
            - 'null'
          minimum: 1
          maximum: 10000
          readOnly: true
          description: Количество выбранных единиц в возврате · null у исторической записи без сохранённого количества.
        reason:
          type: string
          description: Причина возврата, указанная покупателем.
          enum:
            - wrong_size
            - defective
            - not_as_described
            - changed_mind
            - other
          x-enumDescriptions:
            wrong_size: Не подошёл размер
            defective: Брак / дефект
            not_as_described: Не соответствует описанию
            changed_mind: Передумал(а)
            other: Другая причина
        reason_text:
          type:
            - string
            - 'null'
        photos:
          type: array
          maxItems: 0
          description: Не выдаётся; пустой список оставлен для совместимости.
          items:
            type: string
        status:
          $ref: '#/components/schemas/ReturnStatus'
        seller_response:
          type:
            - string
            - 'null'
        seller_responded_at:
          type:
            - string
            - 'null'
          format: date-time
        admin_response:
          type:
            - string
            - 'null'
        admin_responded_at:
          type:
            - string
            - 'null'
          format: date-time
        refund_amount:
          type:
            - integer
            - 'null'
          description: Сумма возврата в копейках.
        refunded_at:
          type:
            - string
            - 'null'
          format: date-time
        return_tracking_number:
          type:
            - string
            - 'null'
        return_tracking_url:
          type:
            - string
            - 'null'
          format: uri
          description: Ссылка на отслеживание обратной отправки, только https; иначе null.
        order_number:
          type:
            - string
            - 'null'
        product_name:
          type:
            - string
            - 'null'
        product_image:
          type:
            - string
            - 'null'
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
      example:
        object: return
        id: 8e0a2c4e-6a8c-4e1a-b3c5-d7e9f1a3b5c7
        order_id: 6d1f3a5b-7c9e-4b2d-8f0a-1c3e5a7b9d2f
        order_item_id: 2b4d6f8a-0c1e-4a3b-9d5f-7e9a1b3c5d7f
        kind: defect
        public_status: requested
        seller_response_deadline: null
        currency: RUB
        refund:
          amount: null
          goods: null
          delivery: null
          commission_reversal: null
          refunded_at: null
        return_shipment:
          method: null
          payer: null
          cost: null
          tracking_number: null
          tracking_url: null
        reason: defective
        reason_text: Скол на ручке кружки
        photos: []
        status: pending
        seller_response: null
        seller_responded_at: null
        admin_response: null
        admin_responded_at: null
        refund_amount: null
        refunded_at: null
        return_tracking_number: null
        return_tracking_url: null
        order_number: TL-2026-00001234
        product_name: Кружка керамическая 350 мл
        product_image: null
        created_at: '2026-10-02T09:00:00.000Z'
        updated_at: '2026-10-02T09:00:00.000Z'
    ReturnApproveRequest:
      type: object
      description: Согласие с заявкой на возврат.
      additionalProperties: false
      properties:
        response:
          type: string
          maxLength: 1000
          description: Комментарий продавца для покупателя.
      example:
        response: Отправьте товар через пункт СДЭК, возврат оплатим мы.
    ReturnRejectRequest:
      type: object
      description: Возражение до истечения 48 часов. Для новых заявок обязательны reason_code и прошедшие проверку фото продавца. Прежнее тело только с response поддерживается для исторических заявок без seller_response_due_at. После срока заявка одобряется автоматически за счёт продавца.
      anyOf:
        - required:
            - response
          properties:
            response:
              minLength: 1
              maxLength: 1000
        - required:
            - reason_code
            - photos
      allOf:
        - if:
            required:
              - reason_code
            properties:
              reason_code:
                const: other
          then:
            required:
              - response
            properties:
              response:
                minLength: 1
        - if:
            required:
              - reason_code
          then:
            required:
              - photos
        - if:
            required:
              - photos
          then:
            required:
              - reason_code
      additionalProperties: false
      properties:
        reason_code:
          type: string
          enum:
            - expired_window
            - signs_of_use
            - incomplete
            - packaging_damaged
            - activated_or_locked
            - serial_mismatch
            - other
        response:
          type: string
          maxLength: 2000
          description: Комментарий, обязателен при reason_code=other. Ссылки проверяются на безопасность.
        photos:
          type: array
          minItems: 1
          maxItems: 5
          items:
            type: string
            maxLength: 500
          description: Ссылки на загруженные фото /api/storage/venets-reviews/ или /api/storage/venets-chat-attachments/.
      example:
        reason_code: signs_of_use
        response: На корпусе следы использования.
        photos:
          - /api/storage/venets-reviews/return-evidence.jpg
    Review:
      type: object
      description: Отзыв покупателя о товаре продавца.
      required:
        - id
        - product_id
        - rating
        - text
        - status
        - created_at
        - updated_at
      properties:
        object:
          type: string
          enum:
            - review
        id:
          type: string
          format: uuid
        product_id:
          type: string
          format: uuid
        product_name:
          type:
            - string
            - 'null'
        product_slug:
          type:
            - string
            - 'null'
        product_image:
          type:
            - string
            - 'null'
        order_id:
          type:
            - string
            - 'null'
          format: uuid
        rating:
          type: integer
          minimum: 1
          maximum: 5
        title:
          type:
            - string
            - 'null'
        text:
          type: string
        pros:
          type:
            - string
            - 'null'
        cons:
          type:
            - string
            - 'null'
        photos:
          type: array
          items:
            type: string
        status:
          type: string
          enum:
            - pending
            - approved
            - rejected
          x-enumDescriptions:
            pending: На модерации
            approved: Опубликован
            rejected: Отклонён модерацией
        is_verified_purchase:
          type: boolean
        is_recommended:
          type: boolean
        is_anonymous:
          type: boolean
        helpful_count:
          type: integer
        seller_reply:
          type:
            - string
            - 'null'
        seller_replied_at:
          type:
            - string
            - 'null'
          format: date-time
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
      example:
        object: review
        id: 1a3c5e7a-9b1d-4f3b-8c5d-7e9f1b3d5f7a
        product_id: 3f6b1c2a-8d4e-4f7a-9b21-5c0e7d9a1b34
        product_name: Кружка керамическая 350 мл
        product_slug: kruzhka-keramicheskaya-350-ml
        product_image: null
        order_id: 6d1f3a5b-7c9e-4b2d-8f0a-1c3e5a7b9d2f
        rating: 5
        title: Отличная кружка
        text: Держит тепло, приятная на ощупь.
        pros: Удобная ручка
        cons: null
        photos: []
        status: approved
        is_verified_purchase: true
        is_recommended: true
        is_anonymous: false
        helpful_count: 3
        seller_reply: null
        seller_replied_at: null
        created_at: '2026-10-05T12:00:00.000Z'
        updated_at: '2026-10-05T12:00:00.000Z'
    ReviewStats:
      type: object
      description: Сводка по опубликованным отзывам покупателей.
      required:
        - stats
        - unreplied_count
      properties:
        stats:
          type: object
          required:
            - average
            - total
            - distribution
          properties:
            average:
              type: number
              description: Средняя оценка.
            total:
              type: integer
              description: Количество отзывов.
            distribution:
              type: object
              description: Количество отзывов по оценкам от 1 до 5.
              propertyNames:
                enum:
                  - '1'
                  - '2'
                  - '3'
                  - '4'
                  - '5'
              additionalProperties:
                type: integer
        unreplied_count:
          type: integer
          description: Опубликованные отзывы без ответа продавца.
      example:
        stats:
          average: 4.7
          total: 42
          distribution:
            '1': 1
            '2': 1
            '3': 2
            '4': 6
            '5': 32
        unreplied_count: 3
    ReviewReplyRequest:
      type: object
      description: Ответ продавца на отзыв. Повторный запрос изменяет ответ, пока открыто окно правки.
      required:
        - text
      additionalProperties: false
      properties:
        text:
          type: string
          minLength: 10
          maxLength: 1000
      example:
        text: Спасибо за отзыв! Рады, что кружка понравилась.
    AnalyticsStats:
      type: object
      description: Показатели продаж продавца за период.
      required:
        - revenue
        - ordersCount
        - averageCheck
        - productViews
        - conversionRate
        - wishlistCount
      properties:
        revenue:
          type: integer
          description: Выручка по позициям продавца в копейках.
        ordersCount:
          type: integer
          description: Количество заказов с позициями продавца за период.
        averageCheck:
          type: integer
          description: Средний чек в копейках.
        productViews:
          type: integer
          description: Просмотры карточек товаров.
        conversionRate:
          type: number
          description: Отношение проданных единиц к просмотрам, проценты с точностью до десятых.
        wishlistCount:
          type: integer
          description: Добавления товаров в избранное.
      example:
        revenue: 1580000
        ordersCount: 12
        averageCheck: 131667
        productViews: 940
        conversionRate: 1.5
        wishlistCount: 31
    FinanceBalance:
      type: object
      description: Баланс продавца по операциям юрлица ключа. Все суммы — в копейках.
      required:
        - totalEarned
        - grossSales
        - commissionPaid
        - onHold
        - available
        - debt
        - paid
        - pendingPayout
      properties:
        totalEarned:
          type: integer
          description: Начислено по продажам за вычетом комиссии.
        grossSales:
          type: integer
          description: Продажи до вычета комиссии.
        commissionPaid:
          type: integer
          description: Комиссия Тилуны по продажам.
        onHold:
          type: integer
          description: Удерживается до окончания срока возврата или передачи заказа.
        available:
          type: integer
          description: Доступно к выплате.
        debt:
          type: integer
          description: Задолженность продавца.
        paid:
          type: integer
          description: Выплачено.
        pendingPayout:
          type: integer
          description: В выплатах и заявках на вывод, которые ещё не завершены.
      example:
        totalEarned: 1422000
        grossSales: 1580000
        commissionPaid: 158000
        onHold: 284400
        available: 853200
        debt: 0
        paid: 284400
        pendingPayout: 0
    FinancePayout:
      type: object
      description: Выплата продавцу или заявка на вывод. Банковские реквизиты не выдаются.
      required:
        - id
        - amount
        - status
        - created_at
      properties:
        id:
          type: string
          format: uuid
        seller_id:
          type: string
          format: uuid
          deprecated: true
          description: Внутренний идентификатор кабинета; не используйте.
        legal_entity_id:
          type:
            - string
            - 'null'
          format: uuid
        bank_detail_id:
          type:
            - string
            - 'null'
          format: uuid
          description: Идентификатор набора реквизитов в кабинете; сами реквизиты не выдаются.
        amount:
          type: integer
          description: Сумма в копейках.
        status:
          type: string
          description: Статус выплаты или заявки.
        processed_at:
          type:
            - string
            - 'null'
          format: date-time
        created_at:
          type: string
          format: date-time
    FinanceScheduleEntry:
      type: object
      description: Ожидаемое поступление — сумма продаж, которая станет доступной к выплате в указанную дату.
      required:
        - available_at
        - amount
        - transaction_count
      properties:
        available_at:
          type:
            - string
            - 'null'
          format: date
          description: День, когда сумма станет доступной, `YYYY-MM-DD` по московскому времени; null — дата ещё не определена.
        amount:
          type: integer
          description: Сумма в копейках.
        transaction_count:
          type: integer
    FinanceTransaction:
      type: object
      description: Операция по счёту продавца. Суммы в копейках.
      required:
        - id
        - type
        - amount
        - commission_amount
        - net_amount
        - balance_after
        - status
        - created_at
      properties:
        id:
          type: string
          format: uuid
        seller_id:
          type: string
          format: uuid
          deprecated: true
          description: Внутренний идентификатор кабинета; не используйте.
        legal_entity_id:
          type:
            - string
            - 'null'
          format: uuid
        order_id:
          type:
            - string
            - 'null'
          format: uuid
        order_item_id:
          type:
            - string
            - 'null'
          format: uuid
        type:
          type: string
          enum:
            - sale
            - commission
            - refund
            - withdrawal
            - adjustment
            - clawback
            - delivery_income
            - delivery_charge
            - acquiring_fee
            - chargeback
            - fee
          x-enumDescriptions:
            sale: Продажа
            commission: Комиссия
            refund: Возврат покупателю
            withdrawal: Вывод средств
            adjustment: Корректировка
            clawback: Удержание ранее начисленного
            delivery_income: Доход от доставки
            delivery_charge: Расход на доставку
            acquiring_fee: Эквайринг
            chargeback: Оспаривание платежа
            fee: Сбор
        amount:
          type: integer
          description: Сумма операции.
        commission_amount:
          type: integer
          description: Комиссия по операции.
        net_amount:
          type: integer
          description: Сумма после комиссии; со знаком.
        balance_after:
          type: integer
          description: Баланс после операции.
        status:
          type: string
          enum:
            - pending
            - available
            - paid
            - cancelled
          x-enumDescriptions:
            pending: Удерживается
            available: Доступна к выплате
            paid: Выплачена
            cancelled: Отменена
        description:
          type:
            - string
            - 'null'
        available_at:
          type:
            - string
            - 'null'
          format: date-time
        paid_at:
          type:
            - string
            - 'null'
          format: date-time
        withdrawal_id:
          type:
            - string
            - 'null'
          format: uuid
        created_at:
          type: string
          format: date-time
      example:
        id: 4c6e8a0c-2e4a-4c6e-9a0c-2e4a6c8e0a2c
        seller_id: 0b2d4f6b-8d0f-4b2d-a4f6-8b0d2f4b6d8f
        legal_entity_id: 5a7c9e1a-3c5e-4a7c-b9e1-3a5c7e9a1c3e
        order_id: 6d1f3a5b-7c9e-4b2d-8f0a-1c3e5a7b9d2f
        order_item_id: 2b4d6f8a-0c1e-4a3b-9d5f-7e9a1b3c5d7f
        type: sale
        amount: 158000
        commission_amount: 15800
        net_amount: 142200
        balance_after: 995400
        status: pending
        description: Продажа по заказу 50001234-0007
        available_at: '2026-10-15T00:00:00.000Z'
        paid_at: null
        withdrawal_id: null
        created_at: '2026-09-24T08:05:00.000Z'
    WebhookEventType:
      type: string
      description: |
        Тип события. `ping` — тестовое событие из кабинета. Адреса прежнего
        формата (`legacy+v1`) получают только типы с версией 2026-05-08. Новые
        типы появляются без смены версии API: неизвестный тип получатель
        должен принимать (2xx) и пропускать.
      enum:
        - order.paid
        - order.accepted
        - order.shipped
        - order.partially_shipped
        - order.cancelled
        - order.items_cancelled
        - order.status_changed
        - order.delivered
        - order.refunded
        - shipment.tracking_updated
        - return.created
        - return.approved
        - return.rejected
        - return.escalated
        - return.shipment_updated
        - return.refunded
        - return.resolved
        - product.created
        - product.updated
        - product.archived
        - product.moderation.approved
        - product.moderation.rejected
        - product.moderation.revision_requested
        - inventory.updated
        - price.updated
        - review.created
        - review.replied
        - payout.created
        - payout.paid
        - payout.failed
        - agent_report.ready
        - report.ready
        - ping
      x-enumDescriptions:
        order.paid: Заказ оплачен покупателем, позиции стороны ждут принятия
        order.accepted: Продавец принял заказ
        order.shipped: Все позиции стороны отгружены
        order.partially_shipped: Часть позиций стороны отгружена
        order.cancelled: Заказ отменён
        order.items_cancelled: Отменена часть позиций заказа
        order.status_changed: Изменился статус заказа
        order.delivered: Заказ доставлен покупателю
        order.refunded: Покупателю возвращены деньги по заказу
        shipment.tracking_updated: Обновился статус отслеживания отправления (только по явной подписке)
        return.created: Покупатель оформил возврат
        return.approved: Возврат одобрен
        return.rejected: Возврат отклонён
        return.escalated: Возврат передан на рассмотрение Тилуны
        return.shipment_updated: Обновилось отправление возврата
        return.refunded: Деньги по возврату отправлены покупателю
        return.resolved: Спор по возврату решён
        product.created: Создан товар
        product.updated: Изменён товар
        product.archived: Товар перенесён в архив
        product.moderation.approved: Товар прошёл модерацию
        product.moderation.rejected: Товар отклонён модерацией
        product.moderation.revision_requested: Модерация просит доработать товар
        inventory.updated: Изменились остатки
        price.updated: Изменились цены
        review.created: Опубликован отзыв о товаре
        review.replied: Продавец ответил на отзыв
        payout.created: Создана выплата
        payout.paid: Выплата проведена
        payout.failed: Выплата не прошла
        agent_report.ready: Сформирован отчёт агента
        report.ready: Асинхронный отчёт готов к скачиванию
        ping: Тестовое событие для проверки endpoint'а
    WebhookEvent:
      type: object
      description: |
        Тело уведомления прежнего формата (`legacy+v1`, версия 2026-05-08) —
        адреса, подключённые до 2026-10-01, пока их не перевели на формат v1
        кнопкой «Обновить формат» в кабинете. `data` — компактный снимок ресурса и
        идентификатор ресурса вида `order_id`.
      required:
        - id
        - type
        - api_version
        - created_at
        - data
      properties:
        id:
          type: string
          format: uuid
          description: Идентификатор события; используйте для дедупликации.
        type:
          $ref: '#/components/schemas/WebhookEventType'
        api_version:
          type: string
          example: '2026-05-08'
        created_at:
          type: string
          format: date-time
        data:
          type: object
          description: Данные события; состав зависит от типа.
          additionalProperties: true
      example:
        id: 9f1b3d5f-7a9c-4e1b-8d3f-5a7c9e1b3d5f
        type: order.shipped
        api_version: '2026-05-08'
        created_at: '2026-09-24T12:00:00.000Z'
        data:
          order_id: 6d1f3a5b-7c9e-4b2d-8f0a-1c3e5a7b9d2f
          status: shipped
          carrier: СДЭК
          tracking_number: '1234567890'
          tracking_url: null
    ProductVariantCreate:
      type: object
      description: |
        Новый вариант товара. Остаток (stock, stock_mode) передаёт ключ с
        inventory:write, цену варианта (price_override) — ключ с prices:write.
        Подарочная упаковка, гравировка и другие платные дополнения через API не
        создаются.
      required:
        - value
      additionalProperties: false
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 200
          description: Название параметра для покупателя; по умолчанию — по типу (Размер, Цвет…).
        type:
          type: string
          enum:
            - size
            - color
            - length
            - coating
            - metal_color
            - gemstone_color
            - custom
          description: Тип варианта, по умолчанию size; type и variant_type — синонимы, передайте одно поле.
        variant_type:
          type: string
          enum:
            - size
            - color
            - length
            - coating
            - metal_color
            - gemstone_color
            - custom
          description: Тип варианта (прежнее имя поля type).
        value:
          type: string
          minLength: 1
          maxLength: 40
          example: M
        external_id:
          type:
            - string
            - 'null'
          minLength: 1
          maxLength: 128
          description: Идентификатор варианта в учётной системе; уникален в пределах товара (иначе 409 external_id_conflict).
        barcode:
          type:
            - string
            - 'null'
          minLength: 1
          maxLength: 64
          description: Штрихкод строкой; ведущие нули сохраняются.
        article:
          type:
            - string
            - 'null'
          minLength: 1
          maxLength: 100
          description: Артикул варианта у продавца.
        sku_suffix:
          type:
            - string
            - 'null'
          maxLength: 100
        price_override:
          type:
            - integer
            - 'null'
          minimum: 100
          maximum: 100000000
          description: Цена варианта в копейках; null — цена товара.
        stock:
          type: integer
          minimum: 0
          maximum: 999
          description: Свой остаток варианта; по умолчанию 0.
        stock_mode:
          type: string
          enum:
            - own
            - product
          default: own
          description: own — свой остаток, product — продаётся из остатка товара.
        is_available:
          type: boolean
          default: true
        sort_order:
          type: integer
          minimum: 0
          maximum: 9999
          default: 0
      example:
        type: size
        value: M
        stock: 5
        external_id: 000012345-M
        barcode: '04601234567890'
    ProductVariantUpdate:
      type: object
      description: |
        Изменение варианта: передаются только меняемые поля. Остаток — ключ с
        inventory:write (expected_stock — запись, только если остаток не менялся,
        иначе 409 inventory_conflict), цена — ключ с prices:write.
      additionalProperties: false
      minProperties: 1
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 200
        type:
          type: string
          enum:
            - size
            - color
            - length
            - coating
            - metal_color
            - gemstone_color
            - custom
          description: Тип варианта; type и variant_type — синонимы, передайте одно поле.
        variant_type:
          type: string
          enum:
            - size
            - color
            - length
            - coating
            - metal_color
            - gemstone_color
            - custom
          description: Тип варианта; type и variant_type — синонимы, передайте одно поле.
        value:
          type: string
          minLength: 1
          maxLength: 200
          description: Новое значение — не длиннее 40 символов; прежнее длинное значение можно передать без изменений.
        external_id:
          type:
            - string
            - 'null'
          minLength: 1
          maxLength: 128
          description: null снимает привязку.
        barcode:
          type:
            - string
            - 'null'
          minLength: 1
          maxLength: 64
        article:
          type:
            - string
            - 'null'
          minLength: 1
          maxLength: 100
        sku_suffix:
          type:
            - string
            - 'null'
          maxLength: 100
        price_override:
          type:
            - integer
            - 'null'
          minimum: 100
          maximum: 100000000
        stock:
          type: integer
          minimum: 0
          maximum: 999
        expected_stock:
          type: integer
          minimum: 0
          maximum: 999
        stock_mode:
          type: string
          enum:
            - own
            - product
        is_available:
          type: boolean
        sort_order:
          type: integer
          minimum: 0
          maximum: 9999
      example:
        stock: 12
        expected_stock: 10
    Category:
      type: object
      description: |
        Категория каталога. Список плоский: дерево строится по parent_id, путь от
        корня — в path. Идентификаторы одинаковы в боевом окружении и песочнице.
      required:
        - object
        - id
        - parent_id
        - name
        - slug
        - path
        - is_leaf
        - attributes_url
      properties:
        object:
          type: string
          enum:
            - category
        id:
          type: string
          format: uuid
        parent_id:
          type:
            - string
            - 'null'
          format: uuid
        name:
          type: string
        slug:
          type: string
        path:
          type: array
          description: Названия категорий от корня до этой включительно.
          items:
            type: string
        is_leaf:
          type: boolean
          description: У категории нет дочерних.
        attributes_url:
          type: string
          description: Адрес характеристик категории относительно базы API.
      example:
        object: category
        id: 9a1e5c7b-2d3f-4a6b-8c9d-0e1f2a3b4c5d
        parent_id: 1b2c3d4e-5f6a-4b7c-8d9e-0f1a2b3c4d5e
        name: Кружки
        slug: kruzhki
        path:
          - Дом
          - Посуда
          - Кружки
        is_leaf: true
        attributes_url: /v1/categories/9a1e5c7b-2d3f-4a6b-8c9d-0e1f2a3b4c5d/attributes
    CategoryAttribute:
      type: object
      description: |
        Характеристика категории. Значение передаётся в attributes_jsonb товара под
        ключом key. Для enum и multi_enum без free_input допустимы только значения
        из values.
      required:
        - object
        - key
        - name
        - type
        - unit
        - required
        - values
        - free_input
      properties:
        object:
          type: string
          enum:
            - attribute
        key:
          type: string
          description: Ключ в attributes_jsonb товара.
          example: import_v4.material
        name:
          type: string
        type:
          type: string
          enum:
            - string
            - number
            - boolean
            - enum
            - multi_enum
        unit:
          type:
            - string
            - 'null'
          description: Единица измерения числового значения.
        required:
          type: boolean
          description: Характеристика обязательна для отправки на модерацию.
        values:
          type: array
          items:
            type: object
            required:
              - value
              - label
            properties:
              value:
                type: string
              label:
                type: string
        free_input:
          type: boolean
          description: Можно указать значение вне списка values.
      example:
        object: attribute
        key: import_v4.material
        name: Материал
        type: enum
        unit: null
        required: false
        values:
          - value: Керамика
            label: Керамика
        free_input: true
    CatalogBatchRowResult:
      type: object
      description: Итог одной позиции пакета остатков или цен.
      required:
        - index
        - product_id
        - variant_id
        - status
      properties:
        index:
          type: integer
          minimum: 0
          description: Номер позиции в items, с нуля.
        product_id:
          type:
            - string
            - 'null'
          format: uuid
        variant_id:
          type:
            - string
            - 'null'
          format: uuid
        status:
          type: string
          enum:
            - updated
            - unchanged
            - error
        error:
          type: object
          description: Причина ошибки позиции (только при status = error).
          required:
            - code
            - message
          properties:
            code:
              type: string
              description: Код из каталога ошибок, например not_found или validation_failed.
            message:
              type: string
            param:
              type: string
      example:
        index: 1
        product_id: null
        variant_id: null
        status: error
        error:
          code: not_found
          message: Товар или вариант не найден
          param: product_id
    FulfillmentStatus:
      type: string
      description: |
        Статус исполнения заказа для стороны ключа — стабильное значение для
        интеграций. Считается по статусу заказа и статусам позиций юрлица ключа;
        в заказе нескольких продавцов у каждой стороны свой статус.
      enum:
        - awaiting_payment
        - awaiting_acceptance
        - accepted
        - partially_shipped
        - shipped
        - delivered
        - completed
        - cancelled
        - return_requested
        - returned
        - refunded
      x-enumDescriptions:
        awaiting_payment: Заказ ещё не оплачен
        awaiting_acceptance: Оплачен, позиции стороны ждут принятия
        accepted: Позиции приняты, готовятся к отгрузке
        partially_shipped: Отгружена часть позиций
        shipped: Все неотменённые позиции отгружены
        delivered: Все неотменённые позиции доставлены
        completed: Заказ завершён
        cancelled: Позиции стороны отменены
        return_requested: Покупатель запросил возврат
        returned: Товар возвращён
        refunded: Деньги возвращены
    Shipment:
      type: object
      description: |
        Отправление заказа стороны ключа. Без стоимости доставки, ссылок на
        этикетки и данных перевозчика.
      required:
        - object
        - id
        - direction
        - provider
        - tracking_number
        - tracking_url
        - status
        - pickup_point
        - declared_weight_g
        - shipped_at
        - delivered_at
        - item_ids
      properties:
        object:
          type: string
          const: shipment
        id:
          type: string
          format: uuid
        direction:
          type: string
          enum:
            - outbound
          description: Направление; обратные отправления описаны в возвратах.
        provider:
          type:
            - string
            - 'null'
          description: Служба доставки.
        tracking_number:
          type:
            - string
            - 'null'
        tracking_url:
          type:
            - string
            - 'null'
          format: uri
          description: Ссылка на отслеживание, только https; иначе null.
        status:
          type:
            - string
            - 'null'
          enum:
            - created
            - pickup_scheduled
            - in_transit
            - at_pvz
            - delivered
            - returned
            - cancelled
            - null
          x-enumDescriptions:
            created: Создано
            pickup_scheduled: Ожидает передачи в доставку
            in_transit: В пути
            at_pvz: В пункте выдачи
            delivered: Доставлено
            returned: Возвращено отправителю
            cancelled: Отменено
        pickup_point:
          oneOf:
            - type: object
              required:
                - code
                - address
              properties:
                code:
                  type:
                    - string
                    - 'null'
                address:
                  type:
                    - string
                    - 'null'
            - type: 'null'
        declared_weight_g:
          type:
            - integer
            - 'null'
          minimum: 1
        shipped_at:
          type:
            - string
            - 'null'
          format: date-time
        delivered_at:
          type:
            - string
            - 'null'
          format: date-time
        item_ids:
          type: array
          description: Позиции заказа стороны в этом отправлении.
          items:
            type: string
            format: uuid
      example:
        object: shipment
        id: 5b7d9f1b-3d5f-4a7b-9c1e-3f5a7c9e1b3d
        direction: outbound
        provider: cdek
        tracking_number: '1234567890'
        tracking_url: https://www.cdek.ru/ru/tracking?order_id=1234567890
        status: in_transit
        pickup_point:
          code: MSK123
          address: Москва, ул. Тверская, 1
        declared_weight_g: 500
        shipped_at: '2026-09-25T10:00:00.000Z'
        delivered_at: null
        item_ids:
          - 2b4d6f8a-0c1e-4a3b-9d5f-7e9a1b3c5d7f
    OrderCommandResult:
      type: object
      description: Команда по заказу выполнена; `order` — заказ стороны ключа после неё.
      required:
        - success
        - order
      properties:
        success:
          type: boolean
          const: true
        order:
          oneOf:
            - $ref: '#/components/schemas/Order'
            - type: 'null'
      example:
        success: true
        order: null
    ReturnCommandResult:
      type: object
      description: Решение по возврату сохранено; `return` — заявка после решения.
      required:
        - success
        - return
      properties:
        success:
          type: boolean
          const: true
        return:
          oneOf:
            - $ref: '#/components/schemas/Return'
            - type: 'null'
      example:
        success: true
        return: null
    Balance:
      type: object
      description: Баланс юрлица ключа. Суммы — целые копейки.
      required:
        - object
        - legal_entity_id
        - on_hold
        - available
        - requested
        - currency
        - as_of
      properties:
        object:
          type: string
          const: balance
        legal_entity_id:
          type:
            - string
            - 'null'
          format: uuid
          description: Юрлицо ключа; null — ключ кабинета без юрлица.
        on_hold:
          type: integer
          description: В удержании до окончания срока возврата.
        available:
          type: integer
          description: Доступно к выплате.
        requested:
          type: integer
          description: Запрошено к выводу и ещё не выплачено.
        currency:
          type: string
          const: RUB
        as_of:
          type: string
          format: date-time
          description: Момент расчёта в UTC.
    Transaction:
      type: object
      description: Операция леджера продавца. Суммы — целые копейки со знаком для продавца.
      required:
        - object
        - id
        - type
        - status
        - amount
        - commission
        - net_amount
        - currency
        - created_at
        - updated_at
      properties:
        object:
          type: string
          const: transaction
        id:
          type: string
          format: uuid
        legal_entity_id:
          type:
            - string
            - 'null'
          format: uuid
        type:
          type: string
          description: Вид операции; неизвестный новый вид — other.
          enum:
            - sale
            - commission
            - refund
            - withdrawal
            - adjustment
            - clawback
            - delivery_income
            - delivery_charge
            - acquiring_fee
            - other
        kind:
          type:
            - string
            - 'null'
          description: Вид корректировки (только для type=adjustment).
          enum:
            - seller_promo_discount
            - seller_promo_discount_reversal
            - tochka_customer_refund
            - finance_settlement_correction
            - other
            - null
        status:
          type: string
          enum:
            - pending
            - available
            - paid
            - cancelled
        amount:
          type: integer
        commission:
          type: integer
          description: Вознаграждение площадки в строке продажи.
        net_amount:
          type: integer
          description: Изменение баланса продавца.
        currency:
          type: string
          const: RUB
        order_id:
          type:
            - string
            - 'null'
          format: uuid
        order_number:
          type:
            - string
            - 'null'
        order_item_id:
          type:
            - string
            - 'null'
          format: uuid
        available_at:
          type:
            - string
            - 'null'
          format: date-time
        paid_at:
          type:
            - string
            - 'null'
          format: date-time
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    Payout:
      type: object
      description: |
        Выплата продавцу. Статус — публичный:

        - `pending` — выплата создана или исполняется;
        - `paid` — банк подтвердил исполнение выплаты получателю;
        - `unconfirmed` — банк закрыл сделку, но исполнение платежа получателю ещё не подтверждено;
        - `in_review` — состояние проверяется (неоднозначный ответ банка);
        - `failed` — платёж отклонён или отменён банком, выплата будет исправлена;
        - `cancelled` — выплата отменена без перечисления.

        Статус не окончательный: выплата, возвращённая банком получателя, может
        перейти из `paid` в `failed`.
      required:
        - object
        - id
        - rail
        - status
        - amount
        - payout_amount
        - currency
        - created_at
        - updated_at
      properties:
        object:
          type: string
          const: payout
        id:
          type: string
          format: uuid
        legal_entity_id:
          type:
            - string
            - 'null'
          format: uuid
        rail:
          type: string
          enum:
            - period
            - deal
            - legacy
          description: period — выплата за отчётный период, deal — по заказу, legacy — прежние выплаты.
        status:
          type: string
          enum:
            - pending
            - paid
            - unconfirmed
            - in_review
            - failed
            - cancelled
        amount:
          type: integer
          description: Сумма к расчёту в копейках.
        payout_amount:
          type: integer
          description: Сумма к перечислению в копейках.
        withheld:
          type:
            - integer
            - 'null'
          description: Удержано из суммы; null — не рассчитывается для направления.
        currency:
          type: string
          const: RUB
        paid_at:
          type:
            - string
            - 'null'
          format: date-time
          description: Момент исполнения; только у статуса paid.
        document:
          type:
            - object
            - 'null'
          description: Основание выплаты (номер и дата платёжного документа).
          required:
            - number
            - date
          properties:
            number:
              type: string
            date:
              type:
                - string
                - 'null'
              format: date
        report_number:
          type:
            - string
            - 'null'
          description: Номер отчёта за период, по которому выплата.
        sources_count:
          type:
            - integer
            - 'null'
          description: Число заказов в выплате; null — разбивки нет.
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    PayoutSource:
      type: object
      description: Заказ, из которого собрана выплата, и сумма по нему в копейках.
      required:
        - object
        - order_id
        - amount
        - currency
      properties:
        object:
          type: string
          const: payout_source
        order_id:
          type: string
          format: uuid
        order_number:
          type:
            - string
            - 'null'
        amount:
          type: integer
        currency:
          type: string
          const: RUB
    Deduction:
      type: object
      description: Услуга или удержание. Сумма со знаком для продавца — удержание отрицательное.
      required:
        - object
        - id
        - service_code
        - service_name
        - amount
        - currency
        - status
        - created_at
        - updated_at
      properties:
        object:
          type: string
          const: deduction
        id:
          type: string
          format: uuid
        service_code:
          type: string
          enum:
            - agent_fee
            - agent_fee_reversal
            - delivery_reimbursement
            - delivery_income
            - acquiring_reimbursement
            - seller_promo
            - correction
            - clawback
        service_name:
          type: string
        legal_entity_id:
          type:
            - string
            - 'null'
          format: uuid
        order_id:
          type:
            - string
            - 'null'
          format: uuid
        order_number:
          type:
            - string
            - 'null'
        order_item_id:
          type:
            - string
            - 'null'
          format: uuid
        amount:
          type: integer
        currency:
          type: string
          const: RUB
        vat_rate:
          type:
            - string
            - 'null'
          description: Ставка НДС услуги; none — без НДС, null — не определена.
          enum:
            - none
            - null
        status:
          type: string
          enum:
            - pending
            - available
            - paid
            - cancelled
        available_at:
          type:
            - string
            - 'null'
          format: date-time
        paid_at:
          type:
            - string
            - 'null'
          format: date-time
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        report_id:
          type:
            - string
            - 'null'
          format: uuid
          description: Отчёт агента, в который вошла строка.
        document:
          type: 'null'
          description: Акт или УПД по услуге; появится в следующих версиях.
    AgentReport:
      type: object
      description: |
        Отчёт агента за период. `preliminary: true`, пока период документа не
        закрыт целиком (одним или несколькими закрытыми отчётными периодами).
        Построчные данные — из неизменяемого отчёта периода (`source:
        tl_snapshot`), когда закрытый период совпадает с периодом документа;
        иначе — из документа «АГ» (`source: ag_legacy`).
      required:
        - object
        - id
        - number
        - status
        - preliminary
        - source
        - issued_at
        - totals
        - currency
        - file_url
        - lines_url
        - updated_at
      properties:
        object:
          type: string
          const: agent_report
        id:
          type: string
          format: uuid
        number:
          type: string
        legal_entity_id:
          type:
            - string
            - 'null'
          format: uuid
        period_from:
          type:
            - string
            - 'null'
          format: date
        period_to:
          type:
            - string
            - 'null'
          format: date
        status:
          type: string
          enum:
            - issued
            - accepted
            - disputed
            - superseded
        preliminary:
          type: boolean
          description: true, пока период документа не закрыт целиком.
        source:
          type: string
          enum:
            - tl_snapshot
            - ag_legacy
        tl_report_number:
          type:
            - string
            - 'null'
          description: |
            Номер отчёта закрытого периода, который совпадает с периодом
            документа; null, если такого нет (в том числе когда месяц закрыт
            несколькими периодами).
        issued_at:
          type: string
          format: date-time
        accept_deadline:
          type:
            - string
            - 'null'
          format: date-time
        totals:
          type: object
          description: Итоги в копейках; null — в документе нет значения.
          required:
            - sales
            - returns
            - agent_fee
            - deductions
            - payable
            - paid
            - balance_open
            - balance_close
          properties:
            sales:
              type:
                - integer
                - 'null'
            returns:
              type:
                - integer
                - 'null'
            agent_fee:
              type:
                - integer
                - 'null'
            deductions:
              type:
                - integer
                - 'null'
            payable:
              type:
                - integer
                - 'null'
            paid:
              type:
                - integer
                - 'null'
            balance_open:
              type:
                - integer
                - 'null'
            balance_close:
              type:
                - integer
                - 'null'
        currency:
          type: string
          const: RUB
        file_url:
          type: string
          description: Адрес PDF документа в API (тем же ключом).
        lines_url:
          type: string
          description: Адрес строк отчёта в API.
        updated_at:
          type: string
          format: date-time
    ReportRow:
      type: object
      description: |
        Строка листа отчёта в JSON: деньги — целые копейки, даты — YYYY-MM-DD,
        моменты — ISO 8601 UTC, коды и штрихкоды — строки. Набор колонок зависит
        от листа.
      additionalProperties:
        type:
          - string
          - integer
          - boolean
          - array
          - 'null'
        items:
          type: string
    ApiKey:
      type: object
      description: Сведения о ключе запроса без секрета и следов использования.
      required:
        - object
        - id
        - name
        - environment
        - key_format
        - scopes
        - effective_scopes
        - tier
        - rate_limits
        - legal_entity
        - seller
        - integration_label
        - expires_at
      properties:
        object:
          type: string
          const: api_key
        id:
          type: string
          description: Идентификатор ключа (kid) — публичная часть ключа.
        name:
          type: string
        environment:
          type: string
          enum:
            - live
            - sandbox
          description: |
            live — боевой ключ, выпущенный владельцем кабинета продавца; sandbox —
            тестовый ключ `tl_test_…` песочницы, выданный интегратору по заявке.
        key_format:
          type: string
          enum:
            - tl
            - vnt_sk
          description: tl — ключ `tl_live_…` или `tl_test_…`; vnt_sk — ранее выпущенный ключ `vnt_sk_live_…`.
        scopes:
          type: array
          description: Scopes, с которыми выпущен ключ.
          items:
            type: string
        effective_scopes:
          type: array
          description: Действующие scopes в канонических именах.
          items:
            type: string
        tier:
          type: string
          enum:
            - basic
            - pro
            - partner
            - internal
        rate_limits:
          type: object
          required:
            - per_key
            - per_seller
            - window
          properties:
            per_key:
              type: integer
            per_seller:
              type: integer
            window:
              type: string
              const: 1m
        legal_entity:
          type:
            - object
            - 'null'
          required:
            - id
            - name
            - type
          properties:
            id:
              type: string
              format: uuid
            name:
              type: string
            type:
              type: string
              enum:
                - ip
                - ooo
                - npd
                - ao
                - other
        seller:
          type: object
          required:
            - public_number
          properties:
            public_number:
              type:
                - string
                - 'null'
        integration_label:
          type:
            - string
            - 'null'
        expires_at:
          type:
            - string
            - 'null'
          format: date-time
    LegalEntity:
      type: object
      description: Юрлицо продавца. Банковские реквизиты, адреса и контакты не выдаются.
      required:
        - object
        - id
        - type
        - legal_name
        - brand_name
        - status
        - sales_paused
        - vat
        - agreement
      properties:
        object:
          type: string
          const: legal_entity
        id:
          type: string
          format: uuid
        type:
          type: string
          enum:
            - ip
            - ooo
            - npd
            - ao
            - other
        legal_name:
          type: string
        brand_name:
          type: string
        inn:
          type:
            - string
            - 'null'
        kpp:
          type:
            - string
            - 'null'
        ogrn:
          type:
            - string
            - 'null'
        tax_regime:
          type:
            - string
            - 'null'
        vat:
          type: object
          required:
            - rate
            - source
          properties:
            rate:
              type:
                - string
                - 'null'
              enum:
                - none
                - '0'
                - '5'
                - '7'
                - '10'
                - '20'
                - '22'
                - null
            source:
              type: string
              const: legal_entity
        status:
          type: string
          enum:
            - pending
            - verified
            - suspended
            - rejected
        sales_paused:
          type: boolean
        agreement:
          type:
            - object
            - 'null'
          required:
            - offer_version
            - accepted_at
          properties:
            offer_version:
              type: string
            accepted_at:
              type:
                - string
                - 'null'
              format: date-time
    Report:
      type: object
      description: Асинхронный отчёт. Файлы хранятся 7 дней после готовности.
      required:
        - object
        - id
        - type
        - formats
        - legal_entity_id
        - status
        - preliminary
        - row_counts
        - created_at
        - files
        - error
      properties:
        object:
          type: string
          const: report
        id:
          type: string
          format: uuid
        type:
          type: string
          enum:
            - agent_sales
            - payouts
            - deductions
            - orders
        formats:
          type: array
          items:
            type: string
            enum:
              - xlsx
              - csv
              - json
        period_from:
          type:
            - string
            - 'null'
          format: date
        period_to:
          type:
            - string
            - 'null'
          format: date
        legal_entity_id:
          type:
            - string
            - 'null'
          format: uuid
        status:
          type: string
          enum:
            - queued
            - processing
            - succeeded
            - failed
            - expired
        preliminary:
          type: boolean
          description: Период не закрыт — расчёт предварительный.
        row_counts:
          type: object
          description: Число строк по листам.
          additionalProperties:
            type: integer
        created_at:
          type: string
          format: date-time
        completed_at:
          type:
            - string
            - 'null'
          format: date-time
        expires_at:
          type:
            - string
            - 'null'
          format: date-time
        files:
          type: array
          description: Файлы готового отчёта; скачиваются тем же ключом.
          items:
            type: object
            required:
              - format
              - size
              - sha256
              - download_url
            properties:
              format:
                type: string
                enum:
                  - xlsx
                  - csv
                  - json
              size:
                type: integer
              sha256:
                type: string
                pattern: ^[a-f0-9]{64}$
              download_url:
                type: string
        error:
          type:
            - object
            - 'null'
          required:
            - code
            - message
          properties:
            code:
              type: string
            message:
              type: string
    ReportCreateRequest:
      type: object
      description: |
        Заявка на отчёт. Период — даты по Москве включительно: orders, payouts и
        deductions — не длиннее 93 дней; agent_sales — календарный месяц или
        период закрытого отчёта. Месяц agent_sales, который пересекается с
        закрытым отчётным периодом или предшествует последнему закрытому,
        отклоняется сразу: 400 validation_failed, details.reason =
        period_overlaps_closed, details.last_closed_period_to — последний день
        последнего закрытого периода.
      additionalProperties: false
      required:
        - type
        - formats
        - period
      properties:
        type:
          type: string
          enum:
            - agent_sales
            - payouts
            - deductions
            - orders
        formats:
          type: array
          minItems: 1
          maxItems: 3
          items:
            type: string
            enum:
              - xlsx
              - csv
              - json
        period:
          type: object
          additionalProperties: false
          required:
            - from
            - to
          properties:
            from:
              type: string
              format: date
            to:
              type: string
              format: date
    Event:
      type: object
      description: |
        Событие журнала — тот же конверт, что приходит вебхуком в формате v1.
        `data.object` — компактный снимок ресурса на момент события (статусы,
        номер, `updated_at` и поля конкретного типа); полный объект — `GET resource.url`.
        `sequence` — позиция в журнале, а не
        гарантия порядка доставки: дедуплицируйте по `id` и сверяйте
        `data.object.updated_at`. Схема снимка и пример для каждого типа — в
        разделе «События вебхуков»; неизвестный тип пропускайте.
      required:
        - id
        - object
        - type
        - api_version
        - created
        - occurred_at
        - livemode
        - sequence
        - legal_entity
        - source
        - resource
        - data
        - request
      properties:
        id:
          type: string
          format: uuid
          description: Идентификатор события; одинаков в ленте и во всех попытках доставки.
        object:
          type: string
          const: event
        type:
          type: string
          maxLength: 64
          description: Тип события (каталог — `GET /event_types`). Новые типы появляются без смены версии.
          example: order.paid
        api_version:
          type: string
          description: Версия формата события.
          example: '2026-10-01'
        created:
          type: string
          format: date-time
          description: Время записи события в журнал.
        occurred_at:
          type: string
          format: date-time
          description: Время изменения ресурса.
        livemode:
          type: boolean
          description: '`true` — боевое окружение, `false` — песочница.'
        sequence:
          type: integer
          format: int64
          minimum: 0
          description: Позиция в журнале; 0 — тестовое событие из кабинета (в журнал не пишется).
        legal_entity:
          type:
            - string
            - 'null'
          format: uuid
          description: Юрлицо ресурса; `null` — событие всего кабинета.
        source:
          type: string
          description: Инициатор изменения.
          enum:
            - buyer
            - seller_cabinet
            - seller_api
            - platform
            - system
            - sandbox
        resource:
          type: object
          required:
            - type
            - id
            - url
          properties:
            type:
              type: string
              example: order
            id:
              type:
                - string
                - 'null'
              format: uuid
            url:
              type:
                - string
                - 'null'
              description: Путь ресурса в API относительно базового адреса.
              example: /v1/orders/6d1f3a5b-7c9e-4b2d-8f0a-1c3e5a7b9d2f
        data:
          type: object
          required:
            - object
            - previous_attributes
          properties:
            object:
              type: object
              description: Компактный снимок ресурса.
              additionalProperties: true
            previous_attributes:
              type:
                - object
                - 'null'
              description: Прежние значения изменившихся полей, если известны.
              additionalProperties: true
        request:
          type: object
          required:
            - id
            - idempotency_key
          properties:
            id:
              type:
                - string
                - 'null'
              description: X-Request-Id запроса, вызвавшего событие.
            idempotency_key:
              type:
                - string
                - 'null'
              description: Idempotency-Key запроса — только для изменений через API.
      example:
        id: 0f5c2f8e-5f7a-4c1b-9a3e-2d4f6b8c0e1a
        object: event
        type: order.paid
        api_version: '2026-10-01'
        created: '2026-10-01T09:00:00.123Z'
        occurred_at: '2026-10-01T08:59:59.800Z'
        livemode: true
        sequence: 1048576
        legal_entity: 1e9a1000-0000-4000-8000-000000000001
        source: buyer
        resource:
          type: order
          id: 6d1f3a5b-7c9e-4b2d-8f0a-1c3e5a7b9d2f
          url: /v1/orders/6d1f3a5b-7c9e-4b2d-8f0a-1c3e5a7b9d2f
        data:
          object:
            object: order
            id: 6d1f3a5b-7c9e-4b2d-8f0a-1c3e5a7b9d2f
            number: TL-2026-000123
            fulfillment_status: awaiting_acceptance
            updated_at: '2026-10-01T08:59:59.800Z'
          previous_attributes:
            fulfillment_status: awaiting_payment
        request:
          id: null
          idempotency_key: null
    EventList:
      type: object
      description: Страница ленты событий. `next_cursor` есть и на последней странице — продолжайте опрос с него.
      required:
        - object
        - url
        - data
        - has_more
        - next_cursor
      properties:
        object:
          type: string
          const: list
        url:
          type: string
          example: /v1/events
        data:
          type: array
          items:
            $ref: '#/components/schemas/Event'
        has_more:
          type: boolean
          description: '`true` — следующие события уже есть, запросите их сразу.'
        next_cursor:
          type:
            - string
            - 'null'
          description: Значение для параметра `after` следующего запроса.
    EventType:
      type: object
      required:
        - object
        - type
        - resource_type
        - required_scope
        - description
        - default_subscribed
        - since_api_version
      properties:
        object:
          type: string
          const: event_type
        type:
          type: string
          example: order.paid
        resource_type:
          type: string
          example: order
        required_scope:
          type:
            - string
            - 'null'
          description: Scope ключа, без которого тип не выдаётся лентой; `null` — служебный тип.
          example: orders:read
        description:
          type: string
          example: Заказ оплачен покупателем, позиции стороны ждут принятия
        default_subscribed:
          type: boolean
          description: Входит в подписку нового адреса и в ленту без параметра `types`.
        since_api_version:
          type: string
          example: '2026-10-01'
    EventTypeList:
      type: object
      required:
        - object
        - url
        - data
        - has_more
        - next_cursor
      properties:
        object:
          type: string
          const: list
        url:
          type: string
          example: /v1/event_types
        data:
          type: array
          items:
            $ref: '#/components/schemas/EventType'
        has_more:
          type: boolean
          const: false
        next_cursor:
          type: 'null'
    WebhookEndpoint:
      type: object
      description: Адрес для уведомлений, настроенный в кабинете. Секрет подписи не выдаётся.
      required:
        - object
        - id
        - name
        - url
        - status
        - enabled_event_types
        - api_version
        - legal_entity_id
        - scope_mode
        - last_success_at
        - last_failure_at
        - created_at
      properties:
        object:
          type: string
          const: webhook_endpoint
        id:
          type: string
          format: uuid
        name:
          type: string
          maxLength: 80
        url:
          type: string
          format: uri
          maxLength: 500
        status:
          type: string
          enum:
            - active
            - paused
            - disabled
          description: |
            `paused` — временная пауза после нескольких неудач подряд (события
            копятся и будут отправлены); `disabled` — адрес отключён (ответ 410,
            трое суток без успешных доставок или владельцем в кабинете).
        enabled_event_types:
          type: array
          items:
            type: string
        api_version:
          type: string
          description: Версия формата событий адреса.
          example: '2026-10-01'
        legal_entity_id:
          type:
            - string
            - 'null'
          format: uuid
        scope_mode:
          type: string
          enum:
            - legal_entity
            - cabinet
          description: '`legal_entity` — события одного юрлица, `cabinet` — всего кабинета.'
        last_success_at:
          type:
            - string
            - 'null'
          format: date-time
        last_failure_at:
          type:
            - string
            - 'null'
          format: date-time
        created_at:
          type: string
          format: date-time
    WebhookEndpointList:
      type: object
      required:
        - object
        - url
        - data
        - has_more
        - next_cursor
      properties:
        object:
          type: string
          const: list
        url:
          type: string
          example: /v1/webhook_endpoints
        data:
          type: array
          items:
            $ref: '#/components/schemas/WebhookEndpoint'
        has_more:
          type: boolean
        next_cursor:
          type:
            - string
            - 'null'
    OrderEventObject:
      type: object
      description: |
        Снимок заказа в части стороны события (юрлицо позиций): статусы и
        позиции стороны без цен. Позиций в снимке не больше
        100 (дальше — items_truncated и GET resource.url). Поля конкретного типа
        события описаны в схеме типа.
      required:
        - object
        - id
      properties:
        object:
          type: string
          const: order
        id:
          type: string
          format: uuid
        number:
          type:
            - string
            - 'null'
          description: Номер заказа.
          example: TL-2026-00001234
        status:
          type: string
          description: Статус заказа целиком (см. OrderStatus).
          example: paid_pending_release
        fulfillment_status:
          $ref: '#/components/schemas/FulfillmentStatus'
        updated_at:
          type:
            - string
            - 'null'
          format: date-time
        items:
          type: array
          description: Позиции стороны события.
          maxItems: 100
          items:
            type: object
            required:
              - id
              - status
            properties:
              id:
                type: string
                format: uuid
              status:
                type: string
                description: Статус позиции (см. OrderItemStatus).
                example: pending
        items_truncated:
          type: boolean
          const: true
          description: Позиций больше 100 — в снимке первые 100.
        test:
          type: boolean
          const: true
          description: |
            Только в тестовом событии, отправленном кнопкой проверки адреса в
            кабинете: id ресурса нулевой, полей типа нет. В журнал такое событие
            не пишется.
        sample:
          type: boolean
          const: true
          description: |
            Только в образце события песочницы (`POST /test_helpers/events`,
            `source: sandbox`, `livemode: false`). Образец по заказу или возврату
            несёт общий снимок ресурса без полей конкретного типа, по остальным
            ресурсам — только `object`, `id` и `sample`. Ресурс — последний
            подходящий в тестовом кабинете.
    OrderPaidEvent:
      title: order.paid
      description: Заказ оплачен — позиции стороны ждут принятия.
      allOf:
        - $ref: '#/components/schemas/Event'
        - type: object
          properties:
            type:
              type: string
              const: order.paid
            data:
              type: object
              properties:
                previous_attributes:
                  type:
                    - object
                    - 'null'
                  additionalProperties: true
                  description: Прежние значения изменившихся полей, если известны; обычно null.
                object:
                  allOf:
                    - $ref: '#/components/schemas/OrderEventObject'
                    - type: object
                      properties:
                        payment_status:
                          type: string
                          enum:
                            - authorized
                            - captured
                          description: |
                            authorized — сумма заблокирована на карте покупателя и
                            будет списана позже: отгрузка возможна после списания,
                            его признак — paid_at в GET /orders/{orderId}
                            (до списания null); captured — деньги списаны.
    OrderAcceptedEvent:
      title: order.accepted
      description: Продавец принял позиции стороны — в кабинете или через API.
      allOf:
        - $ref: '#/components/schemas/Event'
        - type: object
          properties:
            type:
              type: string
              const: order.accepted
            data:
              type: object
              properties:
                previous_attributes:
                  type:
                    - object
                    - 'null'
                  additionalProperties: true
                  description: Прежние значения изменившихся полей, если известны; обычно null.
                object:
                  allOf:
                    - $ref: '#/components/schemas/OrderEventObject'
                    - type: object
                      properties:
                        accepted_item_ids:
                          type: array
                          maxItems: 100
                          items:
                            type: string
                            format: uuid
                          description: Позиции стороны, принятые этим действием.
    OrderShippedEvent:
      title: order.shipped
      description: Отгружены все неотменённые позиции стороны.
      allOf:
        - $ref: '#/components/schemas/Event'
        - type: object
          properties:
            type:
              type: string
              const: order.shipped
            data:
              type: object
              properties:
                previous_attributes:
                  type:
                    - object
                    - 'null'
                  additionalProperties: true
                  description: Прежние значения изменившихся полей, если известны; обычно null.
                object:
                  allOf:
                    - $ref: '#/components/schemas/OrderEventObject'
                    - type: object
                      properties:
                        shipped_item_ids:
                          type: array
                          maxItems: 100
                          items:
                            type: string
                            format: uuid
                          description: Позиции стороны, отгруженные этим действием.
                        carrier:
                          type:
                            - string
                            - 'null'
                          maxLength: 64
                          description: Перевозчик.
                        tracking_number:
                          type:
                            - string
                            - 'null'
                          maxLength: 64
                        tracking_url:
                          type:
                            - string
                            - 'null'
                          format: uri
                          maxLength: 500
                          description: Ссылка на отслеживание, только https; иначе null.
    OrderPartiallyShippedEvent:
      title: order.partially_shipped
      description: Отгружена часть позиций стороны.
      allOf:
        - $ref: '#/components/schemas/Event'
        - type: object
          properties:
            type:
              type: string
              const: order.partially_shipped
            data:
              type: object
              properties:
                previous_attributes:
                  type:
                    - object
                    - 'null'
                  additionalProperties: true
                  description: Прежние значения изменившихся полей, если известны; обычно null.
                object:
                  allOf:
                    - $ref: '#/components/schemas/OrderEventObject'
                    - type: object
                      properties:
                        shipped_item_ids:
                          type: array
                          maxItems: 100
                          items:
                            type: string
                            format: uuid
                          description: Позиции стороны, отгруженные этим действием.
                        carrier:
                          type:
                            - string
                            - 'null'
                          maxLength: 64
                          description: Перевозчик.
                        tracking_number:
                          type:
                            - string
                            - 'null'
                          maxLength: 64
                        tracking_url:
                          type:
                            - string
                            - 'null'
                          format: uri
                          maxLength: 500
                          description: Ссылка на отслеживание, только https; иначе null.
    OrderCancelledEvent:
      title: order.cancelled
      description: Отменены все позиции стороны (или заказ целиком).
      allOf:
        - $ref: '#/components/schemas/Event'
        - type: object
          properties:
            type:
              type: string
              const: order.cancelled
            data:
              type: object
              properties:
                previous_attributes:
                  type:
                    - object
                    - 'null'
                  additionalProperties: true
                  description: Прежние значения изменившихся полей, если известны; обычно null.
                object:
                  allOf:
                    - $ref: '#/components/schemas/OrderEventObject'
                    - type: object
                      properties:
                        cancelled_by:
                          type: string
                          enum:
                            - buyer
                            - seller
                            - platform
                            - system
                          description: Кто отменил — покупатель, продавец, Тилуна или система (истёк срок оплаты или принятия).
                        reason_code:
                          type: string
                          enum:
                            - buyer_request
                            - seller_request
                            - payment_timeout
                            - acceptance_timeout
                            - platform_decision
                          description: Код причины отмены, без свободного текста.
                        partial:
                          type: boolean
                          description: true — у стороны остались неотменённые позиции.
                        cancelled_item_ids:
                          type: array
                          maxItems: 100
                          items:
                            type: string
                            format: uuid
                          description: Позиции стороны, отменённые этим действием.
    OrderItemsCancelledEvent:
      title: order.items_cancelled
      description: Отменена часть позиций стороны; остальные остаются в работе.
      allOf:
        - $ref: '#/components/schemas/Event'
        - type: object
          properties:
            type:
              type: string
              const: order.items_cancelled
            data:
              type: object
              properties:
                previous_attributes:
                  type:
                    - object
                    - 'null'
                  additionalProperties: true
                  description: Прежние значения изменившихся полей, если известны; обычно null.
                object:
                  allOf:
                    - $ref: '#/components/schemas/OrderEventObject'
                    - type: object
                      properties:
                        cancelled_by:
                          type: string
                          enum:
                            - buyer
                            - seller
                            - platform
                            - system
                          description: Кто отменил — покупатель, продавец, Тилуна или система (истёк срок оплаты или принятия).
                        reason_code:
                          type: string
                          enum:
                            - buyer_request
                            - seller_request
                            - payment_timeout
                            - acceptance_timeout
                            - platform_decision
                          description: Код причины отмены, без свободного текста.
                        partial:
                          type: boolean
                          description: true — у стороны остались неотменённые позиции.
                        cancelled_item_ids:
                          type: array
                          maxItems: 100
                          items:
                            type: string
                            format: uuid
                          description: Позиции стороны, отменённые этим действием.
    OrderStatusChangedEvent:
      title: order.status_changed
      description: Изменился статус заказа целиком; прежний статус — в previous_attributes.status.
      allOf:
        - $ref: '#/components/schemas/Event'
        - type: object
          properties:
            type:
              type: string
              const: order.status_changed
            data:
              type: object
              properties:
                object:
                  $ref: '#/components/schemas/OrderEventObject'
                previous_attributes:
                  type:
                    - object
                    - 'null'
                  description: Прежний статус заказа; null — неизвестен.
                  properties:
                    status:
                      type: string
    OrderDeliveredEvent:
      title: order.delivered
      description: Доставлены все неотменённые позиции стороны.
      allOf:
        - $ref: '#/components/schemas/Event'
        - type: object
          properties:
            type:
              type: string
              const: order.delivered
            data:
              type: object
              properties:
                previous_attributes:
                  type:
                    - object
                    - 'null'
                  additionalProperties: true
                  description: Прежние значения изменившихся полей, если известны; обычно null.
                object:
                  $ref: '#/components/schemas/OrderEventObject'
    OrderRefundedEvent:
      title: order.refunded
      description: |
        Тилуна зафиксировала возврат денег покупателю по заказу (полностью или
        частично). При возврате по решению Тилуны (спор, смена статуса заказа)
        `refund.id` равен null, `refund.amount` обычно тоже: такое событие может
        прийти вдобавок к событию с `refund.id` по тому же возврату и не
        означает второго возврата.
      allOf:
        - $ref: '#/components/schemas/Event'
        - type: object
          properties:
            type:
              type: string
              const: order.refunded
            data:
              type: object
              properties:
                previous_attributes:
                  type:
                    - object
                    - 'null'
                  additionalProperties: true
                  description: Прежние значения изменившихся полей, если известны; обычно null.
                object:
                  allOf:
                    - $ref: '#/components/schemas/OrderEventObject'
                    - type: object
                      properties:
                        refund:
                          type: object
                          required:
                            - id
                            - amount
                            - currency
                          properties:
                            id:
                              type:
                                - string
                                - 'null'
                              format: uuid
                              description: Идентификатор возврата денег; null — событие решения Тилуны по заказу, не отдельная операция возврата.
                            amount:
                              type:
                                - integer
                                - 'null'
                              description: Сумма возврата, копейки; null — сумма в событии решения Тилуны не передаётся.
                            currency:
                              type: string
                              const: RUB
    ShipmentTrackingUpdatedEvent:
      title: shipment.tracking_updated
      description: Перевозчик сообщил новый статус отправления. Приходит только по явной подписке.
      allOf:
        - $ref: '#/components/schemas/Event'
        - type: object
          properties:
            type:
              type: string
              const: shipment.tracking_updated
            data:
              type: object
              properties:
                previous_attributes:
                  type:
                    - object
                    - 'null'
                  additionalProperties: true
                  description: Прежние значения изменившихся полей, если известны; обычно null.
                object:
                  allOf:
                    - $ref: '#/components/schemas/OrderEventObject'
                    - type: object
                      properties:
                        shipment:
                          type: object
                          required:
                            - id
                            - status
                          properties:
                            id:
                              type: string
                              format: uuid
                            provider:
                              type:
                                - string
                                - 'null'
                              example: cdek
                            status:
                              type: string
                              description: Статус отправления по данным перевозчика.
                              example: in_transit
                            tracking_number:
                              type:
                                - string
                                - 'null'
                              maxLength: 64
                            tracking_url:
                              type:
                                - string
                                - 'null'
                              format: uri
                              maxLength: 500
                            estimated_delivery:
                              type:
                                - string
                                - 'null'
                              format: date-time
                              description: Ожидаемая дата доставки, если перевозчик её сообщил.
    ReturnEventObject:
      type: object
      description: |
        Снимок заявки на возврат: статусы, сумма возврата и отправление возврата.
        Причина покупателя, фото и комментарии в событие не попадают.
      required:
        - object
        - id
      properties:
        object:
          type: string
          const: return
        id:
          type: string
          format: uuid
        order_id:
          type: string
          format: uuid
        order_number:
          type:
            - string
            - 'null'
        order_item_id:
          type:
            - string
            - 'null'
          format: uuid
        status:
          type: string
          description: Внутренний статус заявки (см. ReturnStatus).
          example: pending
        public_status:
          type: string
          description: Публичный статус заявки — как public_status в GET /returns/{returnId}.
          enum:
            - requested
            - approved
            - rejected
            - in_review
            - refund_processing
            - refunded
            - closed
        kind:
          type:
            - string
            - 'null'
          description: Вид возврата.
          example: defect
        refund_amount:
          type:
            - integer
            - 'null'
          description: Сумма возврата покупателю, копейки.
        currency:
          type: string
          const: RUB
        return_shipment:
          type: object
          properties:
            status:
              type:
                - string
                - 'null'
              example: in_transit
            tracking_number:
              type:
                - string
                - 'null'
              maxLength: 64
            tracking_url:
              type:
                - string
                - 'null'
              format: uri
              maxLength: 500
              description: Ссылка на отслеживание, только https; иначе null.
        updated_at:
          type:
            - string
            - 'null'
          format: date-time
        test:
          type: boolean
          const: true
          description: |
            Только в тестовом событии, отправленном кнопкой проверки адреса в
            кабинете: id ресурса нулевой, полей типа нет. В журнал такое событие
            не пишется.
        sample:
          type: boolean
          const: true
          description: |
            Только в образце события песочницы (`POST /test_helpers/events`,
            `source: sandbox`, `livemode: false`). Образец по заказу или возврату
            несёт общий снимок ресурса без полей конкретного типа, по остальным
            ресурсам — только `object`, `id` и `sample`. Ресурс — последний
            подходящий в тестовом кабинете.
    ReturnCreatedEvent:
      title: return.created
      description: Покупатель оформил заявку на возврат по позиции стороны.
      allOf:
        - $ref: '#/components/schemas/Event'
        - type: object
          properties:
            type:
              type: string
              const: return.created
            data:
              type: object
              properties:
                previous_attributes:
                  type:
                    - object
                    - 'null'
                  additionalProperties: true
                  description: Прежние значения изменившихся полей, если известны; обычно null.
                object:
                  $ref: '#/components/schemas/ReturnEventObject'
    ReturnApprovedEvent:
      title: return.approved
      description: Продавец согласился с возвратом и подтвердил инструкции покупателю.
      allOf:
        - $ref: '#/components/schemas/Event'
        - type: object
          properties:
            type:
              type: string
              const: return.approved
            data:
              type: object
              properties:
                previous_attributes:
                  type:
                    - object
                    - 'null'
                  additionalProperties: true
                  description: Прежние значения изменившихся полей, если известны; обычно null.
                object:
                  $ref: '#/components/schemas/ReturnEventObject'
    ReturnRejectedEvent:
      title: return.rejected
      description: Продавец возразил по заявке на возврат.
      allOf:
        - $ref: '#/components/schemas/Event'
        - type: object
          properties:
            type:
              type: string
              const: return.rejected
            data:
              type: object
              properties:
                previous_attributes:
                  type:
                    - object
                    - 'null'
                  additionalProperties: true
                  description: Прежние значения изменившихся полей, если известны; обычно null.
                object:
                  $ref: '#/components/schemas/ReturnEventObject'
    ReturnEscalatedEvent:
      title: return.escalated
      description: Заявка передана на рассмотрение Тилуны — покупателем или продавцом.
      allOf:
        - $ref: '#/components/schemas/Event'
        - type: object
          properties:
            type:
              type: string
              const: return.escalated
            data:
              type: object
              properties:
                previous_attributes:
                  type:
                    - object
                    - 'null'
                  additionalProperties: true
                  description: Прежние значения изменившихся полей, если известны; обычно null.
                object:
                  allOf:
                    - $ref: '#/components/schemas/ReturnEventObject'
                    - type: object
                      properties:
                        escalated_by:
                          type: string
                          enum:
                            - buyer
                            - seller
    ReturnShipmentUpdatedEvent:
      title: return.shipment_updated
      description: Изменилось отправление возврата — трек-номер или статус перевозчика.
      allOf:
        - $ref: '#/components/schemas/Event'
        - type: object
          properties:
            type:
              type: string
              const: return.shipment_updated
            data:
              type: object
              properties:
                previous_attributes:
                  type:
                    - object
                    - 'null'
                  additionalProperties: true
                  description: Прежние значения изменившихся полей, если известны; обычно null.
                object:
                  $ref: '#/components/schemas/ReturnEventObject'
    ReturnRefundedEvent:
      title: return.refunded
      description: Деньги по заявке на возврат отправлены покупателю.
      allOf:
        - $ref: '#/components/schemas/Event'
        - type: object
          properties:
            type:
              type: string
              const: return.refunded
            data:
              type: object
              properties:
                previous_attributes:
                  type:
                    - object
                    - 'null'
                  additionalProperties: true
                  description: Прежние значения изменившихся полей, если известны; обычно null.
                object:
                  $ref: '#/components/schemas/ReturnEventObject'
    ReturnResolvedEvent:
      title: return.resolved
      description: |
        Заявка на возврат закрыта решением. Тилуна рассмотрела спор
        (`resolution: seller` или `buyer`), покупатель отменил заявку до
        передачи товара (`resolution: cancelled_by_buyer`) либо не передал товар
        в доставку за 7 дней с одобрения (`resolution: handover_expired`).
      allOf:
        - $ref: '#/components/schemas/Event'
        - type: object
          properties:
            type:
              type: string
              const: return.resolved
            data:
              type: object
              properties:
                previous_attributes:
                  type:
                    - object
                    - 'null'
                  additionalProperties: true
                  description: Прежние значения изменившихся полей, если известны; обычно null.
                object:
                  allOf:
                    - $ref: '#/components/schemas/ReturnEventObject'
                    - type: object
                      properties:
                        resolution:
                          type: string
                          enum:
                            - seller
                            - buyer
                            - cancelled_by_buyer
                            - handover_expired
                          description: |
                            `seller` · спор решён в пользу продавца. `buyer` · в пользу
                            покупателя, дальше возврат денег. `cancelled_by_buyer` ·
                            покупатель отменил заявку до передачи товара в доставку,
                            деньги не возвращаются, заявка закрыта (`status: cancelled`,
                            `public_status: closed`). `handover_expired` · покупатель не
                            передал товар в доставку за 7 дней с одобрения, товар остаётся
                            у него, деньги не возвращаются, заявка закрыта так же.
                          x-enumDescriptions:
                            seller: В пользу продавца
                            buyer: В пользу покупателя
                            cancelled_by_buyer: Покупатель отменил заявку
                            handover_expired: Товар не передан в срок
    ProductEventObject:
      type: object
      description: |
        Снимок одного товара. external_id есть в событиях изменений через API;
        moderation_status — в событиях кабинета, импорта и модерации.
      required:
        - object
        - id
      properties:
        object:
          type: string
          const: product
        id:
          type: string
          format: uuid
        external_id:
          type:
            - string
            - 'null'
          maxLength: 128
        product_code:
          type:
            - string
            - 'null'
          description: Код товара Тилуны.
        seller_sku:
          type:
            - string
            - 'null'
          description: Артикул продавца.
        status:
          type:
            - string
            - 'null'
          enum:
            - draft
            - pending
            - active
            - rejected
            - archived
            - null
        moderation_status:
          type:
            - string
            - 'null'
          example: approved
        updated_at:
          type:
            - string
            - 'null'
          format: date-time
        test:
          type: boolean
          const: true
          description: |
            Только в тестовом событии, отправленном кнопкой проверки адреса в
            кабинете: id ресурса нулевой, полей типа нет. В журнал такое событие
            не пишется.
        sample:
          type: boolean
          const: true
          description: |
            Только в образце события песочницы (`POST /test_helpers/events`,
            `source: sandbox`, `livemode: false`). Образец по заказу или возврату
            несёт общий снимок ресурса без полей конкретного типа, по остальным
            ресурсам — только `object`, `id` и `sample`. Ресурс — последний
            подходящий в тестовом кабинете.
    ProductBatchEventObject:
      type: object
      description: |
        Пачка товаров из кабинета или импорта: одно событие на 100 товаров
        одного юрлица. resource.id у такого события — null.
      required:
        - object
        - count
        - products
      properties:
        object:
          type: string
          const: product_batch
        count:
          type: integer
          minimum: 2
          maximum: 100
        products:
          type: array
          maxItems: 100
          items:
            $ref: '#/components/schemas/ProductEventObject'
    ProductCreatedEvent:
      title: product.created
      description: Создан товар (или пачка товаров импортом).
      allOf:
        - $ref: '#/components/schemas/Event'
        - type: object
          properties:
            type:
              type: string
              const: product.created
            data:
              type: object
              properties:
                previous_attributes:
                  type:
                    - object
                    - 'null'
                  additionalProperties: true
                  description: Прежние значения изменившихся полей, если известны; обычно null.
                object:
                  oneOf:
                    - $ref: '#/components/schemas/ProductEventObject'
                    - $ref: '#/components/schemas/ProductBatchEventObject'
    ProductUpdatedEvent:
      title: product.updated
      description: Изменён товар (или пачка товаров импортом и массовыми действиями).
      allOf:
        - $ref: '#/components/schemas/Event'
        - type: object
          properties:
            type:
              type: string
              const: product.updated
            data:
              type: object
              properties:
                previous_attributes:
                  type:
                    - object
                    - 'null'
                  additionalProperties: true
                  description: Прежние значения изменившихся полей, если известны; обычно null.
                object:
                  oneOf:
                    - $ref: '#/components/schemas/ProductEventObject'
                    - $ref: '#/components/schemas/ProductBatchEventObject'
    ProductArchivedEvent:
      title: product.archived
      description: Товар (или пачка товаров) перенесён в архив и снят с продажи.
      allOf:
        - $ref: '#/components/schemas/Event'
        - type: object
          properties:
            type:
              type: string
              const: product.archived
            data:
              type: object
              properties:
                previous_attributes:
                  type:
                    - object
                    - 'null'
                  additionalProperties: true
                  description: Прежние значения изменившихся полей, если известны; обычно null.
                object:
                  oneOf:
                    - $ref: '#/components/schemas/ProductEventObject'
                    - $ref: '#/components/schemas/ProductBatchEventObject'
    ProductModerationEventObject:
      description: Снимок товара и решение модерации.
      allOf:
        - $ref: '#/components/schemas/ProductEventObject'
        - type: object
          properties:
            moderation:
              type: object
              required:
                - decision
                - reason
              properties:
                decision:
                  type: string
                  enum:
                    - approved
                    - rejected
                    - revision_requested
                reason:
                  type:
                    - string
                    - 'null'
                  maxLength: 1000
                  description: Причина отклонения или доработки; null при одобрении.
    ProductModerationApprovedEvent:
      title: product.moderation.approved
      description: Товар прошёл модерацию.
      allOf:
        - $ref: '#/components/schemas/Event'
        - type: object
          properties:
            type:
              type: string
              const: product.moderation.approved
            data:
              type: object
              properties:
                previous_attributes:
                  type:
                    - object
                    - 'null'
                  additionalProperties: true
                  description: Прежние значения изменившихся полей, если известны; обычно null.
                object:
                  $ref: '#/components/schemas/ProductModerationEventObject'
    ProductModerationRejectedEvent:
      title: product.moderation.rejected
      description: Товар отклонён модерацией; причина — в moderation.reason.
      allOf:
        - $ref: '#/components/schemas/Event'
        - type: object
          properties:
            type:
              type: string
              const: product.moderation.rejected
            data:
              type: object
              properties:
                previous_attributes:
                  type:
                    - object
                    - 'null'
                  additionalProperties: true
                  description: Прежние значения изменившихся полей, если известны; обычно null.
                object:
                  $ref: '#/components/schemas/ProductModerationEventObject'
    ProductModerationRevisionRequestedEvent:
      title: product.moderation.revision_requested
      description: Модерация просит доработать товар; что исправить — в moderation.reason.
      allOf:
        - $ref: '#/components/schemas/Event'
        - type: object
          properties:
            type:
              type: string
              const: product.moderation.revision_requested
            data:
              type: object
              properties:
                previous_attributes:
                  type:
                    - object
                    - 'null'
                  additionalProperties: true
                  description: Прежние значения изменившихся полей, если известны; обычно null.
                object:
                  $ref: '#/components/schemas/ProductModerationEventObject'
    InventoryEventObject:
      type: object
      description: |
        Текущие остатки из кабинета, импорта или списания при оплате заказа:
        строка на товар без вариантов и на каждый вариант, до 500 строк в
        событии. order_id — если остаток списан оплатой заказа. count и lines
        есть всегда, кроме тестового события и образца песочницы.
      required:
        - object
      properties:
        object:
          type: string
          const: inventory
        count:
          type: integer
          minimum: 1
          maximum: 500
        order_id:
          type: string
          format: uuid
        lines:
          type: array
          maxItems: 500
          items:
            type: object
            required:
              - product_id
              - variant_id
              - stock
            properties:
              product_id:
                type: string
                format: uuid
              variant_id:
                type:
                  - string
                  - 'null'
                format: uuid
              stock:
                type:
                  - integer
                  - 'null'
                description: Остаток; null — остаток не учитывается.
              stock_mode:
                type:
                  - string
                  - 'null'
                description: Только у варианта. own — свой остаток, product — остаток товара.
                enum:
                  - own
                  - product
                  - null
        test:
          type: boolean
          const: true
          description: |
            Только в тестовом событии, отправленном кнопкой проверки адреса в
            кабинете: id ресурса нулевой, полей типа нет. В журнал такое событие
            не пишется.
        sample:
          type: boolean
          const: true
          description: |
            Только в образце события песочницы (`POST /test_helpers/events`,
            `source: sandbox`, `livemode: false`). Образец по заказу или возврату
            несёт общий снимок ресурса без полей конкретного типа, по остальным
            ресурсам — только `object`, `id` и `sample`. Ресурс — последний
            подходящий в тестовом кабинете.
    InventoryUpdateEventObject:
      type: object
      description: |
        Остатки, изменённые запросом Seller API (POST /inventory/batch, варианты):
        строки, которые записал запрос, до 500 в событии.
      required:
        - object
        - rows
      properties:
        object:
          type: string
          const: inventory_update
        rows:
          type: array
          maxItems: 500
          items:
            type: object
            required:
              - product_id
              - variant_id
              - quantity
            properties:
              product_id:
                type: string
                format: uuid
              variant_id:
                type:
                  - string
                  - 'null'
                format: uuid
              external_id:
                type:
                  - string
                  - 'null'
              seller_sku:
                type:
                  - string
                  - 'null'
              quantity:
                type:
                  - integer
                  - 'null'
                description: Остаток после запроса; null — остаток не учитывается.
              stock_mode:
                type: string
                enum:
                  - own
                  - product
              updated_at:
                type:
                  - string
                  - 'null'
                format: date-time
    InventoryUpdatedEvent:
      title: inventory.updated
      description: Изменились остатки — в кабинете, импортом, оплатой заказа или через API.
      allOf:
        - $ref: '#/components/schemas/Event'
        - type: object
          properties:
            type:
              type: string
              const: inventory.updated
            data:
              type: object
              properties:
                previous_attributes:
                  type:
                    - object
                    - 'null'
                  additionalProperties: true
                  description: Прежние значения изменившихся полей, если известны; обычно null.
                object:
                  oneOf:
                    - $ref: '#/components/schemas/InventoryEventObject'
                    - $ref: '#/components/schemas/InventoryUpdateEventObject'
    PriceEventObject:
      type: object
      description: |
        Текущие цены из кабинета или импорта: строка на товар и на каждый
        вариант, до 500 строк в событии, копейки. count, lines и currency есть
        всегда, кроме тестового события и образца песочницы.
      required:
        - object
      properties:
        object:
          type: string
          const: price
        count:
          type: integer
          minimum: 1
          maximum: 500
        currency:
          type: string
          const: RUB
        lines:
          type: array
          maxItems: 500
          items:
            type: object
            required:
              - product_id
              - variant_id
              - base_price
              - sale_price
            properties:
              product_id:
                type: string
                format: uuid
              variant_id:
                type:
                  - string
                  - 'null'
                format: uuid
              base_price:
                type:
                  - integer
                  - 'null'
              sale_price:
                type:
                  - integer
                  - 'null'
              price_override:
                type:
                  - integer
                  - 'null'
                description: Только у варианта — своя цена варианта.
        test:
          type: boolean
          const: true
          description: |
            Только в тестовом событии, отправленном кнопкой проверки адреса в
            кабинете: id ресурса нулевой, полей типа нет. В журнал такое событие
            не пишется.
        sample:
          type: boolean
          const: true
          description: |
            Только в образце события песочницы (`POST /test_helpers/events`,
            `source: sandbox`, `livemode: false`). Образец по заказу или возврату
            несёт общий снимок ресурса без полей конкретного типа, по остальным
            ресурсам — только `object`, `id` и `sample`. Ресурс — последний
            подходящий в тестовом кабинете.
    PriceUpdateEventObject:
      type: object
      description: |
        Цены, изменённые запросом Seller API (POST /prices/batch, варианты):
        строки, которые записал запрос, до 500 в событии, копейки.
      required:
        - object
        - rows
      properties:
        object:
          type: string
          const: price_update
        rows:
          type: array
          maxItems: 500
          items:
            type: object
            required:
              - product_id
              - variant_id
              - currency
            properties:
              product_id:
                type: string
                format: uuid
              variant_id:
                type:
                  - string
                  - 'null'
                format: uuid
              external_id:
                type:
                  - string
                  - 'null'
              seller_sku:
                type:
                  - string
                  - 'null'
              base_price:
                type:
                  - integer
                  - 'null'
              sale_price:
                type:
                  - integer
                  - 'null'
              compare_at_price:
                type:
                  - integer
                  - 'null'
              price_override:
                type:
                  - integer
                  - 'null'
              buyer_price:
                type:
                  - integer
                  - 'null'
                description: Цена для покупателя после изменения варианта.
              currency:
                type: string
                const: RUB
              updated_at:
                type:
                  - string
                  - 'null'
                format: date-time
    PriceUpdatedEvent:
      title: price.updated
      description: Изменились цены — в кабинете, импортом или через API.
      allOf:
        - $ref: '#/components/schemas/Event'
        - type: object
          properties:
            type:
              type: string
              const: price.updated
            data:
              type: object
              properties:
                previous_attributes:
                  type:
                    - object
                    - 'null'
                  additionalProperties: true
                  description: Прежние значения изменившихся полей, если известны; обычно null.
                object:
                  oneOf:
                    - $ref: '#/components/schemas/PriceEventObject'
                    - $ref: '#/components/schemas/PriceUpdateEventObject'
    ReviewEventObject:
      type: object
      description: |
        Снимок отзыва без текста отзыва и ответа. Время ответа — replied_at в
        событиях кабинета и модерации, seller_replied_at — в событии ответа
        через API.
      required:
        - object
        - id
      properties:
        object:
          type: string
          const: review
        id:
          type: string
          format: uuid
        product_id:
          type: string
          format: uuid
        rating:
          type:
            - integer
            - 'null'
          minimum: 1
          maximum: 5
        status:
          type:
            - string
            - 'null'
          example: approved
        replied:
          type: boolean
        replied_at:
          type:
            - string
            - 'null'
          format: date-time
        seller_replied_at:
          type:
            - string
            - 'null'
          format: date-time
        created_at:
          type:
            - string
            - 'null'
          format: date-time
        updated_at:
          type:
            - string
            - 'null'
          format: date-time
        test:
          type: boolean
          const: true
          description: |
            Только в тестовом событии, отправленном кнопкой проверки адреса в
            кабинете: id ресурса нулевой, полей типа нет. В журнал такое событие
            не пишется.
        sample:
          type: boolean
          const: true
          description: |
            Только в образце события песочницы (`POST /test_helpers/events`,
            `source: sandbox`, `livemode: false`). Образец по заказу или возврату
            несёт общий снимок ресурса без полей конкретного типа, по остальным
            ресурсам — только `object`, `id` и `sample`. Ресурс — последний
            подходящий в тестовом кабинете.
    ReviewCreatedEvent:
      title: review.created
      description: Отзыв о товаре продавца прошёл модерацию и опубликован.
      allOf:
        - $ref: '#/components/schemas/Event'
        - type: object
          properties:
            type:
              type: string
              const: review.created
            data:
              type: object
              properties:
                previous_attributes:
                  type:
                    - object
                    - 'null'
                  additionalProperties: true
                  description: Прежние значения изменившихся полей, если известны; обычно null.
                object:
                  $ref: '#/components/schemas/ReviewEventObject'
    ReviewRepliedEvent:
      title: review.replied
      description: Продавец ответил на отзыв или изменил ответ.
      allOf:
        - $ref: '#/components/schemas/Event'
        - type: object
          properties:
            type:
              type: string
              const: review.replied
            data:
              type: object
              properties:
                previous_attributes:
                  type:
                    - object
                    - 'null'
                  additionalProperties: true
                  description: Прежние значения изменившихся полей, если известны; обычно null.
                object:
                  $ref: '#/components/schemas/ReviewEventObject'
    PayoutEventObject:
      type: object
      description: Снимок выплаты за отчётный период; сумма — копейки.
      required:
        - object
        - id
      properties:
        object:
          type: string
          const: payout
        id:
          type: string
          format: uuid
        status:
          type: string
          enum:
            - created
            - paid
            - failed
        amount:
          type:
            - integer
            - 'null'
        currency:
          type: string
          const: RUB
        document_number:
          type:
            - string
            - 'null'
          description: Номер платёжного документа.
        paid_at:
          type:
            - string
            - 'null'
          format: date-time
        failure_reason:
          type:
            - string
            - 'null'
          enum:
            - cancelled
            - returned
            - null
          description: Только в payout.failed. cancelled — выплата отменена, returned — банк вернул платёж.
        created_at:
          type:
            - string
            - 'null'
          format: date-time
        updated_at:
          type:
            - string
            - 'null'
          format: date-time
        test:
          type: boolean
          const: true
          description: |
            Только в тестовом событии, отправленном кнопкой проверки адреса в
            кабинете: id ресурса нулевой, полей типа нет. В журнал такое событие
            не пишется.
        sample:
          type: boolean
          const: true
          description: |
            Только в образце события песочницы (`POST /test_helpers/events`,
            `source: sandbox`, `livemode: false`). Образец по заказу или возврату
            несёт общий снимок ресурса без полей конкретного типа, по остальным
            ресурсам — только `object`, `id` и `sample`. Ресурс — последний
            подходящий в тестовом кабинете.
    PayoutCreatedEvent:
      title: payout.created
      description: Создана выплата за отчётный период.
      allOf:
        - $ref: '#/components/schemas/Event'
        - type: object
          properties:
            type:
              type: string
              const: payout.created
            data:
              type: object
              properties:
                previous_attributes:
                  type:
                    - object
                    - 'null'
                  additionalProperties: true
                  description: Прежние значения изменившихся полей, если известны; обычно null.
                object:
                  $ref: '#/components/schemas/PayoutEventObject'
    PayoutPaidEvent:
      title: payout.paid
      description: Банк подтвердил выплату.
      allOf:
        - $ref: '#/components/schemas/Event'
        - type: object
          properties:
            type:
              type: string
              const: payout.paid
            data:
              type: object
              properties:
                previous_attributes:
                  type:
                    - object
                    - 'null'
                  additionalProperties: true
                  description: Прежние значения изменившихся полей, если известны; обычно null.
                object:
                  $ref: '#/components/schemas/PayoutEventObject'
    PayoutFailedEvent:
      title: payout.failed
      description: Выплата не прошла — отменена или возвращена банком.
      allOf:
        - $ref: '#/components/schemas/Event'
        - type: object
          properties:
            type:
              type: string
              const: payout.failed
            data:
              type: object
              properties:
                previous_attributes:
                  type:
                    - object
                    - 'null'
                  additionalProperties: true
                  description: Прежние значения изменившихся полей, если известны; обычно null.
                object:
                  $ref: '#/components/schemas/PayoutEventObject'
    AgentReportEventObject:
      type: object
      description: Отчёт агента, размещённый в кабинете.
      required:
        - object
        - id
      properties:
        object:
          type: string
          const: agent_report
        id:
          type: string
          format: uuid
        number:
          type:
            - string
            - 'null'
        period_start:
          type:
            - string
            - 'null'
          format: date
        period_end:
          type:
            - string
            - 'null'
          format: date
        accept_deadline_at:
          type:
            - string
            - 'null'
          format: date-time
        status:
          type: string
          const: issued
        test:
          type: boolean
          const: true
          description: |
            Только в тестовом событии, отправленном кнопкой проверки адреса в
            кабинете: id ресурса нулевой, полей типа нет. В журнал такое событие
            не пишется.
        sample:
          type: boolean
          const: true
          description: |
            Только в образце события песочницы (`POST /test_helpers/events`,
            `source: sandbox`, `livemode: false`). Образец по заказу или возврату
            несёт общий снимок ресурса без полей конкретного типа, по остальным
            ресурсам — только `object`, `id` и `sample`. Ресурс — последний
            подходящий в тестовом кабинете.
    AgentReportReadyEvent:
      title: agent_report.ready
      description: Отчёт агента за период размещён в кабинете.
      allOf:
        - $ref: '#/components/schemas/Event'
        - type: object
          properties:
            type:
              type: string
              const: agent_report.ready
            data:
              type: object
              properties:
                previous_attributes:
                  type:
                    - object
                    - 'null'
                  additionalProperties: true
                  description: Прежние значения изменившихся полей, если известны; обычно null.
                object:
                  $ref: '#/components/schemas/AgentReportEventObject'
    ReportEventObject:
      type: object
      description: Асинхронный отчёт, готовый к скачиванию.
      required:
        - object
        - id
      properties:
        object:
          type: string
          const: report
        id:
          type: string
          format: uuid
        type:
          type: string
          enum:
            - agent_sales
            - payouts
            - deductions
            - orders
        status:
          type: string
          description: Статус отчёта в момент события — готов.
          example: succeeded
        preliminary:
          type: boolean
        period_from:
          type:
            - string
            - 'null'
          format: date
        period_to:
          type:
            - string
            - 'null'
          format: date
        completed_at:
          type:
            - string
            - 'null'
          format: date-time
        expires_at:
          type:
            - string
            - 'null'
          format: date-time
        test:
          type: boolean
          const: true
          description: |
            Только в тестовом событии, отправленном кнопкой проверки адреса в
            кабинете: id ресурса нулевой, полей типа нет. В журнал такое событие
            не пишется.
        sample:
          type: boolean
          const: true
          description: |
            Только в образце события песочницы (`POST /test_helpers/events`,
            `source: sandbox`, `livemode: false`). Образец по заказу или возврату
            несёт общий снимок ресурса без полей конкретного типа, по остальным
            ресурсам — только `object`, `id` и `sample`. Ресурс — последний
            подходящий в тестовом кабинете.
    ReportReadyEvent:
      title: report.ready
      description: Асинхронный отчёт сформирован и готов к скачиванию.
      allOf:
        - $ref: '#/components/schemas/Event'
        - type: object
          properties:
            type:
              type: string
              const: report.ready
            data:
              type: object
              properties:
                previous_attributes:
                  type:
                    - object
                    - 'null'
                  additionalProperties: true
                  description: Прежние значения изменившихся полей, если известны; обычно null.
                object:
                  $ref: '#/components/schemas/ReportEventObject'
    PingEventObject:
      type: object
      description: Тестовое событие для проверки адреса.
      required:
        - object
        - message
      properties:
        object:
          type: string
          const: ping
        message:
          type: string
    PingEvent:
      title: ping
      description: Тестовое событие для проверки адреса; в журнал не записывается.
      allOf:
        - $ref: '#/components/schemas/Event'
        - type: object
          properties:
            type:
              type: string
              const: ping
            data:
              type: object
              properties:
                previous_attributes:
                  type:
                    - object
                    - 'null'
                  additionalProperties: true
                  description: Прежние значения изменившихся полей, если известны; обычно null.
                object:
                  $ref: '#/components/schemas/PingEventObject'
  examples:
    ProductListPage:
      summary: Первая страница товаров
      value:
        object: list
        url: /v1/products
        data:
          - object: product
            id: 3f6b1c2a-8d4e-4f7a-9b21-5c0e7d9a1b34
            external_id: '000012345'
            product_code: '100482'
            legal_entity_id: 1c3e5a7b-9d2f-4b6d-8f1a-3c5e7a9b1d3f
            variants_count: 0
            category_id: 9a1e5c7b-2d3f-4a6b-8c9d-0e1f2a3b4c5d
            name: Кружка керамическая 350 мл
            slug: kruzhka-keramicheskaya-350-ml
            description: Кружка ручной работы из белой глины.
            short_description: Керамика, 350 мл
            base_price: 89000
            sale_price: 79000
            compare_at_price: null
            sku: '100482'
            seller_sku: MUG-350-BLUE
            brand: Глина и огонь
            barcode: '04601234567890'
            country_of_origin: Россия
            product_class: null
            attributes_jsonb:
              color: синий
              volume_ml: 350
            mto_mode: none
            stock: 24
            material: керамика
            weight_grams: 420
            length_cm: 12
            width_cm: 9
            height_cm: 10
            package_length_cm: 14
            package_width_cm: 12
            package_height_cm: 12
            package_length_mm: null
            package_width_mm: null
            package_height_mm: null
            package_weight_grams: 600
            gender: null
            status: active
            has_variants: false
            allow_multiple_variant_options: true
            preparation_days: 2
            is_fragile: true
            is_made_to_order: false
            rejection_reason: null
            total_sales: 57
            total_reviews: 12
            average_rating: 4.8
            seo_title: null
            seo_description: null
            seo_keywords: []
            style_tags:
              - минимализм
            color_tags:
              - синий
            occasion_tags: []
            created_at: '2026-09-01T09:00:00.000Z'
            updated_at: '2026-09-20T14:30:00.000Z'
        has_more: true
        next_cursor: eyJ2IjoxLCJyIjoicHJvZHVjdHMifQ.c2lnbmF0dXJl
    ProductCreated:
      summary: Товар создан черновиком
      value:
        product:
          object: product
          id: 7c2e4a6c-8e0a-4c2e-9a4c-6e8a0c2e4a6c
          external_id: '000012388'
          product_code: '100517'
          legal_entity_id: 1c3e5a7b-9d2f-4b6d-8f1a-3c5e7a9b1d3f
          variants_count: 0
          category_id: 2c4e6a8c-0e2a-4c4e-8a6c-0e2a4c6e8a0c
          name: Футболка хлопковая базовая
          slug: futbolka-hlopkovaya-bazovaya
          description: Футболка прямого кроя из хлопкового трикотажа плотностью 180 г/м².
          short_description: Хлопок 100 %, прямой крой
          base_price: 149000
          sale_price: null
          compare_at_price: null
          sku: '100517'
          seller_sku: TSH-BASIC-WHT
          brand: Северный двор
          barcode: null
          country_of_origin: Россия
          product_class: null
          attributes_jsonb:
            color: белый
            import_v4.material: Хлопок
          mto_mode: none
          stock: null
          material: хлопок
          weight_grams: 180
          length_cm: null
          width_cm: null
          height_cm: null
          package_length_cm: 30
          package_width_cm: 22
          package_height_cm: 3
          package_length_mm: null
          package_width_mm: null
          package_height_mm: null
          package_weight_grams: 220
          gender: unisex
          status: draft
          has_variants: false
          allow_multiple_variant_options: false
          preparation_days: 1
          is_fragile: false
          is_made_to_order: false
          rejection_reason: null
          total_sales: 0
          total_reviews: 0
          average_rating: 0
          seo_title: null
          seo_description: null
          seo_keywords: []
          style_tags:
            - базовый
          color_tags:
            - белый
          occasion_tags: []
          created_at: '2026-10-01T08:00:00.000Z'
          updated_at: '2026-10-01T08:00:00.000Z'
    ProductWithDetails:
      summary: Товар с фотографиями и вариантами
      value:
        product:
          object: product
          id: 7c2e4a6c-8e0a-4c2e-9a4c-6e8a0c2e4a6c
          external_id: '000012388'
          product_code: '100517'
          legal_entity_id: 1c3e5a7b-9d2f-4b6d-8f1a-3c5e7a9b1d3f
          variants_count: 2
          category_id: 2c4e6a8c-0e2a-4c4e-8a6c-0e2a4c6e8a0c
          name: Футболка хлопковая базовая
          slug: futbolka-hlopkovaya-bazovaya
          description: Футболка прямого кроя из хлопкового трикотажа плотностью 180 г/м².
          short_description: Хлопок 100 %, прямой крой
          base_price: 149000
          sale_price: null
          compare_at_price: null
          sku: '100517'
          seller_sku: TSH-BASIC-WHT
          brand: Северный двор
          barcode: null
          country_of_origin: Россия
          product_class: null
          attributes_jsonb:
            color: белый
            import_v4.material: Хлопок
          mto_mode: none
          stock: null
          material: хлопок
          weight_grams: 180
          length_cm: null
          width_cm: null
          height_cm: null
          package_length_cm: 30
          package_width_cm: 22
          package_height_cm: 3
          package_length_mm: null
          package_width_mm: null
          package_height_mm: null
          package_weight_grams: 220
          gender: unisex
          status: draft
          has_variants: true
          allow_multiple_variant_options: false
          preparation_days: 1
          is_fragile: false
          is_made_to_order: false
          rejection_reason: null
          total_sales: 0
          total_reviews: 0
          average_rating: 0
          seo_title: null
          seo_description: null
          seo_keywords: []
          style_tags:
            - базовый
          color_tags:
            - белый
          occasion_tags: []
          created_at: '2026-10-01T08:00:00.000Z'
          updated_at: '2026-10-01T08:00:00.000Z'
        images:
          - id: 6f8a0c2e-4a6c-4e8a-8c2e-4a6c8e0a2c4e
            product_id: 7c2e4a6c-8e0a-4c2e-9a4c-6e8a0c2e4a6c
            url: https://media.tiluna.ru/products/100517/100517_1.webp
            thumbnail_url: https://media.tiluna.ru/products/100517/100517_1_thumb.webp
            blur_data_url: null
            alt_text: Футболка хлопковая базовая, белая
            sort_order: 0
            is_main: true
            created_at: '2026-10-01T08:02:00.000Z'
        variants:
          - object: variant
            id: 4d6f8a0c-2e4a-4c6e-8a0c-2e4a6c8e0a2c
            product_id: 7c2e4a6c-8e0a-4c2e-9a4c-6e8a0c2e4a6c
            external_id: 000012388-M
            type: size
            article: TSH-BASIC-WHT-M
            name: Размер
            variant_type: size
            value: M
            price_override: null
            stock: 15
            stock_mode: own
            sku_suffix: M
            image_url: null
            barcode: '04601234500129'
            source_article: TSH-BASIC-WHT-M
            source_group: null
            ros_size: '48'
            attributes_jsonb: {}
            buyer_note_required: false
            buyer_note_prompt: null
            buyer_note_max_len: null
            is_available: true
            sort_order: 0
            created_at: '2026-10-01T08:00:00.000Z'
            updated_at: '2026-10-01T08:00:00.000Z'
          - object: variant
            id: 5e7a9b1d-3f5b-4d7f-9b1d-3f5b7d9f1b3d
            product_id: 7c2e4a6c-8e0a-4c2e-9a4c-6e8a0c2e4a6c
            external_id: 000012388-L
            type: size
            article: TSH-BASIC-WHT-L
            name: Размер
            variant_type: size
            value: L
            price_override: 159000
            stock: 8
            stock_mode: own
            sku_suffix: L
            image_url: null
            barcode: '04601234500136'
            source_article: TSH-BASIC-WHT-L
            source_group: null
            ros_size: '50'
            attributes_jsonb: {}
            buyer_note_required: false
            buyer_note_prompt: null
            buyer_note_max_len: null
            is_available: true
            sort_order: 1
            created_at: '2026-10-01T08:05:00.000Z'
            updated_at: '2026-10-01T08:05:00.000Z'
    ProductUpdated:
      summary: Товар изменён
      value:
        product:
          object: product
          id: 3f6b1c2a-8d4e-4f7a-9b21-5c0e7d9a1b34
          external_id: '000012345'
          product_code: '100482'
          legal_entity_id: 1c3e5a7b-9d2f-4b6d-8f1a-3c5e7a9b1d3f
          variants_count: 0
          category_id: 9a1e5c7b-2d3f-4a6b-8c9d-0e1f2a3b4c5d
          name: Кружка керамическая 350 мл
          slug: kruzhka-keramicheskaya-350-ml
          description: Кружка ручной работы из белой глины.
          short_description: Керамика ручной работы, 350 мл
          base_price: 89000
          sale_price: 79000
          compare_at_price: null
          sku: '100482'
          seller_sku: MUG-350-BLUE
          brand: Глина и огонь
          barcode: '04601234567890'
          country_of_origin: Россия
          product_class: null
          attributes_jsonb:
            color: синий
            volume_ml: 350
          mto_mode: none
          stock: 24
          material: керамика
          weight_grams: 420
          length_cm: 12
          width_cm: 9
          height_cm: 10
          package_length_cm: 14
          package_width_cm: 12
          package_height_cm: 12
          package_length_mm: null
          package_width_mm: null
          package_height_mm: null
          package_weight_grams: 600
          gender: null
          status: active
          has_variants: false
          allow_multiple_variant_options: true
          preparation_days: 2
          is_fragile: true
          is_made_to_order: false
          rejection_reason: null
          total_sales: 57
          total_reviews: 12
          average_rating: 4.8
          seo_title: null
          seo_description: null
          seo_keywords: []
          style_tags:
            - минимализм
          color_tags:
            - синий
          occasion_tags: []
          created_at: '2026-09-01T09:00:00.000Z'
          updated_at: '2026-10-02T11:20:00.000Z'
    ProductArchived:
      summary: Товар в архиве
      value:
        success: true
        product:
          object: product
          id: 3f6b1c2a-8d4e-4f7a-9b21-5c0e7d9a1b34
          external_id: '000012345'
          product_code: '100482'
          legal_entity_id: 1c3e5a7b-9d2f-4b6d-8f1a-3c5e7a9b1d3f
          variants_count: 0
          category_id: 9a1e5c7b-2d3f-4a6b-8c9d-0e1f2a3b4c5d
          name: Кружка керамическая 350 мл
          slug: kruzhka-keramicheskaya-350-ml
          description: Кружка ручной работы из белой глины.
          short_description: Керамика, 350 мл
          base_price: 89000
          sale_price: 79000
          compare_at_price: null
          sku: '100482'
          seller_sku: MUG-350-BLUE
          brand: Глина и огонь
          barcode: '04601234567890'
          country_of_origin: Россия
          product_class: null
          attributes_jsonb:
            color: синий
            volume_ml: 350
          mto_mode: none
          stock: 24
          material: керамика
          weight_grams: 420
          length_cm: 12
          width_cm: 9
          height_cm: 10
          package_length_cm: 14
          package_width_cm: 12
          package_height_cm: 12
          package_length_mm: null
          package_width_mm: null
          package_height_mm: null
          package_weight_grams: 600
          gender: null
          status: archived
          has_variants: false
          allow_multiple_variant_options: true
          preparation_days: 2
          is_fragile: true
          is_made_to_order: false
          rejection_reason: null
          total_sales: 57
          total_reviews: 12
          average_rating: 4.8
          seo_title: null
          seo_description: null
          seo_keywords: []
          style_tags:
            - минимализм
          color_tags:
            - синий
          occasion_tags: []
          created_at: '2026-09-01T09:00:00.000Z'
          updated_at: '2026-10-02T12:00:00.000Z'
    ProductSubmitted:
      summary: Товар отправлен на модерацию
      value:
        success: true
        product:
          object: product
          id: 7c2e4a6c-8e0a-4c2e-9a4c-6e8a0c2e4a6c
          external_id: '000012388'
          product_code: '100517'
          legal_entity_id: 1c3e5a7b-9d2f-4b6d-8f1a-3c5e7a9b1d3f
          variants_count: 2
          category_id: 2c4e6a8c-0e2a-4c4e-8a6c-0e2a4c6e8a0c
          name: Футболка хлопковая базовая
          slug: futbolka-hlopkovaya-bazovaya
          description: Футболка прямого кроя из хлопкового трикотажа плотностью 180 г/м².
          short_description: Хлопок 100 %, прямой крой
          base_price: 149000
          sale_price: null
          compare_at_price: null
          sku: '100517'
          seller_sku: TSH-BASIC-WHT
          brand: Северный двор
          barcode: null
          country_of_origin: Россия
          product_class: null
          attributes_jsonb:
            color: белый
            import_v4.material: Хлопок
          mto_mode: none
          stock: null
          material: хлопок
          weight_grams: 180
          length_cm: null
          width_cm: null
          height_cm: null
          package_length_cm: 30
          package_width_cm: 22
          package_height_cm: 3
          package_length_mm: null
          package_width_mm: null
          package_height_mm: null
          package_weight_grams: 220
          gender: unisex
          status: pending
          has_variants: true
          allow_multiple_variant_options: false
          preparation_days: 1
          is_fragile: false
          is_made_to_order: false
          rejection_reason: null
          total_sales: 0
          total_reviews: 0
          average_rating: 0
          seo_title: null
          seo_description: null
          seo_keywords: []
          style_tags:
            - базовый
          color_tags:
            - белый
          occasion_tags: []
          created_at: '2026-10-01T08:00:00.000Z'
          updated_at: '2026-10-01T09:30:00.000Z'
    VariantListPage:
      summary: Варианты товара
      value:
        object: list
        url: /v1/products/7c2e4a6c-8e0a-4c2e-9a4c-6e8a0c2e4a6c/variants
        data:
          - object: variant
            id: 4d6f8a0c-2e4a-4c6e-8a0c-2e4a6c8e0a2c
            product_id: 7c2e4a6c-8e0a-4c2e-9a4c-6e8a0c2e4a6c
            external_id: 000012388-M
            type: size
            article: TSH-BASIC-WHT-M
            name: Размер
            variant_type: size
            value: M
            price_override: null
            stock: 15
            stock_mode: own
            sku_suffix: M
            image_url: null
            barcode: '04601234500129'
            source_article: TSH-BASIC-WHT-M
            source_group: null
            ros_size: '48'
            attributes_jsonb: {}
            buyer_note_required: false
            buyer_note_prompt: null
            buyer_note_max_len: null
            is_available: true
            sort_order: 0
            created_at: '2026-10-01T08:00:00.000Z'
            updated_at: '2026-10-01T08:00:00.000Z'
          - object: variant
            id: 5e7a9b1d-3f5b-4d7f-9b1d-3f5b7d9f1b3d
            product_id: 7c2e4a6c-8e0a-4c2e-9a4c-6e8a0c2e4a6c
            external_id: 000012388-L
            type: size
            article: TSH-BASIC-WHT-L
            name: Размер
            variant_type: size
            value: L
            price_override: 159000
            stock: 8
            stock_mode: own
            sku_suffix: L
            image_url: null
            barcode: '04601234500136'
            source_article: TSH-BASIC-WHT-L
            source_group: null
            ros_size: '50'
            attributes_jsonb: {}
            buyer_note_required: false
            buyer_note_prompt: null
            buyer_note_max_len: null
            is_available: true
            sort_order: 1
            created_at: '2026-10-01T08:05:00.000Z'
            updated_at: '2026-10-01T08:05:00.000Z'
        has_more: false
        next_cursor: null
    VariantCreated:
      summary: Вариант создан
      value:
        object: variant
        id: 5e7a9b1d-3f5b-4d7f-9b1d-3f5b7d9f1b3d
        product_id: 7c2e4a6c-8e0a-4c2e-9a4c-6e8a0c2e4a6c
        external_id: 000012388-L
        type: size
        article: TSH-BASIC-WHT-L
        name: Размер
        variant_type: size
        value: L
        price_override: 159000
        stock: 8
        stock_mode: own
        sku_suffix: L
        image_url: null
        barcode: '04601234500136'
        source_article: TSH-BASIC-WHT-L
        source_group: null
        ros_size: '50'
        attributes_jsonb: {}
        buyer_note_required: false
        buyer_note_prompt: null
        buyer_note_max_len: null
        is_available: true
        sort_order: 1
        created_at: '2026-10-01T08:05:00.000Z'
        updated_at: '2026-10-01T08:05:00.000Z'
    VariantUpdated:
      summary: Остаток и штрихкод варианта изменены
      value:
        object: variant
        id: 4d6f8a0c-2e4a-4c6e-8a0c-2e4a6c8e0a2c
        product_id: 7c2e4a6c-8e0a-4c2e-9a4c-6e8a0c2e4a6c
        external_id: 000012388-M
        type: size
        article: TSH-BASIC-WHT-M
        name: Размер
        variant_type: size
        value: M
        price_override: null
        stock: 12
        stock_mode: own
        sku_suffix: M
        image_url: null
        barcode: '04601234500150'
        source_article: TSH-BASIC-WHT-M
        source_group: null
        ros_size: '48'
        attributes_jsonb: {}
        buyer_note_required: false
        buyer_note_prompt: null
        buyer_note_max_len: null
        is_available: true
        sort_order: 0
        created_at: '2026-10-01T08:00:00.000Z'
        updated_at: '2026-10-02T10:00:00.000Z'
    CategoryList:
      summary: Справочник категорий
      value:
        object: list
        url: /v1/categories
        data:
          - object: category
            id: 0a2c4e6a-8c0e-4a2c-8e6a-8c0e2a4c6e8a
            parent_id: null
            name: Дом
            slug: dom
            path:
              - Дом
            is_leaf: false
            attributes_url: /v1/categories/0a2c4e6a-8c0e-4a2c-8e6a-8c0e2a4c6e8a/attributes
          - object: category
            id: 1b2c3d4e-5f6a-4b7c-8d9e-0f1a2b3c4d5e
            parent_id: 0a2c4e6a-8c0e-4a2c-8e6a-8c0e2a4c6e8a
            name: Посуда
            slug: posuda
            path:
              - Дом
              - Посуда
            is_leaf: false
            attributes_url: /v1/categories/1b2c3d4e-5f6a-4b7c-8d9e-0f1a2b3c4d5e/attributes
          - object: category
            id: 9a1e5c7b-2d3f-4a6b-8c9d-0e1f2a3b4c5d
            parent_id: 1b2c3d4e-5f6a-4b7c-8d9e-0f1a2b3c4d5e
            name: Кружки
            slug: kruzhki
            path:
              - Дом
              - Посуда
              - Кружки
            is_leaf: true
            attributes_url: /v1/categories/9a1e5c7b-2d3f-4a6b-8c9d-0e1f2a3b4c5d/attributes
          - object: category
            id: 2c4e6a8c-0e2a-4c4e-8a6c-0e2a4c6e8a0c
            parent_id: 3d5f7b9d-1f3b-4d5f-9b7d-1f3b5d7f9b1d
            name: Футболки
            slug: futbolki
            path:
              - Одежда
              - Футболки
            is_leaf: true
            attributes_url: /v1/categories/2c4e6a8c-0e2a-4c4e-8a6c-0e2a4c6e8a0c/attributes
        has_more: false
        next_cursor: null
    CategoryAttributeList:
      summary: Характеристики категории «Футболки»
      value:
        object: list
        url: /v1/categories/2c4e6a8c-0e2a-4c4e-8a6c-0e2a4c6e8a0c/attributes
        category_id: 2c4e6a8c-0e2a-4c4e-8a6c-0e2a4c6e8a0c
        data:
          - object: attribute
            key: import_v4.material
            name: Материал
            type: enum
            unit: null
            required: true
            values:
              - value: Хлопок
                label: Хлопок
              - value: Лён
                label: Лён
            free_input: true
          - object: attribute
            key: import_v4.fabric_density
            name: Плотность ткани
            type: number
            unit: г/м²
            required: false
            values: []
            free_input: true
        has_more: false
        next_cursor: null
    StockListPage:
      summary: Остатки товара и варианта
      value:
        object: list
        url: /v1/inventory
        data:
          - object: stock
            id: 3f6b1c2a-8d4e-4f7a-9b21-5c0e7d9a1b34
            product_id: 3f6b1c2a-8d4e-4f7a-9b21-5c0e7d9a1b34
            variant_id: null
            external_id: '000012345'
            sku: '100482'
            seller_sku: MUG-350-BLUE
            name: Кружка керамическая 350 мл
            warehouse_id: default
            quantity: 24
            stock: 24
            stock_mode: null
            updated_at: '2026-09-20T14:30:00.000Z'
          - object: stock
            id: 4d6f8a0c-2e4a-4c6e-8a0c-2e4a6c8e0a2c
            product_id: 7c2e4a6c-8e0a-4c2e-9a4c-6e8a0c2e4a6c
            variant_id: 4d6f8a0c-2e4a-4c6e-8a0c-2e4a6c8e0a2c
            external_id: 000012388-M
            sku: '100517'
            seller_sku: TSH-BASIC-WHT
            name: Футболка хлопковая базовая
            warehouse_id: default
            quantity: 15
            stock: 15
            stock_mode: own
            updated_at: '2026-10-01T08:00:00.000Z'
        has_more: true
        next_cursor: eyJ2IjoxLCJyIjoiaW52ZW50b3J5In0.c2lnbmF0dXJl
    StockBatchUpdated:
      summary: Пакет применён целиком (atomic)
      value:
        object: batch_result
        mode: atomic
        results:
          - index: 0
            product_id: 3f6b1c2a-8d4e-4f7a-9b21-5c0e7d9a1b34
            variant_id: null
            status: updated
          - index: 1
            product_id: 7c2e4a6c-8e0a-4c2e-9a4c-6e8a0c2e4a6c
            variant_id: 4d6f8a0c-2e4a-4c6e-8a0c-2e4a6c8e0a2c
            status: unchanged
        updated:
          - id: 3f6b1c2a-8d4e-4f7a-9b21-5c0e7d9a1b34
            product_id: 3f6b1c2a-8d4e-4f7a-9b21-5c0e7d9a1b34
            variant_id: null
            stock: 30
            updated_at: '2026-10-02T10:15:00.000Z'
          - id: 4d6f8a0c-2e4a-4c6e-8a0c-2e4a6c8e0a2c
            product_id: 7c2e4a6c-8e0a-4c2e-9a4c-6e8a0c2e4a6c
            variant_id: 4d6f8a0c-2e4a-4c6e-8a0c-2e4a6c8e0a2c
            stock: 15
            updated_at: '2026-10-01T08:00:00.000Z'
    StockBatchPartial:
      summary: Частичное применение (partial) с ошибкой позиции
      value:
        object: batch_result
        mode: partial
        results:
          - index: 0
            product_id: 3f6b1c2a-8d4e-4f7a-9b21-5c0e7d9a1b34
            variant_id: null
            status: updated
          - index: 1
            product_id: null
            variant_id: null
            status: error
            error:
              code: not_found
              message: Товар или вариант не найден
              param: items.1.external_id
        updated:
          - id: 3f6b1c2a-8d4e-4f7a-9b21-5c0e7d9a1b34
            product_id: 3f6b1c2a-8d4e-4f7a-9b21-5c0e7d9a1b34
            variant_id: null
            stock: 30
            updated_at: '2026-10-02T10:15:00.000Z'
    PriceListPage:
      summary: Цены товара и варианта
      value:
        object: list
        url: /v1/prices
        data:
          - object: price
            id: 3f6b1c2a-8d4e-4f7a-9b21-5c0e7d9a1b34
            product_id: 3f6b1c2a-8d4e-4f7a-9b21-5c0e7d9a1b34
            variant_id: null
            external_id: '000012345'
            sku: '100482'
            seller_sku: MUG-350-BLUE
            name: Кружка керамическая 350 мл
            base_price: 89000
            sale_price: 79000
            compare_at_price: null
            price_override: null
            currency: RUB
            updated_at: '2026-09-20T14:30:00.000Z'
          - object: price
            id: 5e7a9b1d-3f5b-4d7f-9b1d-3f5b7d9f1b3d
            product_id: 7c2e4a6c-8e0a-4c2e-9a4c-6e8a0c2e4a6c
            variant_id: 5e7a9b1d-3f5b-4d7f-9b1d-3f5b7d9f1b3d
            external_id: 000012388-L
            sku: '100517'
            seller_sku: TSH-BASIC-WHT
            name: Футболка хлопковая базовая
            base_price: null
            sale_price: null
            compare_at_price: null
            price_override: 159000
            currency: RUB
            updated_at: '2026-10-01T08:05:00.000Z'
        has_more: false
        next_cursor: null
    PriceBatchUpdated:
      summary: Цены товара и варианта изменены
      value:
        object: batch_result
        mode: atomic
        results:
          - index: 0
            product_id: 3f6b1c2a-8d4e-4f7a-9b21-5c0e7d9a1b34
            variant_id: null
            status: updated
          - index: 1
            product_id: 7c2e4a6c-8e0a-4c2e-9a4c-6e8a0c2e4a6c
            variant_id: 5e7a9b1d-3f5b-4d7f-9b1d-3f5b7d9f1b3d
            status: updated
        updated:
          - id: 3f6b1c2a-8d4e-4f7a-9b21-5c0e7d9a1b34
            product_id: 3f6b1c2a-8d4e-4f7a-9b21-5c0e7d9a1b34
            variant_id: null
            base_price: 95000
            sale_price: null
            compare_at_price: null
            price_override: null
            updated_at: '2026-10-02T10:15:00.000Z'
          - id: 5e7a9b1d-3f5b-4d7f-9b1d-3f5b7d9f1b3d
            product_id: 7c2e4a6c-8e0a-4c2e-9a4c-6e8a0c2e4a6c
            variant_id: 5e7a9b1d-3f5b-4d7f-9b1d-3f5b7d9f1b3d
            base_price: null
            sale_price: null
            compare_at_price: null
            price_override: 155000
            updated_at: '2026-10-02T10:15:00.000Z'
    OrderListPage:
      summary: Новые заказы (fulfillment_status=awaiting_acceptance)
      value:
        object: list
        url: /v1/orders
        data:
          - object: order
            id: 6d1f3a5b-7c9e-4b2d-8f0a-1c3e5a7b9d2f
            number: TL-2026-00001234
            order_number: TL-2026-00001234
            legal_entity_id: 1c3e5a7b-9d2f-4b6d-8f1a-3c5e7a9b1d3f
            fulfillment_status: awaiting_acceptance
            status: paid_pending_release
            has_cancelled_items: false
            created_at: '2026-10-01T08:00:00.000Z'
            paid_at: '2026-10-01T08:02:00.000Z'
            accepted_at: null
            updated_at: '2026-10-01T08:02:00.000Z'
            acceptance_deadline: null
            currency: RUB
            amounts:
              items_total: 158000
              seller_discount: 0
              platform_discount: 0
              commission: 15800
              delivery_share: 0
              pay_on_receipt: 0
            items_total: 158000
            commission: 15800
            payout: 142200
            items:
              - object: order_item
                id: 2b4d6f8a-0c1e-4a3b-9d5f-7e9a1b3c5d7f
                product_id: 3f6b1c2a-8d4e-4f7a-9b21-5c0e7d9a1b34
                variant_id: null
                external_id: '000012345'
                product_code: '100482'
                seller_sku: MUG-350-BLUE
                variant_article: null
                barcode: '04601234567890'
                name: Кружка керамическая 350 мл
                variant: null
                quantity: 2
                unit_price: 79000
                total: 158000
                seller_discount: 0
                platform_discount: 0
                commission: 15800
                commission_bps: 1000
                status: pending
                shipped_at: null
                delivered_at: null
                cancelled_at: null
                marking:
                  required: false
                  status: null
                  codes: []
                addons: []
                option_variant_ids: []
                price: 79000
                product_snapshot:
                  product_id: 3f6b1c2a-8d4e-4f7a-9b21-5c0e7d9a1b34
                  name: Кружка керамическая 350 мл
                  slug: kruzhka-keramicheskaya-350-ml
                  image_url: null
                  product_code: '100482'
                  sku: MUG-350-BLUE
                  variant_value: null
                  brand_name: Глина и огонь
                  legal_entity_id: 1c3e5a7b-9d2f-4b6d-8f1a-3c5e7a9b1d3f
                tracking_number: null
                tracking_url: null
                carrier: null
                created_at: '2026-10-01T08:00:00.000Z'
            delivery:
              method: cdek
              label: СДЭК, пункт выдачи
              city: Казань
              pickup_point:
                code: KZN12
                address: Казань, ул. Баумана, 15
              carrier: null
              tracking_number: null
              tracking_url: null
              shipments: []
            cancellation: null
        has_more: false
        next_cursor: null
    OrderDetail:
      summary: Заказ с историей статусов
      value:
        order:
          object: order
          id: 6d1f3a5b-7c9e-4b2d-8f0a-1c3e5a7b9d2f
          number: TL-2026-00001234
          order_number: TL-2026-00001234
          legal_entity_id: 1c3e5a7b-9d2f-4b6d-8f1a-3c5e7a9b1d3f
          fulfillment_status: awaiting_acceptance
          status: paid_pending_release
          has_cancelled_items: false
          created_at: '2026-10-01T08:00:00.000Z'
          paid_at: '2026-10-01T08:02:00.000Z'
          accepted_at: null
          updated_at: '2026-10-01T08:02:00.000Z'
          acceptance_deadline: null
          currency: RUB
          amounts:
            items_total: 158000
            seller_discount: 0
            platform_discount: 0
            commission: 15800
            delivery_share: 0
            pay_on_receipt: 0
          items_total: 158000
          commission: 15800
          payout: 142200
          items:
            - object: order_item
              id: 2b4d6f8a-0c1e-4a3b-9d5f-7e9a1b3c5d7f
              product_id: 3f6b1c2a-8d4e-4f7a-9b21-5c0e7d9a1b34
              variant_id: null
              external_id: '000012345'
              product_code: '100482'
              seller_sku: MUG-350-BLUE
              variant_article: null
              barcode: '04601234567890'
              name: Кружка керамическая 350 мл
              variant: null
              quantity: 2
              unit_price: 79000
              total: 158000
              seller_discount: 0
              platform_discount: 0
              commission: 15800
              commission_bps: 1000
              status: pending
              shipped_at: null
              delivered_at: null
              cancelled_at: null
              marking:
                required: false
                status: null
                codes: []
              addons: []
              option_variant_ids: []
              price: 79000
              product_snapshot:
                product_id: 3f6b1c2a-8d4e-4f7a-9b21-5c0e7d9a1b34
                name: Кружка керамическая 350 мл
                slug: kruzhka-keramicheskaya-350-ml
                image_url: null
                product_code: '100482'
                sku: MUG-350-BLUE
                variant_value: null
                brand_name: Глина и огонь
                legal_entity_id: 1c3e5a7b-9d2f-4b6d-8f1a-3c5e7a9b1d3f
              tracking_number: null
              tracking_url: null
              carrier: null
              created_at: '2026-10-01T08:00:00.000Z'
          delivery:
            method: cdek
            label: СДЭК, пункт выдачи
            city: Казань
            pickup_point:
              code: KZN12
              address: Казань, ул. Баумана, 15
            carrier: null
            tracking_number: null
            tracking_url: null
            shipments: []
          cancellation: null
          status_history:
            - status: pending
              at: '2026-10-01T08:00:00.000Z'
              actor: buyer
            - status: paid_pending_release
              at: '2026-10-01T08:02:00.000Z'
              actor: system
          delivery_method: cdek_pvz
          tracking_number: null
          carrier: null
          cancel_reason: null
          payout_status: null
          payout_date: null
    OrderAccepted:
      summary: Позиции стороны приняты
      value:
        success: true
        order:
          object: order
          id: 6d1f3a5b-7c9e-4b2d-8f0a-1c3e5a7b9d2f
          number: TL-2026-00001234
          order_number: TL-2026-00001234
          legal_entity_id: 1c3e5a7b-9d2f-4b6d-8f1a-3c5e7a9b1d3f
          fulfillment_status: accepted
          status: confirmed
          has_cancelled_items: false
          created_at: '2026-10-01T08:00:00.000Z'
          paid_at: '2026-10-01T08:02:00.000Z'
          accepted_at: '2026-10-01T09:15:00.000Z'
          updated_at: '2026-10-01T09:15:00.000Z'
          acceptance_deadline: null
          currency: RUB
          amounts:
            items_total: 158000
            seller_discount: 0
            platform_discount: 0
            commission: 15800
            delivery_share: 0
            pay_on_receipt: 0
          items_total: 158000
          commission: 15800
          payout: 142200
          items:
            - object: order_item
              id: 2b4d6f8a-0c1e-4a3b-9d5f-7e9a1b3c5d7f
              product_id: 3f6b1c2a-8d4e-4f7a-9b21-5c0e7d9a1b34
              variant_id: null
              external_id: '000012345'
              product_code: '100482'
              seller_sku: MUG-350-BLUE
              variant_article: null
              barcode: '04601234567890'
              name: Кружка керамическая 350 мл
              variant: null
              quantity: 2
              unit_price: 79000
              total: 158000
              seller_discount: 0
              platform_discount: 0
              commission: 15800
              commission_bps: 1000
              status: processing
              shipped_at: null
              delivered_at: null
              cancelled_at: null
              marking:
                required: false
                status: null
                codes: []
              addons: []
              option_variant_ids: []
              price: 79000
              product_snapshot:
                product_id: 3f6b1c2a-8d4e-4f7a-9b21-5c0e7d9a1b34
                name: Кружка керамическая 350 мл
                slug: kruzhka-keramicheskaya-350-ml
                image_url: null
                product_code: '100482'
                sku: MUG-350-BLUE
                variant_value: null
                brand_name: Глина и огонь
                legal_entity_id: 1c3e5a7b-9d2f-4b6d-8f1a-3c5e7a9b1d3f
              tracking_number: null
              tracking_url: null
              carrier: null
              created_at: '2026-10-01T08:00:00.000Z'
          delivery:
            method: cdek
            label: СДЭК, пункт выдачи
            city: Казань
            pickup_point:
              code: KZN12
              address: Казань, ул. Баумана, 15
            carrier: null
            tracking_number: null
            tracking_url: null
            shipments: []
          cancellation: null
    OrderCancelled:
      summary: Позиции стороны отменены, деньги возвращены
      value:
        success: true
        partial: false
        order_cancelled: true
        cancelled_item_ids:
          - 2b4d6f8a-0c1e-4a3b-9d5f-7e9a1b3c5d7f
        refunded_minor: 158000
        refunded: true
        refund_failed: false
        warning_code: null
        message: Order cancelled
        order:
          object: order
          id: 6d1f3a5b-7c9e-4b2d-8f0a-1c3e5a7b9d2f
          number: TL-2026-00001234
          order_number: TL-2026-00001234
          legal_entity_id: 1c3e5a7b-9d2f-4b6d-8f1a-3c5e7a9b1d3f
          fulfillment_status: cancelled
          status: cancelled
          has_cancelled_items: true
          created_at: '2026-10-01T08:00:00.000Z'
          paid_at: '2026-10-01T08:02:00.000Z'
          accepted_at: null
          updated_at: '2026-10-01T09:40:00.000Z'
          acceptance_deadline: null
          currency: RUB
          amounts:
            items_total: 158000
            seller_discount: 0
            platform_discount: 0
            commission: 15800
            delivery_share: 0
            pay_on_receipt: 0
          items_total: 158000
          commission: 15800
          payout: 142200
          items:
            - object: order_item
              id: 2b4d6f8a-0c1e-4a3b-9d5f-7e9a1b3c5d7f
              product_id: 3f6b1c2a-8d4e-4f7a-9b21-5c0e7d9a1b34
              variant_id: null
              external_id: '000012345'
              product_code: '100482'
              seller_sku: MUG-350-BLUE
              variant_article: null
              barcode: '04601234567890'
              name: Кружка керамическая 350 мл
              variant: null
              quantity: 2
              unit_price: 79000
              total: 158000
              seller_discount: 0
              platform_discount: 0
              commission: 15800
              commission_bps: 1000
              status: cancelled
              shipped_at: null
              delivered_at: null
              cancelled_at: '2026-10-01T09:40:00.000Z'
              marking:
                required: false
                status: null
                codes: []
              addons: []
              option_variant_ids: []
              price: 79000
              product_snapshot:
                product_id: 3f6b1c2a-8d4e-4f7a-9b21-5c0e7d9a1b34
                name: Кружка керамическая 350 мл
                slug: kruzhka-keramicheskaya-350-ml
                image_url: null
                product_code: '100482'
                sku: MUG-350-BLUE
                variant_value: null
                brand_name: Глина и огонь
                legal_entity_id: 1c3e5a7b-9d2f-4b6d-8f1a-3c5e7a9b1d3f
              tracking_number: null
              tracking_url: null
              carrier: null
              created_at: '2026-10-01T08:00:00.000Z'
          delivery:
            method: cdek
            label: СДЭК, пункт выдачи
            city: Казань
            pickup_point:
              code: KZN12
              address: Казань, ул. Баумана, 15
            carrier: null
            tracking_number: null
            tracking_url: null
            shipments: []
          cancellation:
            reason: Нет в наличии
            cancelled_at: '2026-10-01T09:40:00.000Z'
    ReturnListPage:
      summary: Заявки, ждущие решения продавца
      value:
        object: list
        url: /v1/returns
        data:
          - object: return
            id: 8e0a2c4e-6a8c-4e1a-b3c5-d7e9f1a3b5c7
            order_id: 6d1f3a5b-7c9e-4b2d-8f0a-1c3e5a7b9d2f
            order_item_id: 2b4d6f8a-0c1e-4a3b-9d5f-7e9a1b3c5d7f
            kind: defect
            public_status: requested
            seller_response_deadline: null
            currency: RUB
            refund:
              amount: null
              goods: null
              delivery: null
              commission_reversal: null
              refunded_at: null
            return_shipment:
              method: null
              payer: null
              cost: null
              tracking_number: null
              tracking_url: null
            reason: defective
            reason_text: Скол на ручке кружки
            photos: []
            status: pending
            seller_response: null
            seller_responded_at: null
            admin_response: null
            admin_responded_at: null
            refund_amount: null
            refunded_at: null
            return_tracking_number: null
            return_tracking_url: null
            order_number: TL-2026-00001234
            product_name: Кружка керамическая 350 мл
            product_image: null
            created_at: '2026-10-06T09:00:00.000Z'
            updated_at: '2026-10-06T09:00:00.000Z'
        has_more: false
        next_cursor: null
    ReturnDetail:
      summary: Заявка на возврат
      value:
        return:
          object: return
          id: 8e0a2c4e-6a8c-4e1a-b3c5-d7e9f1a3b5c7
          order_id: 6d1f3a5b-7c9e-4b2d-8f0a-1c3e5a7b9d2f
          order_item_id: 2b4d6f8a-0c1e-4a3b-9d5f-7e9a1b3c5d7f
          kind: defect
          public_status: requested
          seller_response_deadline: null
          currency: RUB
          refund:
            amount: null
            goods: null
            delivery: null
            commission_reversal: null
            refunded_at: null
          return_shipment:
            method: null
            payer: null
            cost: null
            tracking_number: null
            tracking_url: null
          reason: defective
          reason_text: Скол на ручке кружки
          photos: []
          status: pending
          seller_response: null
          seller_responded_at: null
          admin_response: null
          admin_responded_at: null
          refund_amount: null
          refunded_at: null
          return_tracking_number: null
          return_tracking_url: null
          order_number: TL-2026-00001234
          product_name: Кружка керамическая 350 мл
          product_image: null
          created_at: '2026-10-06T09:00:00.000Z'
          updated_at: '2026-10-06T09:00:00.000Z'
    ReturnApproved:
      summary: Продавец согласился с возвратом
      value:
        success: true
        return:
          object: return
          id: 8e0a2c4e-6a8c-4e1a-b3c5-d7e9f1a3b5c7
          order_id: 6d1f3a5b-7c9e-4b2d-8f0a-1c3e5a7b9d2f
          order_item_id: 2b4d6f8a-0c1e-4a3b-9d5f-7e9a1b3c5d7f
          kind: defect
          public_status: approved
          seller_response_deadline: null
          currency: RUB
          refund:
            amount: null
            goods: null
            delivery: null
            commission_reversal: null
            refunded_at: null
          return_shipment:
            method: cdek
            payer: seller
            cost: null
            tracking_number: null
            tracking_url: null
          reason: defective
          reason_text: Скол на ручке кружки
          photos: []
          status: seller_approved
          seller_response: Отправьте товар через пункт СДЭК, возврат оплатим мы.
          seller_responded_at: '2026-10-06T11:00:00.000Z'
          admin_response: null
          admin_responded_at: null
          refund_amount: null
          refunded_at: null
          return_tracking_number: null
          return_tracking_url: null
          order_number: TL-2026-00001234
          product_name: Кружка керамическая 350 мл
          product_image: null
          created_at: '2026-10-06T09:00:00.000Z'
          updated_at: '2026-10-06T11:00:00.000Z'
    ReturnRejected:
      summary: Продавец возразил по заявке
      value:
        success: true
        return:
          object: return
          id: 8e0a2c4e-6a8c-4e1a-b3c5-d7e9f1a3b5c7
          order_id: 6d1f3a5b-7c9e-4b2d-8f0a-1c3e5a7b9d2f
          order_item_id: 2b4d6f8a-0c1e-4a3b-9d5f-7e9a1b3c5d7f
          kind: defect
          public_status: rejected
          seller_response_deadline: null
          currency: RUB
          refund:
            amount: null
            goods: null
            delivery: null
            commission_reversal: null
            refunded_at: null
          return_shipment:
            method: null
            payer: null
            cost: null
            tracking_number: null
            tracking_url: null
          reason: defective
          reason_text: Скол на ручке кружки
          photos: []
          status: seller_rejected
          seller_response: Повреждение возникло при эксплуатации, фото упаковки при отправке приложены в кабинете.
          seller_responded_at: '2026-10-06T11:00:00.000Z'
          admin_response: null
          admin_responded_at: null
          refund_amount: null
          refunded_at: null
          return_tracking_number: null
          return_tracking_url: null
          order_number: TL-2026-00001234
          product_name: Кружка керамическая 350 мл
          product_image: null
          created_at: '2026-10-06T09:00:00.000Z'
          updated_at: '2026-10-06T11:00:00.000Z'
    ReturnEscalated:
      summary: Заявка передана на рассмотрение Тилуны
      value:
        success: true
        return:
          object: return
          id: 8e0a2c4e-6a8c-4e1a-b3c5-d7e9f1a3b5c7
          order_id: 6d1f3a5b-7c9e-4b2d-8f0a-1c3e5a7b9d2f
          order_item_id: 2b4d6f8a-0c1e-4a3b-9d5f-7e9a1b3c5d7f
          kind: defect
          public_status: in_review
          seller_response_deadline: null
          currency: RUB
          refund:
            amount: null
            goods: null
            delivery: null
            commission_reversal: null
            refunded_at: null
          return_shipment:
            method: null
            payer: null
            cost: null
            tracking_number: null
            tracking_url: null
          reason: defective
          reason_text: Скол на ручке кружки
          photos: []
          status: admin_review
          seller_response: Прошу проверить фото упаковки при отправке.
          seller_responded_at: '2026-10-06T11:00:00.000Z'
          admin_response: null
          admin_responded_at: null
          refund_amount: null
          refunded_at: null
          return_tracking_number: null
          return_tracking_url: null
          order_number: TL-2026-00001234
          product_name: Кружка керамическая 350 мл
          product_image: null
          created_at: '2026-10-06T09:00:00.000Z'
          updated_at: '2026-10-06T11:00:00.000Z'
    ReviewListPage:
      summary: Отзывы без ответа продавца
      value:
        object: list
        url: /v1/reviews
        data:
          - object: review
            id: 1a3c5e7a-9b1d-4f3b-8c5d-7e9f1b3d5f7a
            product_id: 3f6b1c2a-8d4e-4f7a-9b21-5c0e7d9a1b34
            product_name: Кружка керамическая 350 мл
            product_slug: kruzhka-keramicheskaya-350-ml
            product_image: null
            order_id: 6d1f3a5b-7c9e-4b2d-8f0a-1c3e5a7b9d2f
            rating: 5
            title: Отличная кружка
            text: Держит тепло, приятная на ощупь.
            pros: Удобная ручка
            cons: null
            photos: []
            status: approved
            is_verified_purchase: true
            is_recommended: true
            is_anonymous: false
            helpful_count: 3
            seller_reply: null
            seller_replied_at: null
            created_at: '2026-10-05T12:00:00.000Z'
            updated_at: '2026-10-05T12:00:00.000Z'
        has_more: false
        next_cursor: null
    ReviewStatsSummary:
      summary: Сводка по опубликованным отзывам
      value:
        stats:
          average: 4.7
          total: 42
          distribution:
            '1': 1
            '2': 1
            '3': 2
            '4': 6
            '5': 32
        unreplied_count: 3
    ReviewReplied:
      summary: Ответ на отзыв опубликован
      value:
        success: true
        review:
          object: review
          id: 1a3c5e7a-9b1d-4f3b-8c5d-7e9f1b3d5f7a
          product_id: 3f6b1c2a-8d4e-4f7a-9b21-5c0e7d9a1b34
          product_name: Кружка керамическая 350 мл
          product_slug: kruzhka-keramicheskaya-350-ml
          product_image: null
          order_id: 6d1f3a5b-7c9e-4b2d-8f0a-1c3e5a7b9d2f
          rating: 5
          title: Отличная кружка
          text: Держит тепло, приятная на ощупь.
          pros: Удобная ручка
          cons: null
          photos: []
          status: approved
          is_verified_purchase: true
          is_recommended: true
          is_anonymous: false
          helpful_count: 3
          seller_reply: Спасибо за отзыв! Рады, что кружка понравилась.
          seller_replied_at: '2026-10-06T08:30:00.000Z'
          created_at: '2026-10-05T12:00:00.000Z'
          updated_at: '2026-10-06T08:30:00.000Z'
    AnalyticsLast30Days:
      summary: Показатели за 30 дней
      value:
        stats:
          revenue: 1580000
          ordersCount: 12
          averageCheck: 131667
          productViews: 940
          conversionRate: 1.5
          wishlistCount: 31
        period: 30days
    TransactionListPage:
      summary: Продажа и вознаграждение по заказу
      value:
        object: list
        url: /v1/transactions
        has_more: true
        next_cursor: eyJ2IjoxLCJyIjoidHJhbnNhY3Rpb25zIn0.c2lnbmF0dXJl
        data:
          - object: transaction
            id: 3a5c7e9a-1c3e-4a5c-9e1a-3c5e7a9c1e3a
            legal_entity_id: 1c3e5a7b-9d2f-4b6d-8f1a-3c5e7a9b1d3f
            type: sale
            kind: null
            status: available
            amount: 158000
            commission: 15800
            net_amount: 142200
            currency: RUB
            order_id: 6d1f3a5b-7c9e-4b2d-8f0a-1c3e5a7b9d2f
            order_number: TL-2026-00001234
            order_item_id: 2b4d6f8a-0c1e-4a3b-9d5f-7e9a1b3c5d7f
            available_at: '2026-10-04T08:00:00.000Z'
            paid_at: null
            created_at: '2026-10-01T08:02:00.000Z'
            updated_at: '2026-10-04T08:00:00.000Z'
          - object: transaction
            id: 3a5c7e9a-1c3e-4a5c-9e1a-3c5e7a9c1e3b
            legal_entity_id: 1c3e5a7b-9d2f-4b6d-8f1a-3c5e7a9b1d3f
            type: acquiring_fee
            kind: null
            status: available
            amount: -3950
            commission: 0
            net_amount: -3950
            currency: RUB
            order_id: 6d1f3a5b-7c9e-4b2d-8f0a-1c3e5a7b9d2f
            order_number: TL-2026-00001234
            order_item_id: null
            available_at: '2026-10-04T08:00:00.000Z'
            paid_at: null
            created_at: '2026-10-01T08:02:00.000Z'
            updated_at: '2026-10-04T08:00:00.000Z'
    PayoutListPage:
      summary: Выплаты за периоды
      value:
        object: list
        url: /v1/payouts
        has_more: false
        next_cursor: null
        data:
          - object: payout
            id: 9c1e3a5c-7e9a-4c1e-a3c5-e7a9c1e3a5c7
            legal_entity_id: 1c3e5a7b-9d2f-4b6d-8f1a-3c5e7a9b1d3f
            rail: period
            status: paid
            amount: 1422000
            payout_amount: 1398300
            withheld: 23700
            currency: RUB
            paid_at: '2026-10-08T10:30:00.000Z'
            document:
              number: '4512'
              date: '2026-10-08'
            report_number: ТЛ-2026-000123
            sources_count: 9
            created_at: '2026-10-06T07:00:00.000Z'
            updated_at: '2026-10-08T10:30:00.000Z'
          - object: payout
            id: 9c1e3a5c-7e9a-4c1e-a3c5-e7a9c1e3a5c8
            legal_entity_id: 1c3e5a7b-9d2f-4b6d-8f1a-3c5e7a9b1d3f
            rail: period
            status: pending
            amount: 874500
            payout_amount: 860100
            withheld: 14400
            currency: RUB
            paid_at: null
            document: null
            report_number: ТЛ-2026-000131
            sources_count: 5
            created_at: '2026-10-13T07:00:00.000Z'
            updated_at: '2026-10-13T07:00:00.000Z'
    PayoutDetail:
      summary: Проведённая выплата
      value:
        object: payout
        id: 9c1e3a5c-7e9a-4c1e-a3c5-e7a9c1e3a5c7
        legal_entity_id: 1c3e5a7b-9d2f-4b6d-8f1a-3c5e7a9b1d3f
        rail: period
        status: paid
        amount: 1422000
        payout_amount: 1398300
        withheld: 23700
        currency: RUB
        paid_at: '2026-10-08T10:30:00.000Z'
        document:
          number: '4512'
          date: '2026-10-08'
        report_number: ТЛ-2026-000123
        sources_count: 9
        created_at: '2026-10-06T07:00:00.000Z'
        updated_at: '2026-10-08T10:30:00.000Z'
    PayoutSourceListPage:
      summary: Заказы в выплате
      value:
        object: list
        url: /v1/payouts/9c1e3a5c-7e9a-4c1e-a3c5-e7a9c1e3a5c7/sources
        has_more: false
        next_cursor: null
        data:
          - object: payout_source
            order_id: 6d1f3a5b-7c9e-4b2d-8f0a-1c3e5a7b9d2f
            order_number: TL-2026-00001234
            amount: 138250
            currency: RUB
    DeductionListPage:
      summary: Вознаграждение и возмещение эквайринга
      value:
        object: list
        url: /v1/deductions
        has_more: false
        next_cursor: null
        data:
          - object: deduction
            id: 4b6d8f0b-2d4f-4b6d-8f0b-2d4f6b8d0f2b
            service_code: agent_fee
            service_name: Вознаграждение агента
            legal_entity_id: 1c3e5a7b-9d2f-4b6d-8f1a-3c5e7a9b1d3f
            order_id: 6d1f3a5b-7c9e-4b2d-8f0a-1c3e5a7b9d2f
            order_number: TL-2026-00001234
            order_item_id: 2b4d6f8a-0c1e-4a3b-9d5f-7e9a1b3c5d7f
            amount: -15800
            currency: RUB
            vat_rate: none
            status: paid
            available_at: '2026-10-04T08:00:00.000Z'
            paid_at: '2026-10-08T10:30:00.000Z'
            created_at: '2026-10-01T08:02:00.000Z'
            updated_at: '2026-10-08T10:30:00.000Z'
            report_id: 0d2f4b6d-8f0b-4d2f-b6d8-f0b2d4f6b8d0
            document: null
          - object: deduction
            id: 4b6d8f0b-2d4f-4b6d-8f0b-2d4f6b8d0f2c
            service_code: acquiring_reimbursement
            service_name: Возмещение расходов на эквайринг
            legal_entity_id: 1c3e5a7b-9d2f-4b6d-8f1a-3c5e7a9b1d3f
            order_id: 6d1f3a5b-7c9e-4b2d-8f0a-1c3e5a7b9d2f
            order_number: TL-2026-00001234
            order_item_id: null
            amount: -3950
            currency: RUB
            vat_rate: none
            status: paid
            available_at: '2026-10-04T08:00:00.000Z'
            paid_at: '2026-10-08T10:30:00.000Z'
            created_at: '2026-10-01T08:02:00.000Z'
            updated_at: '2026-10-08T10:30:00.000Z'
            report_id: 0d2f4b6d-8f0b-4d2f-b6d8-f0b2d4f6b8d0
            document: null
    AgentReportListPage:
      summary: Отчёты агента
      value:
        object: list
        url: /v1/agent_reports
        has_more: false
        next_cursor: null
        data:
          - object: agent_report
            id: 0d2f4b6d-8f0b-4d2f-b6d8-f0b2d4f6b8d0
            number: АГ-202609-8B0D2F4B6D8F4B0DA2F46B8D0F2B4D6F-1C3E5A7B9D2F4B6D8F1A3C5E7A9B1D3F
            legal_entity_id: 1c3e5a7b-9d2f-4b6d-8f1a-3c5e7a9b1d3f
            period_from: '2026-09-01'
            period_to: '2026-09-30'
            status: issued
            preliminary: false
            source: tl_snapshot
            tl_report_number: ТЛ-2026-000123
            issued_at: '2026-10-05T06:00:00.000Z'
            accept_deadline: '2026-10-15T20:59:59.000Z'
            totals:
              sales: 1580000
              returns: 0
              agent_fee: 158000
              deductions: 23700
              payable: 1398300
              paid: 1398300
              balance_open: 0
              balance_close: 0
            currency: RUB
            file_url: /v1/agent_reports/0d2f4b6d-8f0b-4d2f-b6d8-f0b2d4f6b8d0/file
            lines_url: /v1/agent_reports/0d2f4b6d-8f0b-4d2f-b6d8-f0b2d4f6b8d0/lines
            updated_at: '2026-10-05T06:00:00.000Z'
    AgentReportDetail:
      summary: Отчёт агента за закрытый период
      value:
        object: agent_report
        id: 0d2f4b6d-8f0b-4d2f-b6d8-f0b2d4f6b8d0
        number: АГ-202609-8B0D2F4B6D8F4B0DA2F46B8D0F2B4D6F-1C3E5A7B9D2F4B6D8F1A3C5E7A9B1D3F
        legal_entity_id: 1c3e5a7b-9d2f-4b6d-8f1a-3c5e7a9b1d3f
        period_from: '2026-09-01'
        period_to: '2026-09-30'
        status: issued
        preliminary: false
        source: tl_snapshot
        tl_report_number: ТЛ-2026-000123
        issued_at: '2026-10-05T06:00:00.000Z'
        accept_deadline: '2026-10-15T20:59:59.000Z'
        totals:
          sales: 1580000
          returns: 0
          agent_fee: 158000
          deductions: 23700
          payable: 1398300
          paid: 1398300
          balance_open: 0
          balance_close: 0
        currency: RUB
        file_url: /v1/agent_reports/0d2f4b6d-8f0b-4d2f-b6d8-f0b2d4f6b8d0/file
        lines_url: /v1/agent_reports/0d2f4b6d-8f0b-4d2f-b6d8-f0b2d4f6b8d0/lines
        updated_at: '2026-10-05T06:00:00.000Z'
    AgentReportSalesLines:
      summary: Лист «Продажи» отчёта агента
      value:
        object: list
        url: /v1/agent_reports/0d2f4b6d-8f0b-4d2f-b6d8-f0b2d4f6b8d0/lines
        has_more: false
        next_cursor: null
        sheet: sales
        source: tl_snapshot
        preliminary: false
        agent_report:
          id: 0d2f4b6d-8f0b-4d2f-b6d8-f0b2d4f6b8d0
          number: АГ-202609-8B0D2F4B6D8F4B0DA2F46B8D0F2B4D6F-1C3E5A7B9D2F4B6D8F1A3C5E7A9B1D3F
        currency: RUB
        data:
          - order_number: TL-2026-00001234
            sold_at: '2026-09-12'
            paid_at: '2026-09-05'
            product_code: '100482'
            seller_sku: MUG-350-BLUE
            external_id: '000012345'
            barcode: '04601234567890'
            name: Кружка керамическая 350 мл
            variant: null
            category: Кружки
            quantity: 2
            unit: '796'
            unit_name: шт
            unit_price: 79000
            amount: 158000
            seller_discount: 0
            platform_discount: 0
            buyer_paid: 158000
            vat_rate: none
            vat_amount: null
            agent_fee: 15800
            agent_fee_bps: 1000
            agent_fee_vat_rate: none
            marking_codes: []
            buyer_type: retail
    CurrentApiKey:
      summary: Ключ интеграции с учётной системой
      value:
        object: api_key
        id: 9f86d081884c7d65
        name: Учётная система склада
        environment: live
        key_format: tl
        scopes:
          - products:read
          - inventory:read
          - inventory:write
          - orders:read
          - orders:fulfill
          - events:read
        effective_scopes:
          - products:read
          - inventory:read
          - inventory:write
          - orders:read
          - orders:fulfill
          - events:read
        tier: basic
        rate_limits:
          per_key: 72
          per_seller: 120
          window: 1m
        legal_entity:
          id: 1c3e5a7b-9d2f-4b6d-8f1a-3c5e7a9b1d3f
          name: ООО «Северный двор»
          type: ooo
        seller:
          public_number: '100245'
        integration_label: warehouse-sync/2.4
        expires_at: '2027-10-01T00:00:00.000Z'
    LegalEntityListPage:
      summary: Юрлицо ключа
      value:
        object: list
        url: /v1/legal_entities
        data:
          - object: legal_entity
            id: 1c3e5a7b-9d2f-4b6d-8f1a-3c5e7a9b1d3f
            type: ooo
            legal_name: ООО «Северный двор»
            brand_name: Северный двор
            inn: '1234567890'
            kpp: '123401001'
            ogrn: '1234567890123'
            tax_regime: usn_income
            vat:
              rate: none
              source: legal_entity
            status: verified
            sales_paused: false
            agreement:
              offer_version: 3.2.0
              accepted_at: '2026-08-01T10:00:00.000Z'
        has_more: false
        next_cursor: null
    LegalEntityDetail:
      summary: Реквизиты юрлица
      value:
        object: legal_entity
        id: 1c3e5a7b-9d2f-4b6d-8f1a-3c5e7a9b1d3f
        type: ooo
        legal_name: ООО «Северный двор»
        brand_name: Северный двор
        inn: '1234567890'
        kpp: '123401001'
        ogrn: '1234567890123'
        tax_regime: usn_income
        vat:
          rate: none
          source: legal_entity
        status: verified
        sales_paused: false
        agreement:
          offer_version: 3.2.0
          accepted_at: '2026-08-01T10:00:00.000Z'
    ReportListPage:
      summary: Отчёты юрлица
      value:
        object: list
        url: /v1/reports
        has_more: false
        next_cursor: null
        data:
          - object: report
            id: 2e4a6c8e-0a2c-4e6a-8c0e-2a4c6e8a0c2e
            type: agent_sales
            formats:
              - xlsx
              - json
            period_from: '2026-09-01'
            period_to: '2026-09-30'
            legal_entity_id: 1c3e5a7b-9d2f-4b6d-8f1a-3c5e7a9b1d3f
            status: succeeded
            preliminary: false
            row_counts:
              sales: 124
              returns: 3
              receipts: 124
              services: 131
              payouts: 4
            created_at: '2026-10-06T08:00:00.000Z'
            completed_at: '2026-10-06T08:00:41.000Z'
            expires_at: '2026-10-13T08:00:41.000Z'
            files:
              - format: xlsx
                size: 48213
                sha256: 9f2b5c8e1a4d7f0b3e6a9c2f5b8e1d4a7c0f3b6e9a2d5c8f1b4e7a0d3c6f9b2e
                download_url: /v1/reports/2e4a6c8e-0a2c-4e6a-8c0e-2a4c6e8a0c2e/download?format=xlsx
              - format: json
                size: 21977
                sha256: 1c4f7a0d3b6e9c2f5a8d1b4e7c0a3f6d9b2e5c8a1f4d7b0e3a6c9f2d5b8e1a4c
                download_url: /v1/reports/2e4a6c8e-0a2c-4e6a-8c0e-2a4c6e8a0c2e/download?format=json
            error: null
          - object: report
            id: 3f5b7d9f-1b3d-4f5b-9d1f-3b5d7f9b1d3f
            type: orders
            formats:
              - csv
            period_from: '2026-10-01'
            period_to: '2026-10-05'
            legal_entity_id: 1c3e5a7b-9d2f-4b6d-8f1a-3c5e7a9b1d3f
            status: processing
            preliminary: true
            row_counts: {}
            created_at: '2026-10-06T08:05:00.000Z'
            completed_at: null
            expires_at: null
            files: []
            error: null
    ReportQueued:
      summary: Отчёт агента за сентябрь поставлен в очередь
      value:
        object: report
        id: 2e4a6c8e-0a2c-4e6a-8c0e-2a4c6e8a0c2e
        type: agent_sales
        formats:
          - xlsx
          - json
        period_from: '2026-09-01'
        period_to: '2026-09-30'
        legal_entity_id: 1c3e5a7b-9d2f-4b6d-8f1a-3c5e7a9b1d3f
        status: queued
        preliminary: false
        row_counts: {}
        created_at: '2026-10-06T08:00:00.000Z'
        completed_at: null
        expires_at: null
        files: []
        error: null
    ReportSucceeded:
      summary: Отчёт готов, файлы доступны 7 дней
      value:
        object: report
        id: 2e4a6c8e-0a2c-4e6a-8c0e-2a4c6e8a0c2e
        type: agent_sales
        formats:
          - xlsx
          - json
        period_from: '2026-09-01'
        period_to: '2026-09-30'
        legal_entity_id: 1c3e5a7b-9d2f-4b6d-8f1a-3c5e7a9b1d3f
        status: succeeded
        preliminary: false
        row_counts:
          sales: 124
          returns: 3
          receipts: 124
          services: 131
          payouts: 4
        created_at: '2026-10-06T08:00:00.000Z'
        completed_at: '2026-10-06T08:00:41.000Z'
        expires_at: '2026-10-13T08:00:41.000Z'
        files:
          - format: xlsx
            size: 48213
            sha256: 9f2b5c8e1a4d7f0b3e6a9c2f5b8e1d4a7c0f3b6e9a2d5c8f1b4e7a0d3c6f9b2e
            download_url: /v1/reports/2e4a6c8e-0a2c-4e6a-8c0e-2a4c6e8a0c2e/download?format=xlsx
          - format: json
            size: 21977
            sha256: 1c4f7a0d3b6e9c2f5a8d1b4e7c0a3f6d9b2e5c8a1f4d7b0e3a6c9f2d5b8e1a4c
            download_url: /v1/reports/2e4a6c8e-0a2c-4e6a-8c0e-2a4c6e8a0c2e/download?format=json
        error: null
    ReportFailed:
      summary: Отчёт не сформирован
      value:
        object: report
        id: 4a6c8e0a-2c4e-4a8c-8e0a-2c4e6a8c0e2a
        type: agent_sales
        formats:
          - xlsx
          - json
        period_from: '2026-09-01'
        period_to: '2026-09-30'
        legal_entity_id: 1c3e5a7b-9d2f-4b6d-8f1a-3c5e7a9b1d3f
        status: failed
        preliminary: false
        row_counts: {}
        created_at: '2026-10-06T08:00:00.000Z'
        completed_at: '2026-10-06T08:01:10.000Z'
        expires_at: null
        files: []
        error:
          code: report_failed
          message: 'Отчёт не сформирован: повторите запрос позже'
    ReportSalesRows:
      summary: Лист «Продажи» отчёта агента
      value:
        object: list
        url: /v1/reports/2e4a6c8e-0a2c-4e6a-8c0e-2a4c6e8a0c2e/rows
        has_more: true
        next_cursor: eyJ2IjoxLCJyIjoicmVwb3J0X3Jvd3MifQ.c2lnbmF0dXJl
        sheet: sales
        report:
          id: 2e4a6c8e-0a2c-4e6a-8c0e-2a4c6e8a0c2e
          type: agent_sales
          preliminary: false
        data:
          - order_number: TL-2026-00001234
            sold_at: '2026-09-12'
            product_code: '100482'
            seller_sku: MUG-350-BLUE
            external_id: '000012345'
            barcode: '04601234567890'
            name: Кружка керамическая 350 мл
            quantity: 2
            unit_price: 79000
            amount: 158000
            agent_fee: 15800
            vat_rate: none
            marking_codes: []
    EventListPage:
      summary: Новые события после сохранённого курсора
      value:
        object: list
        url: /v1/events
        has_more: false
        next_cursor: eyJ2IjoxLCJyIjoiZXZlbnRzIn0.c2lnbmF0dXJl
        data:
          - object: event
            api_version: '2026-10-01'
            livemode: true
            legal_entity: 1c3e5a7b-9d2f-4b6d-8f1a-3c5e7a9b1d3f
            request:
              id: null
              idempotency_key: null
            id: e1a00001-0000-4000-8000-000000000001
            type: order.paid
            created: '2026-10-01T08:02:00.120Z'
            occurred_at: '2026-10-01T08:02:00.000Z'
            sequence: 1048576
            source: buyer
            resource:
              type: order
              id: 6d1f3a5b-7c9e-4b2d-8f0a-1c3e5a7b9d2f
              url: /v1/orders/6d1f3a5b-7c9e-4b2d-8f0a-1c3e5a7b9d2f
            data:
              object:
                object: order
                id: 6d1f3a5b-7c9e-4b2d-8f0a-1c3e5a7b9d2f
                number: TL-2026-00001234
                status: paid_pending_release
                fulfillment_status: awaiting_acceptance
                updated_at: '2026-10-01T08:02:00.000Z'
                items:
                  - id: 2b4d6f8a-0c1e-4a3b-9d5f-7e9a1b3c5d7f
                    status: pending
                  - id: 3c5e7a9c-1e3a-4c5e-9a1c-3e5a7c9e1a3c
                    status: pending
                payment_status: captured
              previous_attributes: null
          - object: event
            api_version: '2026-10-01'
            livemode: true
            legal_entity: 1c3e5a7b-9d2f-4b6d-8f1a-3c5e7a9b1d3f
            request:
              id: null
              idempotency_key: null
            id: e1a00001-0000-4000-8000-000000000011
            type: return.created
            created: '2026-10-06T09:00:00.090Z'
            occurred_at: '2026-10-06T09:00:00.000Z'
            sequence: 1049201
            source: buyer
            resource:
              type: return
              id: 8e0a2c4e-6a8c-4e1a-b3c5-d7e9f1a3b5c7
              url: /v1/returns/8e0a2c4e-6a8c-4e1a-b3c5-d7e9f1a3b5c7
            data:
              object:
                object: return
                id: 8e0a2c4e-6a8c-4e1a-b3c5-d7e9f1a3b5c7
                order_id: 6d1f3a5b-7c9e-4b2d-8f0a-1c3e5a7b9d2f
                order_number: TL-2026-00001234
                order_item_id: 2b4d6f8a-0c1e-4a3b-9d5f-7e9a1b3c5d7f
                status: pending
                public_status: requested
                kind: defect
                refund_amount: null
                currency: RUB
                return_shipment:
                  status: null
                  tracking_number: null
                  tracking_url: null
                updated_at: '2026-10-06T09:00:00.000Z'
              previous_attributes: null
    EventDetail:
      summary: Событие по идентификатору из вебхука
      value:
        object: event
        api_version: '2026-10-01'
        livemode: true
        legal_entity: 1c3e5a7b-9d2f-4b6d-8f1a-3c5e7a9b1d3f
        request:
          id: null
          idempotency_key: null
        id: e1a00001-0000-4000-8000-000000000001
        type: order.paid
        created: '2026-10-01T08:02:00.120Z'
        occurred_at: '2026-10-01T08:02:00.000Z'
        sequence: 1048576
        source: buyer
        resource:
          type: order
          id: 6d1f3a5b-7c9e-4b2d-8f0a-1c3e5a7b9d2f
          url: /v1/orders/6d1f3a5b-7c9e-4b2d-8f0a-1c3e5a7b9d2f
        data:
          object:
            object: order
            id: 6d1f3a5b-7c9e-4b2d-8f0a-1c3e5a7b9d2f
            number: TL-2026-00001234
            status: paid_pending_release
            fulfillment_status: awaiting_acceptance
            updated_at: '2026-10-01T08:02:00.000Z'
            items:
              - id: 2b4d6f8a-0c1e-4a3b-9d5f-7e9a1b3c5d7f
                status: pending
              - id: 3c5e7a9c-1e3a-4c5e-9a1c-3e5a7c9e1a3c
                status: pending
            payment_status: captured
          previous_attributes: null
    EventTypeCatalog:
      summary: Каталог типов событий (фрагмент)
      value:
        object: list
        url: /v1/event_types
        has_more: false
        next_cursor: null
        data:
          - object: event_type
            type: order.paid
            resource_type: order
            required_scope: orders:read
            description: Заказ оплачен покупателем, позиции стороны ждут принятия
            default_subscribed: true
            since_api_version: '2026-10-01'
          - object: event_type
            type: shipment.tracking_updated
            resource_type: order
            required_scope: orders:read
            description: Обновился статус отслеживания отправления (только по явной подписке)
            default_subscribed: false
            since_api_version: '2026-10-01'
          - object: event_type
            type: ping
            resource_type: ping
            required_scope: null
            description: Тестовое событие для проверки endpoint'а
            default_subscribed: false
            since_api_version: '2026-10-01'
    WebhookEndpointListPage:
      summary: Адрес учётной системы, подписанный на заказы и возвраты
      value:
        object: list
        url: /v1/webhook_endpoints
        has_more: false
        next_cursor: null
        data:
          - object: webhook_endpoint
            id: 6b8d0f2b-4d6f-4b8d-a0f2-4d6f8b0d2f4b
            name: Учётная система склада
            url: https://erp.example.ru/hooks/tiluna
            status: active
            enabled_event_types:
              - order.paid
              - order.cancelled
              - order.items_cancelled
              - return.created
            api_version: '2026-10-01'
            legal_entity_id: 1c3e5a7b-9d2f-4b6d-8f1a-3c5e7a9b1d3f
            scope_mode: legal_entity
            last_success_at: '2026-10-06T09:00:01.000Z'
            last_failure_at: null
            created_at: '2026-09-25T10:00:00.000Z'
    SandboxOrderPaid:
      summary: Заказ оплачен симулятором и ждёт принятия
      value:
        object: order
        id: 9e1a3c5e-7a9c-4e1a-8c5e-7a9c1e3a5c7e
        number: TL-2026-00004821
        order_number: TL-2026-00004821
        legal_entity_id: 1c3e5a7b-9d2f-4b6d-8f1a-3c5e7a9b1d3f
        fulfillment_status: awaiting_acceptance
        status: paid_pending_release
        has_cancelled_items: false
        created_at: '2026-10-01T08:00:00.000Z'
        paid_at: '2026-10-01T08:00:01.000Z'
        accepted_at: null
        updated_at: '2026-10-01T08:00:01.000Z'
        acceptance_deadline: null
        currency: RUB
        amounts:
          items_total: 298000
          seller_discount: 0
          platform_discount: 0
          commission: 29800
          delivery_share: 0
          pay_on_receipt: 0
        items_total: 298000
        commission: 29800
        payout: 268200
        items:
          - object: order_item
            id: 5a7c9e1a-3c5e-4a7c-9e1a-3c5e7a9c1e3d
            product_id: 7c2e4a6c-8e0a-4c2e-9a4c-6e8a0c2e4a6c
            variant_id: 4d6f8a0c-2e4a-4c6e-8a0c-2e4a6c8e0a2c
            external_id: EXT-TSHIRT-BASIC
            product_code: '100517'
            seller_sku: TSH-BASIC-WHT-M
            variant_article: TSH-BASIC-WHT-M
            barcode: '04601234567906'
            name: Футболка хлопковая базовая
            variant:
              type: Размер
              value: M
            quantity: 2
            unit_price: 149000
            total: 298000
            seller_discount: 0
            platform_discount: 0
            commission: 29800
            commission_bps: 1000
            status: pending
            shipped_at: null
            delivered_at: null
            cancelled_at: null
            marking:
              required: false
              status: null
              codes: []
            addons: []
            option_variant_ids: []
            price: 149000
            product_snapshot:
              product_id: 7c2e4a6c-8e0a-4c2e-9a4c-6e8a0c2e4a6c
              name: Футболка хлопковая базовая
              slug: futbolka-hlopkovaya-bazovaya
              image_url: null
              product_code: '100517'
              sku: TSH-BASIC-WHT-M
              variant_value: M
              brand_name: Северный двор
              legal_entity_id: 1c3e5a7b-9d2f-4b6d-8f1a-3c5e7a9b1d3f
            tracking_number: null
            tracking_url: null
            carrier: null
            created_at: '2026-10-01T08:00:00.000Z'
        delivery:
          method: cdek
          label: СДЭК, пункт выдачи
          city: Тестовый город
          pickup_point:
            code: TST01
            address: Тестовый город, ул. Примерная, 1
          carrier: null
          tracking_number: null
          tracking_url: null
          shipments: []
        cancellation: null
    SandboxOrderShipped:
      summary: Перевозчик-симулятор принял посылку, трек-номер вымышленный
      value:
        object: order
        id: 9e1a3c5e-7a9c-4e1a-8c5e-7a9c1e3a5c7e
        number: TL-2026-00004821
        order_number: TL-2026-00004821
        legal_entity_id: 1c3e5a7b-9d2f-4b6d-8f1a-3c5e7a9b1d3f
        fulfillment_status: shipped
        status: shipped
        has_cancelled_items: false
        created_at: '2026-10-01T08:00:00.000Z'
        paid_at: '2026-10-01T08:00:01.000Z'
        accepted_at: '2026-10-01T09:15:00.000Z'
        updated_at: '2026-10-02T10:00:00.000Z'
        acceptance_deadline: null
        currency: RUB
        amounts:
          items_total: 298000
          seller_discount: 0
          platform_discount: 0
          commission: 29800
          delivery_share: 0
          pay_on_receipt: 0
        items_total: 298000
        commission: 29800
        payout: 268200
        items:
          - object: order_item
            id: 5a7c9e1a-3c5e-4a7c-9e1a-3c5e7a9c1e3d
            product_id: 7c2e4a6c-8e0a-4c2e-9a4c-6e8a0c2e4a6c
            variant_id: 4d6f8a0c-2e4a-4c6e-8a0c-2e4a6c8e0a2c
            external_id: EXT-TSHIRT-BASIC
            product_code: '100517'
            seller_sku: TSH-BASIC-WHT-M
            variant_article: TSH-BASIC-WHT-M
            barcode: '04601234567906'
            name: Футболка хлопковая базовая
            variant:
              type: Размер
              value: M
            quantity: 2
            unit_price: 149000
            total: 298000
            seller_discount: 0
            platform_discount: 0
            commission: 29800
            commission_bps: 1000
            status: shipped
            shipped_at: '2026-10-02T10:00:00.000Z'
            delivered_at: null
            cancelled_at: null
            marking:
              required: false
              status: null
              codes: []
            addons: []
            option_variant_ids: []
            price: 149000
            product_snapshot:
              product_id: 7c2e4a6c-8e0a-4c2e-9a4c-6e8a0c2e4a6c
              name: Футболка хлопковая базовая
              slug: futbolka-hlopkovaya-bazovaya
              image_url: null
              product_code: '100517'
              sku: TSH-BASIC-WHT-M
              variant_value: M
              brand_name: Северный двор
              legal_entity_id: 1c3e5a7b-9d2f-4b6d-8f1a-3c5e7a9b1d3f
            tracking_number: SBX7K2QD
            tracking_url: null
            carrier: cdek
            created_at: '2026-10-01T08:00:00.000Z'
        delivery:
          method: cdek
          label: СДЭК, пункт выдачи
          city: Тестовый город
          pickup_point:
            code: TST01
            address: Тестовый город, ул. Примерная, 1
          carrier: cdek
          tracking_number: SBX7K2QD
          tracking_url: null
          shipments:
            - object: shipment
              id: 6b8d0f2b-4d6f-4b8d-9f2b-4d6f8b0d2f4b
              direction: outbound
              provider: cdek
              tracking_number: SBX7K2QD
              tracking_url: null
              status: in_transit
              pickup_point:
                code: TST01
                address: Тестовый город, ул. Примерная, 1
              declared_weight_g: 440
              shipped_at: '2026-10-02T10:00:00.000Z'
              delivered_at: null
              item_ids:
                - 5a7c9e1a-3c5e-4a7c-9e1a-3c5e7a9c1e3d
        cancellation: null
    SandboxOrderCancelledByBuyer:
      summary: Покупатель отменил оплаченный заказ, деньги возвращены симулятором
      value:
        object: order
        id: 9e1a3c5e-7a9c-4e1a-8c5e-7a9c1e3a5c7e
        number: TL-2026-00004821
        order_number: TL-2026-00004821
        legal_entity_id: 1c3e5a7b-9d2f-4b6d-8f1a-3c5e7a9b1d3f
        fulfillment_status: cancelled
        status: cancelled
        has_cancelled_items: true
        created_at: '2026-10-01T08:00:00.000Z'
        paid_at: '2026-10-01T08:00:01.000Z'
        accepted_at: null
        updated_at: '2026-10-01T09:40:00.000Z'
        acceptance_deadline: null
        currency: RUB
        amounts:
          items_total: 298000
          seller_discount: 0
          platform_discount: 0
          commission: 29800
          delivery_share: 0
          pay_on_receipt: 0
        items_total: 298000
        commission: 29800
        payout: 268200
        items:
          - object: order_item
            id: 5a7c9e1a-3c5e-4a7c-9e1a-3c5e7a9c1e3d
            product_id: 7c2e4a6c-8e0a-4c2e-9a4c-6e8a0c2e4a6c
            variant_id: 4d6f8a0c-2e4a-4c6e-8a0c-2e4a6c8e0a2c
            external_id: EXT-TSHIRT-BASIC
            product_code: '100517'
            seller_sku: TSH-BASIC-WHT-M
            variant_article: TSH-BASIC-WHT-M
            barcode: '04601234567906'
            name: Футболка хлопковая базовая
            variant:
              type: Размер
              value: M
            quantity: 2
            unit_price: 149000
            total: 298000
            seller_discount: 0
            platform_discount: 0
            commission: 29800
            commission_bps: 1000
            status: cancelled
            shipped_at: null
            delivered_at: null
            cancelled_at: '2026-10-01T09:40:00.000Z'
            marking:
              required: false
              status: null
              codes: []
            addons: []
            option_variant_ids: []
            price: 149000
            product_snapshot:
              product_id: 7c2e4a6c-8e0a-4c2e-9a4c-6e8a0c2e4a6c
              name: Футболка хлопковая базовая
              slug: futbolka-hlopkovaya-bazovaya
              image_url: null
              product_code: '100517'
              sku: TSH-BASIC-WHT-M
              variant_value: M
              brand_name: Северный двор
              legal_entity_id: 1c3e5a7b-9d2f-4b6d-8f1a-3c5e7a9b1d3f
            tracking_number: null
            tracking_url: null
            carrier: null
            created_at: '2026-10-01T08:00:00.000Z'
        delivery:
          method: cdek
          label: СДЭК, пункт выдачи
          city: Тестовый город
          pickup_point:
            code: TST01
            address: Тестовый город, ул. Примерная, 1
          carrier: null
          tracking_number: null
          tracking_url: null
          shipments: []
        cancellation:
          reason: Отменён покупателем
          cancelled_at: '2026-10-01T09:40:00.000Z'
    SandboxReturnCreated:
      summary: Заявка покупателя на возврат ждёт решения продавца
      value:
        object: return
        id: 2c4e6a8c-0e2a-4c4e-8a6c-0e2a4c6e8a0d
        order_id: 9e1a3c5e-7a9c-4e1a-8c5e-7a9c1e3a5c7e
        order_item_id: 5a7c9e1a-3c5e-4a7c-9e1a-3c5e7a9c1e3d
        kind: quality
        public_status: requested
        seller_response_deadline: null
        currency: RUB
        refund:
          amount: null
          goods: null
          delivery: null
          commission_reversal: null
          refunded_at: null
        return_shipment:
          method: null
          payer: null
          cost: null
          tracking_number: null
          tracking_url: null
        reason: wrong_size
        reason_text: null
        photos: []
        status: pending
        seller_response: null
        seller_responded_at: null
        admin_response: null
        admin_responded_at: null
        refund_amount: null
        refunded_at: null
        return_tracking_number: null
        return_tracking_url: null
        order_number: TL-2026-00004821
        product_name: Футболка хлопковая базовая
        product_image: null
        created_at: '2026-10-06T09:00:00.000Z'
        updated_at: '2026-10-06T09:00:00.000Z'
    SandboxReturnRefunded:
      summary: Деньги по возврату возвращены симулятором, без банка и чека
      value:
        object: return
        id: 2c4e6a8c-0e2a-4c4e-8a6c-0e2a4c6e8a0d
        order_id: 9e1a3c5e-7a9c-4e1a-8c5e-7a9c1e3a5c7e
        order_item_id: 5a7c9e1a-3c5e-4a7c-9e1a-3c5e7a9c1e3d
        kind: quality
        public_status: refunded
        seller_response_deadline: null
        currency: RUB
        refund:
          amount: 149000
          goods: 149000
          delivery: 0
          commission_reversal: 14900
          refunded_at: '2026-10-09T12:00:00.000Z'
        return_shipment:
          method: null
          payer: null
          cost: null
          tracking_number: null
          tracking_url: null
        reason: wrong_size
        reason_text: null
        photos: []
        status: refunded
        seller_response: Возврат согласован
        seller_responded_at: '2026-10-06T11:00:00.000Z'
        admin_response: null
        admin_responded_at: null
        refund_amount: 149000
        refunded_at: '2026-10-09T12:00:00.000Z'
        return_tracking_number: null
        return_tracking_url: null
        order_number: TL-2026-00004821
        product_name: Футболка хлопковая базовая
        product_image: null
        created_at: '2026-10-06T09:00:00.000Z'
        updated_at: '2026-10-09T12:00:00.000Z'
    SandboxAgentReportPreliminary:
      summary: Предварительный отчёт агента за текущий месяц
      value:
        object: agent_report
        id: 3e5a7c9e-1a3c-4e5a-9c1e-3a5c7e9a1c3e
        number: АГ-202610-3E5A7C9E1A3C4E5A9C1E3A5C7E9A1C3E-1C3E5A7B9D2F4B6D8F1A3C5E7A9B1D3F
        legal_entity_id: 1c3e5a7b-9d2f-4b6d-8f1a-3c5e7a9b1d3f
        period_from: '2026-10-01'
        period_to: '2026-10-09'
        status: issued
        preliminary: true
        source: tl_snapshot
        tl_report_number: null
        issued_at: '2026-10-09T12:05:00.000Z'
        accept_deadline: null
        totals:
          sales: 298000
          returns: 149000
          agent_fee: 14900
          deductions: 0
          payable: 134100
          paid: 0
          balance_open: 0
          balance_close: 134100
        currency: RUB
        file_url: /v1/agent_reports/3e5a7c9e-1a3c-4e5a-9c1e-3a5c7e9a1c3e/file
        lines_url: /v1/agent_reports/3e5a7c9e-1a3c-4e5a-9c1e-3a5c7e9a1c3e/lines
        updated_at: '2026-10-09T12:05:00.000Z'
    SandboxPayoutPaid:
      summary: Синтетическая выплата сразу в статусе paid, банк не вызывается
      value:
        object: payout
        id: 4f6b8d0f-2b4d-4f6b-8d0f-2b4d6f8b0d2f
        legal_entity_id: 1c3e5a7b-9d2f-4b6d-8f1a-3c5e7a9b1d3f
        rail: period
        status: paid
        amount: 268200
        payout_amount: 268200
        withheld: 0
        currency: RUB
        paid_at: '2026-10-10T10:30:00.000Z'
        document: null
        report_number: null
        sources_count: 1
        created_at: '2026-10-10T10:30:00.000Z'
        updated_at: '2026-10-10T10:30:00.000Z'
    SandboxSampleEvent:
      summary: Образец события order.paid по последнему заказу тестового кабинета
      value:
        object: event
        id: 0a2c4e6a-8c0e-4a2c-9e6a-8c0e2a4c6e8a
        type: order.paid
        api_version: '2026-10-01'
        created: '2026-10-01T08:05:00.000Z'
        occurred_at: '2026-10-01T08:05:00.000Z'
        livemode: false
        sequence: 1024
        legal_entity: 1c3e5a7b-9d2f-4b6d-8f1a-3c5e7a9b1d3f
        source: sandbox
        resource:
          type: order
          id: 9e1a3c5e-7a9c-4e1a-8c5e-7a9c1e3a5c7e
          url: /v1/orders/9e1a3c5e-7a9c-4e1a-8c5e-7a9c1e3a5c7e
        data:
          object:
            object: order
            id: 9e1a3c5e-7a9c-4e1a-8c5e-7a9c1e3a5c7e
            number: TL-2026-00004821
            status: paid_pending_release
            fulfillment_status: awaiting_acceptance
            updated_at: '2026-10-01T08:00:01.000Z'
            items:
              - id: 5a7c9e1a-3c5e-4a7c-9e1a-3c5e7a9c1e3d
                status: pending
            sample: true
          previous_attributes: null
        request:
          id: null
          idempotency_key: null
    SandboxReset:
      summary: Тестовый кабинет возвращён к исходному наполнению
      value:
        object: reset
        completed_at: '2026-10-12T07:00:00.000Z'
    OrderPaidWebhook:
      summary: Заказ оплачен, позиции ждут принятия
      value:
        object: event
        api_version: '2026-10-01'
        livemode: true
        legal_entity: 1c3e5a7b-9d2f-4b6d-8f1a-3c5e7a9b1d3f
        request:
          id: null
          idempotency_key: null
        id: e1a00001-0000-4000-8000-000000000001
        type: order.paid
        created: '2026-10-01T08:02:00.120Z'
        occurred_at: '2026-10-01T08:02:00.000Z'
        sequence: 1048576
        source: buyer
        resource:
          type: order
          id: 6d1f3a5b-7c9e-4b2d-8f0a-1c3e5a7b9d2f
          url: /v1/orders/6d1f3a5b-7c9e-4b2d-8f0a-1c3e5a7b9d2f
        data:
          object:
            object: order
            id: 6d1f3a5b-7c9e-4b2d-8f0a-1c3e5a7b9d2f
            number: TL-2026-00001234
            status: paid_pending_release
            fulfillment_status: awaiting_acceptance
            updated_at: '2026-10-01T08:02:00.000Z'
            items:
              - id: 2b4d6f8a-0c1e-4a3b-9d5f-7e9a1b3c5d7f
                status: pending
              - id: 3c5e7a9c-1e3a-4c5e-9a1c-3e5a7c9e1a3c
                status: pending
            payment_status: captured
          previous_attributes: null
    TestOrderPaidWebhook:
      summary: Тестовое событие order.paid из кабинета
      value:
        object: event
        api_version: '2026-10-01'
        livemode: true
        legal_entity: null
        request:
          id: null
          idempotency_key: null
        id: e1a00001-0000-4000-8000-000000000036
        type: order.paid
        created: '2026-10-01T09:00:00.000Z'
        occurred_at: '2026-10-01T09:00:00.000Z'
        sequence: 0
        source: platform
        resource:
          type: order
          id: 00000000-0000-0000-0000-000000000000
          url: /v1/orders/00000000-0000-0000-0000-000000000000
        data:
          object:
            object: order
            id: 00000000-0000-0000-0000-000000000000
            test: true
            updated_at: '2026-10-01T09:00:00.000Z'
          previous_attributes: null
    OrderAcceptedWebhook:
      summary: Позиции приняты через API
      value:
        object: event
        api_version: '2026-10-01'
        livemode: true
        legal_entity: 1c3e5a7b-9d2f-4b6d-8f1a-3c5e7a9b1d3f
        request:
          id: V1StGXR8_Z5j
          idempotency_key: accept-TL-2026-00001234
        id: e1a00001-0000-4000-8000-000000000002
        type: order.accepted
        created: '2026-10-01T09:15:00.080Z'
        occurred_at: '2026-10-01T09:15:00.000Z'
        sequence: 1048601
        source: seller_api
        resource:
          type: order
          id: 6d1f3a5b-7c9e-4b2d-8f0a-1c3e5a7b9d2f
          url: /v1/orders/6d1f3a5b-7c9e-4b2d-8f0a-1c3e5a7b9d2f
        data:
          object:
            object: order
            id: 6d1f3a5b-7c9e-4b2d-8f0a-1c3e5a7b9d2f
            number: TL-2026-00001234
            status: confirmed
            fulfillment_status: accepted
            updated_at: '2026-10-01T09:15:00.000Z'
            items:
              - id: 2b4d6f8a-0c1e-4a3b-9d5f-7e9a1b3c5d7f
                status: processing
              - id: 3c5e7a9c-1e3a-4c5e-9a1c-3e5a7c9e1a3c
                status: processing
            accepted_item_ids:
              - 2b4d6f8a-0c1e-4a3b-9d5f-7e9a1b3c5d7f
              - 3c5e7a9c-1e3a-4c5e-9a1c-3e5a7c9e1a3c
          previous_attributes: null
    OrderShippedWebhook:
      summary: Все позиции стороны отгружены
      value:
        object: event
        api_version: '2026-10-01'
        livemode: true
        legal_entity: 1c3e5a7b-9d2f-4b6d-8f1a-3c5e7a9b1d3f
        request:
          id: null
          idempotency_key: null
        id: e1a00001-0000-4000-8000-000000000003
        type: order.shipped
        created: '2026-10-02T10:00:00.090Z'
        occurred_at: '2026-10-02T10:00:00.000Z'
        sequence: 1048712
        source: seller_cabinet
        resource:
          type: order
          id: 6d1f3a5b-7c9e-4b2d-8f0a-1c3e5a7b9d2f
          url: /v1/orders/6d1f3a5b-7c9e-4b2d-8f0a-1c3e5a7b9d2f
        data:
          object:
            object: order
            id: 6d1f3a5b-7c9e-4b2d-8f0a-1c3e5a7b9d2f
            number: TL-2026-00001234
            status: shipped
            fulfillment_status: shipped
            updated_at: '2026-10-02T10:00:00.000Z'
            items:
              - id: 2b4d6f8a-0c1e-4a3b-9d5f-7e9a1b3c5d7f
                status: shipped
              - id: 3c5e7a9c-1e3a-4c5e-9a1c-3e5a7c9e1a3c
                status: shipped
            shipped_item_ids:
              - 2b4d6f8a-0c1e-4a3b-9d5f-7e9a1b3c5d7f
              - 3c5e7a9c-1e3a-4c5e-9a1c-3e5a7c9e1a3c
            carrier: СДЭК
            tracking_number: '1234567890'
            tracking_url: https://www.cdek.ru/ru/tracking?order_id=1234567890
          previous_attributes: null
    OrderPartiallyShippedWebhook:
      summary: Отгружена одна из двух позиций
      value:
        object: event
        api_version: '2026-10-01'
        livemode: true
        legal_entity: 1c3e5a7b-9d2f-4b6d-8f1a-3c5e7a9b1d3f
        request:
          id: null
          idempotency_key: null
        id: e1a00001-0000-4000-8000-000000000004
        type: order.partially_shipped
        created: '2026-10-02T10:00:00.090Z'
        occurred_at: '2026-10-02T10:00:00.000Z'
        sequence: 1048713
        source: seller_cabinet
        resource:
          type: order
          id: 6d1f3a5b-7c9e-4b2d-8f0a-1c3e5a7b9d2f
          url: /v1/orders/6d1f3a5b-7c9e-4b2d-8f0a-1c3e5a7b9d2f
        data:
          object:
            object: order
            id: 6d1f3a5b-7c9e-4b2d-8f0a-1c3e5a7b9d2f
            number: TL-2026-00001234
            status: confirmed
            fulfillment_status: partially_shipped
            updated_at: '2026-10-02T10:00:00.000Z'
            items:
              - id: 2b4d6f8a-0c1e-4a3b-9d5f-7e9a1b3c5d7f
                status: shipped
              - id: 3c5e7a9c-1e3a-4c5e-9a1c-3e5a7c9e1a3c
                status: processing
            shipped_item_ids:
              - 2b4d6f8a-0c1e-4a3b-9d5f-7e9a1b3c5d7f
            carrier: СДЭК
            tracking_number: '1234567890'
            tracking_url: https://www.cdek.ru/ru/tracking?order_id=1234567890
          previous_attributes: null
    OrderCancelledWebhook:
      summary: Покупатель отменил заказ
      value:
        object: event
        api_version: '2026-10-01'
        livemode: true
        legal_entity: 1c3e5a7b-9d2f-4b6d-8f1a-3c5e7a9b1d3f
        request:
          id: null
          idempotency_key: null
        id: e1a00001-0000-4000-8000-000000000005
        type: order.cancelled
        created: '2026-10-01T08:40:00.070Z'
        occurred_at: '2026-10-01T08:40:00.000Z'
        sequence: 1048590
        source: buyer
        resource:
          type: order
          id: 6d1f3a5b-7c9e-4b2d-8f0a-1c3e5a7b9d2f
          url: /v1/orders/6d1f3a5b-7c9e-4b2d-8f0a-1c3e5a7b9d2f
        data:
          object:
            object: order
            id: 6d1f3a5b-7c9e-4b2d-8f0a-1c3e5a7b9d2f
            number: TL-2026-00001234
            status: cancelled
            fulfillment_status: cancelled
            updated_at: '2026-10-01T08:40:00.000Z'
            items:
              - id: 2b4d6f8a-0c1e-4a3b-9d5f-7e9a1b3c5d7f
                status: cancelled
              - id: 3c5e7a9c-1e3a-4c5e-9a1c-3e5a7c9e1a3c
                status: cancelled
            cancelled_by: buyer
            reason_code: buyer_request
            partial: false
            cancelled_item_ids:
              - 2b4d6f8a-0c1e-4a3b-9d5f-7e9a1b3c5d7f
              - 3c5e7a9c-1e3a-4c5e-9a1c-3e5a7c9e1a3c
          previous_attributes: null
    OrderItemsCancelledWebhook:
      summary: Продавец отменил одну позицию
      value:
        object: event
        api_version: '2026-10-01'
        livemode: true
        legal_entity: 1c3e5a7b-9d2f-4b6d-8f1a-3c5e7a9b1d3f
        request:
          id: null
          idempotency_key: null
        id: e1a00001-0000-4000-8000-000000000006
        type: order.items_cancelled
        created: '2026-10-01T09:05:00.070Z'
        occurred_at: '2026-10-01T09:05:00.000Z'
        sequence: 1048598
        source: seller_cabinet
        resource:
          type: order
          id: 6d1f3a5b-7c9e-4b2d-8f0a-1c3e5a7b9d2f
          url: /v1/orders/6d1f3a5b-7c9e-4b2d-8f0a-1c3e5a7b9d2f
        data:
          object:
            object: order
            id: 6d1f3a5b-7c9e-4b2d-8f0a-1c3e5a7b9d2f
            number: TL-2026-00001234
            status: paid_pending_release
            fulfillment_status: awaiting_acceptance
            updated_at: '2026-10-01T09:05:00.000Z'
            items:
              - id: 2b4d6f8a-0c1e-4a3b-9d5f-7e9a1b3c5d7f
                status: pending
              - id: 3c5e7a9c-1e3a-4c5e-9a1c-3e5a7c9e1a3c
                status: cancelled
            cancelled_by: seller
            reason_code: seller_request
            partial: true
            cancelled_item_ids:
              - 3c5e7a9c-1e3a-4c5e-9a1c-3e5a7c9e1a3c
          previous_attributes: null
    OrderStatusChangedWebhook:
      summary: Заказ перешёл в подготовку к отгрузке
      value:
        object: event
        api_version: '2026-10-01'
        livemode: true
        legal_entity: 1c3e5a7b-9d2f-4b6d-8f1a-3c5e7a9b1d3f
        request:
          id: null
          idempotency_key: null
        id: e1a00001-0000-4000-8000-000000000007
        type: order.status_changed
        created: '2026-10-01T11:00:00.050Z'
        occurred_at: '2026-10-01T11:00:00.000Z'
        sequence: 1048640
        source: seller_cabinet
        resource:
          type: order
          id: 6d1f3a5b-7c9e-4b2d-8f0a-1c3e5a7b9d2f
          url: /v1/orders/6d1f3a5b-7c9e-4b2d-8f0a-1c3e5a7b9d2f
        data:
          object:
            object: order
            id: 6d1f3a5b-7c9e-4b2d-8f0a-1c3e5a7b9d2f
            number: TL-2026-00001234
            status: preparing
            fulfillment_status: accepted
            updated_at: '2026-10-01T11:00:00.000Z'
            items:
              - id: 2b4d6f8a-0c1e-4a3b-9d5f-7e9a1b3c5d7f
                status: processing
              - id: 3c5e7a9c-1e3a-4c5e-9a1c-3e5a7c9e1a3c
                status: processing
          previous_attributes:
            status: confirmed
    OrderDeliveredWebhook:
      summary: Заказ доставлен покупателю
      value:
        object: event
        api_version: '2026-10-01'
        livemode: true
        legal_entity: 1c3e5a7b-9d2f-4b6d-8f1a-3c5e7a9b1d3f
        request:
          id: null
          idempotency_key: null
        id: e1a00001-0000-4000-8000-000000000008
        type: order.delivered
        created: '2026-10-04T15:20:00.110Z'
        occurred_at: '2026-10-04T15:20:00.000Z'
        sequence: 1049104
        source: system
        resource:
          type: order
          id: 6d1f3a5b-7c9e-4b2d-8f0a-1c3e5a7b9d2f
          url: /v1/orders/6d1f3a5b-7c9e-4b2d-8f0a-1c3e5a7b9d2f
        data:
          object:
            object: order
            id: 6d1f3a5b-7c9e-4b2d-8f0a-1c3e5a7b9d2f
            number: TL-2026-00001234
            status: delivered
            fulfillment_status: delivered
            updated_at: '2026-10-04T15:20:00.000Z'
            items:
              - id: 2b4d6f8a-0c1e-4a3b-9d5f-7e9a1b3c5d7f
                status: delivered
              - id: 3c5e7a9c-1e3a-4c5e-9a1c-3e5a7c9e1a3c
                status: delivered
          previous_attributes: null
    OrderRefundedWebhook:
      summary: Покупателю вернули деньги за позицию
      value:
        object: event
        api_version: '2026-10-01'
        livemode: true
        legal_entity: 1c3e5a7b-9d2f-4b6d-8f1a-3c5e7a9b1d3f
        request:
          id: null
          idempotency_key: null
        id: e1a00001-0000-4000-8000-000000000009
        type: order.refunded
        created: '2026-10-09T12:00:00.100Z'
        occurred_at: '2026-10-09T12:00:00.000Z'
        sequence: 1049380
        source: platform
        resource:
          type: order
          id: 6d1f3a5b-7c9e-4b2d-8f0a-1c3e5a7b9d2f
          url: /v1/orders/6d1f3a5b-7c9e-4b2d-8f0a-1c3e5a7b9d2f
        data:
          object:
            object: order
            id: 6d1f3a5b-7c9e-4b2d-8f0a-1c3e5a7b9d2f
            number: TL-2026-00001234
            status: delivered
            fulfillment_status: delivered
            updated_at: '2026-10-09T12:00:00.000Z'
            items:
              - id: 2b4d6f8a-0c1e-4a3b-9d5f-7e9a1b3c5d7f
                status: delivered
              - id: 3c5e7a9c-1e3a-4c5e-9a1c-3e5a7c9e1a3c
                status: delivered
            refund:
              id: 7a9c1e3a-5c7e-4a9c-8e3a-5c7e9a1c3e5a
              amount: 79000
              currency: RUB
          previous_attributes: null
    OrderRefundedByDecisionWebhook:
      summary: Возврат по решению Тилуны после спора — без идентификатора и суммы
      value:
        object: event
        api_version: '2026-10-01'
        livemode: true
        legal_entity: 1c3e5a7b-9d2f-4b6d-8f1a-3c5e7a9b1d3f
        request:
          id: null
          idempotency_key: null
        id: e1a00001-0000-4000-8000-000000000037
        type: order.refunded
        created: '2026-10-12T15:00:00.100Z'
        occurred_at: '2026-10-12T15:00:00.000Z'
        sequence: 1049720
        source: platform
        resource:
          type: order
          id: 6d1f3a5b-7c9e-4b2d-8f0a-1c3e5a7b9d2f
          url: /v1/orders/6d1f3a5b-7c9e-4b2d-8f0a-1c3e5a7b9d2f
        data:
          object:
            object: order
            id: 6d1f3a5b-7c9e-4b2d-8f0a-1c3e5a7b9d2f
            number: TL-2026-00001234
            status: refunded
            fulfillment_status: refunded
            updated_at: '2026-10-12T15:00:00.000Z'
            items:
              - id: 2b4d6f8a-0c1e-4a3b-9d5f-7e9a1b3c5d7f
                status: delivered
              - id: 3c5e7a9c-1e3a-4c5e-9a1c-3e5a7c9e1a3c
                status: delivered
            refund:
              id: null
              amount: null
              currency: RUB
          previous_attributes: null
    ShipmentTrackingUpdatedWebhook:
      summary: Отправление прибыло в пункт выдачи
      value:
        object: event
        api_version: '2026-10-01'
        livemode: true
        legal_entity: 1c3e5a7b-9d2f-4b6d-8f1a-3c5e7a9b1d3f
        request:
          id: null
          idempotency_key: null
        id: e1a00001-0000-4000-8000-000000000010
        type: shipment.tracking_updated
        created: '2026-10-03T18:10:00.060Z'
        occurred_at: '2026-10-03T18:10:00.000Z'
        sequence: 1048980
        source: system
        resource:
          type: order
          id: 6d1f3a5b-7c9e-4b2d-8f0a-1c3e5a7b9d2f
          url: /v1/orders/6d1f3a5b-7c9e-4b2d-8f0a-1c3e5a7b9d2f
        data:
          object:
            object: order
            id: 6d1f3a5b-7c9e-4b2d-8f0a-1c3e5a7b9d2f
            number: TL-2026-00001234
            status: shipped
            fulfillment_status: shipped
            updated_at: '2026-10-03T18:10:00.000Z'
            items:
              - id: 2b4d6f8a-0c1e-4a3b-9d5f-7e9a1b3c5d7f
                status: shipped
              - id: 3c5e7a9c-1e3a-4c5e-9a1c-3e5a7c9e1a3c
                status: shipped
            shipment:
              id: 5b7d9f1b-3d5f-4a7b-9c1e-3f5a7c9e1b3d
              provider: cdek
              status: at_pvz
              tracking_number: '1234567890'
              tracking_url: https://www.cdek.ru/ru/tracking?order_id=1234567890
              estimated_delivery: null
          previous_attributes: null
    ReturnCreatedWebhook:
      summary: Покупатель оформил возврат
      value:
        object: event
        api_version: '2026-10-01'
        livemode: true
        legal_entity: 1c3e5a7b-9d2f-4b6d-8f1a-3c5e7a9b1d3f
        request:
          id: null
          idempotency_key: null
        id: e1a00001-0000-4000-8000-000000000011
        type: return.created
        created: '2026-10-06T09:00:00.090Z'
        occurred_at: '2026-10-06T09:00:00.000Z'
        sequence: 1049201
        source: buyer
        resource:
          type: return
          id: 8e0a2c4e-6a8c-4e1a-b3c5-d7e9f1a3b5c7
          url: /v1/returns/8e0a2c4e-6a8c-4e1a-b3c5-d7e9f1a3b5c7
        data:
          object:
            object: return
            id: 8e0a2c4e-6a8c-4e1a-b3c5-d7e9f1a3b5c7
            order_id: 6d1f3a5b-7c9e-4b2d-8f0a-1c3e5a7b9d2f
            order_number: TL-2026-00001234
            order_item_id: 2b4d6f8a-0c1e-4a3b-9d5f-7e9a1b3c5d7f
            status: pending
            public_status: requested
            kind: defect
            refund_amount: null
            currency: RUB
            return_shipment:
              status: null
              tracking_number: null
              tracking_url: null
            updated_at: '2026-10-06T09:00:00.000Z'
          previous_attributes: null
    ReturnApprovedWebhook:
      summary: Продавец согласился с возвратом
      value:
        object: event
        api_version: '2026-10-01'
        livemode: true
        legal_entity: 1c3e5a7b-9d2f-4b6d-8f1a-3c5e7a9b1d3f
        request:
          id: null
          idempotency_key: null
        id: e1a00001-0000-4000-8000-000000000012
        type: return.approved
        created: '2026-10-06T11:00:00.070Z'
        occurred_at: '2026-10-06T11:00:00.000Z'
        sequence: 1049230
        source: seller_cabinet
        resource:
          type: return
          id: 8e0a2c4e-6a8c-4e1a-b3c5-d7e9f1a3b5c7
          url: /v1/returns/8e0a2c4e-6a8c-4e1a-b3c5-d7e9f1a3b5c7
        data:
          object:
            object: return
            id: 8e0a2c4e-6a8c-4e1a-b3c5-d7e9f1a3b5c7
            order_id: 6d1f3a5b-7c9e-4b2d-8f0a-1c3e5a7b9d2f
            order_number: TL-2026-00001234
            order_item_id: 2b4d6f8a-0c1e-4a3b-9d5f-7e9a1b3c5d7f
            status: seller_approved
            public_status: approved
            kind: defect
            refund_amount: null
            currency: RUB
            return_shipment:
              status: null
              tracking_number: null
              tracking_url: null
            updated_at: '2026-10-06T11:00:00.000Z'
          previous_attributes: null
    ReturnRejectedWebhook:
      summary: Продавец возразил по заявке
      value:
        object: event
        api_version: '2026-10-01'
        livemode: true
        legal_entity: 1c3e5a7b-9d2f-4b6d-8f1a-3c5e7a9b1d3f
        request:
          id: V1StGXR8_Z5k
          idempotency_key: reject-8e0a2c4e
        id: e1a00001-0000-4000-8000-000000000013
        type: return.rejected
        created: '2026-10-06T11:00:00.070Z'
        occurred_at: '2026-10-06T11:00:00.000Z'
        sequence: 1049231
        source: seller_api
        resource:
          type: return
          id: 8e0a2c4e-6a8c-4e1a-b3c5-d7e9f1a3b5c7
          url: /v1/returns/8e0a2c4e-6a8c-4e1a-b3c5-d7e9f1a3b5c7
        data:
          object:
            object: return
            id: 8e0a2c4e-6a8c-4e1a-b3c5-d7e9f1a3b5c7
            order_id: 6d1f3a5b-7c9e-4b2d-8f0a-1c3e5a7b9d2f
            order_number: TL-2026-00001234
            order_item_id: 2b4d6f8a-0c1e-4a3b-9d5f-7e9a1b3c5d7f
            status: seller_rejected
            public_status: rejected
            kind: defect
            refund_amount: null
            currency: RUB
            return_shipment:
              status: null
              tracking_number: null
              tracking_url: null
            updated_at: '2026-10-06T11:00:00.000Z'
          previous_attributes: null
    ReturnEscalatedWebhook:
      summary: Покупатель передал спор на рассмотрение Тилуны
      value:
        object: event
        api_version: '2026-10-01'
        livemode: true
        legal_entity: 1c3e5a7b-9d2f-4b6d-8f1a-3c5e7a9b1d3f
        request:
          id: null
          idempotency_key: null
        id: e1a00001-0000-4000-8000-000000000014
        type: return.escalated
        created: '2026-10-07T08:30:00.070Z'
        occurred_at: '2026-10-07T08:30:00.000Z'
        sequence: 1049260
        source: buyer
        resource:
          type: return
          id: 8e0a2c4e-6a8c-4e1a-b3c5-d7e9f1a3b5c7
          url: /v1/returns/8e0a2c4e-6a8c-4e1a-b3c5-d7e9f1a3b5c7
        data:
          object:
            object: return
            id: 8e0a2c4e-6a8c-4e1a-b3c5-d7e9f1a3b5c7
            order_id: 6d1f3a5b-7c9e-4b2d-8f0a-1c3e5a7b9d2f
            order_number: TL-2026-00001234
            order_item_id: 2b4d6f8a-0c1e-4a3b-9d5f-7e9a1b3c5d7f
            status: admin_review
            public_status: in_review
            kind: defect
            refund_amount: null
            currency: RUB
            return_shipment:
              status: null
              tracking_number: null
              tracking_url: null
            updated_at: '2026-10-07T08:30:00.000Z'
            escalated_by: buyer
          previous_attributes: null
    ReturnShipmentUpdatedWebhook:
      summary: Покупатель отправил товар обратно
      value:
        object: event
        api_version: '2026-10-01'
        livemode: true
        legal_entity: 1c3e5a7b-9d2f-4b6d-8f1a-3c5e7a9b1d3f
        request:
          id: null
          idempotency_key: null
        id: e1a00001-0000-4000-8000-000000000015
        type: return.shipment_updated
        created: '2026-10-07T14:00:00.070Z'
        occurred_at: '2026-10-07T14:00:00.000Z'
        sequence: 1049275
        source: buyer
        resource:
          type: return
          id: 8e0a2c4e-6a8c-4e1a-b3c5-d7e9f1a3b5c7
          url: /v1/returns/8e0a2c4e-6a8c-4e1a-b3c5-d7e9f1a3b5c7
        data:
          object:
            object: return
            id: 8e0a2c4e-6a8c-4e1a-b3c5-d7e9f1a3b5c7
            order_id: 6d1f3a5b-7c9e-4b2d-8f0a-1c3e5a7b9d2f
            order_number: TL-2026-00001234
            order_item_id: 2b4d6f8a-0c1e-4a3b-9d5f-7e9a1b3c5d7f
            status: seller_approved
            public_status: approved
            kind: defect
            refund_amount: null
            currency: RUB
            return_shipment:
              status: in_transit
              tracking_number: '9876543210'
              tracking_url: https://www.cdek.ru/ru/tracking?order_id=9876543210
            updated_at: '2026-10-07T14:00:00.000Z'
          previous_attributes: null
    ReturnRefundedWebhook:
      summary: Деньги по возврату отправлены покупателю
      value:
        object: event
        api_version: '2026-10-01'
        livemode: true
        legal_entity: 1c3e5a7b-9d2f-4b6d-8f1a-3c5e7a9b1d3f
        request:
          id: null
          idempotency_key: null
        id: e1a00001-0000-4000-8000-000000000016
        type: return.refunded
        created: '2026-10-09T12:00:00.100Z'
        occurred_at: '2026-10-09T12:00:00.000Z'
        sequence: 1049381
        source: platform
        resource:
          type: return
          id: 8e0a2c4e-6a8c-4e1a-b3c5-d7e9f1a3b5c7
          url: /v1/returns/8e0a2c4e-6a8c-4e1a-b3c5-d7e9f1a3b5c7
        data:
          object:
            object: return
            id: 8e0a2c4e-6a8c-4e1a-b3c5-d7e9f1a3b5c7
            order_id: 6d1f3a5b-7c9e-4b2d-8f0a-1c3e5a7b9d2f
            order_number: TL-2026-00001234
            order_item_id: 2b4d6f8a-0c1e-4a3b-9d5f-7e9a1b3c5d7f
            status: refunded
            public_status: refunded
            kind: defect
            refund_amount: 79000
            currency: RUB
            return_shipment:
              status: null
              tracking_number: null
              tracking_url: null
            updated_at: '2026-10-09T12:00:00.000Z'
          previous_attributes: null
    ReturnResolvedWebhook:
      summary: Тилуна решила спор в пользу покупателя
      value:
        object: event
        api_version: '2026-10-01'
        livemode: true
        legal_entity: 1c3e5a7b-9d2f-4b6d-8f1a-3c5e7a9b1d3f
        request:
          id: null
          idempotency_key: null
        id: e1a00001-0000-4000-8000-000000000017
        type: return.resolved
        created: '2026-10-08T10:00:00.080Z'
        occurred_at: '2026-10-08T10:00:00.000Z'
        sequence: 1049330
        source: platform
        resource:
          type: return
          id: 8e0a2c4e-6a8c-4e1a-b3c5-d7e9f1a3b5c7
          url: /v1/returns/8e0a2c4e-6a8c-4e1a-b3c5-d7e9f1a3b5c7
        data:
          object:
            object: return
            id: 8e0a2c4e-6a8c-4e1a-b3c5-d7e9f1a3b5c7
            order_id: 6d1f3a5b-7c9e-4b2d-8f0a-1c3e5a7b9d2f
            order_number: TL-2026-00001234
            order_item_id: 2b4d6f8a-0c1e-4a3b-9d5f-7e9a1b3c5d7f
            status: refund_processing
            public_status: refund_processing
            kind: defect
            refund_amount: null
            currency: RUB
            return_shipment:
              status: null
              tracking_number: null
              tracking_url: null
            updated_at: '2026-10-08T10:00:00.000Z'
            resolution: buyer
          previous_attributes: null
    ProductCreatedWebhook:
      summary: Товар создан через API
      value:
        object: event
        api_version: '2026-10-01'
        livemode: true
        legal_entity: 1c3e5a7b-9d2f-4b6d-8f1a-3c5e7a9b1d3f
        request:
          id: V1StGXR8_Z5m
          idempotency_key: create-000012388
        id: e1a00001-0000-4000-8000-000000000018
        type: product.created
        created: '2026-10-01T08:00:00.060Z'
        occurred_at: '2026-10-01T08:00:00.000Z'
        sequence: 1048500
        source: seller_api
        resource:
          type: product
          id: 7c2e4a6c-8e0a-4c2e-9a4c-6e8a0c2e4a6c
          url: /v1/products/7c2e4a6c-8e0a-4c2e-9a4c-6e8a0c2e4a6c
        data:
          object:
            object: product
            id: 7c2e4a6c-8e0a-4c2e-9a4c-6e8a0c2e4a6c
            external_id: '000012388'
            product_code: '100517'
            seller_sku: TSH-BASIC-WHT
            status: draft
            updated_at: '2026-10-01T08:00:00.000Z'
          previous_attributes: null
    ProductUpdatedBatchWebhook:
      summary: Пачка товаров изменена импортом
      value:
        object: event
        api_version: '2026-10-01'
        livemode: true
        legal_entity: 1c3e5a7b-9d2f-4b6d-8f1a-3c5e7a9b1d3f
        request:
          id: null
          idempotency_key: null
        id: e1a00001-0000-4000-8000-000000000019
        type: product.updated
        created: '2026-10-02T07:30:00.200Z'
        occurred_at: '2026-10-02T07:30:00.000Z'
        sequence: 1048650
        source: seller_cabinet
        resource:
          type: product
          id: null
          url: null
        data:
          object:
            object: product_batch
            count: 2
            products:
              - object: product
                id: 3f6b1c2a-8d4e-4f7a-9b21-5c0e7d9a1b34
                product_code: '100482'
                seller_sku: MUG-350-BLUE
                status: active
                moderation_status: approved
                updated_at: '2026-09-20T14:30:00.000Z'
              - object: product
                id: 7c2e4a6c-8e0a-4c2e-9a4c-6e8a0c2e4a6c
                product_code: '100517'
                seller_sku: TSH-BASIC-WHT
                status: pending
                moderation_status: pending
                updated_at: '2026-10-02T07:30:00.000Z'
          previous_attributes: null
    ProductArchivedWebhook:
      summary: Товар перенесён в архив в кабинете
      value:
        object: event
        api_version: '2026-10-01'
        livemode: true
        legal_entity: 1c3e5a7b-9d2f-4b6d-8f1a-3c5e7a9b1d3f
        request:
          id: null
          idempotency_key: null
        id: e1a00001-0000-4000-8000-000000000020
        type: product.archived
        created: '2026-10-02T12:00:00.060Z'
        occurred_at: '2026-10-02T12:00:00.000Z'
        sequence: 1048760
        source: seller_cabinet
        resource:
          type: product
          id: 3f6b1c2a-8d4e-4f7a-9b21-5c0e7d9a1b34
          url: /v1/products/3f6b1c2a-8d4e-4f7a-9b21-5c0e7d9a1b34
        data:
          object:
            object: product
            id: 3f6b1c2a-8d4e-4f7a-9b21-5c0e7d9a1b34
            product_code: '100482'
            seller_sku: MUG-350-BLUE
            status: archived
            moderation_status: approved
            updated_at: '2026-10-02T12:00:00.000Z'
          previous_attributes: null
    ProductModerationApprovedWebhook:
      summary: Товар прошёл модерацию
      value:
        object: event
        api_version: '2026-10-01'
        livemode: true
        legal_entity: 1c3e5a7b-9d2f-4b6d-8f1a-3c5e7a9b1d3f
        request:
          id: null
          idempotency_key: null
        id: e1a00001-0000-4000-8000-000000000021
        type: product.moderation.approved
        created: '2026-10-01T13:00:00.060Z'
        occurred_at: '2026-10-01T13:00:00.000Z'
        sequence: 1048660
        source: platform
        resource:
          type: product
          id: 7c2e4a6c-8e0a-4c2e-9a4c-6e8a0c2e4a6c
          url: /v1/products/7c2e4a6c-8e0a-4c2e-9a4c-6e8a0c2e4a6c
        data:
          object:
            object: product
            id: 7c2e4a6c-8e0a-4c2e-9a4c-6e8a0c2e4a6c
            product_code: '100517'
            seller_sku: TSH-BASIC-WHT
            status: active
            moderation_status: approved
            updated_at: '2026-10-01T13:00:00.000Z'
            moderation:
              decision: approved
              reason: null
          previous_attributes: null
    ProductModerationRejectedWebhook:
      summary: Товар отклонён модерацией
      value:
        object: event
        api_version: '2026-10-01'
        livemode: true
        legal_entity: 1c3e5a7b-9d2f-4b6d-8f1a-3c5e7a9b1d3f
        request:
          id: null
          idempotency_key: null
        id: e1a00001-0000-4000-8000-000000000022
        type: product.moderation.rejected
        created: '2026-10-01T13:00:00.060Z'
        occurred_at: '2026-10-01T13:00:00.000Z'
        sequence: 1048661
        source: platform
        resource:
          type: product
          id: 7c2e4a6c-8e0a-4c2e-9a4c-6e8a0c2e4a6c
          url: /v1/products/7c2e4a6c-8e0a-4c2e-9a4c-6e8a0c2e4a6c
        data:
          object:
            object: product
            id: 7c2e4a6c-8e0a-4c2e-9a4c-6e8a0c2e4a6c
            product_code: '100517'
            seller_sku: TSH-BASIC-WHT
            status: rejected
            moderation_status: rejected
            updated_at: '2026-10-01T13:00:00.000Z'
            moderation:
              decision: rejected
              reason: На главном фото товар не виден целиком.
          previous_attributes: null
    ProductModerationRevisionRequestedWebhook:
      summary: Модерация просит доработать карточку
      value:
        object: event
        api_version: '2026-10-01'
        livemode: true
        legal_entity: 1c3e5a7b-9d2f-4b6d-8f1a-3c5e7a9b1d3f
        request:
          id: null
          idempotency_key: null
        id: e1a00001-0000-4000-8000-000000000023
        type: product.moderation.revision_requested
        created: '2026-10-01T13:00:00.060Z'
        occurred_at: '2026-10-01T13:00:00.000Z'
        sequence: 1048662
        source: platform
        resource:
          type: product
          id: 7c2e4a6c-8e0a-4c2e-9a4c-6e8a0c2e4a6c
          url: /v1/products/7c2e4a6c-8e0a-4c2e-9a4c-6e8a0c2e4a6c
        data:
          object:
            object: product
            id: 7c2e4a6c-8e0a-4c2e-9a4c-6e8a0c2e4a6c
            product_code: '100517'
            seller_sku: TSH-BASIC-WHT
            status: draft
            moderation_status: draft
            updated_at: '2026-10-01T13:00:00.000Z'
            moderation:
              decision: revision_requested
              reason: Укажите состав ткани в характеристиках.
          previous_attributes: null
    InventoryUpdatedWebhook:
      summary: Остатки списаны оплатой заказа
      value:
        object: event
        api_version: '2026-10-01'
        livemode: true
        legal_entity: 1c3e5a7b-9d2f-4b6d-8f1a-3c5e7a9b1d3f
        request:
          id: null
          idempotency_key: null
        id: e1a00001-0000-4000-8000-000000000024
        type: inventory.updated
        created: '2026-10-01T08:02:00.150Z'
        occurred_at: '2026-10-01T08:02:00.000Z'
        sequence: 1048577
        source: buyer
        resource:
          type: inventory
          id: null
          url: null
        data:
          object:
            object: inventory
            count: 2
            order_id: 6d1f3a5b-7c9e-4b2d-8f0a-1c3e5a7b9d2f
            lines:
              - product_id: 3f6b1c2a-8d4e-4f7a-9b21-5c0e7d9a1b34
                variant_id: null
                stock: 22
              - product_id: 7c2e4a6c-8e0a-4c2e-9a4c-6e8a0c2e4a6c
                variant_id: 4d6f8a0c-2e4a-4c6e-8a0c-2e4a6c8e0a2c
                stock: 14
                stock_mode: own
          previous_attributes: null
    InventoryUpdatedByApiWebhook:
      summary: Остатки изменены запросом POST /inventory/batch
      value:
        object: event
        api_version: '2026-10-01'
        livemode: true
        legal_entity: 1c3e5a7b-9d2f-4b6d-8f1a-3c5e7a9b1d3f
        request:
          id: V1StGXR8_Z5n
          idempotency_key: stock-sync-2026-10-02T10:15
        id: e1a00001-0000-4000-8000-000000000025
        type: inventory.updated
        created: '2026-10-02T10:15:00.090Z'
        occurred_at: '2026-10-02T10:15:00.000Z'
        sequence: 1048720
        source: seller_api
        resource:
          type: inventory
          id: null
          url: null
        data:
          object:
            object: inventory_update
            rows:
              - product_id: 3f6b1c2a-8d4e-4f7a-9b21-5c0e7d9a1b34
                variant_id: null
                external_id: '000012345'
                seller_sku: MUG-350-BLUE
                quantity: 30
                updated_at: '2026-10-02T10:15:00.000Z'
          previous_attributes: null
    PriceUpdatedWebhook:
      summary: Цены изменены в кабинете
      value:
        object: event
        api_version: '2026-10-01'
        livemode: true
        legal_entity: 1c3e5a7b-9d2f-4b6d-8f1a-3c5e7a9b1d3f
        request:
          id: null
          idempotency_key: null
        id: e1a00001-0000-4000-8000-000000000026
        type: price.updated
        created: '2026-10-02T09:00:00.090Z'
        occurred_at: '2026-10-02T09:00:00.000Z'
        sequence: 1048700
        source: seller_cabinet
        resource:
          type: price
          id: null
          url: null
        data:
          object:
            object: price
            count: 1
            currency: RUB
            lines:
              - product_id: 3f6b1c2a-8d4e-4f7a-9b21-5c0e7d9a1b34
                variant_id: null
                base_price: 95000
                sale_price: 85000
          previous_attributes: null
    PriceUpdatedByApiWebhook:
      summary: Цены изменены запросом POST /prices/batch
      value:
        object: event
        api_version: '2026-10-01'
        livemode: true
        legal_entity: 1c3e5a7b-9d2f-4b6d-8f1a-3c5e7a9b1d3f
        request:
          id: V1StGXR8_Z5p
          idempotency_key: price-sync-2026-10-02T10:15
        id: e1a00001-0000-4000-8000-000000000027
        type: price.updated
        created: '2026-10-02T10:15:00.090Z'
        occurred_at: '2026-10-02T10:15:00.000Z'
        sequence: 1048721
        source: seller_api
        resource:
          type: price
          id: null
          url: null
        data:
          object:
            object: price_update
            rows:
              - product_id: 3f6b1c2a-8d4e-4f7a-9b21-5c0e7d9a1b34
                variant_id: null
                external_id: '000012345'
                seller_sku: MUG-350-BLUE
                base_price: 95000
                sale_price: null
                compare_at_price: null
                price_override: null
                currency: RUB
                updated_at: '2026-10-02T10:15:00.000Z'
          previous_attributes: null
    ReviewCreatedWebhook:
      summary: Опубликован отзыв о товаре
      value:
        object: event
        api_version: '2026-10-01'
        livemode: true
        legal_entity: 1c3e5a7b-9d2f-4b6d-8f1a-3c5e7a9b1d3f
        request:
          id: null
          idempotency_key: null
        id: e1a00001-0000-4000-8000-000000000028
        type: review.created
        created: '2026-10-05T12:00:00.090Z'
        occurred_at: '2026-10-05T12:00:00.000Z'
        sequence: 1049150
        source: platform
        resource:
          type: review
          id: 1a3c5e7a-9b1d-4f3b-8c5d-7e9f1b3d5f7a
          url: null
        data:
          object:
            object: review
            id: 1a3c5e7a-9b1d-4f3b-8c5d-7e9f1b3d5f7a
            product_id: 3f6b1c2a-8d4e-4f7a-9b21-5c0e7d9a1b34
            rating: 5
            status: approved
            replied: false
            replied_at: null
            created_at: '2026-10-05T12:00:00.000Z'
            updated_at: '2026-10-05T12:00:00.000Z'
          previous_attributes: null
    ReviewRepliedWebhook:
      summary: Продавец ответил на отзыв в кабинете
      value:
        object: event
        api_version: '2026-10-01'
        livemode: true
        legal_entity: 1c3e5a7b-9d2f-4b6d-8f1a-3c5e7a9b1d3f
        request:
          id: null
          idempotency_key: null
        id: e1a00001-0000-4000-8000-000000000029
        type: review.replied
        created: '2026-10-06T08:30:00.090Z'
        occurred_at: '2026-10-06T08:30:00.000Z'
        sequence: 1049215
        source: seller_cabinet
        resource:
          type: review
          id: 1a3c5e7a-9b1d-4f3b-8c5d-7e9f1b3d5f7a
          url: null
        data:
          object:
            object: review
            id: 1a3c5e7a-9b1d-4f3b-8c5d-7e9f1b3d5f7a
            product_id: 3f6b1c2a-8d4e-4f7a-9b21-5c0e7d9a1b34
            rating: 5
            status: approved
            replied: true
            replied_at: '2026-10-06T08:30:00.000Z'
            created_at: '2026-10-05T12:00:00.000Z'
            updated_at: '2026-10-06T08:30:00.000Z'
          previous_attributes: null
    PayoutCreatedWebhook:
      summary: Создана выплата за период
      value:
        object: event
        api_version: '2026-10-01'
        livemode: true
        legal_entity: 1c3e5a7b-9d2f-4b6d-8f1a-3c5e7a9b1d3f
        request:
          id: null
          idempotency_key: null
        id: e1a00001-0000-4000-8000-000000000030
        type: payout.created
        created: '2026-10-06T07:00:00.090Z'
        occurred_at: '2026-10-06T07:00:00.000Z'
        sequence: 1049190
        source: platform
        resource:
          type: payout
          id: 9c1e3a5c-7e9a-4c1e-a3c5-e7a9c1e3a5c7
          url: /v1/payouts/9c1e3a5c-7e9a-4c1e-a3c5-e7a9c1e3a5c7
        data:
          object:
            object: payout
            id: 9c1e3a5c-7e9a-4c1e-a3c5-e7a9c1e3a5c7
            status: created
            amount: 1398300
            currency: RUB
            document_number: null
            paid_at: null
            failure_reason: null
            created_at: '2026-10-06T07:00:00.000Z'
            updated_at: '2026-10-06T07:00:00.000Z'
          previous_attributes: null
    PayoutPaidWebhook:
      summary: Банк подтвердил выплату
      value:
        object: event
        api_version: '2026-10-01'
        livemode: true
        legal_entity: 1c3e5a7b-9d2f-4b6d-8f1a-3c5e7a9b1d3f
        request:
          id: null
          idempotency_key: null
        id: e1a00001-0000-4000-8000-000000000031
        type: payout.paid
        created: '2026-10-08T10:30:00.090Z'
        occurred_at: '2026-10-08T10:30:00.000Z'
        sequence: 1049320
        source: platform
        resource:
          type: payout
          id: 9c1e3a5c-7e9a-4c1e-a3c5-e7a9c1e3a5c7
          url: /v1/payouts/9c1e3a5c-7e9a-4c1e-a3c5-e7a9c1e3a5c7
        data:
          object:
            object: payout
            id: 9c1e3a5c-7e9a-4c1e-a3c5-e7a9c1e3a5c7
            status: paid
            amount: 1398300
            currency: RUB
            document_number: '4512'
            paid_at: '2026-10-08T10:30:00.000Z'
            failure_reason: null
            created_at: '2026-10-06T07:00:00.000Z'
            updated_at: '2026-10-08T10:30:00.000Z'
          previous_attributes: null
    PayoutFailedWebhook:
      summary: Банк вернул выплату
      value:
        object: event
        api_version: '2026-10-01'
        livemode: true
        legal_entity: 1c3e5a7b-9d2f-4b6d-8f1a-3c5e7a9b1d3f
        request:
          id: null
          idempotency_key: null
        id: e1a00001-0000-4000-8000-000000000032
        type: payout.failed
        created: '2026-10-09T09:00:00.090Z'
        occurred_at: '2026-10-09T09:00:00.000Z'
        sequence: 1049360
        source: platform
        resource:
          type: payout
          id: 9c1e3a5c-7e9a-4c1e-a3c5-e7a9c1e3a5c7
          url: /v1/payouts/9c1e3a5c-7e9a-4c1e-a3c5-e7a9c1e3a5c7
        data:
          object:
            object: payout
            id: 9c1e3a5c-7e9a-4c1e-a3c5-e7a9c1e3a5c7
            status: failed
            amount: 1398300
            currency: RUB
            document_number: null
            paid_at: null
            failure_reason: returned
            created_at: '2026-10-06T07:00:00.000Z'
            updated_at: '2026-10-09T09:00:00.000Z'
          previous_attributes: null
    AgentReportReadyWebhook:
      summary: Отчёт агента за сентябрь в кабинете
      value:
        object: event
        api_version: '2026-10-01'
        livemode: true
        legal_entity: 1c3e5a7b-9d2f-4b6d-8f1a-3c5e7a9b1d3f
        request:
          id: null
          idempotency_key: null
        id: e1a00001-0000-4000-8000-000000000033
        type: agent_report.ready
        created: '2026-10-05T06:00:00.090Z'
        occurred_at: '2026-10-05T06:00:00.000Z'
        sequence: 1049100
        source: platform
        resource:
          type: agent_report
          id: 0d2f4b6d-8f0b-4d2f-b6d8-f0b2d4f6b8d0
          url: /v1/agent_reports/0d2f4b6d-8f0b-4d2f-b6d8-f0b2d4f6b8d0
        data:
          object:
            object: agent_report
            id: 0d2f4b6d-8f0b-4d2f-b6d8-f0b2d4f6b8d0
            number: АГ-202609-8B0D2F4B6D8F4B0DA2F46B8D0F2B4D6F-1C3E5A7B9D2F4B6D8F1A3C5E7A9B1D3F
            period_start: '2026-09-01'
            period_end: '2026-09-30'
            accept_deadline_at: '2026-10-15T20:59:59.000Z'
            status: issued
          previous_attributes: null
    ReportReadyWebhook:
      summary: Отчёт готов к скачиванию
      value:
        object: event
        api_version: '2026-10-01'
        livemode: true
        legal_entity: 1c3e5a7b-9d2f-4b6d-8f1a-3c5e7a9b1d3f
        request:
          id: null
          idempotency_key: null
        id: e1a00001-0000-4000-8000-000000000034
        type: report.ready
        created: '2026-10-06T08:00:41.090Z'
        occurred_at: '2026-10-06T08:00:41.000Z'
        sequence: 1049205
        source: system
        resource:
          type: report
          id: 2e4a6c8e-0a2c-4e6a-8c0e-2a4c6e8a0c2e
          url: /v1/reports/2e4a6c8e-0a2c-4e6a-8c0e-2a4c6e8a0c2e
        data:
          object:
            object: report
            id: 2e4a6c8e-0a2c-4e6a-8c0e-2a4c6e8a0c2e
            type: agent_sales
            status: succeeded
            preliminary: false
            period_from: '2026-09-01'
            period_to: '2026-09-30'
            completed_at: '2026-10-06T08:00:41.000Z'
            expires_at: '2026-10-13T08:00:41.000Z'
          previous_attributes: null
    PingWebhook:
      summary: Проверка адреса из кабинета
      value:
        object: event
        api_version: '2026-10-01'
        livemode: true
        legal_entity: null
        request:
          id: null
          idempotency_key: null
        id: e1a00001-0000-4000-8000-000000000035
        type: ping
        created: '2026-10-01T09:00:00.000Z'
        occurred_at: '2026-10-01T09:00:00.000Z'
        sequence: 0
        source: platform
        resource:
          type: ping
          id: null
          url: null
        data:
          object:
            object: ping
            message: Тестовое событие Тилуны. Ответьте статусом 2xx — интеграция настроена.
          previous_attributes: null
