openapi: 3.0.1
info:
  title: 'Nominal Accounts Overview (beneficiary-executor)'
  description: |
    ### Сервис предназначен для управления сделками (смарт-контрактами) при расчетах через номинальный счет с множеством бенефициаров по схеме "Бенефициар-исполнитель".
    
    **Рекомендации по использованию API:**
    
    * При использовании методов в параметре **scope** ссылки авторизации пользователя должен быть указан сервис **nominal_accounts** для получения доступа к конкретному ресурсу
    * Действия, касающиеся одного и того же бенефициара - создание сделки (смарт-контракта), исполнение сделки (смарт-контракта) прерывание сделки (смарт-контракта) и вывод средств - выполняются на стороне Банка последовательно (под блокировкой). Рекомендуется со стороны площадки также отправлять запросы по одному бенефициару последовательно, дожидаясь ответа по предыдущему запросу. Неисполнение данной рекомендации может привести к ошибке с кодом 429 "Too many requests" и необходимости повторной отправки запроса
    * Бенефициар, в отношении которого выполняются операции по удалению, изменению информации, выводу средств, созданию сделки (смарт-контракта), исполнению сделки (смарт-контракта) или прерывание сделки (смарт-контракта), должен быть активным
    * В случае получения ответа с кодом 500 "SOWA Internal Error" необходимо переподписать content и повторить отправку запроса

    [Подробнее о сделках (смарт-контрактах)](/ru/sber-api/scenarios/transfers/nominal-accounts/overview)

    [Инструкция по получению токена в интерфейсе СББОЛ](/ru/sber-api/start/connect#poluchit-access-token)
    
    ### API URLs
    
    * Тестовый контур - https://iftfintech.testsbi.sberbank.ru:9443
    * Промышленный контур - https://fintech.sberbank.ru:9443
    
    [Правила получения доступа к API](/ru/sber-api/specifications/overview)
    
    [Скачать JSON-схемы](https://cdn-app.sberdevices.ru/misc/0.0.0/assets/bsm-docs/849aa7c0_nominal_accounts_overview_(beneficiary-executor).1.0.0.schemas.zip)

    [Таблица ошибок](/ru/sber-api/scenarios/transfers/nominal-accounts/table-errors)
  version: 1.0.0
servers:
  - url: https://iftfintech.testsbi.sberbank.ru:9443/fintech/api/v1/secure-deals
    description: Тестовый контур
  - url: https://fintech.sberbank.ru:9443/v1/secure-deals
    description: Промышленный контур
paths:
  '/signup':
    post:
      operationId: signup
      tags:
        - 'Активация API'
      summary: 'Активировать API'
      description: 'Разовый запрос, выполняемый для сопоставления clientId SberAPI с номинальным счетом<br></br>Чтобы использовать метод, в параметре **scope** ссылки авторизации пользователя должен быть указан сервис **nominal_accounts** для получения доступа к этому ресурсу'
      parameters:
        - $ref: '#/components/parameters/RqUID'
        - $ref: '#/components/parameters/Authorization'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - content
                - signature
              properties:
                content:
                  type: object
                  required:
                    - data
                    - agreement
                  properties:
                    data:
                      type: object
                      required:
                        - nominalAccountNumber
                      properties:
                        nominalAccountNumber:
                          $ref: '#/components/schemas/nominalAccountNumber'
                      additionalProperties: false
                      description: 'Данные'
                    agreement:
                      $ref: '#/components/schemas/agreement'
                  additionalProperties: false
                  description: 'Подписываемый payload'
                signature:
                  $ref: '#/components/schemas/signature'
              additionalProperties: false
              description: 'Запрос онбординга системы партнера, содержащий номер номинального счета'
        required: true  
      responses:
        '201':
          content:
            application/json:
              schema:
                type: object
                properties:
                  nominalAccountId:
                    $ref: '#/components/schemas/id'
                additionalProperties: false
                description: 'успешный ответ'
          description: Created
        '400':
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/error'
                  - $ref: '#/components/schemas/errorSberBusinessAPIBadRequest'
          headers:
            X-Request-Id:
                $ref: '#/components/headers/XRequestId'
          description: Bad Request
        '401':
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/error'
                  - $ref: '#/components/schemas/errorSberBusinessAPIUnauthorized'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId' 
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/error'
                  - $ref: '#/components/schemas/errorSberBusinessAPIForbidden'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId' 
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
          description: Not Found
        '405':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
          description: Method Not Allowed
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
          description: Conflict
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorSberBusinessAPIUnprocessableEntity'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'       
          description: Unprocessable Entity  
        '429':
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/error'
                  - $ref: '#/components/schemas/errorSberBusinessAPITooManyRequests'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'      
          description: Too Many Requests
        '500':
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/error'
                  - $ref: '#/components/schemas/errorSberBusinessAPIInternalServerError'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'      
          description: Internal Server Error
        '502':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorSberBusinessAPIBadGateway'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId' 
          description: Bad Gateway
        '503':
          description: Service Unavailable
        '504':
          description: Gateway Timeout

  '/beneficiaries':
    post:
      operationId: addBeneficiarylite
      tags:
        - Методы работы с бенефициарами
      summary: 'Создать бенефициара'
      description: 'Запрос отправляет анкету бенефициара для добавления в реестр бенефициаров номинального счета <br></br>Чтобы использовать метод, в параметре **scope** ссылки авторизации пользователя должен быть указан сервис **nominal_accounts** для получения доступа к этому ресурсу <br></br>В случае открытия клиентом нескольких номинальных счетов заголовок **nominalAccountId** является обязательным к заполнению <br></br> После успешного вызова метода **POST /beneficiaries** бенефициар будет переведен в статус **ACTIVATED** асинхронно. Процесс активации бенефициара занимает в среднем от 5 до 15 минут<br></br>  Значение атрибута **beneficiaryId** в запросе должно быть уникально относительно **beneficiaryId** ранее созданных бенефициаров <br></br>Схема блока **data** должна соответствовать типу бенефициара (**beneficiaryType**) <br></br>БИК банка счета бенефициара в запросе (**account.bankBIC**) должен соответствовать номеру счета бенефициара в запросе (**account.accountNumber**). Подробности правил соответствия по [ссылке](https://normativ.kontur.ru/document?moduleId=1&documentId=24444&ysclid=m3ygncn8z6925372348) <br></br>Значение ИНН бенефициара (**inn**) в запросе должно быть уникально относительно ранее созданных бенефициаров <br></br> Владелец номинального счета не может стать его бенефициаром'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - content
                - signature
              description: Структура тела ответа на запрос создания бенефициара
              properties:
                content:
                  type: object
                  required:
                    - data
                    - agreement
                  properties:
                    data:
                      oneOf:
                        - $ref: '#/components/schemas/beneficiaryIndividualliteNonResident'
                        - $ref: '#/components/schemas/beneficiaryIndividuallite'
                        - $ref: '#/components/schemas/beneficiaryOrglite'
                        - $ref: '#/components/schemas/beneficiaryIndividualEntrepreneurlite'
                    agreement:
                      $ref: '#/components/schemas/agreement'
                  additionalProperties: false
                  description: 'Подписываемый контент'
                signature:
                  $ref: '#/components/schemas/signature'
              additionalProperties: false
        required: true
      parameters:
        - $ref: '#/components/parameters/RqUID'
        - $ref: '#/components/parameters/Authorization'  
        - $ref: '#/components/parameters/nominalAccountId'      
      responses:
        '201':
          content:
            application/json:
              schema:
                type: object
                description: 'ID бенефициара в реестре'
                properties:
                  beneficiaryId:
                    $ref: '#/components/schemas/beneficiaryId'
                additionalProperties: false
          description: Created
        '400':
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/error'
                  - $ref: '#/components/schemas/errorSberBusinessAPIBadRequest'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'        
          description: Bad Request
        '401':
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/error'
                  - $ref: '#/components/schemas/errorSberBusinessAPIUnauthorized'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId' 
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/error'
                  - $ref: '#/components/schemas/errorSberBusinessAPIForbidden'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId' 
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
          description: Not Found
        '405':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
          description: Method Not Allowed
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorSberBusinessAPIUnprocessableEntity'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'      
          description: Unprocessable Entity  
        '429':
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/error'
                  - $ref: '#/components/schemas/errorSberBusinessAPITooManyRequests'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'      
          description: Too Many Requests
        '500':
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/error'
                  - $ref: '#/components/schemas/errorSberBusinessAPIInternalServerError'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'      
          description: Internal Server Error
        '502':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorSberBusinessAPIBadGateway'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId' 
          description: Bad Gateway
        '503':
          description: Service Unavailable
        '504':
          description: Gateway Timeout
    get:
      operationId: getBeneficiariesRegistry
      tags:
        - 'Методы работы с бенефициарами'
      summary: 'Получить реестр бенефициаров номинального счета'
      description: 'В ответ на запрос возвращается список бенефициаров в статусах **ACTIVATED**. Список можно пролистать постранично. Каждая страница может содержать до 40 элементов списка<br></br>Чтобы использовать метод, в параметре **scope** ссылки авторизации пользователя должен быть указан сервис **nominal_accounts** для получения доступа к этому ресурсу<br></br>'
      parameters:
        - $ref: '#/components/parameters/RqUID'
        - $ref: '#/components/parameters/Authorization'  
        - $ref: '#/components/parameters/nominalAccountId'     
        - $ref: '#/components/parameters/pageNumber' 
        - name: pageSize
          in: query
          required: false
          schema:
            type: number
            minimum: 1
            maximum: 40
            default: 40
            description: 'Количество элементов реестра бенефициаров на одной странице'
            example: 40
      responses:
        '200':
          headers:
            page-number:
              schema:
                type: number
                minimum: 0
                #maximum: 10000
              description: 'Порядковый номер страницы реестра бенефициаров'
              example: 0
            page-size:
              schema:
                type: number
                minimum: 1
                maximum: 40
              description: 'Количество элементов реестра бенефициаров на одной странице'
              example: 40
            total-elements:
              schema:
                type: number
                minimum: 0
                #maximum: 10000
              description: 'Общее количество элементов реестра бенефициаров'
              example: 2086
            updated:
              schema:
                type: string
                format: date-time
              description: 'Время обновления списка'
              example: '2022-03-15T23:31:00.999Z'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/beneficiariesRegistryArrayResp'
          description: OK
        '400':
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/error'
                  - $ref: '#/components/schemas/errorSberBusinessAPIBadRequest'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'        
          description: Bad Request
        '401':
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/error'
                  - $ref: '#/components/schemas/errorSberBusinessAPIUnauthorized'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId' 
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/error'
                  - $ref: '#/components/schemas/errorSberBusinessAPIForbidden'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId' 
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
          description: Not Found
        '405':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
          description: Method Not Allowed
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorSberBusinessAPIUnprocessableEntity'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'       
          description: Unprocessable Entity  
        '429':
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/error'
                  - $ref: '#/components/schemas/errorSberBusinessAPITooManyRequests'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'      
          description: Too Many Requests
        '500':
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/error'
                  - $ref: '#/components/schemas/errorSberBusinessAPIInternalServerError'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'      
          description: Internal Server Error
        '502':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorSberBusinessAPIBadGateway'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId' 
          description: Bad Gateway
        '503':
          description: Service Unavailable
        '504':
          description: Gateway Timeout
  '/beneficiaries/{id}':
    get:
      operationId: getBeneficiaryDetailsById
      tags:
        - 'Методы работы с бенефициарами'
      summary: 'Получить сведения о бенефициарe'
      description: | 
        Возвращает текущий статус и реквизиты бенефициара, хранимые в реестре <br></br> Чтобы использовать метод, в параметре **scope** ссылки авторизации пользователя должен быть указан сервис **nominal_accounts** для получения доступа к этому ресурсу 

        События по бенефициару: 
          - включить бенефициара в реестр; 
          - изменить информацию по бенефициару; 
          - удалить бенефициара из реестра; 
          - заблокировать/разблокировать бенефициара (события, инициируемые банком);'
      
      parameters:
        - $ref: '#/components/parameters/RqUID'
        - $ref: '#/components/parameters/Authorization' 
        - $ref: '#/components/parameters/nominalAccountId' 
        - name: id
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/id'
        - $ref: '#/components/parameters/pageNumber' 
        - name: pageSize
          in: query
          required: false
          schema:
            type: number
            minimum: 1
            maximum: 40
            default: 40
            description: 'Количество элементов событий бенефициара на одной странице'
            example: 40
      responses:
        '200':
          headers:
            page-number:
              schema:
                type: number
                minimum: 0
                #maximum: 10000
              description: 'Порядковый номер страницы событий бенефициара'
              example: 0
            page-size:
              schema:
                type: number
                minimum: 1
                maximum: 40
              description: 'Количество элементов событий бенефициара на одной странице'
              example: 40
            total-elements:
              schema:
                type: number
                minimum: 0
                #maximum: 10000
              description: 'Общее количество элементов событий бенефициара'
              example: 2086
            updated:
              schema:
                type: string
                format: date-time
              description: 'Время обновления списка'
              example: '2022-03-15T23:31:00.999Z'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/beneficiariesDetailsResp'
          description: OK
        '400':
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/error'
                  - $ref: '#/components/schemas/errorSberBusinessAPIBadRequest'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'        
          description: Bad Request
        '401':
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/error'
                  - $ref: '#/components/schemas/errorSberBusinessAPIUnauthorized'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId' 
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/error'
                  - $ref: '#/components/schemas/errorSberBusinessAPIForbidden'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId' 
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
          description: Not Found
        '405':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
          description: Method Not Allowed
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorSberBusinessAPIUnprocessableEntity'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'      
          description: Unprocessable Entity  
        '429':
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/error'
                  - $ref: '#/components/schemas/errorSberBusinessAPITooManyRequests'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'      
          description: Too Many Requests
        '500':
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/error'
                  - $ref: '#/components/schemas/errorSberBusinessAPIInternalServerError'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'      
          description: Internal Server Error
        '502':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorSberBusinessAPIBadGateway'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId' 
          description: Bad Gateway
        '503':
          description: Service Unavailable
        '504':
          description: Gateway Timeout    
  
  '/beneficiaries/{id}/balance':
    get:
      operationId: getBeneficiaryBalance
      tags:
        - 'Методы работы с бенефициарами'
      summary: 'Получить детальный баланс бенефициара'
      description: | 
        Метод позволяет по заданным параметрам получить детали баланса бенефицира<br></br> Чтобы использовать метод, в параметре **scope** ссылки авторизации пользователя должен быть указан сервис **nominal_accounts** для получения доступа к этому ресурсу 
      parameters:
        - $ref: '#/components/parameters/RqUID'
        - $ref: '#/components/parameters/Authorization' 
        - $ref: '#/components/parameters/nominalAccountId' 
        - name: id
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/id'   
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/beneficiaryBalance'
          description: OK
        '400':
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/error'
                  - $ref: '#/components/schemas/errorSberBusinessAPIBadRequest'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'        
          description: Bad Request
        '401':
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/error'
                  - $ref: '#/components/schemas/errorSberBusinessAPIUnauthorized'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId' 
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/error'
                  - $ref: '#/components/schemas/errorSberBusinessAPIForbidden'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId' 
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
          description: Not Found
        '405':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
          description: Method Not Allowed
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorSberBusinessAPIUnprocessableEntity'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'     
          description: Unprocessable Entity  
        '429':
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/error'
                  - $ref: '#/components/schemas/errorSberBusinessAPITooManyRequests'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'      
          description: Too Many Requests
        '500':
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/error'
                  - $ref: '#/components/schemas/errorSberBusinessAPIInternalServerError'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'       
          description: Internal Server Error
        '502':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorSberBusinessAPIBadGateway'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId' 
          description: Bad Gateway
        '503':
          description: Service Unavailable
        '504':
          description: Gateway Timeout   
  
  '/deals':
    post:
      operationId: createDeal
      tags:
        - Методы работы со сделками
      summary: Создать сделку
      description: | 
        Метод предназначен для фиксации наименования сделки и привязки её к конкретному бенефициару, а также последующего получения уникального идентификатора сделки для дальнейшей работы с ним.
        <br></br> В теле запроса направляется название сделки и ID соответствующего ей бенефициара. В ответе передается  уникальный идентификатор сделки, который клиент обязан зафиксировать и впоследствии использовать для последующих обращений и манипуляций с данной сделкой.
        <br></br>Рекомендуемое поведение клиента: После успешной отправки запроса клиент обязан записать полученный идентификатор сделки (dealId), чтобы обращаться к нему в дальнейшем при просмотре статуса сделки, редактировании, завершении или любых других действиях, связанных с управлением сделкой.
        <br></br>Этот метод позволит клиентам удобно создавать сделки, надежно сохранять связь между сделками и бенефициарами, а также обеспечит удобный доступ к необходимой информации по сделкам посредством единого идентификатора.

      parameters:
        - $ref: '#/components/parameters/RqUID'
        - $ref: '#/components/parameters/Authorization'
        - $ref: '#/components/parameters/nominalAccountId'
      requestBody:
        description: Бизнес-данные запроса
        content:
          application/json:
            schema:
              type: object
              required:
                - content
                - signature
              description: Структура запрос создания сделки
              properties:
                content:
                  type: object
                  required:
                    - data
                    - agreement
                  properties:
                    data:
                      type: object
                      required: 
                        - title
                        - payeeBeneficiaryId
                        - dealId
                      properties:
                        title:
                          $ref: '#/components/schemas/title'
                        dealId:
                          $ref: '#/components/schemas/dealId'
                        payeeBeneficiaryId:
                          $ref: '#/components/schemas/beneficiaryId'
                      additionalProperties: false
                    agreement:
                      $ref: '#/components/schemas/agreement'
                  additionalProperties: false
                  description: 'Подписываемый payload'
                signature:
                  $ref: '#/components/schemas/signature'
              additionalProperties: false
      responses:
        '201':
          description: 'Created'
  
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
        '405':
          description: Method Not Allowed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
        '503':
          description: Service Unavailable
        '504':
          description: Gateway Timeout
  '/deals/{id}':
      get:
        operationId: getDealId
        tags: 
          - Методы работы со сделками
        summary: Получить информацию по сделке
        description: | 
          Метод позволяет получить актуальную информацию по сделке. Возможные статусы сделки: RUN (Активная)<br></br> Чтобы использовать метод, в параметре **scope** ссылки авторизации пользователя должен быть указан сервис **nominal_accounts** для получения доступа к этому ресурсу
        parameters:
          - $ref: '#/components/parameters/RqUID'
          - $ref: '#/components/parameters/Authorization'  
          - $ref: '#/components/parameters/nominalAccountId'    
          - name: id
            in: path
            required: true
            schema:
              $ref: '#/components/schemas/id'      
        responses:
          '200':
            content:
              application/json:
                schema:
                  $ref: '#/components/schemas/dealResp'
            description: OK  
          '400':
            content:
              application/json:
                schema:
                  oneOf:
                    - $ref: '#/components/schemas/error'
                    - $ref: '#/components/schemas/errorSberBusinessAPIBadRequest'
            headers:
              X-Request-Id:
                $ref: '#/components/headers/XRequestId'         
            description: Bad Request
          '401':
            content:
              application/json:
                schema:
                  oneOf:
                    - $ref: '#/components/schemas/error'
                    - $ref: '#/components/schemas/errorSberBusinessAPIUnauthorized'
            headers:
              X-Request-Id:
                $ref: '#/components/headers/XRequestId' 
            description: Unauthorized
          '403':
            content:
              application/json:
                schema:
                  oneOf:
                    - $ref: '#/components/schemas/error'
                    - $ref: '#/components/schemas/errorSberBusinessAPIForbidden'
            headers:
              X-Request-Id:
                $ref: '#/components/headers/XRequestId' 
            description: Forbidden
          '404':
            content:
              application/json:
                schema:
                  $ref: '#/components/schemas/error'
            description: Not Found
          '405':
            content:
              application/json:
                schema:
                  $ref: '#/components/schemas/error'
            description: Method Not Allowed
          '422':
            content:
              application/json:
                schema:
                  $ref: '#/components/schemas/errorSberBusinessAPIUnprocessableEntity'
            headers:
              X-Request-Id:
                $ref: '#/components/headers/XRequestId'      
            description: Unprocessable Entity  
          '429':
            content:
              application/json:
                schema:
                  oneOf:
                    - $ref: '#/components/schemas/error'
                    - $ref: '#/components/schemas/errorSberBusinessAPITooManyRequests'
            headers:
              X-Request-Id:
                $ref: '#/components/headers/XRequestId'       
            description: Too Many Requests
          '500':
            content:
              application/json:
                schema:
                  oneOf:
                    - $ref: '#/components/schemas/error'
                    - $ref: '#/components/schemas/errorSberBusinessAPIInternalServerError'
            headers:
              X-Request-Id:
                $ref: '#/components/headers/XRequestId'      
            description: Internal Server Error
          '502':
            content:
              application/json:
                schema:
                  $ref: '#/components/schemas/errorSberBusinessAPIBadGateway'
            headers:
              X-Request-Id:
                $ref: '#/components/headers/XRequestId' 
            description: Bad Gateway
          '503':
            description: Service Unavailable
          '504':
            description: Gateway Timeout     
           
  '/deals/orders/ecom':
    post:
      operationId: createOrder
      summary: 'Создать заказ для зачисления на номинальный счет'
      tags: 
        - Методы работы с сущностями зачисления
      description: 'Метод позволяет создать и зарегистрировать заказ на оплату по СБП С2В<br></br>Перед использованием запроса клиенту необходимо самостоятельно зарегистрироваться в системе интернет-эквайринга. Инициировать процесс регистрации необходимо в личном кабинете СББОЛ. В рамках регистрации необходимо сообщить клиентскому менеджеру интернет-эквайринга о необходимости использования функционала СБП С2В, а также о том, что **userName** должен быть равен **merchantLogin**. Также перед отправкой запроса необходимо предварительно создать сделку, в рамках которой будет осуществлено зачисление средств<br></br>После успешной регистрации направьте на адрес **prom_teh_safe_pay@sberbank.ru** логин вашего пользователя в системе эквайринга. Это необходимо для корректной настройки назначения платежа. Если этого не сделать, средства, поступившие через СБП С2В, будут отображаться на номинальном счете как неразнесённые<br></br>Значения атрибутов **userName** и **password** в запросе должны соответствовать логину и паролю, полученным при регистрации в интернет-эквайринге (после получения приветственного письма от коллег из эквайринга в рамках регистрации, необходимо сменить выданный временный пароль на постоянный с помощью вызова метода **POST/ecom/set-permanent-password**)<br></br>При каждом новом создании заказа атрибут **orderNumber** в запросе должен быть уникальным<br></br>При пополнении номинального счета с использованием данного сервиса с плательщика будет взиматься комиссия в соответствии с тарифами, установленными в рамках договора при регистрации в интернет-эквайринге'
      parameters: 
        - $ref: '#/components/parameters/RqUID'
        - $ref: '#/components/parameters/Authorization'
        - $ref: '#/components/parameters/nominalAccountId'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - content
                - signature
              description: 'Описать'
              additionalProperties: false
              properties:
                content:
                  type: object
                  additionalProperties: false
                  required: 
                    - data
                    - agreement
                  properties:
                    data:
                      $ref: "#/components/schemas/createOrderC2Breq"
                    agreement:
                      $ref: "#/components/schemas/agreement"
                  description: 'Подписываемый payload'
                signature:
                  $ref: '#/components/schemas/signature'
      responses:
        '201':
          content:
            application/json:
                schema:
                  $ref: '#/components/schemas/createOrderC2Bresp'
          description: 'Created'
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
          description: 'Bad Request'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
        '405':
          description: Method Not Allowed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
        '503':
            description: Service Unavailable
        '504':
          description: Gateway Timeout
  
  '/deals/orders/ecom/info':
    post:
      operationId: orderStatus
      summary: 'Получить информацию по заказу'
      tags:
        - Методы работы с сущностями зачисления
      description: 'Предоставляет информацию о ранее созданном заказе по его идентификатору <br></br>Перед использованием запроса клиенту необходимо самостоятельно зарегистрироваться в системе интернет-эквайринга. Инициировать процесс регистрации необходимо в личном кабинете СББОЛ <br></br>Значения атрибутов **userName** и **password** в запросе должны соответствовать логину и паролю, полученным при регистрации в интернет-эквайринге (после получения приветственного письма от коллег из эквайринга в рамках регистрации, необходимо сменить выданный временный пароль на постоянный с помощью вызова метода **setPermanentPassword**)'
      parameters:
        - $ref: '#/components/parameters/RqUID'
        - $ref: '#/components/parameters/Authorization'
        - $ref: '#/components/parameters/nominalAccountId'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - content
                - signature
              description: 'Структура тела запроса'
              additionalProperties: false
              properties:
                content:
                  description: 'Подписываемый payload'
                  additionalProperties: false
                  type: object
                  required:
                    - data
                    - agreement
                  properties:
                    data:
                      $ref: "#/components/schemas/infoOrderC2Breq"
                    agreement:
                      $ref: "#/components/schemas/agreement"
                signature:
                  $ref: '#/components/schemas/signature'
                  
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/infoOrderC2Bresp'
          description: 'OK'
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
          description: 'Bad Request'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
        '405':
          description: Method Not Allowed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
        '503':
            description: Service Unavailable
        '504':
          description: Gateway Timeout
  
  '/deals/{id}/execute':
      post:
        operationId: executeDeal
        summary: 'Исполнить сделку'
        tags:
          - Методы работы со сделками
        description: |
          Метод предназначен для распределения средств на виртуальные счета бенефициаров в рамках заключённой сделки с указанным идентификатором, т.е. выполняется  
           распределение денежные средства между выбранными бенефициарами, соблюдая установленные лимиты и контролируя распределение суммы сделки.
           
          В ответе будет передан массив id транзакций. сформированных для обработки сделки в статусе DRAFT. 
          
          В рамках вызова данного метода комиссия сервиса Безопасные сделки не взымается.
          
        parameters:
            - $ref: '#/components/parameters/RqUID'
            - $ref: '#/components/parameters/Authorization'
            - $ref: '#/components/parameters/nominalAccountId'
            - name: id
              in: path
              description: 'Идентификатор сделки'
              required: true
              schema:
                $ref: '#/components/schemas/dealId'
        requestBody:
          content:
            application/json:
              schema:
                type: object
                required:
                  - content
                  - signature
                properties:
                  content:
                    type: object
                    required:
                      - data
                      - agreement
                    additionalProperties: false
                    properties:
                      data:
                        $ref: '#/components/schemas/disclose'
                      agreement:
                        $ref: '#/components/schemas/agreement'
                  signature:
                    $ref: '#/components/schemas/signature'
                additionalProperties: false
             
        responses:
          '201':
            description: 'Created'
            #content:
            #    application/json:
            #        schema:
            #            $ref: '#/components/schemas/executeDeal'
          '400':
            content:
              application/json:
                schema:
                  $ref: '#/components/schemas/error'
            description: 'Bad Request'
          '401':
            description: Unauthorized
            content:
              application/json:
                schema:
                  $ref: '#/components/schemas/error'
          '403':
            description: Forbidden
            content:
              application/json:
                schema:
                  $ref: '#/components/schemas/error'
          '404':
            description: Not Found
            content:
              application/json:
                schema:
                  $ref: '#/components/schemas/error'
          '405':
            description: Method Not Allowed
            content:
              application/json:
                schema:
                  $ref: '#/components/schemas/error'
          '429':
            description: Too Many Requests
            content:
              application/json:
                schema:
                  $ref: '#/components/schemas/error'
          '500':
            description: Internal Server Error
            content:
              application/json:
                schema:
                  $ref: '#/components/schemas/error'
          '503':
              description: Service Unavailable
          '504':
            description: Gateway Timeout
                
          
  '/transactions/payments':
    post:
      operationId: createPayment
      summary: 'Создать платеж по реквизитам счета'
      tags:
        - Методы работы с платежами
      description: |
         Метод позволяет создавать платежи по реквизатам счета (за исключением налоговых платежей). 
         
         В рамках вызова данного метода взымается комиссия сервиса Безопасные сделки.


      parameters:
          - $ref: '#/components/parameters/RqUID'
          - $ref: '#/components/parameters/Authorization'
          - $ref: '#/components/parameters/nominalAccountId'
      requestBody:
        content:
            application/json:
              schema:
                type: object
                required:
                  - content
                  - signature
                
                properties:
                  content:
                    type: object
                    required: 
                      - data
                      - agreement
                    additionalProperties: false
                    properties:
                      data:
                        $ref : '#/components/schemas/transaction'
                      agreement:
                        $ref: "#/components/schemas/agreement"
                  signature:
                    $ref: '#/components/schemas/signature'
                additionalProperties: false
        required: true      
      responses:
        '201':    
          description: 'Created'
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
          description: 'Bad Request'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
        '405':
          description: Method Not Allowed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
        '503':
            description: Service Unavailable
        '504':
          description: Gateway Timeout  
  #'/transactions/sbp/b2c':
  #  post:
  #    operationId: createPaymentSBP
  #    summary: 'Создать платеж по СБП В2С'
  #    tags:
  #      - Методы работы с платежами
  #    description: |
  #       Метод позволяет создавать платежи по СБП В2С 

  #    parameters:
  #        - $ref: '#/components/parameters/RqUID'
  #        - $ref: '#/components/parameters/Authorization'
  #        - $ref: '#/components/parameters/nominalAccountId'
  #    requestBody:
  #      content:
  #          application/json:
  #            schema:
  #              type: object
  #              required:
  #                - content
  #                - signature
  #              
  #              properties:
  #                content:
  #                  type: object
  #                  required: 
  #                    - data
  #                    - agreement
  #                  additionalProperties: false
  #                  properties:
  #                    data:
  #                      $ref : '#/components/schemas/transactionSBP'
  #                    agreement:
  #                      $ref: "#/components/schemas/agreement"
  #                signature:
  #                  $ref: '#/components/schemas/signature'
  #              additionalProperties: false
  #      required: true      
  #    responses:
  #      '201':    
  #        description: 'Created'
  #      '400':
  #        content:
  #          application/json:
  #            schema:
  #              $ref: '#/components/schemas/error'
  #        description: 'Bad Request'
  #      '401':
  #        description: Unauthorized
  #        content:
  #          application/json:
  #            schema:
  #              $ref: '#/components/schemas/error'
  #      '403':
  #        description: Forbidden
  #        content:
  #          application/json:
  #            schema:
  #              $ref: '#/components/schemas/error'
  #      '404':
  #        description: Not Found
  #        content:
  #          application/json:
  #            schema:
  #              $ref: '#/components/schemas/error'
  #      '405':
  #        description: Method Not Allowed
  #        content:
  #          application/json:
  #            schema:
  #              $ref: '#/components/schemas/error'
  #      '429':
  #        description: Too Many Requests
  #        content:
  #          application/json:
  #            schema:
  #              $ref: '#/components/schemas/error'
  #      '500':
  #        description: Internal Server Error
  #        content:
  #          application/json:
  #            schema:
  #              $ref: '#/components/schemas/error'
  #      '503':
  #          description: Service Unavailable
  #      '504':
  #        description: Gateway Timeout          
  '/transactions':
    get:
      operationId: cashFlowEventsByIdNominalAccounts
      tags:
        - Методы работы с платежами
      summary: 'Получить список операций по номинальному счету за определенный промежуток времени'
      description: 'Метод возвращает список операций по номинальному счету, начиная с дня Х на заданную глубину (за исключением операций возврата). Для получения списка операций возврата по номинальному счету необходимо воспользоваться методом **GET/payments/refunds**<br></br> Чтобы использовать метод, в параметре **scope** ссылки авторизации пользователя должен быть указан сервис **nominal_accounts** для получения доступа к этому ресурсу <br></br> Значения параметров **startDate** и **endDate** фильтруют события по дате создания транзакции<br></br>Значение параметра **pageNumber** в запросе позволит отобразить в ответе необходимую страницу с данными <br></br>Значение параметра **pageSize** в запросе позволит отобразить в ответе необходимое количество записей на странице//поменять даты тут и в новом рефанде, поменять объект на старом рефанде'
      parameters:
        - $ref: '#/components/parameters/RqUID'
        - $ref: '#/components/parameters/Authorization'  
        - $ref: '#/components/parameters/nominalAccountId' 
        - $ref: '#/components/parameters/pageNumber' 
        - $ref: '#/components/parameters/pageSize' 
        - name: startDate
          in: query
          description: 'Дата начала диапазона поиска событий по дате его последнего изменения (включительно) (передавать в UTC)'
          required: false
          schema:
            type: string
            format: date-time
            example: '2026-03-15T23:31:00.999Z'  
        - name: endDate
          in: query
          description: 'Дата окончания диапазона поиска событий по дате его последнего изменения (включительно) (передавать в UTC)'
          required: false
          schema:
            type: string
            format: date-time
            example: '2026-03-15T23:31:00.999Z'  
        - $ref: '#/components/parameters/beneficiaryId' 
        - $ref: '#/components/parameters/dealId'     
      responses:
        '200':
          headers:
            page-number:
              schema:
                type: number
                minimum: 0
              description: 'Порядковый номер страницы событий'
              example: 0
            page-size:
              schema:
                type: number
                minimum: 1
                maximum: 100
              description: 'Количество элементов событий'
              example: 20
            total-elements:
              schema:
                type: number
                minimum: 0
              description: Общее количество элементов списка
              example: 2086  
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/transactionsFlowResp'
          description: OK  
        '400':
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/error'
                  - $ref: '#/components/schemas/errorSberBusinessAPIBadRequest'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'        
          description: Bad Request
        '401':
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/error'
                  - $ref: '#/components/schemas/errorSberBusinessAPIUnauthorized'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId' 
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/error'
                  - $ref: '#/components/schemas/errorSberBusinessAPIForbidden'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId' 
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
          description: Not Found
        '405':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
          description: Method Not Allowed
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorSberBusinessAPIUnprocessableEntity'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'      
          description: Unprocessable Entity  
        '429':
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/error'
                  - $ref: '#/components/schemas/errorSberBusinessAPITooManyRequests'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'      
          description: Too Many Requests
        '500':
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/error'
                  - $ref: '#/components/schemas/errorSberBusinessAPIInternalServerError'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'       
          description: Internal Server Error
        '502':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorSberBusinessAPIBadGateway'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId' 
          description: Bad Gateway
        '503':
          description: Service Unavailable
        '504':
          description: Gateway Timeout    
  '/transactions/{id}':
    get:
      operationId: cashFlowEvent
      tags:
        - Методы работы с платежами
      summary: 'Получить детали операции'
      description: 'Метод возвращает детали операции по ее id <br></br> Чтобы использовать метод, в параметре **scope** ссылки авторизации пользователя должен быть указан сервис **nominal_accounts** для получения доступа к этому ресурсу '
      parameters:
        - $ref: '#/components/parameters/RqUID'
        - $ref: '#/components/parameters/Authorization'  
        - $ref: '#/components/parameters/nominalAccountId'    
        - name: id
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/id'     
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/oneTransactionResp'
          description: OK  
        '400':
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/error'
                  - $ref: '#/components/schemas/errorSberBusinessAPIBadRequest'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'         
          description: Bad Request
        '401':
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/error'
                  - $ref: '#/components/schemas/errorSberBusinessAPIUnauthorized'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId' 
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/error'
                  - $ref: '#/components/schemas/errorSberBusinessAPIForbidden'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId' 
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
          description: Not Found
        '405':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
          description: Method Not Allowed
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorSberBusinessAPIUnprocessableEntity'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'      
          description: Unprocessable Entity  
        '429':
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/error'
                  - $ref: '#/components/schemas/errorSberBusinessAPITooManyRequests'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'       
          description: Too Many Requests
        '500':
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/error'
                  - $ref: '#/components/schemas/errorSberBusinessAPIInternalServerError'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'      
          description: Internal Server Error
        '502':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorSberBusinessAPIBadGateway'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId' 
          description: Bad Gateway
        '503':
          description: Service Unavailable
        '504':
          description: Gateway Timeout     
  '/transactions/refunds':
    get:
      operationId: getRefunds
      tags:
        - 'Методы работы с платежами'
      summary: 'Получить список операций возврата'
      description: 'Метод возвращает список событий по зачислению средств на номинальный счет со счетов невыясненных сумм (возврат средств на номинальный счет по факту отказа в зачислении в **сторонних банках**)<br></br> Чтобы использовать метод, в параметре **scope** ссылки авторизации пользователя должен быть указан сервис **nominal_accounts** для получения доступа к этому ресурсу <br></br>Транзакция возврата не связана с первоначальной проведенной транзакцией дебета, и никак не повлияет на статус исполненной первоначальной транзакции, статус сделки и иные исполненные транзакции в рамках сделки  (для банка она будет восприниматься, как транзакция кредита в пользу бенефициара). Сопоставить перваначальную транзакцию с транзакцией возврата можно с помощью идентификаторов **primaryTransactionId** и **refundTransactionId** из ответа <br></br>Сортировка в запросе выполняется по createDate (дата создания возврата). Параметр  **sortMethode = asc** в запросе, сортировка ответа будет от меньшего значения даты к большему, значение ** sortMethod = desc** - от большенго к меньшему. По умолчанию значение параметра  **sortMethod = asc** <br></br>Значение параметра **startDate** и **endDate** в запросе позволит осуществить поиск событий возврата за указанный период (включая дату начала и дату окончания)<br></br>Значение параметра **pageNumber** в запросе позволит отобразить в ответе необходимую страницу с данными<br></br>Значение параметра **pageSize** в запросе позволит отобразить в ответе необходимое количество записей на странице <br></br>Значение параметра **beneficiaryId** в запросе позволит выполнить запрос по одному бенефициару'
      parameters:
        - $ref: '#/components/parameters/RqUID'
        - $ref: '#/components/parameters/Authorization'  
        - $ref: '#/components/parameters/nominalAccountId'      
        - $ref: '#/components/parameters/pageNumber' 
        - $ref: '#/components/parameters/pageSize' 
        - name: startDate
          in: query
          description: 'Дата начала диапазона поиска событий возврата по дате создания возврата (включительно) (передавать в UTC)'
          required: false
          schema:
            type: string
            format: date-time
            example: '2026-03-15T23:31:00.999Z'  
        - name: endDate
          in: query
          description: 'Дата окончания диапазона поиска событий возврата по дате создания возврата (включительно) (передавать в UTC)'
          required: false
          schema:
            type: string
            format: date-time
            example: '2026-03-15T23:31:00.999Z'  
            
      responses:
        '200':
          headers:
            page-number:
              schema:
                type: number
                minimum: 0
              description: 'Порядковый номер страницы событий возврата'
              example: 0
            page-size:
              schema:
                type: number
                minimum: 1
                maximum: 100
              description: 'Количество элементов событий возврата'
              example: 20
            total-elements:
              schema:
                type: number
                minimum: 0
              description: Общее количество элементов списка возвратов
              example: 2086
          content:
            application/json:
              schema:
                type: object
                description: 'Список событий возврата'
                properties:
                  refundEvents:
                    $ref: '#/components/schemas/refundEvents'
                additionalProperties: false    
          description: OK
        '400':
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/error'
                  - $ref: '#/components/schemas/errorSberBusinessAPIBadRequest'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'        
          description: Bad Request
        '401':
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/error'
                  - $ref: '#/components/schemas/errorSberBusinessAPIUnauthorized'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId' 
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/error'
                  - $ref: '#/components/schemas/errorSberBusinessAPIForbidden'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId' 
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
          description: Not Found
        '405':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
          description: Method Not Allowed
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorSberBusinessAPIUnprocessableEntity'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'       
          description: Unprocessable Entity  
        '429':
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/error'
                  - $ref: '#/components/schemas/errorSberBusinessAPITooManyRequests'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'       
          description: Too Many Requests
        '500':
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/error'
                  - $ref: '#/components/schemas/errorSberBusinessAPIInternalServerError'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'       
          description: Internal Server Error
        '502':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorSberBusinessAPIBadGateway'
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId' 
          description: Bad Gateway
        '503':
          description: Service Unavailable
        '504':
          description: Gateway Timeout             
  
  
          
  
components:
  headers:
    XRequestId:
      required: false
      description: 'Уникальный идентификатор запроса.'
      schema:
        type: string
        minLength: 1
        maxLength: 36
        example: 'a30b2c5c-3d89-4f59-9f3b-f20b55ef4f59'  
  parameters:
    RqUID:
      name: RqUID
      in: header
      required: true
      schema:
        $ref: '#/components/schemas/uuid'
    Authorization:
      name: Authorization
      in: header
      required: true
      schema:
        $ref: '#/components/schemas/Authorization'
    nominalAccountId:
      name: nominalAccountId
      in: header
      required: true
      schema:
        $ref: '#/components/schemas/Authorization'
    pageNumber:
      in: query
      name: pageNumber
      required: false
      schema:
        type: number
        description: 'Номер страницы'
        example: 0
        minimum: 0
        maximum: 20
        default: 0
    pageSize:
      in: query
      required: false
      name: pageSize
      schema:
        type: number
        description: 'Количество элементов на странице'
        example: 20
        minimum: 1
        maximum: 100
        default: 20
    id:
      in: path
      required: true
      name: id
      schema: 
        type: string
        format: uuid
        description: 'Id сделки'
        pattern: '^[0-9a-fA-F-]{36}$' 
        example: 'ad3e301b-8e06-4fd5-88d4-2ca5668294b1'
    beneficiaryId:
      name: beneficiaryId
      in: query
      required: false
      description: Filter by beneficiaryId (only one value for filtering by id)
      schema:
        $ref: '#/components/schemas/uuid' 
    dealId:
      name: dealId
      in: query
      required: false
      description: Filter by dealId (only one value for filtering by id)
      schema:
        $ref: '#/components/schemas/uuid'      

    
  schemas:
    uuid:
      description: Уникальный идентификатор запроса
      maxLength: 36
      pattern: '^[0-9a-fA-F-]{36}$'
      type: string
      example: 'a3444f12-2ccf-84f7-777f-01df6ffd8c28'
    Authorization:
      type: string
      description: 'Access token пользователя, полученный через SSO'
      format: uuid
      pattern: '^([a-zA-Z0-9]){36}$'
      example: 'ac444f12-2ccf-84f7-777f-01df6ffd8c28'
    title:
      type: string
      pattern: '^(?!.*--)[^<>#@&$’*]+$'
      maxLength: 210
      description: 'Наименование сделки'
      example: 'Оплата доставки'
    beneficiaryId:
      type: string
      format: uuid
      pattern: '^[0-9a-fA-F-]{36}$'
      description: 'Идентификатор бенефициара номинального счета'
      example: '99ee301b-8e06-4fd5-88d4-2ca5668294b1'
    amount:
      type: integer
      minimum: 0
      maximum: 100000000000
      description: 'Cумма средств в копейках'
      example: 20100
    dealId:
      type: string
      format: uuid
      pattern: '^[0-9A-Fa-f-]{36}$'
      description: 'Id сделки'
      example: 'cc444f12-2ccf-84f7-777f-01df6ffd8c28'
    date:
      type: string
      pattern: '^20[0-9]{2}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$'
      description: 'Дата'
      example: '2022-03-15'
        
    createOrderC2Breq:
      type: object
      description: "Реквизиты запроса для создания и регистрации заказа в рамках интернет-эквайринга"
      required:
        - userName
        - password
        - orderNumber
        - dealId
        - amount
        - currency
        - returnUrl
      properties:
        userName:
          $ref: '#/components/schemas/userNameSBPC2B'
        password:
          $ref: '#/components/schemas/passwordSBPC2B'
        orderNumber:
          $ref: '#/components/schemas/orderNumberSBPC2B'
        dealId:
          $ref: '#/components/schemas/dealId'
        #orderFor:
        #  oneOf:
        #    - $ref: '#/components/schemas/dealId'
        #    - $ref: '#/components/schemas/beneficiaryId'
        amount:
          $ref: '#/components/schemas/amount'  
        currency:
          $ref: '#/components/schemas/currency'  
        returnUrl:
          $ref: '#/components/schemas/returnUrlSBPC2B'
        failUrl:
          $ref: '#/components/schemas/failUrlSBPC2B'
        createBindingId:
          $ref: '#/components/schemas/clientIdSBPC2B'
        bindingId:
          $ref: '#/components/schemas/bindingId'
        features:
          $ref: '#/components/schemas/features'
        phone:
          description: "Номер телефона Плательщика. Если в телефон включён код страны, номер должен начинаться со знака плюс («+»). Если телефон передаётся без знака плюс («+»), то код страны указывать не следует. В случае использования фискализации обязателен для передачи в формате +79998887700, при отсутствии номера телефона обязателен email"
          type: string
          example: "+79998887700"
          maxLength: 16
          minLength: 1
          pattern: '^(\+?)\d{7,15}$' 
        email:
          description: "Адрес электронной почты Плательщика. В случае использования фискализации обязателен, при отсутствии phone."
          type: string
          format: email
          example: "+info@your-company.ru"
          maxLength: 128
          minLength: 3  
      additionalProperties: false
    userNameSBPC2B:
      description: "Логин Партнера, полученный при подключении к ПШ"
      type: string
      example: "test"
      maxLength: 30
      minLength: 1
      pattern: '^[A-Za-z0-9-_ ]+$'  
    passwordSBPC2B:
      description: "Пароль Партнера, полученный при подключении к ПШ"
      type: string
      example: "test"
      maxLength: 36
      minLength: 1
      pattern: '^[ -~]+$'
    orderNumberSBPC2B:
      description: "Уникальный номер (идентификатор) заказа в системе Партнера"
      type: string
      example: "e2574f1785324f1592d9029cb05adbbd"
      maxLength: 36
      minLength: 1
      pattern: '^[ -~А-Яа-яЁёA-Za-z0-9-_№]*$'
    returnUrlSBPC2B:
      description: "Адрес, на который требуется перенаправить Плательщика в случае успешной оплаты, когда Партнер использует платёжную страницу ПШ <br></br>Обратите внимание! <br></br>1. Если доменное имя содержит кирилические символы, то его необходимо преобразовать по алгоритму ACE. Т.е. строка \"сберпей.рф\" будет выглядеть как \"xn--90aiaq2afe.xn--p1ai\" <br></br> 2. Если query параметр содержит символ % - считается, что к данному параметру уже применено экранирование и преобразование не осуществляется (параметр остается \"как есть\")<br></br> 3. Если query параметр содержит символы, отличные от множества [a-zA-Z0-9.-*_ ], эти символы экранируются через символ %. Строка вида \"сберпей.рф\" будет выглядеть как \"%D1%81%D0%B1%D0%B5%D1%80%D0%BF%D0%B5%D0%B9%2E%D1%80%D1%84\""
      type: string
      example: "https://testmerchant.ru/return"
      maxLength: 2048
      minLength: 12
      pattern: '^[ -~]+$'
    failUrlSBPC2B:
      description: "Адрес, на который требуется перенаправить Плательщика в случае неуспешной оплаты, когда Партнер использует платёжную страницу ПШ. Если не указан, используется returnUrl. <br></br>Обратите внимание! <br></br>1. Если доменное имя содержит кирилические символы, то его необходимо преобразовать по алгоритму ACE. Т.е. строка \"сберпей.рф\" будет выглядеть как \"xn--90aiaq2afe.xn--p1ai\" <br></br> 2. Если query параметр содержит символ % - считается, что к данному параметру уже применено экранирование и преобразование не осуществляется (параметр остается \"как есть\")<br></br> 3. Если query параметр содержит символы, отличные от множества [a-zA-Z0-9.-*_ ], эти символы экранируются через символ %. Строка вида \"сберпей.рф\" будет выглядеть как \"%D1%81%D0%B1%D0%B5%D1%80%D0%BF%D0%B5%D0%B9%2E%D1%80%D1%84\""
      type: string
      example: "https://testmerchant.ru/return"
      maxLength: 2048
      minLength: 12
      pattern: '^[ -~]+$'
    clientIdSBPC2B:  
      description: "Номер (идентификатор) Плательщика в системе Партнера. Используется для реализации функционала Связок"
      type: string
      example: "123abc"
      maxLength: 255
      minLength: 1
      pattern: '^[ -~]+$'
    bindingId:
      description: "Идентификатор Связки, созданной ранее. Может использоваться, только если у магазина есть разрешение на работу со связками"
      type: string
      format: uuid
      pattern: '^[0-9a-fA-F-]{36}$'
      example: "2090df9c-5c7c-11ee-8c99-0242ac120002"
    features:
      description: "Дополнительные параметры управления сценариями при использовании платёжных реквизитов (можно указать несколько через разделитель \";\"): <br></br> VERIFY = Происходит верификация Плательщика без списания средств с его счёта, поэтому в запросе можно передавать нулевую сумму. Даже если сумма платежа будет передана в запросе, она не будет списана со счёта покупателя. После успешной верификации заказ сразу переводится в статус REVERSED (отменён); <br></br>FORCE_SSL = Принудительное проведение платежа без использования 3-D Secure; <br></br>FORCE_TDS = Принудительное проведение платежа с использованием 3-D Secure. Если карта не поддерживает 3-D Secure, операция будет отклонена; <br></br>FORCE_FULL_TDS = Принудительное проведение платежа только с успешной аутентификацией плательщика 3-D Secure (Y). В противном случае операция будет отклонена."
      type: string
      maxLength: 255
      minLength: 1
      pattern: '^[ -~]+$'
      example: 'VERIFY'  
    currency:
      type: string
      enum:
        - RUB
        - RUR
      description: 'Валюта'
      example: 'RUB'
    createOrderC2Bresp:
      description: 'Структура ответа с данными по заказу'
      type: object
      required: 
        - orderId
        - sbpPayload
        - dayLife
        #- operationId
      properties:
        orderId:
          $ref: '#/components/schemas/orderIdC2B'
        #operationId:
        #  $ref: '#/components/schemas/operationId'
        formUrl:
          $ref: '#/components/schemas/formUrl'
        sbpPayload:
          $ref: '#/components/schemas/sbpPayload'
        dayLife:
          $ref: '#/components/schemas/dayLifeC2B' 
      additionalProperties: false  
    orderIdC2B:
      type: string
      format: uuid
      pattern: '^[0-9a-fA-F-]{36}$'
      description: 'id заказа'
      example: '74550e51-9e81-435d-864c-4b5e07d70e18'  
    formUrl:
      type: string
      description: "URL-адрес страницы, на который должен быть перенаправлен браузер Плательщика для дальнейшего проведения операции"
      example: "https://payecom.ru/pay?orderId=1000da9f-615b-511f-1f92-9d695ac2429d"
      maxLength: 255
      minLength: 1
      pattern: '^[ -~]+$' 
    dayLifeC2B:
      description: 'Дата и время окончания жизни заказа на стороне ПШ в формате YYYY-MM-DDThh:mm:ss.sssZ.'
      type: string
      format: date-time    
    sbpPayload:
      type: string
      description: "Зарегистрированная Платежная или Информационная ссылка СБП актуальной версии формата двухмерного QR-кода (ISO/IEC 18004-2015), представляемая в виде URLBased."
      example: "https://qr.nspk.ru/AD100044G8OTINP79SJPL1K2A0GGGIDQ?type=02&bank=100000000111&sum=100&cur=RUB&crc=8000"
      maxLength: 999
      minLength: 1
      pattern: '^[ -~]+$' 
    operationId:
      type: string
      description: 'Идентификатор операции'
      example: '123456789012345678901012'
      maxLength: 255
    id:
      type: string
      format: uuid
      pattern: '^[0-9a-fA-F-]{36}$'
      description: 'Идентификатор'
      example: '74550e51-9e81-435d-864c-4b5e07d70e18'
    infoOrderC2Breq:
      type: object
      description: "Реквизиты запроса информации по ранее созданному заказу"
      required:
        - userName
        - password
        - orderId
      properties:
        orderId:
          $ref: '#/components/schemas/orderIdC2B'
        userName:
          $ref: '#/components/schemas/userNameSBPC2B'
        password:
          $ref: '#/components/schemas/passwordSBPC2B'
      additionalProperties: false
    infoOrderC2Bresp:
      type: object
      description: "Детали ранее созданного заказа"
      properties:
        bindingInfo:
          $ref: '#/components/schemas/bindingInfo'
        paymentAmountInfo:
          $ref: '#/components/schemas/paymentAmountInfo'
        bankInfo:
          $ref: '#/components/schemas/bankInfo'
        operations:
          $ref: '#/components/schemas/operations'
        orderNumber:
          $ref: '#/components/schemas/orderNumberSBPC2B'
        orderStatus:
          $ref: '#/components/schemas/orderStatus'
        actionCode:
          $ref: '#/components/schemas/actionCode'
        errorMessage:
          $ref: '#/components/schemas/errorMessage'
        actionCodeDescription:
          $ref: '#/components/schemas/actionCodeDescription'
        amount:
          $ref: '#/components/schemas/amountC2B'
        currency:
          $ref: '#/components/schemas/currencyC2B'
        date:
          $ref: '#/components/schemas/dateC2B'
        depositedDate:
           $ref: '#/components/schemas/depositedDate'
        orderDescription:
          $ref: '#/components/schemas/orderDescription'
        authRefNum:
          $ref: '#/components/schemas/authRefNum'
        refundedDate:
          $ref: '#/components/schemas/refundedDate'
        authDateTime:
          $ref: '#/components/schemas/authDateTime'
        terminalId:
          $ref: '#/components/schemas/terminalId'
        payerData:
          $ref: '#/components/schemas/payerData'  
      additionalProperties: false
    payerData:
      description: Блок информации о Плательщике
      type: object
      properties:
        email:
          description: "Адрес электронной почты Плательщика. В случае использования фискализации обязателен, при отсутствии phone."
          type: string
          format: email
          example: "+info@your-company.ru"
          maxLength: 128
          minLength: 3
      additionalProperties: false  
    bindingInfo:
      description: Блок информации о связке
      type: object
      properties:
        clientId:
          $ref: '#/components/schemas/clientIdSBPC2B'
        bindingId:
          $ref: '#/components/schemas/bindingId'
      additionalProperties: false
    paymentAmountInfo:
      description: Блок информации о суммах, участвующих в цикле платежа
      type: object
      properties:
        approvedAmount:
          description: Сумма холдирования для двухстадийного платежа или подтвержденная сумма списания для одностадийного платежа
          type: integer
          maximum: 999999999999
          minimum: 0
          example: 19900
        depositedAmount:
          description: Сумма завершения оплаты для двухстадийного сценария платежа
          type: integer
          maximum: 999999999999
          minimum: 0
          example: 14900
        refundedAmount:
          description: Сумма возвращенных средств
          x-description-i18n:
            eng: Refunded amount
          type: integer
          maximum: 999999999999
          minimum: 0
          example: 0
        feeAmount:
          description: Сумма комиссии в минимальных единицах валюты
          type: integer
          maximum: 999999999999
          minimum: 0
          example: 0

        paymentState:
          description: |
            Состояние платежа. Возможны следующие варианты:
              * `CREATED`
              * `APPROVED`
              * `DEPOSITED`
              * `REVERSED`
              * `REFUNDED`
              * `DECLINED`
          type: string
          maxLength: 10
          minLength: 1
          pattern: ^[A-Za-z]*$
          example: DEPOSITED
      additionalProperties: false      
    bankInfo:
      description: Блок информации о Банке-эмитенте
      type: object
      properties:
        bankName:
          description: Наименование Банка-эмитента Карты Плательщика
          type: string
          maxLength: 50
          minLength: 1
          pattern: ^[ -~]*$
          example: ПАО Сбербанк
        bankCountryCode:
          description: Код страны Банка-эмитента
          type: string
          maxLength: 4
          minLength: 1
          pattern: ^\w+$
          example: "643"
        bankCountryName:
          description: Наименование страны банка-эмитента на языке, переданном в параметре language в запросе или если не указан, будет использован язык по умолчанию, указанный в настройках Партнера
          type: string
          maxLength: 160
          minLength: 1
          pattern: ^[А-Яа-яЁё\w\s]+$
          example: Россия
      example: {}
      additionalProperties: false
    operations:
      description: Массив объектов, содержащий информацию по всем платёжным операциям в рамках заказа. Возвращается в ответе, если Партнеру разрешено использование данного функционала
      type: array
      items:
        type: object
        properties:
          date:
            $ref: '#/components/schemas/dateC2B'
          type:
            $ref: '#/components/schemas/operationType'
          amount:
            $ref: '#/components/schemas/amountC2B'
          referenceNumber:
            $ref: '#/components/schemas/authRefNum'
          #externalRefundId:
          #  $ref: '#/components/schemas/externalRefundId'
          approvalCode:
            $ref: '#/components/schemas/approvalCodeC2B'
          actionCode:
            $ref: '#/components/schemas/actionCode'
        additionalProperties: false
      maxItems: 255  
      example: []
    operationType:
      description: |
        Тип платёжной операции. Возможные значения:
          * `AUTHORIZATION`
          * `PREAUTHORIZATION`
          * `COMPLETION`
          * `REVERSAL`
          * `REFUND`
      type: string
      maxLength: 20
      minLength: 1
      pattern: ^[ -~]*$
      example: AUTHORIZATION  
    dateC2B:
      description: Дата и время регистрации заказа в формате UNIX-времени (POSIX-времени) format
      type: number
      minimum: 0
      maximum: 999999999999999
      example: 1636985192232  
    authRefNum:
      description: Ссылочный номер авторизации платежа, который присваивается при регистрации платежа на стороне платёжной системы
      type: string
      maxLength: 24
      minLength: 0
      pattern: ^[A-Za-z0-9]+$
      example: "303112098637"  
    amountC2B:
      description: Сумма операции в минимальных единицах валюты
      type: integer
      maximum: 999999999999
      minimum: 0
      example: 19900
    approvalCodeC2B:
      description: Код авторизации платежа
      type: string
      maxLength: 6
      minLength: 1
      pattern: ^\w+$
      example: "433187"
    actionCode:
      description: Код ответа платёжного шлюза - цифровое обозначение результата, к которому привело обращение со стороны Партнера
      type: integer
      minimum: -9999999
      maximum: 9999999
      example: 0
    orderStatus:
      description: |
        По значению этого параметра определяется состояние заказа в платёжном шлюзе. Отсутствует, если заказ не был найден. Возможны следующие значения:
          * `0` = заказ зарегистрирован, но не оплачен;
          * `1` = сумма захолдирована (для двухстадийного сценария);
          * `2` = проведена полная авторизация суммы заказа / создана подписка СБП;
          * `3` = авторизация отменена;
          * `4` = по заказу была проведена операция возврата;
          * `5` = инициирована аутентификация через ACS Банка-эмитента;
          * `6` = авторизация отклонена.
      type: integer
      minimum: 0
      maximum: 9
      example: 2
    actionCodeDescription:
      description: Расшифровка кода ответа на языке, переданном в параметре запроса language
      type: string
      maxLength: 255
      minLength: 0
      pattern: ^[ -~А-Яа-яЁё№]*$
      example: ""  
    currencyC2B:
      description: Цифровой код валюты операции ISO-4217
      type: string
      maxLength: 3
      minLength: 3
      pattern: ^\d{3}$
      default: "643"
      example: "643"  
    depositedDate:
      description: Дата и время оплаты/завершения оплаты заказа в формате UNIX-времени (POSIX-времени)
      type: number
      minimum: 0
      maximum: 999999999999999
      example: 1636985192232
    orderDescription:
      description: Описание заказа в свободной форме на стороне Партнера.
      type: string
      maxLength: 255
      minLength: 1
      pattern: ^[ -~А-Яа-яЁёA-Za-z0-9-_№]*$
      example: Тестовый заказ
    refundedDate:
      description: Дата и время возврата средств.
      type: string
      format: date-time
      example: 2022-12-31T23:59:59      
    authDateTime:
      description: Дата и время авторизации в Банке-эквайере в формате UNIX-времени (POSIX-времени)
      type: number
      minimum: 0
      maximum: 999999999999999
      example: 1636985192232
    terminalId:
      description: Идентификатор терминала в платёжном шлюзе Банка-эквайера, через который осуществлялась оплата
      type: string
      maxLength: 10
      minLength: 1
      pattern: ^\w+$
      example: "20235777"
    docNumber:
      type: string
      maxLength: 32
      #pattern: '^[0-9]{1,32}$'
      description: номер платежного поручения
      example: '145578'
    purpose:
      type: string
      pattern: '^(?!.--)[^<>#@&$’—\u00A0]+$' 
      maxLength: 210
      description: 'Назначение платежа'
      example: 'Оплата по Договору поставки №23/04-2022 от 01.04.2022, включая НДС 20%'
    getPurpose:
      type: string
      #pattern: |
      #  ^(?!.--)[^<>#@&$’]+$
      maxLength: 210
      description: 'Назначение платежа'
      example: 'Оплата по Договору поставки №23/04-2022 от 01.04.2022, включая НДС 20%'   
    kvd:
      type: integer
      description: "Код вида дохода"
      minimum: 1
      maximum: 5
      example: 1
    transaction:
        type: object
        required:
          - transactionId
          - transactionType
          - payee
          - amount
          - purpose
          - priority
        additionalProperties: false
        properties:
          transactionId:
            $ref: '#/components/schemas/id'
          transactionType:
            type: string
            description: 'Тип транзакции'
            enum:
                - ACCOUNT
                - SBP_B2C
            #    - TAX
            #    - INTERNAL
            example: 'ACCOUNT'
          payerBeneficiaryId:
            $ref: '#/components/schemas/id'
          amount:
            $ref: '#/components/schemas/amount'
          kvd:
            $ref: '#/components/schemas/kvd'
          priority:
            $ref: '#/components/schemas/priority'
          purpose:
            $ref: '#/components/schemas/purpose'  
          payee:
            oneOf:
              - $ref: '#/components/schemas/payeeFL'
              - $ref: '#/components/schemas/payeeFLSBP'
              - $ref: '#/components/schemas/payeeIP'
              - $ref: '#/components/schemas/payeeUL'
              - $ref: '#/components/schemas/payeeBEN'
          #tax:
          #  $ref: '#/components/schemas/tax'
    transactionSBP:
        type: object
        required:
          - transactionId
          - transactionType
          - payee
          - amount
          - purpose
          - priority
        properties:
          transactionId:
            $ref: '#/components/schemas/id'
          transactionType:
            type: string
            description: 'Тип транзакции'
            enum:
                - SBP_B2C
            example: 'SBP_B2C'
          payerBeneficiaryId:
            $ref: '#/components/schemas/id'
          amount:
            $ref: '#/components/schemas/amount'
          kvd:
            $ref: '#/components/schemas/kvd'
          priority:
            $ref: '#/components/schemas/priority'
          purpose:
            $ref: '#/components/schemas/purpose'  
          payee:
            $ref: '#/components/schemas/payeeFLSBP'
               
        additionalProperties: false
      
    payeeUL:
      type: object
      required:
        - typeCode
        - orgName
        - inn
        - kpp
        - account
      description: 'Реквизиты получателя ЮЛ'
      properties:
        typeCode:
          type: string
          pattern: '^UL$'
          default: 'UL'
          description: 'Тип участника UL'
          example: 'UL'
        orgName:
          $ref: '#/components/schemas/orgName'
        inn:
          pattern: '^[0-9]{10}$'
          type: string
          description: 'ИНН ЮЛ'
          #minLength: 10
          example: '0743528989'
        kpp:
          $ref: '#/components/schemas/kpp'
        account:
          $ref: '#/components/schemas/account'
      additionalProperties: false
    payeeIP:  
      type: object
      required:
        - typeCode
        - inn
        - account
        - orgName
      description: 'Общий набор данных для ИП'
      properties:
        typeCode:
          description: 'Тип участника IP'
          type: string
          pattern: '^IP$'
          default: 'IP'
          example: 'IP'
        orgName:
          type: string
          pattern: '^[А-Яа-яёЁA-Za-z0-9 "№.+()-]{3,250}$'
          description: 'Наименование ИП для платежа' #заполнять поле в соответствии с тем, как указано в свидетельстве о регистрации
          example: 'Индивидуальный предприниматель И Кван Ё'
        inn:
          type: string
          pattern: '^[0-9]{12}$'
          #minLength: 12
          description: 'ИНН ФЛ'
          example: '774352898912'
        account:
          $ref: '#/components/schemas/account'
      additionalProperties: false   
    payeeFL:
      type: object
      required:
        - typeCode
        - personName
        - inn
        - account
      description: 'Общий набор данные для ФЛ'
      properties:
        typeCode:
          type: string
          pattern: '^FL$'
          default: 'FL'
          description: 'Тип участника FL'
          example: 'FL'
        personName:
          type: string
          pattern: '^[А-ЯЁа-яёA-Za-z -]{3,250}$'
          description: 'ФИО для платежа'
          example: 'Коган-Константинопольский Константин Константинович'
        inn:
          type: string
          pattern: '^[0-9]{12}$'
          description: 'ИНН ФЛ'
          example: '074352898912'
        account:
          $ref: '#/components/schemas/account'
      additionalProperties: false
    payeeFLSBP:
      type: object
      required:
        - typeCode
        - phone
        - bankBIC
      description: 'Общий набор данные для ФЛ при оплате по номеру телефона'
      properties:
        typeCode:
          type: string
          pattern: '^FL$'
          default: 'FL'
          description: 'Тип участника FL'
          example: 'FL'
        phone:
          $ref: '#/components/schemas/receiverPhone'
        bankBIC:
          description: БИК банка получателя
          type: string
          maxLength: 9
          pattern: "^[0-9]{9}$" 
        inn:
          type: string
          pattern: '^[0-9]{12}$'
          description: 'ИНН ФЛ-получателя'
          example: '614352898912'
        fullNameForCheck:
          $ref: '#/components/schemas/fullNameForCheck'  
      additionalProperties: false  
    fullNameForCheck:
      type: object
      required:
        - lastName
        - firstName
      description: 'Общий набор данных для проверки ФИО получателя из запроса с ФИО получателя из НСПК (если объект fullNameForCheck заполнен - осуществлять проверку ФИО, если объект fullNameForCheck не заполнен - не осуществлять проверку ФИО)'
      properties:  
        lastName:
          $ref: '#/components/schemas/surname'
        firstName:
          $ref: '#/components/schemas/name'
        middleName:
          $ref: '#/components/schemas/patronymic'
      additionalProperties: false    
    
    payeeBEN:
      type: object
      required:
        - typeCode
        - beneficiaryId
      description: 'Общий набор данные для получателя бенефициара'
      properties:
        typeCode:
          type: string
          pattern: '^BEN$'
          default: 'BEN'
          description: 'Тип участника BEN (бенефициар)'
          example: 'BEN'
        beneficiaryId:
          type: string
          format: uuid
          pattern: '^[0-9a-fA-F-]{36}$'
          description: 'Идентификатор бенефициара номинального счета, в пользу кого зачисляются средства'
          example: '99ee301b-8e06-4fd5-88d4-2ca5668294b1'   
      additionalProperties: false    
        
          
    account:
      required:
        - bankBIC
        - bankCorAccount
        - bankName
        - accountNumber
      type: object
      description: 'Данные расчетного счета'
      properties:
        accountNumber:
          $ref: '#/components/schemas/accountNumber'
        bankBIC:
          type: string
          pattern: '^[0-9]{9}$'
          description: 'БИК'
          example: '044525225'
        bankCorAccount:
          type: string
          pattern: '^[0-9]{20}$'
          description: 'Корреспондентский счет'
          example: '30101810400000000225'
        bankName:
          type: string
          pattern: ^[А-ЯЁа-яёa-zA-Z][А-ЯЁа-яёa-zA-Z0-9 №N.,()\"#$%&\'\*{|}~\[\]\-\\\/]+$
          maxLength: 140
          description: 'Наименование банка'
          example: 'ПАО СБЕРБАНК'
      additionalProperties: false
    accountNumber:
      type: string
      pattern: '^[0-9]{20,25}$'
      description: 'номер счета'
      example: '40702810538000118319'
    nominalAccountNumber:
      type: string
      pattern: '^40[0-9]{3}810[0-9]{12}$'
      description: 'Номер номинального счета'
      example: '40703810012345678910'  
    orgName:
      type: string
      pattern: '^[А-Яа-яёЁ0-9 "№.+()-]{3,160}$'
      description: 'Наименование организации'
      example: 'ПАО Ромашки'
    kpp:
      type: string
      pattern: '^[0-9]{9}$'
      description: 'Код причины постановки на учет'
      example: '773101001'
    disclose:
      type: object
      description: 'Реквизиты для раскрытия'
      additionalProperties: false
      required: 
        - transactions
      properties:
        transactions:
          type: array
          maxItems: 20
          items:
            type: object
            required:
              - transactionId
              - beneficiaryId
              - amount
            properties:
              transactionId:
                $ref: '#/components/schemas/id'
              beneficiaryId:
                $ref: '#/components/schemas/beneficiaryId'
              amount:
                $ref: '#/components/schemas/amount'
            additionalProperties: false   

        
    error:
      type: object
      required:
        - httpCode
        - httpMessage
        - moreInformation
      description: 'Сообщение об ошибке'
      properties:
        httpCode:
          pattern: '^[0-9]{3}$'
          type: string
          description: 'Код ошибки'
          example: '400'
        httpMessage:
          type: string
          pattern: "^[0-9a-zA-Z '.-]+$"
          maxLength: 50
          description: 'Описание ошибки'
          example: 'Error description'
        moreInformation:
          type: string
          pattern: '^[0-9a-zA-ZА-ЯЁа-яё.,@№^)(}{$|\s:_!=?/-]*$'
          maxLength: 254
          description: 'Дополнительная информация об ошибке'
          example: 'Error details'
      additionalProperties: false
    errorMessage:
      type: string
      #pattern: '^[0-9а-яёА-ЯЁa-zA-Z._ @()/\№,]+$'
      maxLength: 254
      description: 'Сообщение об ошибке'
      example: 'На счете получателя установлены блокирующие ограничения'

    agreement:
      type: string
      enum:
        - 'Клиент подтверждает, что операция совершается в соответствии с условиями Договора номинального счета'
      description: 'Соглашение'
      example: 'Клиент подтверждает, что операция совершается в соответствии с условиями Договора номинального счета'
    signature:
      type: string
      pattern: '^[A-Za-z0-9+/=]+$'
      maxLength: 16000
      description: 'Подпись над content'
      example: "MIIN9gYJKoZIhvcNAQcCoIIN5zCCDeMCAQExDDAKBggqhQMHAQECAjALBgkqhkiG9w0BBwGgggpKMIIFHDCCBMmgAwIBAgIQOyCK5f1GaIZJoFD6r6iDkzAKBggqhQMHAQEDAjCCAQoxGDAWBgUqhQNkARINMTIzNDU2Nzg5MDEyMzEaMBgGCCqFAwOBAwEBEgwwMDEyMzQ1Njc4OTAxLzAtBgNVBAkMJtGD0LsuINCh0YPRidGR0LLRgdC60LjQuSDQstCw0Lsg0LQuIDE4MQswCQYDVQQGEwJSVTEZMBcGA1UECAwQ0LMuINCc0L7RgdC60LLQsDEVMBMGA1UEBwwM0JzQvtGB0LrQstCwMSUwIwYDVQQKDBzQntCe0J4gItCa0KDQmNCf0KLQni3Qn9Cg0J4iMTswOQYDVQQDDDLQotC10YHRgtC+0LLRi9C5INCj0KYg0J7QntCeICLQmtCg0JjQn9Ci0J4t0J/QoNCeIjAeFw0xODA5MTIxMDE5MzBaFw0yMzA5MTIxMDI4NTVaMIIBCjEYMBYGBSqFA2QBEg0xMjM0NTY3ODkwMTIzMRowGAYIKoUDA4EDAQESDDAwMTIzNDU2Nzg5MDEvMC0GA1UECQwm0YPQuy4g0KHRg9GJ0ZHQstGB0LrQuNC5INCy0LDQuyDQtC4gMTgxCzAJBgNVBAYTAlJVMRkwFwYDVQQIDBDQsy4g0JzQvtGB0LrQstCwMRUwEwYDVQQHDAzQnNC+0YHQutCy0LAxJTAjBgNVBAoMHNCe0J7QniAi0JrQoNCY0J/QotCeLdCf0KDQniIxOzA5BgNVBAMMMtCi0LXRgdGC0L7QstGL0Lkg0KPQpiDQntCe0J4gItCa0KDQmNCf0KLQni3Qn9Cg0J4iMGYwHwYIKoUDBwEBAQEwEwYHKoUDAgIjAQYIKoUDBwEBAgIDQwAEQJgf/alQzSGGMPRZBnKp1j1rwDOCBkY349whSrH4n7dW7KUttYGHtp3CLt/9CTNTnBgyrNdCLgml9DajpcHSIvCjggH+MIIB+jA2BgUqhQNkbwQtDCsi0JrRgNC40L/RgtC+0J/RgNC+IENTUCIgKNCy0LXRgNGB0LjRjyA0LjApMIIBIQYFKoUDZHAEggEWMIIBEgwrItCa0YDQuNC/0YLQvtCf0YDQviBDU1AiICjQstC10YDRgdC40Y8gNC4wKQxB0KPQtNC+0YHRgtC+0LLQtdGA0Y/RjtGJ0LjQuSDRhtC10L3RgtGAICLQmtGA0LjQv9GC0L7Qn9GA0L4g0KPQpiIMT9Ch0LXRgNGC0LjRhNC40LrQsNGCINGB0L7QvtGC0LLQtdGC0YHRgtCy0LjRjyDihJYg0KHQpC8wMDAtMDAwMCDQvtGCIDAwLjAwLjAwMDAMT9Ch0LXRgNGC0LjRhNC40LrQsNGCINGB0L7QvtGC0LLQtdGC0YHRgtCy0LjRjyDihJYg0KHQpC8wMDAtMDAwMCDQvtGCIDAwLjAwLjAwMDAwCwYDVR0PBAQDAgGGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFJuFXvuB3E1ZB1Fjz77f2ix/yUQ8MBIGCSsGAQQBgjcVAQQFAgMBAAEwJQYDVR0gBB4wHDAIBgYqhQNkcQEwCAYGKoUDZHECMAYGBFUdIAAwIwYJKwYBBAGCNxUCBBYEFMjaZsu2l9I+yWcdwltkOqvcu89pMAoGCCqFAwcBAQMCA0EAPpXN2B+VvQmrc4L1BODyZhIygpsrA8xLwLNz+OcN1r2DyCctAcHs72VdrHf93dqdBOK/6AJ/hzYbz6x6KJwh/jCCBSYwggTToAMCAQICE3wAA9tSn+fyWo8tD/sAAQAD21IwCgYIKoUDBwEBAwIwggEKMRgwFgYFKoUDZAESDTEyMzQ1Njc4OTAxMjMxGjAYBggqhQMDgQMBARIMMDAxMjM0NTY3ODkwMS8wLQYDVQQJDCbRg9C7LiDQodGD0YnRkdCy0YHQutC40Lkg0LLQsNC7INC0LiAxODELMAkGA1UEBhMCUlUxGTAXBgNVBAgMENCzLiDQnNC+0YHQutCy0LAxFTATBgNVBAcMDNCc0L7RgdC60LLQsDElMCMGA1UECgwc0J7QntCeICLQmtCg0JjQn9Ci0J4t0J/QoNCeIjE7MDkGA1UEAwwy0KLQtdGB0YLQvtCy0YvQuSDQo9CmINCe0J7QniAi0JrQoNCY0J/QotCeLdCf0KDQniIwHhcNMjExMDAxMTQyNTMxWhcNMjIwMTAxMTQzNTMxWjCBtjEYMBYGCCqFAwOBAwEBEgo2MTY1MTczNDA4MSAwHgYJKoZIhvcNAQkBFhFpaWNvbWV0YUB0ZWN0LmNvbTEvMC0GA1UEAwwm0JrQvtC80LXRgtCwINCY0LLQsNC9INCY0LLQsNC90L7QstC40YcxFTATBgNVBAoMDNCa0L7QvNC10YLQsDEjMCEGA1UEBwwa0KDQvtGB0YLQvtCyLdC90LAt0JTQvtC90YMxCzAJBgNVBAYTAlJVMGYwHwYIKoUDBwEBAQEwEwYHKoUDAgIkAAYIKoUDBwEBAgIDQwAEQFnrKMdW+QUgH8484b8cVBr3LQmikew2ZWUnfXpFzNi0yEfh/JM/autCt/YhmX9bAkYH86jCHq6J2RMk5VRJOPyjggJaMIICVjAPBgNVHQ8BAf8EBQMDB/AAMBMGA1UdJQQMMAoGCCsGAQUFBwMCMB0GA1UdDgQWBBR+BEDU3Eo8o2VJC0hT3Pi7FmBArTAfBgNVHSMEGDAWgBSbhV77gdxNWQdRY8++39osf8lEPDCCAQ8GA1UdHwSCAQYwggECMIH/oIH8oIH5hoG1aHR0cDovL3Rlc3Rnb3N0MjAxMi5jcnlwdG9wcm8ucnUvQ2VydEVucm9sbC8hMDQyMiEwNDM1ITA0NDEhMDQ0MiEwNDNlITA0MzIhMDQ0YiEwNDM5JTIwITA0MjMhMDQyNiUyMCEwNDFlITA0MWUhMDQxZSUyMCEwMDIyITA0MWEhMDQyMCEwNDE4ITA0MWYhMDQyMiEwNDFlLSEwNDFmITA0MjAhMDQxZSEwMDIyKDEpLmNybIY/aHR0cDovL3Rlc3Rnb3N0MjAxMi5jcnlwdG9wcm8ucnUvQ2VydEVucm9sbC90ZXN0Z29zdDIwMTIoMSkuY3JsMIHaBggrBgEFBQcBAQSBzTCByjBEBggrBgEFBQcwAoY4aHR0cDovL3Rlc3Rnb3N0MjAxMi5jcnlwdG9wcm8ucnUvQ2VydEVucm9sbC9yb290MjAxOC5jcnQwPwYIKwYBBQUHMAGGM2h0dHA6Ly90ZXN0Z29zdDIwMTIuY3J5cHRvcHJvLnJ1L29jc3AyMDEyZy9vY3NwLnNyZjBBBggrBgEFBQcwAYY1aHR0cDovL3Rlc3Rnb3N0MjAxMi5jcnlwdG9wcm8ucnUvb2NzcDIwMTJnc3Qvb2NzcC5zcmYwCgYIKoUDBwEBAwIDQQA2aueOfec/1xFA/NOfciGpRGYPr06YaDfZRdx0jbiU2fubJgSjB/MvZMsrOrIPGSK9DBN9pk/cOqDQ3f20TottMYIDczCCA28CAQEwggEjMIIBCjEYMBYGBSqFA2QBEg0xMjM0NTY3ODkwMTIzMRowGAYIKoUDA4EDAQESDDAwMTIzNDU2Nzg5MDEvMC0GA1UECQwm0YPQuy4g0KHRg9GJ0ZHQstGB0LrQuNC5INCy0LDQuyDQtC4gMTgxCzAJBgNVBAYTAlJVMRkwFwYDVQQIDBDQsy4g0JzQvtGB0LrQstCwMRUwEwYDVQQHDAzQnNC+0YHQutCy0LAxJTAjBgNVBAoMHNCe0J7QniAi0JrQoNCY0J/QotCeLdCf0KDQniIxOzA5BgNVBAMMMtCi0LXRgdGC0L7QstGL0Lkg0KPQpiDQntCe0J4gItCa0KDQmNCf0KLQni3Qn9Cg0J4iAhN8AAPbUp/n8lqPLQ/7AAEAA9tSMAoGCCqFAwcBAQICoIIB5zAYBgkqhkiG9w0BCQMxCwYJKoZIhvcNAQcBMBwGCSqGSIb3DQEJBTEPFw0yMTEwMDExNDU4MjZaMC8GCSqGSIb3DQEJBDEiBCA/U5ohPpfIAswinUdMaqMqglo2CyqTOpSf2SUgjZzhuzCCAXoGCyqGSIb3DQEJEAIvMYIBaTCCAWUwggFhMIIBXTAKBggqhQMHAQECAgQg1wk0diRGLZG+oWXUM8cCdDszaDCKQ5onnGCp3uNcAnIwggErMIIBEqSCAQ4wggEKMRgwFgYFKoUDZAESDTEyMzQ1Njc4OTAxMjMxGjAYBggqhQMDgQMBARIMMDAxMjM0NTY3ODkwMS8wLQYDVQQJDCbRg9C7LiDQodGD0YnRkdCy0YHQutC40Lkg0LLQsNC7INC0LiAxODELMAkGA1UEBhMCUlUxGTAXBgNVBAgMENCzLiDQnNC+0YHQutCy0LAxFTATBgNVBAcMDNCc0L7RgdC60LLQsDElMCMGA1UECgwc0J7QntCeICLQmtCg0JjQn9Ci0J4t0J/QoNCeIjE7MDkGA1UEAwwy0KLQtdGB0YLQvtCy0YvQuSDQo9CmINCe0J7QniAi0JrQoNCY0J/QotCeLdCf0KDQniICE3wAA9tSn+fyWo8tD/sAAQAD21IwCgYIKoUDBwEBAQEEQCS2z4wN+cZlvy+49XUpf/K6pO2T/In+4PSC6xO0zJLGpiWIvbijHwaiZ8CpWu7/GlN++fWzkai7lAd4E0g4Qis="
  
    
    
    errorSberBusinessAPIBadRequest:
      description: 'Схема ответа канала SberBusinessAPI. Данные не соответствуют требованиям валидации. Сведения о некорректных атрибутах request содержатся в массивах fieldNames и checks. Подробные требования к атрибутам описаны в request ресурса, включая типы, форматы и регулярные выражения. Необходимо скорректировать заполнение атрибутов и повторить запрос.'
      type: object
      properties:
        internalErrorCode:
          description: 'Внутренний код, указывающий на место возникновения ошибки.'
          type: string
          minLength: 1
          example: '241.1-1000'
          x-field-extra-annotation: "@com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL)"
        cause:
          type: string
          description: 'Причина ошибки.'
          example: 'DESERIALIZATION_FAULT'
        referenceId:
          type: string
          format: uuid
          description: 'Уникальный идентификатор ошибки.'
          example: 'd1bdba36-d0b5-96c9-88ef-44083cf88ef2'
        message:
          type: string
          description: 'Сообщение об ошибке.'
          example: 'Неверный формат запроса'
        checks:
          type: array
          maxItems: 200
          items:
            $ref: '#/components/schemas/Check'
          description: 'Список проверок, приведших к ошибке.'
        fieldNames:
          description: 'Названия полей с некорректным значением.'
          type: array
          maxItems: 200
          items:
            type: string
            example: 'fileIds[0]'
      additionalProperties: false   
    Check:
      description: 'Результат проверки.'
      type: object
      properties:
        level:
          $ref: '#/components/schemas/ErrorCode'
        message:
          type: string
          description: 'Сообщение об ошибке.'
          example: 'Cannot deserialize value of type java.util.UUID from String \"6f5186a3-f40e-4694-b7b7-86433d342649q\": UUID has to be represented by standard 36-char representation'
        fields:
          type: array
          maxItems: 200
          description: 'Названия полей (при наличии связи с моделью).'
          items:
            type: string
            example: 'fileIds[0]'   
      additionalProperties: false
    ErrorCode:
      description: 'Уровень результата. Возможные результаты - ERROR, WARNING.'
      example: 'ERROR'
      type: string
      maxLength: 20
      enum:
        - ERROR
        - WARNING   
    bankListSBPresp:
      type: object
      properties:
        banks:
          description: Список банков-получателей
          type: array
          maxItems: 500
          items:
            type: object
            description: реквизиты банка
            required:
              - agentId
              - bankBIC
              - bankName
            additionalProperties: false
            properties:
              agentId:
                description: Иденификатор банка в СБП
                type: string
                pattern: '^(?!.*--)[^<>#@&$’*]+$'
                minLength: 0
                maxLength: 12
                example: 123456789123
              bankBIC:
                description: БИК банка
                type: string
                pattern: '^[0-9]{9}$'
                minLength: 0
                maxLength: 9
                example: 046015602
              bankName:
                description: Наименование банка
                pattern: '^(?!.*--)[^<>#@&$’*]+$'
                type: string
                minLength: 0
                maxLength: 50
                example: Альфа-банк
      additionalProperties: false
#анкета бенефициара
    birthDate:
      type: string
      pattern: '^(19|20)[0-9]{2}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$'
      description: 'Дата рождения'
      example: '1985-09-09'
    beneficiaryIndividualliteNonResident:
      type: object
      required:
        - beneficiaryId
        - beneficiaryType
        - nominalAccountId
        - contractNumber
        - contractDate
        - surname
        - name
        - birthDate
        - birthCountry
        - birthPlace
        - identificationDoc
        - addresses
        - account
        - phone
        - inn
        - citizenShips
        - taxResidenceDifference
        - rightOfResidenceUnderInvestmentScheme
      description: 'Анкета бенефициара ФЛ-нерезидента'
      properties:
        beneficiaryId:
          $ref: '#/components/schemas/beneficiaryId'
        beneficiaryType:
          description: 'Тип бенефициара 4 - ФЛ Нерез'
          type: string
          pattern: '^4$'
          example: '4'
        nominalAccountId:
          $ref: '#/components/schemas/id'
        contractNumber:
          $ref: '#/components/schemas/contractNumber'
        contractDate:
          $ref: '#/components/schemas/date'
        surname:
          type: string
          pattern: '^[А-ЯЁA-Z][А-ЯЁа-яёA-Za-z -]+$'
          maxLength: 50
          description: 'Фамилия'
          example: 'Коган-Константинопольский'
        name:
          type: string
          pattern: '^[А-ЯЁA-Z][А-ЯЁа-яёA-Za-z -]+$'
          maxLength: 50
          description: 'Имя'
          example: 'Фарид Оглы'
        patronymic:
          type: string
          pattern: '^[А-ЯЁA-Z][А-Яа-яёЁA-Za-z -]+$'
          maxLength: 50
          description: 'Отчество' #поле обязательно к заполнению при наличии в паспорте
          example: 'Николаевич'
        birthDate:
          $ref: '#/components/schemas/birthDate'
        identificationDoc:
          $ref: "#/components/schemas/identificationDocNonResident"
        otherCountriesOfTaxResident:
          type: array
          maxItems: 20
          items:
            $ref: "#/components/schemas/otherCountriesOfTaxResident"
        addresses:
          type: array
          maxItems: 2
          items:
            type: object
            required:
              - typeAddress
              - address
            additionalProperties: false
            properties:
              typeAddress:
                type: string
                enum: 
                  - 'адрес регистрации'
                  - 'адрес фактического места пребывания/проживания'
              address:
                $ref: '#/components/schemas/addressNonResident'
        birthCountry:
          $ref: '#/components/schemas/country' 
        birthPlace:
          type: string
          pattern: '^[А-ЯЁа-яё .-]+$'
          maxLength: 50
          description: 'Место рождения – Город'
          example: 'г. Санкт-Петербург'
        account:
          oneOf:
            - $ref: '#/components/schemas/accountProfile'
            - $ref: '#/components/schemas/sbpRequisites'
        residentCard:
          description: 'Вид на жительство - код страны в формате https://snipp.ru/handbk/iso-3166-1-alpha-2'
          type: array
          maxItems: 10
          items:
            description: 'Код страны в формате https://snipp.ru/handbk/iso-3166-1-alpha-2'
            type: object
            additionalProperties: false
            properties:
              country:
                $ref: '#/components/schemas/country' 
        citizenShips:
          description: 'Гражданство - код страны в формате https://snipp.ru/handbk/iso-3166-1-alpha-2'
 
          type: array
          maxItems: 10
          items:
            description: 'Код страны в формате https://snipp.ru/handbk/iso-3166-1-alpha-2'
            type: object
            additionalProperties: false
            properties:
              country:
                $ref: '#/components/schemas/country' 
        taxResidenceDifference:
          description: 'Отличается ли страна Вашего налогового резидентства от адреса фактического проживания?'
          type: object
          required: 
            - taxResidenceDifference
          additionalProperties: false
          properties:
            taxResidenceDifference:
              type: boolean
              example: false
              description: 'Отличается ли страна Вашего налогового резидентства от адреса фактического проживания?'
            explanationLackResidencyCountryResidence:
              description: 'Причина отсутствия страны Вашего налогового резидентства в адресе фактического проживания'
              type: string
              maxLength: 255
              pattern: '^[А-ЯЁа-яё .-]+$'
              example: 'Причина отсутствия страны Вашего налогового резидентства в адресе фактического проживания'
            
        rightOfResidenceUnderInvestmentScheme:
          $ref: '#/components/schemas/rightOfInvestmentScheme'
 
        phone:
          $ref: '#/components/schemas/phone'
        email:
          $ref: '#/components/schemas/email'
        inn:
          type: string
          pattern: '^[0-9]{12}$'
          description: 'ИНН'
          example: '097743528989'
      additionalProperties: false    
    identificationDocNonResident:
      type: object
      required:
        - number
        - issueDate
        - identificationDocType
        - issuer
      description: 'Документ удостоверяющий личность'
      properties:
        identificationDocType:
          type: string
          description: 'Тип (наименование) документа удостоверяющего личность:<br>- PF - Паспорт иностранного гражданина,<br>- RAC - Свид-во о рассмотрении ходатайства о признании лица беженцем на территории РФ,<br>- RCS - Вид на жительство в Российской Федерации лица без гражданства,<br>- RID - Удостоверение беженца,<br> - PTS - Свидетельство о предоставлении временного убежища на территории РФ'
          enum:
            - 'PF'
            - 'RAC'
            - 'RCS'
            - 'RID'
            - 'PTS'
          example: 'PF'
          default: 'PF'
        seria:
          type: string
          pattern: '^(?!.*[^A-Z0-9])[A-Z0-9]{0,10}$'
          description: 'Серия документа'
          example: '4508'
        number:
          type: string
          description: 'Номер документа'
          pattern: '^(?!.*[^A-Z0-9])[A-Z0-9]{0,30}$'
          example: 'FA567845'
        issuer:
          type: string
          pattern: '^[А-ЯЁа-яё0-9 -/.№]{0,150}$'
          description: 'Наименование органа, выдавшего документ. Обязательно для Паспорт иностранного гражданина и Паспорта РФ'
          example: 'ОВД г. Минск'
        issueDate:
          type: string
          pattern: '^(19|20)[0-9]{2}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$'
          description: 'Дата выдачи документа'
          example: '2026-03-15'
        expireDate:
          type: string
          pattern: '^(19|20)[0-9]{2}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$'
          description: 'Дата окончания срока действия документа. Указываемая дата должна быть строго больше текущей. Разница между датой выдачи и датой окончания не должна превышать определенный срок, в зависимости от типа'
          example: '2035-03-15'
      additionalProperties: false
    otherCountriesOfTaxResident:
      description: "Страны налогового резидентства"
      type: object
      required: 
        - country
      properties:
        country:
          $ref: '#/components/schemas/country'
        taxId:
          $ref: '#/components/schemas/taxId'
        inAbsenceReason:
          $ref: '#/components/schemas/inAbsenceReason'
      additionalProperties: false
    country:
      description: 'Код страны в формате https://snipp.ru/handbk/iso-3166-1-alpha-2'
      type: string
      maxLength: 2
      pattern: '^[A-Z]{2}$'
      example: 'BY'
    taxId:
      description: "ИН в другой стране налогового резидентства"
      type: string
      maxLength: 50
      minLength: 0
    inAbsenceReason:
      description: "Причина отсутствия ИН"
      type: string
      enum:
        - юрисдикция не присваивает ИН
        - юрисдикция не присвоила ИН физическому лицу
        - иное
        - подано заявление на получение и(или) восстановление идентификатора налогоплательщика (ИН)
      example: "юрисдикция не присвоила ИН физическому лицу"

    addressNonResident:
      type: string
      pattern: '^[1-9А-ЯЁа-яё][0-9А-ЯЁа-яё №N.,()/\"«»-]{1,250}$'
      description: 'Адрес'
      example: '123456, Кабардино-Балкарская Республика, г.Тырны-Ауз, ул. 50 лет Окт. революци, 69/с1, стр.17, корп.1, этаж 8, ком.258 '
    rightOfInvestmentScheme:
      type: object
      description: 'Налоговое резидентство получено по программе «гражданство/ резидентство в обмен на инвестиции'
      required: 
        - rightOfResidenceUnderInvestmentScheme
      additionalProperties: false  
      properties:
        rightOfResidenceUnderInvestmentScheme:
          description: 'Право на проживание в РФ по инвестиционной схеме'
          type: object
          required: 
            - rightOfResidenceUnderInvestmentScheme
          properties:
            rightOfResidenceUnderInvestmentScheme:
              description: 'Имеет ли право на проживание в РФ по инвестиционной схеме?' 
              type: boolean
              example: false
            country:
              type: array
              maxItems: 20
              items:
                description: '3 - Страны, в которых получено право на проживание по инвестиционной схеме (прил.4.0, п.3.2) (Код страны в формате https://snipp.ru/handbk/iso-3166-1-alpha-2)'
                type: string
                maxLength: 2
                pattern: '^[A-Z]{2}$'
                example: 'BY'
                #$ref: '#/components/schemas/country'
          additionalProperties: false
                
        ninetyDaysOtherResidence:
          description: 'Верно ли утверждение, что более 90 дней были проведены в какой-либо другой стране(ах), отличном от указанного Вами в качестве юрисдикции налогового резидентства, в течение предыдущего года?'
          type: object
          properties:
            ninetyDaysOtherResidence:
              description: 'Более 90 дней были проведены в какой-либо другой стране(ах), отличном от указанного в качестве юрисдикции налогового резидентства, в течение предыдущего года'
              type: boolean
              example: false
            country:
              type: array
              maxItems: 20
              items:
                description: '4 - Страны, в которых было проведено более 90 дней, отличное от указанного в качестве юрисдикции налогового резидентства, в течение предыдущего года (Код страны в формате https://snipp.ru/handbk/iso-3166-1-alpha-2)'
                type: string
                maxLength: 2
                pattern: '^[A-Z]{2}$'
                example: 'BY'
              #  $ref: '#/components/schemas/country'
          additionalProperties: false
        statesFilingIncomeDeclarations:
          description: 'Страны, в которых подавалась декларация по налогу на доходы физических лиц за предыдущий год'
          type: object
          properties:
            statesFilingIncomeDeclarations:
              description: 'Подтверждаю, что являюсь плательщиком подоходного налога или его аналога в следующих государствах'
              type: boolean
              example: false
            country:
              type: array
              maxItems: 20
              items:
                description: '1 - Страны, в которых подавалась декларация по налогу на доходы физических лиц за предыдущий год (Код страны в формате https://snipp.ru/handbk/iso-3166-1-alpha-2)'
                type: string
                maxLength: 2
                pattern: '^[A-Z]{2}$'
                example: 'BY'
          additionalProperties: false
              
        centerOfVitalInterestsInStates:
          description: 'Страны, в которых находится «центр моих жизненных интересов»'
          type: object
          properties:
            centerOfVitalInterestsInStates:
              description: 'Подтверждаю, что являюсь плательщиком подоходного налога или его аналога в следующих государствах'
              type: boolean
              example: false
            country:
              type: array
              maxItems: 20
              items:
                description: '1 - Страны, в которых находится «центр моих жизненных интересов» (Код страны в формате https://snipp.ru/handbk/iso-3166-1-alpha-2)'
                type: string
                maxLength: 2
                pattern: '^[A-Z]{2}$'
                example: 'BY'
          additionalProperties: false
      
    beneficiaryOrglite:
      type: object
      required:
        - beneficiaryId
        - beneficiaryType
        - nominalAccountId
        - contractNumber
        - contractDate
        - ogrn
        - inn
        - kpp
        - orgName
        - account
        - legalAddress
        - isForeignOrg
        - isTaxResidentRF
        - isOnlyTaxResidentRF
        - isControlPersonsRF
        - phone
        - email
      description: 'Анкета бенефициара ЮЛ'
      properties:
        beneficiaryId:
          $ref: '#/components/schemas/beneficiaryId'
        beneficiaryType:
          type: string
          pattern: '^1$'
          description: 'Тип бенефициара 1 - ЮЛ'
          example: '1'
        nominalAccountId:
          $ref: '#/components/schemas/id'
        contractNumber:
          $ref: '#/components/schemas/contractNumber'
        contractDate:
          $ref: '#/components/schemas/date'
        ogrn:
          type: string
          pattern: '^[0-9]{13}$'
          description: 'ОГРН'
          example: '1047796372711'
        inn:
          type: string
          pattern: '^[0-9]{10}$'
          description: 'ИНН'
          #minLength: 10
          example: '0743528989'
        kpp:
          $ref: '#/components/schemas/kpp'
        orgName:
          $ref: '#/components/schemas/orgName'
        account:
          $ref: '#/components/schemas/account'
        legalAddress:
          $ref: '#/components/schemas/addresslite'
        isForeignOrg:
          type: boolean
          description: 'Признак зарубежной организации: true – да, false – нет'
          example: false
        isTaxResidentRF:
          type: boolean
          description: 'Признак налогового резидента РФ: true – да, false – нет'
          example: true
        isOnlyTaxResidentRF:
          type: boolean
          description: 'Признак налогового резиденства только в РФ: true – да, false – нет'
          example: true
        isControlPersonsRF:
          type: boolean
          description: 'Являются ли все контролирующие лица организации налоговыми резидентами только РФ?: true – да, false – нет'
          example: true
        phone:
          $ref: '#/components/schemas/phone'
        email:
          $ref: '#/components/schemas/email'
      additionalProperties: false
    
    beneficiaryIndividualEntrepreneurlite:
      type: object
      required:
        - beneficiaryId
        - beneficiaryType
        - nominalAccountId
        - contractNumber
        - contractDate
        - surname
        - name
        - birthDate
        - identificationDoc
        - inn
        - ogrnip
        - account
        - postAddress
        - isOnlyTaxResidentRF
        - email
        - phone
      description: 'Анкета бенефициара ИП'
      properties:
        beneficiaryId:
          $ref: '#/components/schemas/beneficiaryId'
        beneficiaryType:
          description: 'Тип бенефициара 2 - ИП'
          type: string
          pattern: '^2$'
          example: '2'
        nominalAccountId:
          $ref: '#/components/schemas/id'
        contractNumber:
          $ref: '#/components/schemas/contractNumber'
        contractDate:
          $ref: '#/components/schemas/date'
        surname:
          $ref: '#/components/schemas/surname'
        name:
          $ref: '#/components/schemas/name'
        patronymic:
          $ref: '#/components/schemas/patronymic'
        birthDate:
          $ref: '#/components/schemas/birthDate'
        identificationDoc:
          $ref: "#/components/schemas/identificationDoc"
        inn:
          type: string
          pattern: '^[0-9]{12}$'
          description: 'ИНН'
          #minLength: 12
          example: '097743528989'
        account:
          $ref: '#/components/schemas/account'
        ogrnip:
          type: string
          pattern: '^3[0-9]{14}$'
          description: 'ОГРНИП'
          example: '304500116000157'
        postAddress:
          $ref: '#/components/schemas/addressPost'
        isOnlyTaxResidentRF:
          type: boolean
          description: 'Признак налогового резиденства только в РФ: true – да, false – нет'
          example: true
        phone:
          $ref: '#/components/schemas/phone'
        email:
          $ref: '#/components/schemas/email'
      additionalProperties: false
    beneficiaryIndividuallite:
      type: object
      required:
        - beneficiaryId
        - beneficiaryType
        - nominalAccountId
        - contractNumber
        - contractDate
        - surname
        - name
        - birthDate
        - birthPlace
        - inn
        - identificationDoc
        - regAddress
        - isOnlyTaxResidentRF
        - phone
        - account
      description: 'Анкета бенефициара ФЛ'
      properties:
        beneficiaryId:
          $ref: '#/components/schemas/beneficiaryId'
        beneficiaryType:
          description: 'Тип бенефициара 3 - ФЛ'
          type: string
          pattern: '^3$'
          example: '3'
        nominalAccountId:
          $ref: '#/components/schemas/id'
        contractNumber:
          $ref: '#/components/schemas/contractNumber'
        contractDate:
          $ref: '#/components/schemas/date'
        surname:
          $ref: '#/components/schemas/surname'
        name:
          $ref: '#/components/schemas/name'
        patronymic:
          $ref: '#/components/schemas/patronymic'
        birthDate:
          $ref: '#/components/schemas/birthDate'
        identificationDoc:
          $ref: "#/components/schemas/identificationDoc"
        regAddress:
          $ref: '#/components/schemas/addressReg'
        birthPlace:
          type: string
          pattern: '^[А-ЯЁа-яё .-]+$'
          maxLength: 50
          description: 'Место рождения – Город'
          example: 'г. Санкт-Петербург'
        account:
          oneOf:
            - $ref: '#/components/schemas/accountProfile'
            - $ref: '#/components/schemas/sbpRequisites'
        isOnlyTaxResidentRF:
          type: boolean
          description: 'Признак налогового резиденства только в РФ: true – да, false – нет'
          example: true
        phone:
          $ref: '#/components/schemas/phone'
        email:
          $ref: '#/components/schemas/email'
        inn:
          type: string
          pattern: '^[0-9]{12}$'
          description: 'ИНН'
          #minLength: 12
          example: '097743528989'
      additionalProperties: false
    surname:
      type: string
      pattern: '^[А-ЯЁA-Z][А-ЯЁа-яёA-Za-z -]+$'
      maxLength: 50
      description: 'Фамилия'
      example: 'Коган-Константинопольский'
    name:
      type: string
      pattern: '^[А-ЯЁA-Z][А-ЯЁа-яёA-Za-z -]+$'
      maxLength: 50
      description: 'Имя'
      example: 'Фарид Оглы'
    patronymic:
      type: string
      pattern: '^[А-ЯЁA-Z][А-ЯЁа-яёA-Za-z -]+$'
      maxLength: 50
      description: 'Отчество' #поле обязательно к заполнению при наличии в паспорте
      example: 'Николаевич'
    contractNumber:
      type: string
      pattern: '^[А-ЯЁа-яёA-Za-z\d\/\-\_]+$'
      maxLength: 25
      description: 'Номер договора-основания'
      example: 'ДКП02-01/2022'
    addresslite:
      type: string
      pattern: '^[1-9А-ЯЁа-яёA-Za-z][0-9А-ЯЁа-яёA-Za-z №N.,()/\"«»-]{1,250}$'
      description: 'Юридический адрес'
      example: '123456, Кабардино-Балкарская Республика, г.Тырны-Ауз, ул. 50 лет Окт. революци, 69/с1, стр.17, корп.1, этаж 8, ком.258 '
    addressReg:
      type: string
      pattern: '^[1-9А-ЯЁа-яёA-Za-z][0-9А-ЯЁа-яёA-Za-z №N.,()/\"«»-]{1,250}$'
      description: 'Адрес регистрации'
      example: '123456, Кабардино-Балкарская Республика, г.Тырны-Ауз, ул. 50 лет Окт. революци, 69/с1, стр.17, корп.1, этаж 8, ком.258 '  
    addressPost:
      type: string
      pattern: '^[1-9А-ЯЁа-яёA-Za-z][0-9А-ЯЁа-яёA-Za-z №N.,()/\"«»-]{1,250}$'
      description: 'Почтовый адрес'
      example: '123456, Кабардино-Балкарская Республика, г.Тырны-Ауз, ул. 50 лет Окт. революци, 69/с1, стр.17, корп.1, этаж 8, ком.258 '
    
    phone:
      type: string
      pattern: '^((8|\+7)[ -]?)?(\(?\d{3}\)?[ -]?)?[\d -]{7,10}$'
      description: 'Номер телефона для контактов (оповещений)'
      example: '+7(905)123-45-67'
    
    email:
      type: string
      format: email
      maxLength: 40
      description: 'Адрес электронной почты для контактов (оповещений). (**format: email** в данном атрибуте подразумевает следующие правила валидации: данное поле должно содержать строку, соответствующую формату адреса электронной почты согласно стандарту RFC; соответствие значения стандарту электронного адреса (например, с указанием домена верхнего уровня); отсутствие ведущих или конечных символов пробела; проверка актуальных доменов верхнего уровня согласно документации - https://commons.apache.org/proper/commons-validator/apidocs/src-html/org/apache/commons/validator/routines/DomainValidator.html)'
      example: 'info@your-company.ru'
    identificationDoc:
      type: object
      required:
        - seria
        - number
        - issuer
        - issueDate
        - issuerCode
      description: 'Документ удостоверяющий личность'
      properties:
        identificationDocType:
          type: string
          description: 'Тип (наименование) документа, удостоверяющего личность - Паспорт гражданина РФ'
          enum:
            - 'Паспорт гражданина РФ'
          example: 'Паспорт гражданина РФ'
          default: 'Паспорт гражданина РФ'
        seria:
          type: string
          pattern: '^[0-9]{4}$'
          description: 'Серия документа'
          example: '4508'
        number:
          type: string
          pattern: '^[0-9]{6}$'
          description: 'Номер документа'
          example: '947357'
        issuer:
          type: string
          pattern: '^[А-ЯЁа-яё0-9 -/.№]{0,150}$'
          description: 'Наименование органа, выдавшего документ'
          example: 'ОВД района Северное Тушино г. Москвы'
        issueDate:
          type: string
          pattern: '^(19|20)[0-9]{2}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$'
          description: 'Дата выдачи паспорта'
          example: '2022-03-15'
        issuerCode:
          type: string
          pattern: '^[0-9-]{7}$'
          description: 'Код подразделения'
          example: '123-243'
      additionalProperties: false
    accountProfile:
      required:
        - bankBIC
        - bankCorAccount
        - bankName
        - accountNumber
      type: object
      description: 'Расчетный счет бенефициара, на который будут выведены средства с номинального счета при исключении бенефициара из реестра'
      properties:
        accountNumber:
          $ref: '#/components/schemas/accountNumber'
        bankBIC:
          type: string
          pattern: '^[0-9]{9}$'
          description: 'БИК'
          example: '044525225'
        bankCorAccount:
          type: string
          pattern: '^[0-9]{20}$'
          description: 'Корреспондентский счет'
          example: '30101810400000000225'
        bankName:
          type: string
          pattern: ^[А-ЯЁа-яёa-zA-Z][А-ЯЁа-яёa-zA-Z0-9 №N.,()\"#$%&\'\*{|}~\[\]\-\\\/]+$
          maxLength: 140
          description: 'Наименование банка'
          example: 'ПАО СБЕРБАНК'
      additionalProperties: false
    sbpRequisites:
      type: object
      required:
        - phone
        - bankBIC
      description: 'Реквизиты СБП бенефициара, по которым будут выведены средства с номинального счета при исключении бенефициара из реестра'
      properties:
        phone:
          $ref: '#/components/schemas/receiverPhone'
        bankBIC:
          description: БИК банка получателя
          type: string
          maxLength: 9
          pattern: "^[0-9]{9}$" 
      additionalProperties: false
    receiverPhone:
      description: "Номер телефона получателя ФЛ в рамках перевода СБП В2С. Первые 3 цифры номера - код страны (если код страны менее 3 символов, то его необходимо впереди дополнить нулями (например, '007' для РФ)). Последующие 12 цифр - код идентификации и номер абонента"
      type: string
      maxLength: 15
      minLength: 11
      example: "0079052222222"  
##анкета бенефициара  
  
    errorSberBusinessAPIUnauthorized:
      description: 'Схема ответа канала SberBusinessAPI. Информационное сообщение об ошибке, сбое или предупреждение.'
      type: object
      properties:
        internalErrorCode:
          description: 'Внутренний код, указывающий на место возникновения ошибки.'
          type: string
          minLength: 1
          example: '234.1-1003'
          x-field-extra-annotation: "@com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL)"
        cause:
          type: string
          description: 'Причина или основание сообщения.'
          example: 'UNAUTHORIZED'
        referenceId:
          type: string
          format: uuid
          description: 'Уникальный идентификатор ошибки.'
          example: '22a6dd81-103a-4d3a-8e9b-0ba4b527f5f6'
        message:
          type: string
          description: 'Сообщение об ошибке.'
          example: 'Ошибка авторизации по Access Token 3513f959-bbd5-490a-9f9f-67fb7380fae5-2'  
      additionalProperties: false    
    errorSberBusinessAPIForbidden:
      description: 'Схема ответа канала SberBusinessAPI. Информационное сообщение об ошибке, сбое или предупреждение.'
      type: object
      properties:
        internalErrorCode:
          description: 'Внутренний код, указывающий на место возникновения ошибки.'
          type: string
          minLength: 1
          example: '235.1-1003'
          x-field-extra-annotation: "@com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL)"
        cause:
          type: string
          description: 'Причина или основание сообщения.'
          example: 'CERTIFICATE_ACCESS_EXCEPTION'
        referenceId:
          type: string
          format: uuid
          description: 'Уникальный идентификатор ошибки.'
          example: '22a6dd81-103a-4d3a-8e9b-0ba4b527f5f6'
        message:
          type: string
          description: 'Сообщение об ошибке.'
          example: 'Сертификат (serialNumber = 51E75203172EFD920FAAD907ABA40448668B9210) из входящего запроса не найден в белом списке сертификатов, не истекших на момент проверки'   
      additionalProperties: false
    errorSberBusinessAPIUnprocessableEntity:
      description: 'Схема ответа канала SberBusinessAPI. Информационное сообщение об ошибке, сбое или предупреждение.'
      type: object
      properties:
        internalErrorCode:
          description: 'Внутренний код, указывающий на место возникновения ошибки.'
          type: string
          minLength: 1
          example: '256.2-1000'
          x-field-extra-annotation: "@com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL)"
        cause:
          type: string
          description: 'Причина или основание сообщения.'
          example: 'UNPROCESSABLE_ENTITY'
        referenceId:
          type: string
          format: uuid
          description: 'Уникальный идентификатор ошибки.'
          example: '22a6dd81-103a-4d3a-8e9b-0ba4b527f5f6'
        message:
          type: string
          description: 'Сообщение об ошибке.'
          example: 'Ошибка валидации'  
      additionalProperties: false  
    errorSberBusinessAPITooManyRequests:
      description: 'Схема ответа канала SberBusinessAPI. Информационное сообщение об ошибке, сбое или предупреждение.'
      type: object
      properties:
        internalErrorCode:
          description: 'Внутренний код, указывающий на место возникновения ошибки.'
          type: string
          minLength: 1
          example: '234.1-1004'
          x-field-extra-annotation: "@com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL)"
        cause:
          type: string
          description: 'Причина или основание сообщения.'
          example: 'TOO_MANY_REQUESTS'
        referenceId:
          type: string
          format: uuid
          description: 'Уникальный идентификатор ошибки.'
          example: '22a6dd81-103a-4d3a-8e9b-0ba4b527f5f6'
        message:
          type: string
          description: 'Сообщение об ошибке.'
          example: 'Превышен лимит запросов. Повторите операцию позже.'  
      additionalProperties: false  
    errorSberBusinessAPIInternalServerError:
      description: 'Схема ответа канала SberBusinessAPI. Информационное сообщение об ошибке, сбое или предупреждение.'
      type: object
      properties:
        internalErrorCode:
          description: 'Внутренний код, указывающий на место возникновения ошибки.'
          type: string
          minLength: 1
          example: '234.1-1005'
          x-field-extra-annotation: "@com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL)"
        cause:
          type: string
          description: 'Причина или основание сообщения.'
          example: 'UNKNOWN_EXCEPTION'
        referenceId:
          type: string
          format: uuid
          description: 'Уникальный идентификатор ошибки.'
          example: '22a6dd81-103a-4d3a-8e9b-0ba4b527f5f6'
        message:
          type: string
          description: 'Сообщение об ошибке.'
          example: 'При выполнении операции произошла ошибка. Мы уже работаем над её устранением. Повторите попытку позже.'  
      additionalProperties: false  
    errorSberBusinessAPIBadGateway:
      description: 'Схема ответа канала SberBusinessAPI. Информационное сообщение об ошибке, сбое или предупреждение.'
      type: object
      properties:
        internalErrorCode:
          description: 'Внутренний код, указывающий на место возникновения ошибки.'
          type: string
          minLength: 1
          example: '235.4-1005'
          x-field-extra-annotation: "@com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL)"
        cause:
          type: string
          description: 'Причина или основание сообщения.'
          example: 'BAD_GATEWAY'
        referenceId:
          type: string
          format: uuid
          description: 'Уникальный идентификатор ошибки.'
          example: '22a6dd81-103a-4d3a-8e9b-0ba4b527f5f6'
        message:
          type: string
          description: 'Сообщение об ошибке.'
          example: 'При выполнении операции произошла ошибка. Мы уже работаем над её устранением. Повторите попытку позже.'  
      additionalProperties: false  
     
    transactionsFlowResp: 
      type: object
      description: "Данные по денежным операциям"
      additionalProperties: false
      properties:
        transactions:
          type: array
          description: "Данные по денежным операциям"
          items:
            $ref: '#/components/schemas/transactionResp'
          maxItems: 200 
    transactionReportResp: 
      type: object
      description: "Данные по денежной операции"
      required:
        - status
        - paymentType
        - channel
        - createDate
        - amount
        - id
      properties:
        id:
          $ref: '#/components/schemas/id'
        status:
          $ref: '#/components/schemas/paymentStatusReport'
        paymentType:
          $ref: '#/components/schemas/paymentType'
        channel:
          $ref: '#/components/schemas/paymentMethod'
        dealId:
          $ref: '#/components/schemas/id'
        createDate:
          type: string
          format: date-time
          description: 'Время создания события'
          example: '2026-03-15T23:31:00.999Z'
        editDate:
          type: string
          format: date-time
          description: 'Время изменения статуса события'
          example: '2026-03-15T23:31:00.999Z'
        executionDate:
          type: string
          format: date-time
          description: 'Дата обработки операции'
          example: '2026-03-15T00:00:00.999Z'
        amount:
          $ref: '#/components/schemas/amount'
        purpose:
          $ref: '#/components/schemas/getPurpose'
        docNumber:
          $ref: '#/components/schemas/docNumber'  
        operationId:
          $ref: '#/components/schemas/operationId' 
      additionalProperties: false      
    
    transactionResp: 
      type: object
      description: "Данные по денежной операции"
      required:
        - status
        - paymentType
        - createDate
        - amount
        - id
      properties:
        id:
          $ref: '#/components/schemas/id'
        status:
          $ref: '#/components/schemas/paymentStatus'
        paymentType:
          $ref: '#/components/schemas/paymentType'
        channel:
          $ref: '#/components/schemas/paymentMethod'    
        createDate:
          type: string
          format: date-time
          description: 'Время создания события'
          example: '2026-03-15T23:31:00.999Z'
        editDate:
          type: string
          format: date-time
          description: 'Время изменения статуса события'
          example: '2026-03-15T23:31:00.999Z'
        executionDate:
          type: string
          format: date-time
          description: 'Дата обработки операции'
          example: '2026-03-15T00:00:00.999Z'
        errorMessage:
          $ref: '#/components/schemas/errorMessage'
        amount:
          $ref: '#/components/schemas/amount'
        purpose:
          $ref: '#/components/schemas/getPurpose'
        docNumber:
          $ref: '#/components/schemas/docNumber'  
        operationId:
          $ref: '#/components/schemas/operationId'  
      additionalProperties: false   
    oneTransactionResp: 
      type: object
      description: "Данные по денежной операции"
      required:
        - status
        - paymentType
        - createDate
        - amount
        - id
        - payer
        - payee
      properties:
        id:
          $ref: '#/components/schemas/id'
        status:
          $ref: '#/components/schemas/paymentStatus'
        paymentType:
          $ref: '#/components/schemas/paymentType'
        channel:
          $ref: '#/components/schemas/paymentMethod'    
        createDate:
          type: string
          format: date-time
          description: 'Время создания события'
          example: '2026-03-15T23:31:00.999Z'
        editDate:
          type: string
          format: date-time
          description: 'Время изменения статуса события'
          example: '2026-03-15T23:31:00.999Z'
        executionDate:
          type: string
          format: date-time
          description: 'Дата обработки операции'
          example: '2026-03-15T00:00:00.999Z'
        payer:
          $ref: '#/components/schemas/transactionParticipantPayer'
        payee:
          $ref: '#/components/schemas/transactionParticipantPayee'  
        errorMessage:
          $ref: '#/components/schemas/errorMessage'
        amount:
          $ref: '#/components/schemas/amount'
        purpose:
          $ref: '#/components/schemas/getPurpose'
        docNumber:
          $ref: '#/components/schemas/docNumber'  
        operationId:
          $ref: '#/components/schemas/operationId'  
        kvd:
          $ref: '#/components/schemas/kvd'
        priority:
          $ref: '#/components/schemas/priority'
      additionalProperties: false     
    transactionParticipantPayer: 
      type: object
      description: "Данные по отправителю денежной операции"
      properties: 
        dealId:
          $ref: '#/components/schemas/id'
        beneficiaryId:
          $ref: '#/components/schemas/id' 
        nominalAccountId:
          $ref: '#/components/schemas/id' 
        contragent:
          $ref: '#/components/schemas/contragentPayer'   
      additionalProperties: false    
    transactionParticipantPayee: 
      type: object
      description: "Данные по получателю денежной операции"
      properties: 
        dealId:
          $ref: '#/components/schemas/id'
        beneficiaryId:
          $ref: '#/components/schemas/id' 
        nominalAccountId:
          $ref: '#/components/schemas/id'   
        contragent:
          $ref: '#/components/schemas/contragentPayee' 
      additionalProperties: false   
    contragentPayee:
      type: object
      description: "Данные по получателю в рамках внешних операций"
      required:
        - name
        - inn
        - bankBIC
      properties: 
        name:
          $ref: '#/components/schemas/contragentName'
        inn:
          $ref: '#/components/schemas/inn'
        kpp:
          $ref: '#/components/schemas/kpp'
        accountNumber:
          $ref: '#/components/schemas/accountNumber'
        phone:
          $ref: '#/components/schemas/receiverPhone'
        bankBIC:  
          $ref: '#/components/schemas/bankBIC'
      additionalProperties: false  
    contragentPayer:
      type: object
      description: "Данные по отправителю в рамках внешних операций"
      required:
        - name
        - inn
        - accountNumber
        - bankBIC
      properties: 
        name:
          $ref: '#/components/schemas/contragentName'
        inn:
          $ref: '#/components/schemas/inn'
        kpp:
          $ref: '#/components/schemas/kpp'
        accountNumber:
          $ref: '#/components/schemas/accountNumber'
        bankBIC:  
          $ref: '#/components/schemas/bankBIC'
      additionalProperties: false    
    contragentName:
      type: string
      pattern: '^[А-Яа-яёЁA-Za-z0-9 "№.+()-]{3,250}$'
      description: 'Наименование'
      example: 'ПАО Ромашки'  
    inn:
      pattern: '^[0-9]{10,12}$'
      type: string
      description: 'ИНН'
      example: '0743528989'  
    bankBIC:
          type: string
          pattern: '^[0-9]{9}$'
          description: 'БИК'
          example: '044525225'    
    
    paymentType:
      type: string
      pattern: '^[A-Za-z]{1,20}$'
      description: 'Тип транзакции может принять одно из значений: "CREDIT", "DEBIT", "INTERNAL"' 
      example: 'DEBIT' 
    paymentStatus:
      type: string
      pattern: '^[A-Za-z]{1,20}$'
      description: | 
        Статус транзакции.

        Может принять одно из значений: 
          - "CREATED (Создан)", 
          - "EXECUTING (В процессе)", 
          - "DONE (Исполнен)", 
          - "ERROR (Ошибка)"
      example: 'ERROR'
    paymentStatusReport:
      type: string
      pattern: '^[A-Za-z]{1,20}$'
      description: | 
        Статус транзакции.

        Может принять только значение: 
          - "DONE (Исполнен)"
      example: 'DONE'  
    paymentMethod:
      type: string
      pattern: '^[A-Za-z]{1,20}$'
      description: | 
        Метод оплаты

        Может принять одно из значений: 
          - "SBP" (платеж по СБП)
          - "ACCOUNT" (платеж по реквизитам счета)
          - "TAX" (налоговый платеж)
          - "EXQLUDE" (при выводе средств с номинального счета по инициативе банка (при банкротстве/ликвидации бенефициара))
          - "COLLECT" (при выводе средств с номинального счета по инициативе исполнительного производства)
      example: 'ACCOUNT'   
    refundEvents:
      type: array
      description: 'Список событий возврата'
      items:
        $ref: '#/components/schemas/refundEvent'
      maxItems: 20
    refundEvent:
      type: object
      description: 'Событие возврата'
      required:
        - beneficiaryId
        - primaryTransactionId
        - refundTransaction
      properties:
        beneficiaryId:
          $ref: '#/components/schemas/id'
        primaryTransactionId:
          $ref: '#/components/schemas/id'
        refundTransaction:
          $ref: '#/components/schemas/refundTransactions'
      additionalProperties: false  
    refundTransactions:
      type: object
      description: 'Транзакция возврата'
      required:
        - id
        - createDate
        - amount
        - purpose
      properties:
        id:
          $ref: '#/components/schemas/id'
        createDate:
          type: string
          format: date-time
          description: Время создания события
          example: '2022-03-15T23:31:00.999Z'
        purpose:
          $ref: '#/components/schemas/getPurpose'
        amount:
          $ref: '#/components/schemas/amount'  
        docNumber:
          $ref: '#/components/schemas/docNumber'  
        operationId:
          $ref: '#/components/schemas/operationId'  
      additionalProperties: false 
     
        
    dealResp:
      type: object
      description: 'Детальная информация по сделке'
      required:
        - id
        - title
        - totalAmount
        - payeeBeneficiaryId
        - status
        - createDate
      properties:
        id:
          $ref: '#/components/schemas/id'
        title:
          $ref: '#/components/schemas/title'
        status:
          $ref: '#/components/schemas/statusDeal'   
        payeeBeneficiaryId:
          $ref: '#/components/schemas/beneficiaryId'
        totalAmount:
          $ref: '#/components/schemas/amount'
        createDate:
          type: string
          format: date-time
          description: 'Время создания сделки'
          example: '2026-03-15T23:31:00.999Z'
        editDate:
          type: string
          format: date-time
          description: 'Время изменения статуса сделки'
          example: '2026-03-15T23:31:00.999Z' 
      additionalProperties: false      
    statusDeal:
      type: string
      pattern: '^[A-Za-z]{1,20}$'
      description: 'Статус сделки: RUN (Активная)'
      #, DONE (Завершена), CANCELED (Отмененена/Закрыта)' 
      example: 'RUN'   
    
    subjectBeneficiary:
      oneOf:
        - $ref: '#/components/schemas/organization'
        - $ref: '#/components/schemas/individualEntrepreneur'
        - $ref: '#/components/schemas/individualBen'   
    organization:
      type: object
      required:
        - typeCode
        - orgName
        - inn
        - kpp
        - account
      description: 'Общая структура описания организации'
      properties:
        typeCode:
          type: string
          pattern: ^UL$
          description: 'Тип участника UL'
          default: 'UL'
          example: 'UL'
        orgName:
          $ref: '#/components/schemas/orgShortNameRu'
        inn:
          type: string
          pattern: '^[0-9]{10}$'
          description: 'ИНН ЮЛ'
          #minLength: 10
          example: '0743528989'
        kpp:
          $ref: '#/components/schemas/kpp'
        ogrn:
          type: string
          pattern: '^[0-9]{13}$'
          description: 'ОРГН'
          example: '1047796372711'
        account:
          $ref: '#/components/schemas/account'
      additionalProperties: false    
    individualEntrepreneur:
      type: object
      required:
        - typeCode
        - personName
        - inn
        - account
      description: 'Общий набор данных для ИП'
      properties:
        typeCode:
          description: 'Тип участника IP'
          type: string
          pattern: '^IP$'
          default: 'IP'
          example: 'IP'
        personName:
          type: string
          pattern: '^[А-ЯЁа-яёA-Za-z -]{3,250}$'
          description: 'ФИО для платежа'
          example: 'И Кван Ё'
        orgName:
          type: string
          pattern: '^[А-Яа-яёЁA-Za-z0-9 "№.+()-]{3,160}$'
          description: 'Наименование ИП для платежа' #заполнять поле в соответствии с тем, как указано в свидетельстве о регистрации
          example: 'Индивидуальный предприниматель И Кван Ё'
        inn:
          type: string
          pattern: '^[0-9]{12}$'
          #minLength: 12
          description: 'ИНН ФЛ'
          example: '774352898912'
        ogrnip:
          type: string
          pattern: '^3[0-9]{14}$'
          description: 'ОГРНИП'
          example: '304500116000157'
        account:
          $ref: '#/components/schemas/account'
      additionalProperties: false
    individualBen:
      type: object
      required:
        - typeCode
        - personName
        - inn
        - account
      description: 'Общий набор данные для ФЛ'
      properties:
        typeCode:
          type: string
          pattern: '^FL$'
          default: 'FL'
          description: 'Тип участника FL'
          example: 'FL'
        personName:
          type: string
          pattern: '^[А-ЯЁа-яёA-Za-z -]{3,250}$'
          description: 'ФИО для платежа'
          example: 'Коган-Константинопольский Константин Константинович'
        inn:
          type: string
          pattern: '^[0-9]{12}$'
          description: 'ИНН ФЛ'
          example: '074352898912'
        account:
          oneOf:
            - $ref: '#/components/schemas/accountProfile'
            - $ref: '#/components/schemas/sbpRequisites' 
      additionalProperties: false   
    orgShortNameRu:
      type: string
      pattern: '^[А-Яа-яёЁ0-9 "№.+()-]{3,160}$'
      description: 'Наименование организации'
      example: 'ПАО Ромашки'  
    beneficiaryEvent:
      type: object
      required:
        - eventId
        - eventType
        - eventValue
        - createDate
      description: 'Событие, определяющее статус бенефициара'
      properties:
        eventId:
          $ref: '#/components/schemas/id'
        eventType:
          type: string
          pattern: '^[A-Za-z]{1,20}$'
          description: 'Тип события CREATE, UPDATE, DELETE, BLOCK, UNBLOCK, BANKRUPT'
          example: 'CREATE'
        eventValue:
          type: string
          pattern: '^[A-Za-z]{1,20}$'
          description: 'Статус события CREATED (Создан), PENDING (В процессе), ACTIVATED (Активирован), BLOCKED (Заблокирован), DELETED (Удален), ERROR (Ошибка), DONE (Исполнен)'
          example: 'CREATED'
        errorMessage:
          $ref: '#/components/schemas/errorMessageBen'
        createDate:
          type: string
          format: date-time
          description: 'Время создания события'
          example: '2022-03-15T23:31:00.999Z'
        editDate:
          type: string
          format: date-time
          description: 'Время изменения статуса события'
          example: '2022-03-15T23:31:00.999Z'
      additionalProperties: false  
    errorMessageBen:
      type: string
      pattern: '^[0-9а-яёА-ЯЁa-zA-Z._ @()/\№,]+$'
      maxLength: 254
      description: 'Сообщение об ошибке'
      example: 'Внутренняя ошибка сервиса' 
    beneficiaryBalance:
      type: object
      description: 'Данные по балансу бенефициара'
      required: 
        - balance
      properties:
        balance:
          type: integer
          minimum: 0
          maximum: 1000000000000
          description: 'Все деньги бенефициара на НС в копейках'
          example: 100100500
        #availableBalance:
        #  type: integer
        #  minimum: 0
        #  maximum: 1000000000000
        #  description: 'Доступный остаток бенефициара на НС в копейках (расчитывается, как balance - holdBalance - pending - blocked - debt. Если debt > 0, то freeBalance может получиться отрицательным значением)'
        #  example: 100100500
        hold:
          type: integer
          minimum: 0
          maximum: 1000000000000
          description: 'Деньги бенефициара, закрепленные за сделками на НС, в копейках (до раскрытия сделки данные средства не пренадлежат бенефициару)'
          example: 100100500  
        pending:
          type: integer
          minimum: 0
          maximum: 1000000000000
          description: 'Деньги, находящиеся в обработке банком при выводе средств с НС, в копейках'
          example: 220030  
        blocked:
          type: integer
          minimum: 0
          maximum: 1000000000000
          description: 'Деньги, заблокированные ССП, в копейках'
          example: 50000
        debt:
          type: integer
          minimum: 0
          maximum: 1000000000000
          description: 'Текущий долг перед ССП, в копейках'
          example: 0
      additionalProperties: false 
    beneficiariesRegistryArrayResp:
      type: object
      description: 'Реестр бенефициаров'
      required:
        - beneficiaries
      properties:
        beneficiaries:
          type: array
          maxItems: 40
          description: 'Реестр бенефициаров'
          items:
            $ref: '#/components/schemas/beneficiariesRegistryResp'
      additionalProperties: false   
    beneficiariesRegistryResp:
      type: object
      required: 
        - id
        - status
        - subject
        - contractNumber
        - contractDate
      properties:
        id:
          $ref: '#/components/schemas/id'
        status:
          type: string
          pattern: '^[A-Za-z]{1,20}$'
          description: | 
            Статус бенефициара принимает одно из значений: 
              CREATED (Создан), 
              ACTIVATED (Активирован), 
              TOCLOSE (Помечен к закрытию), 
              DELETED (Исключен из реестра), 
              BLOCKED (Заблокирован со стороны банка), 
              ERROR (Ошибка)
          example: 'ACTIVATED'
        subject:
          $ref: '#/components/schemas/subjectBeneficiary'
        contractNumber:
          $ref: '#/components/schemas/contractNumber'
        contractDate:
          $ref: '#/components/schemas/date'
      additionalProperties: false
      description: 'Бенефициар'
    beneficiariesDetailsResp:  
      type: object
      required:
        - beneficiaryId
        - status
        - subject
        - contractNumber
        - contractDate
      properties:
        beneficiaryId:
          $ref: '#/components/schemas/id'
        status:
          type: string
          pattern: '^[A-Za-z]{1,20}$'
          description: 'Статус бенефициара принимает одно из значений: CREATED (Создан), ACTIVATED (Активирован), TOCLOSE (Помечен к закрытию), DELETED (Исключен из реестра), BLOCKED (Заблокирован со стороны банка), ERROR (Ошибка)'
          example: 'ACTIVATED'
        subject:
          $ref: '#/components/schemas/subjectBeneficiary'
        contractNumber:
          $ref: '#/components/schemas/contractNumber'
        contractDate:
          $ref: '#/components/schemas/date'
        events:
          type: array
          items:
            $ref: '#/components/schemas/beneficiaryEvent'
          maxItems: 40
          description: 'События по бенефициару и их статусы'
      additionalProperties: false
      description: 'Данные бенефициара'  
    priority:
      type: integer
      minimum: 1
      maximum: 5
      description: 'Номер группы очередности платежного документа'
      example: 5  

# Powered by APIStudio