openapi: 3.1.0
info:
  title: B2Core IB API
  version: '1.0'
  description: Introducing Brokers partner/affiliate management API for B2Core platform
servers:
- url: '{baseUrl}'
  variables:
    baseUrl:
      default: https://api.example.com/srvsz/ib/v1
      description: Base URL of the IB API
security:
- bearerAuth: []
paths:
  /tokens:
    post:
      summary: Authorize
      operationId: createToken
      description: 'Use **client_id** as username and **client_secret** as password in Basic Auth header.'
      security:
      - basicAuth: []
      tags:
      - Auth
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                grant_type:
                  type: string
                  example: client_credentials
      responses:
        '200':
          description: Token response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TokenResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
  /accounts/export:
    get:
      summary: Get Accounts (export)
      operationId: exportAccounts
      tags:
      - Accounts
      security:
      - signatureAuth: []
      parameters:
      - name: signature
        in: query
        required: true
        schema:
          type: string
      - name: expires
        in: query
        required: true
        schema:
          type: integer
      responses:
        '200':
          description: Accounts CSV export
          content:
            text/csv:
              schema:
                type: string
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /accounts:
    post:
      summary: Create a new Account
      operationId: createAccount
      tags:
      - Accounts
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AccountRequest'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Account'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /accounts/{accountId}:
    parameters:
    - $ref: '#/components/parameters/accountId'
    - name: accountId
      in: path
      required: true
      schema:
        type: string
    get:
      summary: Get Account Details
      operationId: getAccount
      tags:
      - Accounts
      responses:
        '200':
          description: Account details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Account'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    put:
      summary: Update Account
      operationId: replaceAccount
      tags:
      - Accounts
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AccountRequest'
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Account'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    patch:
      summary: Update Account (partial)
      operationId: updateAccount
      tags:
      - Accounts
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AccountRequest'
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Account'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    delete:
      summary: Delete Account
      operationId: deleteAccount
      tags:
      - Accounts
      responses:
        '204':
          description: Deleted
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /accounts/{accountId}/metrics:
    parameters:
    - $ref: '#/components/parameters/accountId'
    - name: accountId
      in: path
      required: true
      schema:
        type: string
    get:
      summary: Get Account Metrics
      operationId: getAccountMetrics
      tags:
      - Accounts
      responses:
        '200':
          description: Metrics
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MetricsListResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /addresses:
    get:
      summary: Get IP Address Policies
      operationId: listAddresses
      tags:
      - Addresses
      parameters:
      - $ref: '#/components/parameters/limit'
      - $ref: '#/components/parameters/offset'
      responses:
        '200':
          description: Address policies list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AddressListResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    post:
      summary: Create a new IP Address Policy
      operationId: createAddress
      tags:
      - Addresses
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AddressRequest'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Address'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /addresses/{addressId}:
    parameters:
    - $ref: '#/components/parameters/addressId'
    - name: addressId
      in: path
      required: true
      schema:
        type: string
    get:
      summary: Get IP Address Policy Details
      operationId: getAddress
      tags:
      - Addresses
      responses:
        '200':
          description: Address policy details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Address'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    put:
      summary: Update IP Address Policy
      operationId: replaceAddress
      tags:
      - Addresses
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AddressRequest'
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Address'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    patch:
      summary: Update IP Address Policy (partial)
      operationId: updateAddress
      tags:
      - Addresses
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AddressRequest'
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Address'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    delete:
      summary: Delete IP Address Policy
      operationId: deleteAddress
      tags:
      - Addresses
      responses:
        '204':
          description: Deleted
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /clients:
    get:
      summary: Get Apps
      operationId: listClients
      tags:
      - Clients
      parameters:
      - $ref: '#/components/parameters/limit'
      - $ref: '#/components/parameters/offset'
      responses:
        '200':
          description: Apps list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientListResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    post:
      summary: Create a new App
      operationId: createClient
      tags:
      - Clients
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ClientRequest'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Client'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /clients/{clientId}:
    parameters:
    - $ref: '#/components/parameters/clientId'
    - name: clientId
      in: path
      required: true
      schema:
        type: string
    get:
      summary: Get App Details
      operationId: getClient
      tags:
      - Clients
      responses:
        '200':
          description: App details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Client'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    delete:
      summary: Delete an App
      operationId: deleteClient
      tags:
      - Clients
      responses:
        '204':
          description: Deleted
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /banners:
    get:
      summary: Get Banners
      operationId: listBanners
      tags:
      - Banners
      parameters:
      - $ref: '#/components/parameters/limit'
      - $ref: '#/components/parameters/offset'
      responses:
        '200':
          description: Banners list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BannerListResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    post:
      summary: Create a new Banner
      operationId: createBanner
      tags:
      - Banners
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BannerRequest'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Banner'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /banners/{bannerId}:
    parameters:
    - $ref: '#/components/parameters/bannerId'
    - name: bannerId
      in: path
      required: true
      schema:
        type: string
    get:
      summary: Get Banner Details
      operationId: getBanner
      tags:
      - Banners
      responses:
        '200':
          description: Banner details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Banner'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    put:
      summary: Update Banner
      operationId: replaceBanner
      tags:
      - Banners
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BannerRequest'
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Banner'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    patch:
      summary: Update Banner (partial)
      operationId: updateBanner
      tags:
      - Banners
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BannerRequest'
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Banner'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    delete:
      summary: Delete a Banner
      operationId: deleteBanner
      tags:
      - Banners
      responses:
        '204':
          description: Deleted
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /banners/filters:
    get:
      summary: Get Banner Filters
      operationId: getBannerFilters
      tags:
      - Banners
      responses:
        '200':
          description: Banner filters
          content:
            application/json:
              schema:
                type: object
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /banners/languages:
    get:
      summary: Get Languages
      operationId: listBannerLanguages
      tags:
      - Banners
      parameters:
      - $ref: '#/components/parameters/limit'
      - $ref: '#/components/parameters/offset'
      responses:
        '200':
          description: Languages list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LanguageListResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    post:
      summary: Create a new Language
      operationId: createBannerLanguage
      tags:
      - Banners
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LanguageRequest'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Language'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /banners/languages/{languageId}:
    parameters:
    - $ref: '#/components/parameters/languageId'
    - name: languageId
      in: path
      required: true
      schema:
        type: string
    get:
      summary: Get Language Details
      operationId: getBannerLanguage
      tags:
      - Banners
      responses:
        '200':
          description: Language details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Language'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    put:
      summary: Update Language
      operationId: replaceBannerLanguage
      tags:
      - Banners
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LanguageRequest'
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Language'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    patch:
      summary: Update Language (partial)
      operationId: updateBannerLanguage
      tags:
      - Banners
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LanguageRequest'
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Language'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    delete:
      summary: Delete a Language
      operationId: deleteBannerLanguage
      tags:
      - Banners
      responses:
        '204':
          description: Deleted
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /banners/sizes:
    get:
      summary: Get Sizes
      operationId: listBannerSizes
      tags:
      - Banners
      responses:
        '200':
          description: Sizes list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SizeListResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    post:
      summary: Create a new Size
      operationId: createBannerSize
      tags:
      - Banners
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SizeRequest'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Size'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /banners/sizes/{sizeId}:
    parameters:
    - name: sizeId
      in: path
      required: true
      schema:
        type: string
    get:
      summary: Get Size Details
      operationId: getBannerSize
      tags:
      - Banners
      responses:
        '200':
          description: Size details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Size'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    delete:
      summary: Delete a Size
      operationId: deleteBannerSize
      tags:
      - Banners
      responses:
        '204':
          description: Deleted
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /banners/themes:
    get:
      summary: Get Themes
      operationId: listBannerThemes
      tags:
      - Banners
      parameters:
      - $ref: '#/components/parameters/limit'
      - $ref: '#/components/parameters/offset'
      responses:
        '200':
          description: Themes list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ThemeListResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    post:
      summary: Create a new Theme
      operationId: createBannerTheme
      tags:
      - Banners
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ThemeRequest'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Theme'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /banners/themes/{themeId}:
    parameters:
    - name: themeId
      in: path
      required: true
      schema:
        type: string
    get:
      summary: Get Theme Details
      operationId: getBannerTheme
      tags:
      - Banners
      responses:
        '200':
          description: Theme details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Theme'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    put:
      summary: Update Theme
      operationId: replaceBannerTheme
      tags:
      - Banners
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ThemeRequest'
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Theme'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    patch:
      summary: Update Theme (partial)
      operationId: updateBannerTheme
      tags:
      - Banners
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ThemeRequest'
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Theme'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    delete:
      summary: Delete a Theme
      operationId: deleteBannerTheme
      tags:
      - Banners
      responses:
        '204':
          description: Deleted
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /campaigns:
    get:
      summary: Get Campaigns
      operationId: listCampaigns
      tags:
      - Campaigns
      parameters:
      - $ref: '#/components/parameters/limit'
      - $ref: '#/components/parameters/offset'
      responses:
        '200':
          description: Campaigns list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CampaignListResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    post:
      summary: Create a new Campaign
      operationId: createCampaign
      tags:
      - Campaigns
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CampaignRequest'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Campaign'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /campaigns/{campaignId}:
    parameters:
    - $ref: '#/components/parameters/campaignId'
    - name: campaignId
      in: path
      required: true
      schema:
        type: string
    get:
      summary: Get Campaign Details
      operationId: getCampaign
      tags:
      - Campaigns
      responses:
        '200':
          description: Campaign details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Campaign'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    put:
      summary: Update Campaign
      operationId: replaceCampaign
      tags:
      - Campaigns
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CampaignRequest'
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Campaign'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    patch:
      summary: Update Campaign (partial)
      operationId: updateCampaign
      tags:
      - Campaigns
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CampaignRequest'
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Campaign'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    delete:
      summary: Delete a Campaign
      operationId: deleteCampaign
      tags:
      - Campaigns
      responses:
        '204':
          description: Deleted
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /nodes:
    get:
      summary: Get Chains
      operationId: listNodes
      tags:
      - Chains
      parameters:
      - $ref: '#/components/parameters/limit'
      - $ref: '#/components/parameters/offset'
      responses:
        '200':
          description: Chains list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NodeListResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /nodes/{nodeId}:
    parameters:
    - name: nodeId
      in: path
      required: true
      schema:
        type: string
    get:
      summary: Get Chain Details
      operationId: getNode
      tags:
      - Chains
      responses:
        '200':
          description: Chain details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Node'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /nodes/{nodeId}/metrics:
    parameters:
    - name: nodeId
      in: path
      required: true
      schema:
        type: string
    get:
      summary: Get Chain Metrics
      operationId: getNodeMetrics
      tags:
      - Chains
      responses:
        '200':
          description: Metrics
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MetricsListResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /clicks:
    get:
      summary: Get Clicks
      operationId: listClicks
      tags:
      - Clicks
      parameters:
      - $ref: '#/components/parameters/limit'
      - $ref: '#/components/parameters/offset'
      responses:
        '200':
          description: Clicks list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClickListResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    post:
      summary: Create a new Click
      operationId: createClick
      tags:
      - Clicks
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ClickRequest'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Click'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /clicks/{clickId}:
    parameters:
    - name: clickId
      in: path
      required: true
      schema:
        type: string
    get:
      summary: Get Click Details
      operationId: getClick
      tags:
      - Clicks
      parameters:
      - name: userTags
        in: query
        schema:
          type: string
      responses:
        '200':
          description: Click details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Click'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    put:
      summary: Update Click
      operationId: replaceClick
      tags:
      - Clicks
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ClickRequest'
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Click'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    patch:
      summary: Update Click (partial)
      operationId: updateClick
      tags:
      - Clicks
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ClickRequest'
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Click'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    delete:
      summary: Delete a Click
      operationId: deleteClick
      tags:
      - Clicks
      responses:
        '204':
          description: Deleted
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /countries:
    get:
      summary: Get Countries
      operationId: listCountries
      tags:
      - Countries
      parameters:
      - $ref: '#/components/parameters/limit'
      - $ref: '#/components/parameters/offset'
      responses:
        '200':
          description: Countries list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CountryListResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    post:
      summary: Create a new Country
      operationId: createCountry
      tags:
      - Countries
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CountryRequest'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Country'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /countries/{countryId}:
    parameters:
    - name: countryId
      in: path
      required: true
      schema:
        type: string
    get:
      summary: Get Country Details
      operationId: getCountry
      tags:
      - Countries
      responses:
        '200':
          description: Country details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Country'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    put:
      summary: Update Country
      operationId: replaceCountry
      tags:
      - Countries
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CountryRequest'
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Country'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    patch:
      summary: Update Country (partial)
      operationId: updateCountry
      tags:
      - Countries
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CountryRequest'
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Country'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    delete:
      summary: Delete a Country
      operationId: deleteCountry
      tags:
      - Countries
      responses:
        '204':
          description: Deleted
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /currencies:
    get:
      summary: Get Currencies
      operationId: listCurrencies
      tags:
      - Currencies
      parameters:
      - $ref: '#/components/parameters/limit'
      - $ref: '#/components/parameters/offset'
      responses:
        '200':
          description: Currencies list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CurrencyListResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    post:
      summary: Create a new Currency
      operationId: createCurrency
      tags:
      - Currencies
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CurrencyRequest'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Currency'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /currencies/{currencyId}:
    parameters:
    - name: currencyId
      in: path
      required: true
      schema:
        type: string
    get:
      summary: Get Currency Details
      operationId: getCurrency
      tags:
      - Currencies
      responses:
        '200':
          description: Currency details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Currency'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    put:
      summary: Update Currency
      operationId: replaceCurrency
      tags:
      - Currencies
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CurrencyRequest'
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Currency'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    patch:
      summary: Update Currency (partial)
      operationId: updateCurrency
      tags:
      - Currencies
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CurrencyRequest'
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Currency'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    delete:
      summary: Delete a Currency
      operationId: deleteCurrency
      tags:
      - Currencies
      responses:
        '204':
          description: Deleted
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /operations/deposits:
    get:
      summary: Get Deposits
      operationId: listDeposits
      tags:
      - Operations
      parameters:
      - $ref: '#/components/parameters/limit'
      - $ref: '#/components/parameters/offset'
      responses:
        '200':
          description: Deposits list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DepositListResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /operations/deposits/{depositId}:
    parameters:
    - name: depositId
      in: path
      required: true
      schema:
        type: string
    get:
      summary: Get Deposit Details
      operationId: getDeposit
      tags:
      - Operations
      responses:
        '200':
          description: Deposit details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Deposit'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /operations/client-deposits:
    get:
      summary: Get Client Deposits
      operationId: listClientDeposits
      tags:
      - Operations
      parameters:
      - $ref: '#/components/parameters/limit'
      - $ref: '#/components/parameters/offset'
      - name: filter[clientExternalId]
        in: query
        schema:
          type: integer
      - name: filter[clientName]
        in: query
        schema:
          type: string
      - name: filter[clientEmail]
        in: query
        schema:
          type: string
      - name: filter[profileId]
        in: query
        schema:
          type: string
      - name: filter[userId]
        in: query
        schema:
          type: string
      - name: filter[operationId]
        in: query
        schema:
          type: integer
      - name: filter[currencyCode]
        in: query
        schema:
          type: string
      - name: filter[startTime]
        in: query
        schema:
          type: string
          format: date-time
      - name: filter[endTime]
        in: query
        schema:
          type: string
          format: date-time
      - name: filter[userTags]
        in: query
        schema:
          type: string
      - name: sort_by
        in: query
        schema:
          type: string
          enum:
          - createTime
          - amount
      - name: sort_order
        in: query
        schema:
          type: string
          enum:
          - asc
          - desc
      responses:
        '200':
          description: Client deposits list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientDepositListResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /operations/client-deposits/sign:
    get:
      summary: Sign Client Deposits Export URL
      operationId: signClientDepositsExport
      tags:
      - Operations
      responses:
        '200':
          description: Signed export URL
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SignedUrlResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /operations/client-deposits/export:
    get:
      summary: Get Client Deposits (export)
      operationId: exportClientDeposits
      tags:
      - Operations
      security:
      - signatureAuth: []
      parameters:
      - name: signature
        in: query
        required: true
        schema:
          type: string
      - name: expires
        in: query
        required: true
        schema:
          type: integer
      responses:
        '200':
          description: Client deposits CSV export
          content:
            text/csv:
              schema:
                type: string
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /operations/client-deposits/{depositId}:
    parameters:
    - name: depositId
      in: path
      required: true
      schema:
        type: string
        format: uuid
    get:
      summary: Get Client Deposit Details
      operationId: getClientDeposit
      tags:
      - Operations
      parameters:
      - name: userTags
        in: query
        schema:
          type: string
      responses:
        '200':
          description: Client deposit details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientDeposit'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /regions:
    get:
      summary: Get Geographic Regions
      operationId: listRegions
      tags:
      - Regions
      parameters:
      - $ref: '#/components/parameters/limit'
      - $ref: '#/components/parameters/offset'
      responses:
        '200':
          description: Regions list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RegionListResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /regions/{regionId}:
    parameters:
    - name: regionId
      in: path
      required: true
      schema:
        type: string
    get:
      summary: Get Geographic Region Details
      operationId: getRegion
      tags:
      - Regions
      responses:
        '200':
          description: Region details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Region'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /groups:
    get:
      summary: Get Groups
      operationId: listGroups
      tags:
      - Groups
      parameters:
      - $ref: '#/components/parameters/limit'
      - $ref: '#/components/parameters/offset'
      - name: filter[paymentCurrencyCode]
        in: query
        schema:
          type: string
        description: Keep only groups paid out in this currency
      responses:
        '200':
          description: Groups list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GroupListResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    post:
      summary: Create a new Group
      operationId: createGroup
      tags:
      - Groups
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GroupRequest'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Group'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /groups/{groupId}:
    parameters:
    - $ref: '#/components/parameters/groupId'
    - name: groupId
      in: path
      required: true
      schema:
        type: string
    get:
      summary: Get Group Details
      operationId: getGroup
      tags:
      - Groups
      responses:
        '200':
          description: Group details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Group'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    put:
      summary: Update Group
      operationId: replaceGroup
      tags:
      - Groups
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GroupRequest'
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Group'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    patch:
      summary: Update Group (partial)
      operationId: updateGroup
      tags:
      - Groups
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GroupRequest'
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Group'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    delete:
      summary: Delete a Group
      operationId: deleteGroup
      tags:
      - Groups
      responses:
        '204':
          description: Deleted
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /groups/{groupId}/levels:
    parameters:
    - $ref: '#/components/parameters/groupId'
    - name: groupId
      in: path
      required: true
      schema:
        type: string
    get:
      summary: Get Levels
      operationId: listGroupLevels
      tags:
      - Groups
      responses:
        '200':
          description: Levels list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LevelListResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    post:
      summary: Create a new Level
      operationId: createGroupLevel
      tags:
      - Groups
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LevelRequest'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Level'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /groups/{groupId}/levels/{levelId}:
    parameters:
    - $ref: '#/components/parameters/groupId'
    - $ref: '#/components/parameters/levelId'
    - name: groupId
      in: path
      required: true
      schema:
        type: string
    - name: levelId
      in: path
      required: true
      schema:
        type: string
    get:
      summary: Get Level Details
      operationId: getGroupLevel
      tags:
      - Groups
      responses:
        '200':
          description: Level details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Level'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    put:
      summary: Update Level
      operationId: replaceGroupLevel
      tags:
      - Groups
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LevelRequest'
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Level'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    patch:
      summary: Update Level (partial)
      operationId: updateGroupLevel
      tags:
      - Groups
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LevelRequest'
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Level'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    delete:
      summary: Delete a Level
      operationId: deleteGroupLevel
      tags:
      - Groups
      responses:
        '204':
          description: Deleted
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /groups/{groupId}/metrics:
    parameters:
    - $ref: '#/components/parameters/groupId'
    - name: groupId
      in: path
      required: true
      schema:
        type: string
    get:
      summary: Get Group Metrics
      operationId: getGroupMetrics
      tags:
      - Groups
      responses:
        '200':
          description: Metrics
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MetricsListResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /groups/{groupId}/resources:
    parameters:
    - $ref: '#/components/parameters/groupId'
    - name: groupId
      in: path
      required: true
      schema:
        type: string
    get:
      summary: Get Localizations
      operationId: listGroupResources
      tags:
      - Groups
      responses:
        '200':
          description: Localizations list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceListResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    post:
      summary: Create a new Localization
      operationId: createGroupResource
      tags:
      - Groups
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ResourceRequest'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Resource'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /groups/{groupId}/resources/{resourceId}:
    parameters:
    - $ref: '#/components/parameters/groupId'
    - name: resourceId
      in: path
      required: true
      schema:
        type: string
    - name: groupId
      in: path
      required: true
      schema:
        type: string
    get:
      summary: Get Localization Details
      operationId: getGroupResource
      tags:
      - Groups
      responses:
        '200':
          description: Localization details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Resource'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    put:
      summary: Update Localization
      operationId: replaceGroupResource
      tags:
      - Groups
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ResourceRequest'
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Resource'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    patch:
      summary: Update Localization (partial)
      operationId: updateGroupResource
      tags:
      - Groups
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ResourceRequest'
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Resource'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    delete:
      summary: Delete a Localization
      operationId: deleteGroupResource
      tags:
      - Groups
      responses:
        '204':
          description: Deleted
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /groups/{groupId}/tiers:
    parameters:
    - $ref: '#/components/parameters/groupId'
    - name: groupId
      in: path
      required: true
      schema:
        type: string
    get:
      summary: Get Tiers
      operationId: listGroupTiers
      tags:
      - Groups
      responses:
        '200':
          description: Tiers list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TierListResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    post:
      summary: Create a new Tier
      operationId: createGroupTier
      tags:
      - Groups
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TierRequest'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Tier'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /groups/{groupId}/tiers/{tierId}:
    parameters:
    - $ref: '#/components/parameters/groupId'
    - name: tierId
      in: path
      required: true
      schema:
        type: string
    - name: groupId
      in: path
      required: true
      schema:
        type: string
    get:
      summary: Get Tier Details
      operationId: getGroupTier
      tags:
      - Groups
      responses:
        '200':
          description: Tier details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Tier'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    put:
      summary: Update Tier
      operationId: replaceGroupTier
      tags:
      - Groups
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TierRequest'
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Tier'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    patch:
      summary: Update Tier (partial)
      operationId: updateGroupTier
      tags:
      - Groups
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TierRequest'
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Tier'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    delete:
      summary: Delete a Tier
      operationId: deleteGroupTier
      tags:
      - Groups
      responses:
        '204':
          description: Deleted
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /links:
    get:
      summary: Get Links
      operationId: listLinks
      tags:
      - Links
      parameters:
      - $ref: '#/components/parameters/limit'
      - $ref: '#/components/parameters/offset'
      responses:
        '200':
          description: Links list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LinkListResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    post:
      summary: Create a new Link
      operationId: createLink
      tags:
      - Links
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LinkRequest'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Link'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /links/{linkId}:
    parameters:
    - $ref: '#/components/parameters/linkId'
    - name: linkId
      in: path
      required: true
      schema:
        type: string
    get:
      summary: Get Link Details
      operationId: getLink
      tags:
      - Links
      responses:
        '200':
          description: Link details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Link'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    put:
      summary: Update Link
      operationId: replaceLink
      tags:
      - Links
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LinkRequest'
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Link'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    patch:
      summary: Update Link (partial)
      operationId: updateLink
      tags:
      - Links
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LinkRequest'
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Link'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    delete:
      summary: Delete a Link
      operationId: deleteLink
      tags:
      - Links
      responses:
        '204':
          description: Deleted
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /links/{linkId}/languages:
    parameters:
    - $ref: '#/components/parameters/linkId'
    - name: linkId
      in: path
      required: true
      schema:
        type: string
    get:
      summary: Get Link Languages
      operationId: listLinkLanguages
      tags:
      - Links
      responses:
        '200':
          description: Link languages list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LinkLanguageListResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    post:
      summary: Create a new Link Language
      operationId: createLinkLanguage
      tags:
      - Links
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LinkLanguageRequest'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LinkLanguage'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /links/{linkId}/languages/{languageId}:
    parameters:
    - $ref: '#/components/parameters/linkId'
    - $ref: '#/components/parameters/languageId'
    - name: linkId
      in: path
      required: true
      schema:
        type: string
    - name: languageId
      in: path
      required: true
      schema:
        type: string
    get:
      summary: Get Link Language Details
      operationId: getLinkLanguage
      tags:
      - Links
      responses:
        '200':
          description: Link language details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LinkLanguage'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    put:
      summary: Update Link Language
      operationId: replaceLinkLanguage
      tags:
      - Links
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LinkLanguageRequest'
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LinkLanguage'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    patch:
      summary: Update Link Language (partial)
      operationId: updateLinkLanguage
      tags:
      - Links
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LinkLanguageRequest'
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LinkLanguage'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    delete:
      summary: Delete a Link Language
      operationId: deleteLinkLanguage
      tags:
      - Links
      responses:
        '204':
          description: Deleted
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /links/{linkId}/metrics:
    parameters:
    - $ref: '#/components/parameters/linkId'
    - name: linkId
      in: path
      required: true
      schema:
        type: string
    get:
      summary: Get Link Metrics
      operationId: getLinkMetrics
      tags:
      - Links
      responses:
        '200':
          description: Metrics
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MetricsListResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /messages:
    get:
      summary: Get Messages
      operationId: listMessages
      tags:
      - Messages
      parameters:
      - $ref: '#/components/parameters/limit'
      - $ref: '#/components/parameters/offset'
      responses:
        '200':
          description: Messages list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageListResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /messages/{messageId}:
    parameters:
    - name: messageId
      in: path
      required: true
      schema:
        type: string
    get:
      summary: Get Message Details
      operationId: getMessage
      tags:
      - Messages
      responses:
        '200':
          description: Message details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Message'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /location:
    get:
      summary: Get Location Services
      operationId: listLocationServices
      tags:
      - Location
      parameters:
      - $ref: '#/components/parameters/limit'
      - $ref: '#/components/parameters/offset'
      responses:
        '200':
          description: Location services list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LocationServiceListResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    post:
      summary: Create a new Location Service
      operationId: createLocationService
      tags:
      - Location
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LocationServiceRequest'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LocationService'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /location/{serviceId}:
    parameters:
    - name: serviceId
      in: path
      required: true
      schema:
        type: string
    get:
      summary: Get Location Service Details
      operationId: getLocationService
      tags:
      - Location
      responses:
        '200':
          description: Location service details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LocationService'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    put:
      summary: Update Location Service
      operationId: replaceLocationService
      tags:
      - Location
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LocationServiceRequest'
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LocationService'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    patch:
      summary: Update Location Service (partial)
      operationId: updateLocationService
      tags:
      - Location
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LocationServiceRequest'
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LocationService'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    delete:
      summary: Delete Location Service
      operationId: deleteLocationService
      tags:
      - Location
      responses:
        '204':
          description: Deleted
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /location/{serviceId}/drivers:
    parameters:
    - name: serviceId
      in: path
      required: true
      schema:
        type: string
    get:
      summary: Get Location Service Drivers
      operationId: listLocationDrivers
      tags:
      - Location
      responses:
        '200':
          description: Drivers list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DriverListResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /location/{serviceId}/drivers/{driverId}:
    parameters:
    - name: serviceId
      in: path
      required: true
      schema:
        type: string
    - $ref: '#/components/parameters/driverId'
    - name: driverId
      in: path
      required: true
      schema:
        type: string
    get:
      summary: Get Location Service Driver Details
      operationId: getLocationDriver
      tags:
      - Location
      responses:
        '200':
          description: Driver details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Driver'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    put:
      summary: Update Location Service Driver
      operationId: replaceLocationDriver
      tags:
      - Location
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DriverRequest'
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Driver'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    patch:
      summary: Update Location Service Driver (partial)
      operationId: updateLocationDriver
      tags:
      - Location
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DriverRequest'
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Driver'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /location/{serviceId}/updates:
    parameters:
    - name: serviceId
      in: path
      required: true
      schema:
        type: string
    get:
      summary: Check for Updates
      operationId: getLocationUpdates
      tags:
      - Location
      responses:
        '200':
          description: Updates info
          content:
            application/json:
              schema:
                type: object
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /payments:
    get:
      summary: Get Payments
      operationId: listPayments
      tags:
      - Payments
      parameters:
      - $ref: '#/components/parameters/limit'
      - $ref: '#/components/parameters/offset'
      responses:
        '200':
          description: Payments list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentListResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /payments/{paymentId}:
    parameters:
    - name: paymentId
      in: path
      required: true
      schema:
        type: string
    get:
      summary: Get Payment Details
      operationId: getPayment
      tags:
      - Payments
      responses:
        '200':
          description: Payment details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Payment'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /methods:
    get:
      summary: Get Payment Methods
      operationId: listMethods
      tags:
      - Methods
      parameters:
      - $ref: '#/components/parameters/limit'
      - $ref: '#/components/parameters/offset'
      responses:
        '200':
          description: Payment methods list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MethodListResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    post:
      summary: Create a new Payment Method
      operationId: createMethod
      tags:
      - Methods
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MethodRequest'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Method'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /methods/{methodId}:
    parameters:
    - $ref: '#/components/parameters/methodId'
    - name: methodId
      in: path
      required: true
      schema:
        type: string
    get:
      summary: Get Payment Method Details
      operationId: getMethod
      tags:
      - Methods
      responses:
        '200':
          description: Method details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Method'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    put:
      summary: Update Payment Method
      operationId: replaceMethod
      tags:
      - Methods
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MethodUpdateRequest'
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Method'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    patch:
      summary: Update Payment Method (partial)
      operationId: updateMethod
      tags:
      - Methods
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MethodUpdateRequest'
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Method'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    delete:
      summary: Delete a Method
      operationId: deleteMethod
      tags:
      - Methods
      responses:
        '204':
          description: Deleted
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /methods/{methodId}/drivers:
    parameters:
    - $ref: '#/components/parameters/methodId'
    - name: methodId
      in: path
      required: true
      schema:
        type: string
    get:
      summary: Get Payment Method Drivers
      operationId: listMethodDrivers
      tags:
      - Methods
      responses:
        '200':
          description: Drivers list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DriverListResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    post:
      summary: Create a new Payment Method Driver
      operationId: createMethodDriver
      tags:
      - Methods
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DriverRequest'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Driver'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /methods/{methodId}/drivers/{driverId}:
    parameters:
    - $ref: '#/components/parameters/methodId'
    - $ref: '#/components/parameters/driverId'
    - name: methodId
      in: path
      required: true
      schema:
        type: string
    - name: driverId
      in: path
      required: true
      schema:
        type: string
    get:
      summary: Get Payment Method Driver Details
      operationId: getMethodDriver
      tags:
      - Methods
      responses:
        '200':
          description: Driver details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Driver'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    put:
      summary: Update Payment Method Driver
      operationId: replaceMethodDriver
      tags:
      - Methods
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DriverRequest'
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Driver'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    patch:
      summary: Update Payment Method Driver (partial)
      operationId: updateMethodDriver
      tags:
      - Methods
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DriverRequest'
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Driver'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    delete:
      summary: Delete Driver
      operationId: deleteMethodDriver
      tags:
      - Methods
      responses:
        '204':
          description: Deleted
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /platforms:
    get:
      summary: Get Platforms
      operationId: listPlatforms
      tags:
      - Platforms
      parameters:
      - $ref: '#/components/parameters/limit'
      - $ref: '#/components/parameters/offset'
      responses:
        '200':
          description: Platforms list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformListResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    post:
      summary: Create a new Platform
      operationId: createPlatform
      tags:
      - Platforms
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PlatformRequest'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Platform'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /platforms/{platformId}:
    parameters:
    - $ref: '#/components/parameters/platformId'
    - name: platformId
      in: path
      required: true
      schema:
        type: string
    get:
      summary: Get Platform Details
      operationId: getPlatform
      tags:
      - Platforms
      responses:
        '200':
          description: Platform details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Platform'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    put:
      summary: Update Platform
      operationId: replacePlatform
      tags:
      - Platforms
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PlatformRequest'
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Platform'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    patch:
      summary: Update Platform (partial)
      operationId: updatePlatform
      tags:
      - Platforms
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PlatformRequest'
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Platform'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    delete:
      summary: Delete a Platform
      operationId: deletePlatform
      tags:
      - Platforms
      responses:
        '204':
          description: Deleted
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /platforms/{platformId}/drivers:
    parameters:
    - $ref: '#/components/parameters/platformId'
    - name: platformId
      in: path
      required: true
      schema:
        type: string
    get:
      summary: Get Platform Drivers
      operationId: listPlatformDrivers
      tags:
      - Platforms
      responses:
        '200':
          description: Drivers list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DriverListResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    post:
      summary: Create a new Platform Driver
      operationId: createPlatformDriver
      tags:
      - Platforms
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PlatformDriverRequest'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformDriver'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /platforms/{platformId}/drivers/{driverId}:
    parameters:
    - $ref: '#/components/parameters/platformId'
    - $ref: '#/components/parameters/driverId'
    - name: platformId
      in: path
      required: true
      schema:
        type: string
    - name: driverId
      in: path
      required: true
      schema:
        type: string
    get:
      summary: Get Platform Driver Details
      operationId: getPlatformDriver
      tags:
      - Platforms
      responses:
        '200':
          description: Driver details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformDriver'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    put:
      summary: Update Platform Driver
      operationId: replacePlatformDriver
      tags:
      - Platforms
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PlatformDriverRequest'
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformDriver'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    delete:
      summary: Delete Platform Driver
      operationId: deletePlatformDriver
      tags:
      - Platforms
      responses:
        '204':
          description: Deleted
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /platforms/groups:
    get:
      summary: Get Platform Groups
      operationId: listPlatformGroups
      tags:
      - Platforms
      parameters:
      - $ref: '#/components/parameters/limit'
      - $ref: '#/components/parameters/offset'
      responses:
        '200':
          description: Platform groups list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformGroupListResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /platforms/groups/{platformGroupId}:
    parameters:
    - $ref: '#/components/parameters/platformGroupId'
    - name: platformGroupId
      in: path
      required: true
      schema:
        type: string
    get:
      summary: Get Platform Group Details
      operationId: getPlatformGroup
      tags:
      - Platforms
      responses:
        '200':
          description: Platform group details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformGroup'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    put:
      summary: Update Platform Group
      operationId: replacePlatformGroup
      tags:
      - Platforms
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                lotMultiplier:
                  type: number
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformGroup'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    patch:
      summary: Update Platform Group (partial)
      operationId: updatePlatformGroup
      tags:
      - Platforms
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                lotMultiplier:
                  type: number
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformGroup'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /platforms/groups/{platformGroupId}/metrics:
    parameters:
    - $ref: '#/components/parameters/platformGroupId'
    - name: platformGroupId
      in: path
      required: true
      schema:
        type: string
    get:
      summary: Get Platform Group Metrics
      operationId: getPlatformGroupMetrics
      tags:
      - Platforms
      responses:
        '200':
          description: Metrics
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MetricsListResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /platforms/{platformId}/metrics:
    parameters:
    - $ref: '#/components/parameters/platformId'
    - name: platformId
      in: path
      required: true
      schema:
        type: string
    get:
      summary: Get Platform Metrics
      operationId: getPlatformMetrics
      tags:
      - Platforms
      responses:
        '200':
          description: Metrics
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MetricsListResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /platforms/{platformId}/consumers:
    parameters:
    - $ref: '#/components/parameters/platformId'
    - name: platformId
      in: path
      required: true
      schema:
        type: string
    get:
      summary: Get Platform Consumers
      operationId: getPlatformConsumers
      tags:
      - Platforms
      responses:
        '200':
          description: Consumer info
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformConsumer'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    put:
      summary: Update Platform Consumers
      operationId: updatePlatformConsumers
      tags:
      - Platforms
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PlatformConsumerRequest'
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformConsumer'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /processes:
    get:
      summary: Get Processes
      operationId: listProcesses
      tags:
      - Processes
      parameters:
      - $ref: '#/components/parameters/limit'
      - $ref: '#/components/parameters/offset'
      responses:
        '200':
          description: Processes list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProcessListResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    post:
      summary: Create a new process
      operationId: createProcess
      tags:
      - Processes
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProcessRequest'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Process'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /processes/{processId}:
    parameters:
    - name: processId
      in: path
      required: true
      schema:
        type: string
    get:
      summary: Get Process Details
      operationId: getProcess
      tags:
      - Processes
      responses:
        '200':
          description: Process details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Process'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /profiles:
    get:
      summary: Get Profiles
      operationId: listProfiles
      tags:
      - Profiles
      parameters:
      - $ref: '#/components/parameters/limit'
      - $ref: '#/components/parameters/offset'
      responses:
        '200':
          description: Profiles list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProfileListResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    post:
      summary: Create a new Profile
      operationId: createProfile
      tags:
      - Profiles
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProfileRequest'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Profile'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /profiles/{profileId}:
    parameters:
    - $ref: '#/components/parameters/profileId'
    - name: profileId
      in: path
      required: true
      schema:
        type: string
    get:
      summary: Get Profile Details
      operationId: getProfile
      tags:
      - Profiles
      responses:
        '200':
          description: Profile details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Profile'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    put:
      summary: Update Profile Information
      operationId: replaceProfile
      tags:
      - Profiles
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProfileUpdateRequest'
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Profile'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    patch:
      summary: Update Profile Information (partial)
      operationId: updateProfile
      tags:
      - Profiles
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProfileUpdateRequest'
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Profile'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    delete:
      summary: Delete a Profile
      operationId: deleteProfile
      tags:
      - Profiles
      responses:
        '204':
          description: Deleted
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /profiles/{profileId}/contacts:
    parameters:
    - $ref: '#/components/parameters/profileId'
    - name: profileId
      in: path
      required: true
      schema:
        type: string
    get:
      summary: Get Contacts
      operationId: listProfileContacts
      tags:
      - Profiles
      responses:
        '200':
          description: Contacts list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContactListResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    post:
      summary: Create a new Contact
      operationId: createProfileContact
      tags:
      - Profiles
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ContactRequest'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Contact'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /profiles/{profileId}/contacts/{contactId}:
    parameters:
    - $ref: '#/components/parameters/profileId'
    - $ref: '#/components/parameters/contactId'
    - name: profileId
      in: path
      required: true
      schema:
        type: string
    - name: contactId
      in: path
      required: true
      schema:
        type: string
    get:
      summary: Get Contact Details
      operationId: getProfileContact
      tags:
      - Profiles
      responses:
        '200':
          description: Contact details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Contact'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    put:
      summary: Update Contact Information
      operationId: replaceProfileContact
      tags:
      - Profiles
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ContactRequest'
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Contact'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    patch:
      summary: Update Contact Information (partial)
      operationId: updateProfileContact
      tags:
      - Profiles
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ContactRequest'
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Contact'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    delete:
      summary: Delete Contact Information
      operationId: deleteProfileContact
      tags:
      - Profiles
      responses:
        '204':
          description: Deleted
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /qrcodes:
    post:
      summary: Generate QR Code
      operationId: generateQrCode
      tags:
      - QRCodes
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                uri:
                  type: string
                  format: uri
                iconId:
                  type: string
                colorId:
                  type: string
                format:
                  type: string
                  example: png
                size:
                  type: integer
                  example: 1000
                background:
                  type: string
                  example: '#000000'
                foreground:
                  type: string
                  example: '#ffffff'
      responses:
        '200':
          description: QR code image (base64)
          content:
            application/json:
              schema:
                type: object
                properties:
                  qrCode:
                    type: string
                    description: Base64-encoded image
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /qrcodes/colors:
    get:
      summary: Get Colors
      operationId: listQrColors
      tags:
      - QRCodes
      responses:
        '200':
          description: Colors list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QrColorListResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    post:
      summary: Create a new Color
      operationId: createQrColor
      tags:
      - QRCodes
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/QrColorRequest'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QrColor'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /qrcodes/colors/{colorId}:
    parameters:
    - name: colorId
      in: path
      required: true
      schema:
        type: string
    get:
      summary: Get Color Details
      operationId: getQrColor
      tags:
      - QRCodes
      responses:
        '200':
          description: Color details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QrColor'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    put:
      summary: Update Color
      operationId: replaceQrColor
      tags:
      - QRCodes
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/QrColorRequest'
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QrColor'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    patch:
      summary: Update Color (partial)
      operationId: updateQrColor
      tags:
      - QRCodes
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/QrColorRequest'
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QrColor'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    delete:
      summary: Delete a Color
      operationId: deleteQrColor
      tags:
      - QRCodes
      responses:
        '204':
          description: Deleted
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /qrcodes/icons:
    get:
      summary: Get Icons
      operationId: listQrIcons
      tags:
      - QRCodes
      responses:
        '200':
          description: Icons list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QrIconListResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    post:
      summary: Create a new Icon
      operationId: createQrIcon
      tags:
      - QRCodes
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/QrIconRequest'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QrIcon'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /qrcodes/icons/{iconId}:
    parameters:
    - name: iconId
      in: path
      required: true
      schema:
        type: string
    get:
      summary: Get Icon Details
      operationId: getQrIcon
      tags:
      - QRCodes
      responses:
        '200':
          description: Icon details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QrIcon'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    put:
      summary: Update Icon
      operationId: replaceQrIcon
      tags:
      - QRCodes
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/QrIconRequest'
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QrIcon'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    patch:
      summary: Update Icon (partial)
      operationId: updateQrIcon
      tags:
      - QRCodes
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/QrIconRequest'
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QrIcon'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    delete:
      summary: Delete an Icon
      operationId: deleteQrIcon
      tags:
      - QRCodes
      responses:
        '204':
          description: Deleted
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /rates:
    get:
      summary: Get Rate Providers
      operationId: listRates
      tags:
      - Rates
      parameters:
      - $ref: '#/components/parameters/limit'
      - $ref: '#/components/parameters/offset'
      responses:
        '200':
          description: Rate providers list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateListResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    post:
      summary: Create a new Rate Provider
      operationId: createRate
      tags:
      - Rates
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RateRequest'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Rate'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /rates/{providerId}:
    parameters:
    - name: providerId
      in: path
      required: true
      schema:
        type: string
    get:
      summary: Get Rate Provider Details
      operationId: getRate
      tags:
      - Rates
      responses:
        '200':
          description: Rate provider details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Rate'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    put:
      summary: Update Rate Provider
      operationId: replaceRate
      tags:
      - Rates
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RateUpdateRequest'
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Rate'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    patch:
      summary: Update Rate Provider (partial)
      operationId: updateRate
      tags:
      - Rates
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RateUpdateRequest'
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Rate'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    delete:
      summary: Delete a Rate Provider
      operationId: deleteRate
      tags:
      - Rates
      responses:
        '204':
          description: Deleted
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /rates/{providerId}/drivers:
    parameters:
    - name: providerId
      in: path
      required: true
      schema:
        type: string
    get:
      summary: Get Rate Provider Drivers
      operationId: listRateDrivers
      tags:
      - Rates
      responses:
        '200':
          description: Drivers list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DriverListResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    post:
      summary: Create a new Rate Provider Driver
      operationId: createRateDriver
      tags:
      - Rates
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DriverRequest'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Driver'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /rates/{providerId}/drivers/{driverId}:
    parameters:
    - name: providerId
      in: path
      required: true
      schema:
        type: string
    - $ref: '#/components/parameters/driverId'
    - name: driverId
      in: path
      required: true
      schema:
        type: string
    get:
      summary: Get Rate Provider Driver Details
      operationId: getRateDriver
      tags:
      - Rates
      responses:
        '200':
          description: Driver details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Driver'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    put:
      summary: Update Rate Provider Driver
      operationId: replaceRateDriver
      tags:
      - Rates
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DriverRequest'
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Driver'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    patch:
      summary: Update Rate Provider Driver (partial)
      operationId: updateRateDriver
      tags:
      - Rates
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DriverRequest'
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Driver'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    delete:
      summary: Delete a Driver
      operationId: deleteRateDriver
      tags:
      - Rates
      responses:
        '204':
          description: Deleted
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /reassignments:
    get:
      summary: Get Reassignments
      operationId: listReassignments
      description: Returns a paginated list of reassignments. Use `filter[users]` to find reassignments involving a specific IB user.
      tags:
      - Reassignments
      parameters:
      - $ref: '#/components/parameters/limit'
      - $ref: '#/components/parameters/offset'
      - name: filter[type]
        in: query
        schema:
          type: string
          enum:
          - children
          - single_user
      - name: filter[status]
        in: query
        schema:
          type: string
          enum:
          - awaiting_confirmation
          - pending
          - processing
          - chains_rebuilding
          - completed
          - cancelled
          - failed
      - name: filter[users]
        in: query
        schema:
          type: string
          format: uuid
          description: Filter by source or target user ID
      - name: sort_by
        in: query
        schema:
          type: string
          enum:
          - createTime
      - name: sort_order
        in: query
        schema:
          type: string
          enum:
          - asc
          - desc
      responses:
        '200':
          description: Reassignments list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReassignmentListResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    post:
      summary: Create Reassignment
      operationId: createReassignment
      description: |
        Creates a reassignment in `pending` status. The response contains `movedRelations` — a preview of all users and sub-IBs that will be moved upon confirmation.

        **Step 1 of the call flow.** The reassignment is created with status `awaiting_confirmation`. After reviewing `movedRelations`, proceed with confirm or cancel.
      tags:
      - Reassignments
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReassignmentRequest'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Reassignment'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /reassignments/{reassignmentId}:
    parameters:
    - $ref: '#/components/parameters/reassignmentId'
    get:
      summary: Get Reassignment Details
      operationId: getReassignment
      description: Returns the current state of a reassignment, including `movedRelations` and `status`.
      tags:
      - Reassignments
      responses:
        '200':
          description: Reassignment details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Reassignment'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /reassignments/{reassignmentId}/cancel:
    parameters:
    - $ref: '#/components/parameters/reassignmentId'
    post:
      summary: Cancel Reassignment
      operationId: cancelReassignment
      description: Cancels an `awaiting_confirmation` reassignment. No relations are moved. The reassignment status changes to `cancelled`.
      tags:
      - Reassignments
      responses:
        '200':
          description: Reassignment cancelled
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Reassignment'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /reassignments/{reassignmentId}/confirm:
    parameters:
    - $ref: '#/components/parameters/reassignmentId'
    post:
      summary: Confirm Reassignment
      operationId: confirmReassignment
      description: Confirms an `awaiting_confirmation` reassignment and executes the move. All relations listed in `movedRelations` are transferred to the target IB. The reassignment status transitions through `pending` → `processing` → `chains_rebuilding` → `completed`.
      tags:
      - Reassignments
      responses:
        '200':
          description: Reassignment confirmed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Reassignment'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /relations:
    get:
      summary: Get Relations
      operationId: listRelations
      tags:
      - Relations
      parameters:
      - $ref: '#/components/parameters/limit'
      - $ref: '#/components/parameters/offset'
      - name: sort_by
        in: query
        schema:
          type: string
          example: createTime
      - name: sort_order
        in: query
        schema:
          type: string
          enum:
          - asc
          - desc
      responses:
        '200':
          description: Relations list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RelationListResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    post:
      summary: Create Relation
      operationId: createRelation
      tags:
      - Relations
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RelationRequest'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Relation'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /relations/{relationId}:
    parameters:
    - name: relationId
      in: path
      required: true
      schema:
        type: string
    get:
      summary: Get Relation Details
      operationId: getRelation
      tags:
      - Relations
      responses:
        '200':
          description: Relation details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Relation'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    put:
      summary: Update Relations
      operationId: replaceRelation
      tags:
      - Relations
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                uuid:
                  type: string
                  nullable: true
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Relation'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    patch:
      summary: Update Relations (partial)
      operationId: updateRelation
      tags:
      - Relations
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                uuid:
                  type: string
                  nullable: true
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Relation'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    delete:
      summary: Delete a Relation
      operationId: deleteRelation
      tags:
      - Relations
      responses:
        '204':
          description: Deleted
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /reports/clicks:
    get:
      summary: Get Click Report
      operationId: getClickReport
      tags:
      - Reports
      parameters:
      - name: group_by
        in: query
        schema:
          type: string
          enum:
          - day
          - week
          - month
      - name: from
        in: query
        schema:
          type: string
          format: date-time
      - name: to
        in: query
        schema:
          type: string
          format: date-time
      responses:
        '200':
          description: Click report
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClickReportResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /reports/payments:
    get:
      summary: Get Payment Report
      operationId: getPaymentReport
      tags:
      - Reports
      parameters:
      - name: group_by
        in: query
        schema:
          type: string
          enum:
          - day
          - week
          - month
      - name: from
        in: query
        schema:
          type: string
          format: date-time
      - name: to
        in: query
        schema:
          type: string
          format: date-time
      responses:
        '200':
          description: Payment report
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentReportResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /partner/cpa-stats:
    get:
      summary: Get CPA Stats
      operationId: getCpaStats
      tags:
      - Partner
      parameters:
      - name: userId
        in: query
        required: true
        schema:
          type: string
          format: uuid
        description: Identifier of the partner user whose CPA stats are requested
      - name: startTime
        in: query
        schema:
          type: string
          format: date-time
        description: Start of the reporting window (inclusive)
      - name: endTime
        in: query
        schema:
          type: string
          format: date-time
        description: End of the reporting window (inclusive)
      - name: cpaProgramId
        in: query
        schema:
          type: string
          format: uuid
        description: Optional CPA program used to scope the stats
      - name: cpaPaymentPlanId
        in: query
        schema:
          type: string
          format: uuid
        description: Optional CPA payment plan used to scope the qualified count and reward earned
      responses:
        '200':
          description: CPA stats report
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CpaStatsResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /savings-programs:
    get:
      summary: Get Savings Programs
      operationId: listSavingsPrograms
      tags:
      - Savings
      parameters:
      - $ref: '#/components/parameters/limit'
      - $ref: '#/components/parameters/offset'
      - name: filter[name]
        in: query
        schema:
          type: string
      - name: filter[isActive]
        in: query
        schema:
          type: boolean
      - name: filter[savingsProgramStartDate]
        in: query
        schema:
          type: string
          format: date-time
      - name: filter[savingsProgramEndDate]
        in: query
        schema:
          type: string
          format: date-time
      - name: filter[createdAtStartDate]
        in: query
        schema:
          type: string
          format: date-time
      - name: filter[createdAtEndDate]
        in: query
        schema:
          type: string
          format: date-time
      - name: sort_by
        in: query
        schema:
          type: string
          enum:
          - name
          - isActive
          - createdAt
          - updatedAt
      - name: sort_order
        in: query
        schema:
          type: string
          enum:
          - asc
          - desc
      responses:
        '200':
          description: Savings programs list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SavingsProgramListResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    post:
      summary: Create a new Savings Program
      operationId: createSavingsProgram
      tags:
      - Savings
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SavingsProgramRequest'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SavingsProgram'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /savings-programs/{savingsProgram}:
    parameters:
    - $ref: '#/components/parameters/savingsProgram'
    get:
      summary: Get Savings Program Details
      operationId: getSavingsProgram
      tags:
      - Savings
      responses:
        '200':
          description: Savings program details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SavingsProgram'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    put:
      summary: Update a Savings Program
      operationId: updateSavingsProgram
      tags:
      - Savings
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SavingsProgramUpdateRequest'
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SavingsProgram'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    patch:
      summary: Update a Savings Program (partial)
      operationId: patchSavingsProgram
      tags:
      - Savings
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SavingsProgramUpdateRequest'
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SavingsProgram'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    delete:
      summary: Delete a Savings Program
      operationId: deleteSavingsProgram
      tags:
      - Savings
      responses:
        '204':
          description: Deleted
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /savings-programs/{savingsProgram}/levels:
    parameters:
    - $ref: '#/components/parameters/savingsProgram'
    get:
      summary: Get Savings Program Levels
      operationId: listSavingsProgramLevels
      tags:
      - Savings
      parameters:
      - $ref: '#/components/parameters/limit'
      - $ref: '#/components/parameters/offset'
      - name: filter[level]
        in: query
        schema:
          type: integer
      - name: filter[rewardValue]
        in: query
        schema:
          type: string
      - name: sort_by
        in: query
        schema:
          type: string
          enum:
          - level
          - rewardValue
          - createdAt
      - name: sort_order
        in: query
        schema:
          type: string
          enum:
          - asc
          - desc
      responses:
        '200':
          description: Savings program levels list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SavingsProgramLevelListResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    post:
      summary: Create a new Savings Program Level
      operationId: createSavingsProgramLevel
      tags:
      - Savings
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SavingsProgramLevelRequest'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SavingsProgramLevel'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /savings-programs/{savingsProgram}/levels/{level}:
    parameters:
    - $ref: '#/components/parameters/savingsProgram'
    - $ref: '#/components/parameters/level'
    get:
      summary: Get Savings Program Level Details
      operationId: getSavingsProgramLevel
      tags:
      - Savings
      responses:
        '200':
          description: Savings program level details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SavingsProgramLevel'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    put:
      summary: Update a Savings Program Level
      operationId: updateSavingsProgramLevel
      tags:
      - Savings
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SavingsProgramLevelUpdateRequest'
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SavingsProgramLevel'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    patch:
      summary: Update a Savings Program Level (partial)
      operationId: patchSavingsProgramLevel
      tags:
      - Savings
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SavingsProgramLevelUpdateRequest'
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SavingsProgramLevel'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    delete:
      summary: Delete a Savings Program Level
      operationId: deleteSavingsProgramLevel
      tags:
      - Savings
      responses:
        '204':
          description: Deleted
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /savings-programs/{savingsProgram}/acquisitions:
    parameters:
    - $ref: '#/components/parameters/savingsProgram'
    get:
      summary: Get Savings Program Acquisitions
      operationId: listSavingsAcquisitions
      tags:
      - Savings
      parameters:
      - $ref: '#/components/parameters/limit'
      - $ref: '#/components/parameters/offset'
      - name: filter[partnerUserId]
        in: query
        schema:
          type: string
          format: uuid
      - name: sort_by
        in: query
        schema:
          type: string
          enum:
          - clientExternalId
          - partnerUserId
          - createdAt
      - name: sort_order
        in: query
        schema:
          type: string
          enum:
          - asc
          - desc
      responses:
        '200':
          description: Savings acquisitions list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SavingsAcquisitionListResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /savings-payments:
    get:
      summary: Get Savings Payments
      operationId: listSavingsPayments
      tags:
      - Savings
      parameters:
      - $ref: '#/components/parameters/limit'
      - $ref: '#/components/parameters/offset'
      - name: filter[partnerUserId]
        in: query
        schema:
          type: string
          format: uuid
      - name: filter[partnerName]
        in: query
        schema:
          type: string
      - name: filter[status]
        in: query
        schema:
          type: string
          enum:
          - pending
          - processing
          - processed
          - succeeded
          - failed
          - cancelled
      - name: filter[transactionState]
        in: query
        schema:
          type: string
          enum:
          - unconfirmed
          - confirmed
          - failed
      - name: filter[periodDate]
        in: query
        schema:
          type: string
          format: date
      - name: filter[periodDateStartDate]
        in: query
        schema:
          type: string
          format: date
      - name: filter[periodDateEndDate]
        in: query
        schema:
          type: string
          format: date
      - name: filter[savingsPaymentStartDate]
        in: query
        schema:
          type: string
          format: date-time
      - name: filter[savingsPaymentEndDate]
        in: query
        schema:
          type: string
          format: date-time
      - name: sort_by
        in: query
        schema:
          type: string
          enum:
          - partnerUserId
          - partnerName
          - level
          - paymentAmount
          - paymentCurrencyCode
          - periodDate
          - status
          - transactionState
          - processedAt
          - createdAt
      - name: sort_order
        in: query
        schema:
          type: string
          enum:
          - asc
          - desc
      responses:
        '200':
          description: Savings payments list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SavingsPaymentListResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /partner/savings-programs:
    get:
      summary: Get Partner Savings Programs
      operationId: listPartnerSavingsPrograms
      description: Returns a paginated list of active savings programs available to the partner.
      tags:
      - Savings
      parameters:
      - $ref: '#/components/parameters/limit'
      - $ref: '#/components/parameters/offset'
      - name: sort_by
        in: query
        schema:
          type: string
          enum:
          - name
          - createdAt
      - name: sort_order
        in: query
        schema:
          type: string
          enum:
          - asc
          - desc
      responses:
        '200':
          description: Savings programs list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SavingsProgramListResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /partner/savings-programs/{savingsProgram}:
    parameters:
    - $ref: '#/components/parameters/savingsProgram'
    get:
      summary: Get Partner Savings Program Details
      operationId: getPartnerSavingsProgram
      description: Returns an active savings program with its levels. Returns 404 if the program does not exist or is inactive.
      tags:
      - Savings
      responses:
        '200':
          description: Savings program details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SavingsProgram'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /partner/savings-acquisitions:
    get:
      summary: Get Partner Savings Acquisitions
      operationId: listPartnerSavingsAcquisitions
      tags:
      - Savings
      parameters:
      - name: userId
        in: query
        required: true
        schema:
          type: string
          format: uuid
        description: Identifier of the partner user whose acquisitions are requested
      - $ref: '#/components/parameters/limit'
      - $ref: '#/components/parameters/offset'
      - name: sort_by
        in: query
        schema:
          type: string
          enum:
          - createdAt
      - name: sort_order
        in: query
        schema:
          type: string
          enum:
          - asc
          - desc
      responses:
        '200':
          description: Savings acquisitions list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SavingsAcquisitionListResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /partner/savings-payments:
    get:
      summary: Get Partner Savings Payments
      operationId: listPartnerSavingsPayments
      tags:
      - Savings
      parameters:
      - name: userId
        in: query
        required: true
        schema:
          type: string
          format: uuid
        description: Identifier of the partner user whose payments are requested
      - $ref: '#/components/parameters/limit'
      - $ref: '#/components/parameters/offset'
      - name: filter[status]
        in: query
        schema:
          type: string
          enum:
          - pending
          - processing
          - processed
          - succeeded
          - failed
          - cancelled
      - name: filter[transactionState]
        in: query
        schema:
          type: string
          enum:
          - unconfirmed
          - confirmed
          - failed
      - name: filter[periodDate]
        in: query
        schema:
          type: string
          format: date
      - name: filter[savingsPaymentStartDate]
        in: query
        schema:
          type: string
          format: date-time
      - name: filter[savingsPaymentEndDate]
        in: query
        schema:
          type: string
          format: date-time
      - name: sort_by
        in: query
        schema:
          type: string
          enum:
          - level
          - paymentAmount
          - paymentCurrencyCode
          - periodDate
          - status
          - transactionState
          - processedAt
          - createdAt
          - programName
      - name: sort_order
        in: query
        schema:
          type: string
          enum:
          - asc
          - desc
      responses:
        '200':
          description: Savings payments list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SavingsPaymentListResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /partner/performance-stats:
    get:
      summary: Get Performance Stats
      operationId: getPerformanceStats
      tags:
      - Partner
      parameters:
      - name: userId
        in: query
        required: true
        schema:
          type: string
          format: uuid
        description: Identifier of the partner user whose performance stats are requested
      - name: startTime
        in: query
        schema:
          type: string
          format: date-time
        description: Start of the reporting window (inclusive)
      - name: endTime
        in: query
        schema:
          type: string
          format: date-time
        description: End of the reporting window (inclusive)
      responses:
        '200':
          description: Account performance KPIs for the period
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PerformanceStatsResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /partner/performance-timeseries:
    get:
      summary: Get Performance Timeseries
      operationId: getPerformanceTimeseries
      tags:
      - Partner
      parameters:
      - name: userId
        in: query
        required: true
        schema:
          type: string
          format: uuid
        description: Identifier of the partner user whose performance timeseries is requested
      - name: indicator
        in: query
        required: true
        schema:
          type: string
          enum:
          - rebate
          - notionalValue
          - newClients
          - activeTraders
          - cpaReward
        description: KPI to build the daily series for
      - name: startTime
        in: query
        schema:
          type: string
          format: date-time
        description: Start of the reporting window (inclusive)
      - name: endTime
        in: query
        schema:
          type: string
          format: date-time
        description: End of the reporting window (inclusive)
      responses:
        '200':
          description: Daily series for the requested indicator
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PerformanceTimeseriesResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /partner/top-clients:
    get:
      summary: Get Top Clients
      operationId: getTopClients
      tags:
      - Partner
      parameters:
      - name: userId
        in: query
        required: true
        schema:
          type: string
          format: uuid
        description: Identifier of the partner user whose top clients are requested
      - name: startTime
        in: query
        schema:
          type: string
          format: date-time
        description: Start of the reporting window (inclusive)
      - name: endTime
        in: query
        schema:
          type: string
          format: date-time
        description: End of the reporting window (inclusive)
      - name: comparative
        in: query
        schema:
          type: boolean
          default: false
        description: When true, include each client's absolute change versus the previous equal-length window
      - name: sortBy
        in: query
        schema:
          type: string
          enum:
          - volumeUsd
          - volumeLots
          - rebate
          default: volumeUsd
        description: Ranking metric
      - name: sortOrder
        in: query
        schema:
          type: string
          enum:
          - asc
          - desc
          default: desc
        description: Ranking direction
      - name: limit
        in: query
        schema:
          type: integer
          minimum: 1
          maximum: 100
          default: 50
        description: Maximum number of ranked clients to return
      - name: offset
        in: query
        schema:
          type: integer
          minimum: 0
          default: 0
        description: Number of ranked clients to skip
      responses:
        '200':
          description: Ranked page of the partner's direct clients
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TopClientsResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /symbols:
    get:
      summary: Get Symbols
      operationId: listSymbols
      tags:
      - Symbols
      parameters:
      - $ref: '#/components/parameters/limit'
      - $ref: '#/components/parameters/offset'
      responses:
        '200':
          description: Symbols list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SymbolListResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /symbols/preferences:
    get:
      summary: Get Payment Plans by Symbol
      operationId: listSymbolPreferencesSummary
      description: Returns payment plan configurations for all symbols matching the `filter[symbol]` prefix, grouped by unique configuration. Trading groups sharing the same configuration are collapsed into `groupCount`. The response is not paginated.
      tags:
      - Symbols
      parameters:
      - name: filter[symbol]
        in: query
        required: true
        schema:
          type: string
          description: 'Symbol name prefix: matches the exact name and any characters after it, e.g. `D40EUR` matches both `D40EUR` and `D40EUR#`. Case-sensitive.'
      - name: filter[planId]
        in: query
        schema:
          type: string
          format: uuid
          description: Return only configurations of this payment plan
      responses:
        '200':
          description: Payment plan configurations list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SymbolPreferenceSummaryListResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /symbols/{symbolId}:
    parameters:
    - $ref: '#/components/parameters/symbolId'
    - name: symbolId
      in: path
      required: true
      schema:
        type: string
    get:
      summary: Get Symbol Details
      operationId: getSymbol
      tags:
      - Symbols
      responses:
        '200':
          description: Symbol details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Symbol'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /symbols/{symbolId}/metrics:
    parameters:
    - $ref: '#/components/parameters/symbolId'
    - name: symbolId
      in: path
      required: true
      schema:
        type: string
    get:
      summary: Get Symbol Metrics
      operationId: getSymbolMetrics
      tags:
      - Symbols
      responses:
        '200':
          description: Metrics
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MetricsListResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /symbols/{symbolId}/preferences:
    parameters:
    - $ref: '#/components/parameters/symbolId'
    - name: symbolId
      in: path
      required: true
      schema:
        type: string
    get:
      summary: Get Payment Plans
      operationId: listSymbolPreferences
      tags:
      - Symbols
      responses:
        '200':
          description: Payment plans list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SymbolPreferenceListResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    post:
      summary: Create a new Payment Plan
      operationId: createSymbolPreference
      tags:
      - Symbols
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SymbolPreferenceRequest'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SymbolPreference'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /symbols/{symbolId}/preferences/{paymentPlanId}:
    parameters:
    - $ref: '#/components/parameters/symbolId'
    - name: paymentPlanId
      in: path
      required: true
      schema:
        type: string
    - name: symbolId
      in: path
      required: true
      schema:
        type: string
    get:
      summary: Get Payment Plan Details
      operationId: getSymbolPreference
      tags:
      - Symbols
      responses:
        '200':
          description: Payment plan details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SymbolPreference'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    put:
      summary: Update Payment Plan
      operationId: replaceSymbolPreference
      tags:
      - Symbols
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SymbolPreferenceRequest'
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SymbolPreference'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    patch:
      summary: Update Payment Plan (partial)
      operationId: updateSymbolPreference
      tags:
      - Symbols
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SymbolPreferenceRequest'
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SymbolPreference'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    delete:
      summary: Delete Payment Plan
      operationId: deleteSymbolPreference
      tags:
      - Symbols
      responses:
        '204':
          description: Deleted
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /symbols/groups:
    get:
      summary: Get Symbol Groups
      operationId: listSymbolGroups
      tags:
      - Symbols
      parameters:
      - $ref: '#/components/parameters/limit'
      - $ref: '#/components/parameters/offset'
      responses:
        '200':
          description: Symbol groups list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SymbolGroupListResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /symbols/groups/{symbolGroupId}:
    parameters:
    - name: symbolGroupId
      in: path
      required: true
      schema:
        type: string
    get:
      summary: Get Symbol Group Details
      operationId: getSymbolGroup
      tags:
      - Symbols
      responses:
        '200':
          description: Symbol group details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SymbolGroup'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /preferences:
    get:
      summary: Get System Preferences
      operationId: listPreferences
      tags:
      - Preferences
      parameters:
      - $ref: '#/components/parameters/limit'
      - $ref: '#/components/parameters/offset'
      responses:
        '200':
          description: System preferences list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SystemPreferenceListResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    post:
      summary: Create a new System Preference
      operationId: createPreference
      tags:
      - Preferences
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SystemPreferenceRequest'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SystemPreference'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /preferences/{preferenceId}:
    parameters:
    - name: preferenceId
      in: path
      required: true
      schema:
        type: string
    get:
      summary: Get System Preference Details
      operationId: getPreference
      tags:
      - Preferences
      responses:
        '200':
          description: System preference details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SystemPreference'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    put:
      summary: Update System Preference
      operationId: replacePreference
      tags:
      - Preferences
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                value:
                  type: string
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SystemPreference'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    patch:
      summary: Update System Preference (partial)
      operationId: updatePreference
      tags:
      - Preferences
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                value:
                  type: string
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SystemPreference'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    delete:
      summary: Delete System Preference
      operationId: deletePreference
      tags:
      - Preferences
      responses:
        '204':
          description: Deleted
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /trades:
    get:
      summary: Get Trades
      operationId: listTrades
      tags:
      - Trades
      parameters:
      - $ref: '#/components/parameters/limit'
      - $ref: '#/components/parameters/offset'
      responses:
        '200':
          description: Trades list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TradeListResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /trades/{tradeId}:
    parameters:
    - name: tradeId
      in: path
      required: true
      schema:
        type: string
    get:
      summary: Get Trade Details
      operationId: getTrade
      tags:
      - Trades
      responses:
        '200':
          description: Trade details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Trade'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /transactions:
    get:
      summary: Get Transactions
      operationId: listTransactions
      tags:
      - Transactions
      parameters:
      - $ref: '#/components/parameters/limit'
      - $ref: '#/components/parameters/offset'
      responses:
        '200':
          description: Transactions list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransactionListResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /transactions/{transactionId}:
    parameters:
    - name: transactionId
      in: path
      required: true
      schema:
        type: string
    get:
      summary: Get Transaction Details
      operationId: getTransaction
      tags:
      - Transactions
      responses:
        '200':
          description: Transaction details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Transaction'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /users:
    get:
      summary: Get Users
      operationId: listUsers
      tags:
      - Users
      parameters:
      - $ref: '#/components/parameters/limit'
      - $ref: '#/components/parameters/offset'
      responses:
        '200':
          description: Users list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserListResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    post:
      summary: Create a new User
      operationId: createUser
      tags:
      - Users
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserRequest'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/User'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /users/{userId}:
    parameters:
    - $ref: '#/components/parameters/userId'
    - name: userId
      in: path
      required: true
      schema:
        type: string
    get:
      summary: Get User Details
      operationId: getUser
      tags:
      - Users
      responses:
        '200':
          description: User details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/User'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    put:
      summary: Update User
      operationId: replaceUser
      tags:
      - Users
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserUpdateRequest'
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/User'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    patch:
      summary: Update User (partial)
      operationId: updateUser
      tags:
      - Users
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserUpdateRequest'
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/User'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    delete:
      summary: Delete a User
      operationId: deleteUser
      tags:
      - Users
      responses:
        '204':
          description: Deleted
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /users/{userId}/banners:
    parameters:
    - $ref: '#/components/parameters/userId'
    - name: userId
      in: path
      required: true
      schema:
        type: string
    get:
      summary: Get User Banners
      operationId: listUserBanners
      tags:
      - Users
      responses:
        '200':
          description: User banners list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserBannerListResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /users/{userId}/banners/{bannerId}:
    parameters:
    - $ref: '#/components/parameters/userId'
    - $ref: '#/components/parameters/bannerId'
    - name: userId
      in: path
      required: true
      schema:
        type: string
    - name: bannerId
      in: path
      required: true
      schema:
        type: string
    get:
      summary: Get User Banner Details
      operationId: getUserBanner
      tags:
      - Users
      responses:
        '200':
          description: User banner details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserBanner'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /users/{userId}/campaigns:
    parameters:
    - $ref: '#/components/parameters/userId'
    - name: userId
      in: path
      required: true
      schema:
        type: string
    get:
      summary: Get User Campaigns
      operationId: listUserCampaigns
      tags:
      - Users
      responses:
        '200':
          description: User campaigns list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CampaignListResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /users/{userId}/campaigns/{campaignId}:
    parameters:
    - $ref: '#/components/parameters/userId'
    - $ref: '#/components/parameters/campaignId'
    - name: userId
      in: path
      required: true
      schema:
        type: string
    - name: campaignId
      in: path
      required: true
      schema:
        type: string
    get:
      summary: Get User Campaign Details
      operationId: getUserCampaign
      tags:
      - Users
      responses:
        '200':
          description: Campaign details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Campaign'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /users/{userId}/metrics:
    parameters:
    - $ref: '#/components/parameters/userId'
    - name: userId
      in: path
      required: true
      schema:
        type: string
    get:
      summary: Get User Metrics
      operationId: getUserMetrics
      tags:
      - Users
      responses:
        '200':
          description: User metrics
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MetricsListResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /wallets:
    get:
      summary: Get Wallets
      operationId: listWallets
      tags:
      - Wallets
      parameters:
      - $ref: '#/components/parameters/limit'
      - $ref: '#/components/parameters/offset'
      responses:
        '200':
          description: Wallets list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WalletListResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    post:
      summary: Create a new Wallet
      operationId: createWallet
      tags:
      - Wallets
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WalletRequest'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Wallet'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /wallets/{walletId}:
    parameters:
    - name: walletId
      in: path
      required: true
      schema:
        type: string
    get:
      summary: Get Wallet Details
      operationId: getWallet
      tags:
      - Wallets
      responses:
        '200':
          description: Wallet details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Wallet'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    put:
      summary: Update Wallet
      operationId: replaceWallet
      tags:
      - Wallets
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WalletUpdateRequest'
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Wallet'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    patch:
      summary: Update Wallet (partial)
      operationId: updateWallet
      tags:
      - Wallets
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WalletUpdateRequest'
      responses:
        '200':
          description: Updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Wallet'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
    delete:
      summary: Delete a Wallet
      operationId: deleteWallet
      tags:
      - Wallets
      responses:
        '204':
          description: Deleted
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /operations/withdrawals:
    get:
      summary: Get Withdrawals
      operationId: listWithdrawals
      tags:
      - Operations
      parameters:
      - $ref: '#/components/parameters/limit'
      - $ref: '#/components/parameters/offset'
      responses:
        '200':
          description: Withdrawals list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WithdrawalListResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /operations/withdrawals/{withdrawalId}:
    parameters:
    - name: withdrawalId
      in: path
      required: true
      schema:
        type: string
    get:
      summary: Get Withdrawal Details
      operationId: getWithdrawal
      tags:
      - Operations
      responses:
        '200':
          description: Withdrawal details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Withdrawal'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /operations/client-withdrawals:
    get:
      summary: Get Client Withdrawals
      operationId: listClientWithdrawals
      tags:
      - Operations
      parameters:
      - $ref: '#/components/parameters/limit'
      - $ref: '#/components/parameters/offset'
      - name: filter[clientExternalId]
        in: query
        schema:
          type: integer
      - name: filter[clientName]
        in: query
        schema:
          type: string
      - name: filter[clientEmail]
        in: query
        schema:
          type: string
      - name: filter[profileId]
        in: query
        schema:
          type: string
      - name: filter[userId]
        in: query
        schema:
          type: string
      - name: filter[operationId]
        in: query
        schema:
          type: integer
      - name: filter[currencyCode]
        in: query
        schema:
          type: string
      - name: filter[startTime]
        in: query
        schema:
          type: string
          format: date-time
      - name: filter[endTime]
        in: query
        schema:
          type: string
          format: date-time
      - name: filter[userTags]
        in: query
        schema:
          type: string
      - name: sort_by
        in: query
        schema:
          type: string
          enum:
          - createTime
          - amount
      - name: sort_order
        in: query
        schema:
          type: string
          enum:
          - asc
          - desc
      responses:
        '200':
          description: Client withdrawals list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientWithdrawalListResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /operations/client-withdrawals/sign:
    get:
      summary: Sign Client Withdrawals Export URL
      operationId: signClientWithdrawalsExport
      tags:
      - Operations
      responses:
        '200':
          description: Signed export URL
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SignedUrlResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /operations/client-withdrawals/export:
    get:
      summary: Get Client Withdrawals (export)
      operationId: exportClientWithdrawals
      tags:
      - Operations
      security:
      - signatureAuth: []
      parameters:
      - name: signature
        in: query
        required: true
        schema:
          type: string
      - name: expires
        in: query
        required: true
        schema:
          type: integer
      responses:
        '200':
          description: Client withdrawals CSV export
          content:
            text/csv:
              schema:
                type: string
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
  /operations/client-withdrawals/{withdrawalId}:
    parameters:
    - name: withdrawalId
      in: path
      required: true
      schema:
        type: string
        format: uuid
    get:
      summary: Get Client Withdrawal Details
      operationId: getClientWithdrawal
      tags:
      - Operations
      parameters:
      - name: userTags
        in: query
        schema:
          type: string
      responses:
        '200':
          description: Client withdrawal details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientWithdrawal'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
    basicAuth:
      type: http
      scheme: basic
      description: "Enter **client_id** in the Username field and **client_secret** in the Password field."
    signatureAuth:
      type: apiKey
      in: query
      name: signature
      description: Signature-based authentication for CSV export endpoints
  parameters:
    limit:
      name: limit
      in: query
      schema:
        type: integer
        default: 20
    offset:
      name: offset
      in: query
      schema:
        type: integer
        default: 0
    accountId:
      name: accountId
      in: path
      required: true
      schema:
        type: string
    addressId:
      name: addressId
      in: path
      required: true
      schema:
        type: string
    bannerId:
      name: bannerId
      in: path
      required: true
      schema:
        type: string
    campaignId:
      name: campaignId
      in: path
      required: true
      schema:
        type: string
    clientId:
      name: clientId
      in: path
      required: true
      schema:
        type: string
    contactId:
      name: contactId
      in: path
      required: true
      schema:
        type: string
    driverId:
      name: driverId
      in: path
      required: true
      schema:
        type: string
    groupId:
      name: groupId
      in: path
      required: true
      schema:
        type: string
    languageId:
      name: languageId
      in: path
      required: true
      schema:
        type: string
    levelId:
      name: levelId
      in: path
      required: true
      schema:
        type: string
    linkId:
      name: linkId
      in: path
      required: true
      schema:
        type: string
    methodId:
      name: methodId
      in: path
      required: true
      schema:
        type: string
    platformId:
      name: platformId
      in: path
      required: true
      schema:
        type: string
    platformGroupId:
      name: platformGroupId
      in: path
      required: true
      schema:
        type: string
    profileId:
      name: profileId
      in: path
      required: true
      schema:
        type: string
    symbolId:
      name: symbolId
      in: path
      required: true
      schema:
        type: string
    userId:
      name: userId
      in: path
      required: true
      schema:
        type: string
    cpaProgramId:
      name: cpaProgramId
      in: path
      required: true
      schema:
        type: string
    planId:
      name: planId
      in: path
      required: true
      schema:
        type: string
    conditionId:
      name: conditionId
      in: path
      required: true
      schema:
        type: string
    subscriptionId:
      name: subscriptionId
      in: path
      required: true
      schema:
        type: string
    exportId:
      name: exportId
      in: path
      required: true
      schema:
        type: string
    reassignmentId:
      name: reassignmentId
      in: path
      required: true
      schema:
        type: string
    syncChainId:
      name: syncChainId
      in: path
      required: true
      schema:
        type: string
    savingsProgram:
      name: savingsProgram
      in: path
      required: true
      schema:
        type: string
        format: uuid
    level:
      name: level
      in: path
      required: true
      schema:
        type: string
        format: uuid
  responses:
    BadRequest:
      description: Bad Request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NotFound:
      description: Not Found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    TooManyRequests:
      description: Too Many Requests
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    ServiceUnavailable:
      description: Service Unavailable
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  schemas:
    ErrorResponse:
      type: object
      properties:
        message:
          type: string
          description: Descriptive message
        errors:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
          description: List of validation or error messages
    TokenResponse:
      type: object
      properties:
        token_type:
          type: string
          example: Bearer
          description: Token type (e.g. Bearer)
        expires_in:
          type: integer
          description: Token expiry duration in seconds
        access_token:
          type: string
          description: JWT access token
        refresh_token:
          type: string
          description: JWT refresh token
    MetricItem:
      type: object
      properties:
        key:
          type: string
          example: trades
          description: Unique key identifier
        value:
          oneOf:
          - type: integer
          - type: string
          - type: object
          description: Associated value
    MetricsListResponse:
      type: object
      properties:
        total:
          type: integer
          description: Total number of items
        metrics:
          type: array
          items:
            $ref: '#/components/schemas/MetricItem'
          description: List of metrics
    DiagnosticsResponse:
      type: object
      properties:
        health:
          type: boolean
          description: Health check status of system components
        message:
          type: string
          nullable: true
          description: Descriptive message
    Credentials:
      type: object
      properties:
        username:
          type: string
          description: User login name
      additionalProperties: true
    CredentialsWithPassword:
      type: object
      properties:
        username:
          type: string
          description: User login name
        password:
          type: string
          description: User password
      additionalProperties: true
    Account:
      type: object
      properties:
        accountId:
          type: string
          description: Unique identifier of the trading account
        userId:
          type: string
          description: Identifier of the user who owns this account
        number:
          type: string
          description: Account number as assigned by the trading platform
        platformId:
          type: string
          description: Identifier of the trading platform this account belongs to
        platformGroupId:
          type: string
          description: Identifier of the group within the trading platform
        currencyCode:
          type: string
          description: Base currency of the trading account
        createTime:
          type: string
          format: date-time
          description: Timestamp when the account was created
        updateTime:
          type: string
          format: date-time
          description: Timestamp when the account was last updated
        uuid:
          type: string
          nullable: true
          description: Universally unique identifier of the account record
    AccountRequest:
      type: object
      properties:
        userId:
          type: string
          description: Identifier of the associated user
        number:
          type: string
          description: Account number
        platformId:
          type: string
          description: Identifier of the trading platform
        platformGroupId:
          type: string
          description: Identifier of the group within the trading platform
        currencyCode:
          type: string
          description: Currency code (e.g. USD, EUR)
        uuid:
          type: string
          nullable: true
          description: Universally unique identifier
    AccountListResponse:
      type: object
      properties:
        total:
          type: integer
          description: Total number of items
        accounts:
          type: array
          items:
            $ref: '#/components/schemas/Account'
          description: List of accounts
    Address:
      type: object
      properties:
        addressId:
          type: string
          description: Unique identifier of the address
        ip:
          type: string
          description: IP address
        policy:
          type: string
          description: Policy
        createTime:
          type: string
          format: date-time
          description: Timestamp when the record was created
        updateTime:
          type: string
          format: date-time
          description: Timestamp when the record was last updated
        uuid:
          type: string
          nullable: true
          description: Universally unique identifier
    AddressRequest:
      type: object
      properties:
        ip:
          type: string
          description: IP address
        policy:
          type: string
          description: Access policy identifier
        uuid:
          type: string
          nullable: true
          description: Universally unique identifier
    AddressListResponse:
      type: object
      properties:
        total:
          type: integer
          description: Total number of items
        addresses:
          type: array
          items:
            $ref: '#/components/schemas/Address'
          description: List of addresses
    Authentication:
      type: object
      properties:
        authenticationId:
          type: string
          description: Unique identifier of the authentication
        userId:
          type: string
          description: Identifier of the associated user
        ip:
          type: string
          description: IP address
        createTime:
          type: string
          format: date-time
          description: Timestamp when the record was created
    AuthenticationListResponse:
      type: object
      properties:
        total:
          type: integer
          description: Total number of items
        authentications:
          type: array
          items:
            $ref: '#/components/schemas/Authentication'
          description: List of authentications
    Authorization:
      type: object
      properties:
        authorizationId:
          type: string
          description: Unique identifier of the authorization
        clientId:
          type: string
          description: OAuth client identifier
        userId:
          type: string
          description: Identifier of the associated user
        scopes:
          type: array
          items:
            type: string
          description: Comma-separated list of OAuth scopes
        createTime:
          type: string
          format: date-time
          description: Timestamp when the record was created
    AuthorizationListResponse:
      type: object
      properties:
        total:
          type: integer
          description: Total number of items
        authorizations:
          type: array
          items:
            $ref: '#/components/schemas/Authorization'
          description: List of authorizations
    Banner:
      type: object
      properties:
        bannerId:
          type: string
          description: Unique identifier of the banner
        bannerName:
          type: string
          description: Banner name
        cdnFileUrl:
          type: string
          format: uri
          description: Cdn file url
        themeId:
          type: string
          description: Identifier of the associated theme
        themeName:
          type: string
          description: Theme name
        languageId:
          type: string
          description: Identifier of the associated language
        languageName:
          type: string
          description: Language name
        sizeId:
          type: string
          description: Identifier of the associated size
        sizeName:
          type: string
          description: Size name
        width:
          type: integer
          description: Banner width in pixels
        height:
          type: integer
          description: Banner height in pixels
        linkId:
          type: string
          nullable: true
          description: Identifier of the associated link
        linkName:
          type: string
          nullable: true
          description: Link name
        linkUri:
          type: string
          nullable: true
          description: Link uri
        createTime:
          type: string
          format: date-time
          description: Timestamp when the record was created
        updateTime:
          type: string
          format: date-time
          description: Timestamp when the record was last updated
    BannerRequest:
      type: object
      properties:
        themeId:
          type: string
          description: Identifier of the associated theme
        languageId:
          type: string
          description: Identifier of the associated language
        sizeId:
          type: string
          description: Identifier of the associated banner size
        linkId:
          type: string
          nullable: true
          description: Identifier of the associated link
    BannerListResponse:
      type: object
      properties:
        total:
          type: integer
          description: Total number of items
        banners:
          type: array
          items:
            $ref: '#/components/schemas/Banner'
          description: List of banners
    Language:
      type: object
      properties:
        languageId:
          type: string
          description: Unique identifier of the language
        name:
          type: string
          description: Display name
        code:
          type: string
          description: Short code identifier
        createTime:
          type: string
          format: date-time
          description: Timestamp when the record was created
        updateTime:
          type: string
          format: date-time
          description: Timestamp when the record was last updated
    LanguageRequest:
      type: object
      properties:
        name:
          type: string
          description: Display name
        code:
          type: string
          description: Short code identifier
    LanguageListResponse:
      type: object
      properties:
        total:
          type: integer
          description: Total number of items
        languages:
          type: array
          items:
            $ref: '#/components/schemas/Language'
          description: List of associated language entries
    Size:
      type: object
      properties:
        sizeId:
          type: string
          description: Unique identifier of the size
        name:
          type: string
          description: Display name
        width:
          type: integer
          description: Banner width in pixels
        height:
          type: integer
          description: Banner height in pixels
        createTime:
          type: string
          format: date-time
          description: Timestamp when the record was created
    SizeRequest:
      type: object
      properties:
        name:
          type: string
          description: Display name
        width:
          type: integer
          description: Width in pixels
        height:
          type: integer
          description: Height in pixels
    SizeListResponse:
      type: object
      properties:
        total:
          type: integer
          description: Total number of items
        sizes:
          type: array
          items:
            $ref: '#/components/schemas/Size'
          description: List of sizes
    Theme:
      type: object
      properties:
        themeId:
          type: string
          description: Unique identifier of the theme
        name:
          type: string
          description: Display name
        createTime:
          type: string
          format: date-time
          description: Timestamp when the record was created
        updateTime:
          type: string
          format: date-time
          description: Timestamp when the record was last updated
    ThemeRequest:
      type: object
      properties:
        name:
          type: string
          description: Display name
    ThemeListResponse:
      type: object
      properties:
        total:
          type: integer
          description: Total number of items
        themes:
          type: array
          items:
            $ref: '#/components/schemas/Theme'
          description: List of themes
    Campaign:
      type: object
      properties:
        campaignId:
          type: string
          description: Unique identifier of the campaign
        name:
          type: string
          description: Display name
        uri:
          type: string
          format: uri
          description: Uri
        utmCampaign:
          type: string
          nullable: true
          description: Utm campaign
        utmContent:
          type: string
          nullable: true
          description: Utm content
        utmMedium:
          type: string
          nullable: true
          description: Utm medium
        utmSource:
          type: string
          nullable: true
          description: Utm source
        utmTerm:
          type: string
          nullable: true
          description: Utm term
        linkId:
          type: string
          description: Identifier of the associated link
        userId:
          type: string
          description: Identifier of the associated user
        link:
          $ref: '#/components/schemas/LinkSummary'
          description: Associated referral link object
        createTime:
          type: string
          format: date-time
          description: Timestamp when the record was created
        updateTime:
          type: string
          format: date-time
          description: Timestamp when the record was last updated
    CampaignRequest:
      type: object
      properties:
        name:
          type: string
          description: Display name
        linkId:
          type: string
          description: Identifier of the associated link
        utmCampaign:
          type: string
          nullable: true
          description: UTM campaign parameter
        utmContent:
          type: string
          nullable: true
          description: UTM content parameter
        utmMedium:
          type: string
          nullable: true
          description: UTM medium parameter
        utmSource:
          type: string
          nullable: true
          description: UTM source parameter
        utmTerm:
          type: string
          nullable: true
          description: UTM term parameter
    CampaignListResponse:
      type: object
      properties:
        total:
          type: integer
          description: Total number of items
        campaigns:
          type: array
          items:
            $ref: '#/components/schemas/Campaign'
          description: List of campaigns
    Node:
      type: object
      properties:
        nodeId:
          type: string
          description: Unique identifier of the node
        userId:
          type: string
          description: Identifier of the associated user
        level:
          type: integer
          description: Level number (1-based)
        children:
          type: array
          items:
            type: object
          description: Child nodes in the hierarchy
        createTime:
          type: string
          format: date-time
          description: Timestamp when the record was created
    NodeListResponse:
      type: object
      properties:
        total:
          type: integer
          description: Total number of items
        nodes:
          type: array
          items:
            $ref: '#/components/schemas/Node'
          description: List of nodes
    Click:
      type: object
      properties:
        clickId:
          type: string
          description: Unique identifier of the click
        ip:
          type: string
          description: IP address of the visitor
        linkId:
          type: string
          description: Identifier of the associated link
        userId:
          type: string
          nullable: true
          description: Identifier of the associated user
        createTime:
          type: string
          format: date-time
          description: Timestamp when the record was created
        updateTime:
          type: string
          format: date-time
          description: Timestamp when the record was last updated
    ClickRequest:
      type: object
      properties:
        ip:
          type: string
          description: IP address
        linkId:
          type: string
          description: Identifier of the associated link
    ClickListResponse:
      type: object
      properties:
        total:
          type: integer
          description: Total number of items
        clicks:
          type: array
          items:
            $ref: '#/components/schemas/Click'
          description: List of clicks
    Country:
      type: object
      properties:
        countryId:
          type: string
          description: Unique identifier of the country
        name:
          type: string
          description: Display name
        numericCode:
          type: string
          description: Numeric code
        alpha2Code:
          type: string
          description: Alpha2 code
        alpha3Code:
          type: string
          description: Alpha3 code
        createTime:
          type: string
          format: date-time
          description: Timestamp when the record was created
        updateTime:
          type: string
          format: date-time
          description: Timestamp when the record was last updated
    CountryRequest:
      type: object
      properties:
        name:
          type: string
          description: Display name
        numericCode:
          type: string
          description: ISO 3166-1 numeric country code
        alpha2Code:
          type: string
          description: ISO 3166-1 alpha-2 country code (e.g. US)
        alpha3Code:
          type: string
          description: ISO 3166-1 alpha-3 country code (e.g. USA)
    CountryListResponse:
      type: object
      properties:
        total:
          type: integer
          description: Total number of items
        countries:
          type: array
          items:
            $ref: '#/components/schemas/Country'
          description: List of countries
    Currency:
      type: object
      properties:
        currencyId:
          type: string
          description: Unique identifier of the currency
        code:
          type: string
          description: Short code identifier
        name:
          type: string
          description: Display name
        sign:
          type: string
          description: Sign
        precision:
          type: integer
          description: Number of decimal digits
        createTime:
          type: string
          format: date-time
          description: Timestamp when the record was created
        updateTime:
          type: string
          format: date-time
          description: Timestamp when the record was last updated
    CurrencyRequest:
      type: object
      properties:
        code:
          type: string
          description: Short code identifier
        name:
          type: string
          description: Display name
        sign:
          type: string
          description: Currency symbol (e.g. $)
        precision:
          type: integer
          description: Number of decimal places
    CurrencyListResponse:
      type: object
      properties:
        total:
          type: integer
          description: Total number of items
        currencies:
          type: array
          items:
            $ref: '#/components/schemas/Currency'
          description: List of currencies
    Deposit:
      type: object
      properties:
        depositId:
          type: string
          description: Unique identifier of the deposit
        accountId:
          type: string
          description: Identifier of the associated account
        accountNumber:
          type: string
          description: Account number
        amount:
          type: string
          description: Transaction amount
        currencyCode:
          type: string
          description: Currency code (ISO 4217)
        platformUniqueValue:
          type: string
          description: Unique value assigned by the external trading platform
        createTime:
          type: string
          format: date-time
          description: Timestamp when the record was created
    DepositListResponse:
      type: object
      properties:
        total:
          type: integer
          description: Total number of items
        deposits:
          type: array
          items:
            $ref: '#/components/schemas/Deposit'
          description: List of deposits
    ClientDeposit:
      type: object
      properties:
        depositId:
          type: string
          format: uuid
          description: Unique identifier of the client deposit
        clientExternalId:
          type: integer
          description: External identifier of the client
        profileId:
          type: string
          description: Identifier of the client user profile
        clientName:
          type: string
          nullable: true
          description: Client name
        clientEmail:
          type: string
          nullable: true
          description: Client email
        operationId:
          type: integer
          description: Identifier of the related operation
        amount:
          type: string
          description: Transaction amount
        amountInUsd:
          type: string
          description: Transaction amount converted to USD
        currencyCode:
          type: string
          description: Currency code (ISO 4217)
        createTime:
          type: string
          format: date-time
          description: Timestamp when the deposit happened
    ClientDepositListResponse:
      type: object
      properties:
        total:
          type: integer
          description: Total number of items
        deposits:
          type: array
          items:
            $ref: '#/components/schemas/ClientDeposit'
          description: List of client deposits
    Withdrawal:
      type: object
      properties:
        withdrawalId:
          type: string
          description: Unique identifier of the withdrawal
        accountId:
          type: string
          description: Identifier of the associated account
        accountNumber:
          type: string
          description: Account number
        amount:
          type: string
          description: Transaction amount
        currencyCode:
          type: string
          description: Currency code (ISO 4217)
        platformUniqueValue:
          type: string
          description: Unique value assigned by the external trading platform
        createTime:
          type: string
          format: date-time
          description: Timestamp when the record was created
    WithdrawalListResponse:
      type: object
      properties:
        total:
          type: integer
          description: Total number of items
        withdrawals:
          type: array
          items:
            $ref: '#/components/schemas/Withdrawal'
          description: List of withdrawals
    ClientWithdrawal:
      type: object
      properties:
        withdrawalId:
          type: string
          format: uuid
          description: Unique identifier of the client withdrawal
        clientExternalId:
          type: integer
          description: External identifier of the client
        profileId:
          type: string
          description: Identifier of the client user profile
        clientName:
          type: string
          nullable: true
          description: Client name
        clientEmail:
          type: string
          nullable: true
          description: Client email
        operationId:
          type: integer
          description: Identifier of the related operation
        amount:
          type: string
          description: Transaction amount
        amountInUsd:
          type: string
          description: Transaction amount converted to USD
        currencyCode:
          type: string
          description: Currency code (ISO 4217)
        createTime:
          type: string
          format: date-time
          description: Timestamp when the withdrawal happened
    ClientWithdrawalListResponse:
      type: object
      properties:
        total:
          type: integer
          description: Total number of items
        withdrawals:
          type: array
          items:
            $ref: '#/components/schemas/ClientWithdrawal'
          description: List of client withdrawals
    SignedUrlResponse:
      type: object
      properties:
        location:
          type: string
          description: Signed URL for downloading the export
    Region:
      type: object
      properties:
        regionId:
          type: string
          description: Unique identifier of the region
        name:
          type: string
          description: Display name
        code:
          type: string
          description: Short code identifier
    RegionListResponse:
      type: object
      properties:
        total:
          type: integer
          description: Total number of items
        regions:
          type: array
          items:
            $ref: '#/components/schemas/Region'
          description: List of regions
    Group:
      type: object
      properties:
        groupId:
          type: string
          description: Identifier of the group
        name:
          type: string
          description: Display name
        formula:
          type: string
          description: Payment formula type
        levels:
          type: array
          items:
            $ref: '#/components/schemas/Level'
          description: Payment levels configuration
        tiers:
          type: array
          items:
            $ref: '#/components/schemas/Tier'
          description: Payment tiers configuration
        createTime:
          type: string
          format: date-time
          description: Timestamp when the record was created
        updateTime:
          type: string
          format: date-time
          description: Timestamp when the record was last updated
        uuid:
          type: string
          nullable: true
          description: Universal unique identifier (UUID)
    GroupRequest:
      type: object
      properties:
        name:
          type: string
          description: Display name
        formula:
          type: string
          description: Payment formula type
        uuid:
          type: string
          nullable: true
          description: Universally unique identifier
    GroupListResponse:
      type: object
      properties:
        total:
          type: integer
          description: Total number of items
        groups:
          type: array
          items:
            $ref: '#/components/schemas/Group'
          description: List of groups
    Level:
      type: object
      properties:
        levelId:
          type: string
          description: Unique identifier of the level
        groupId:
          type: string
          description: Identifier of the group
        level:
          type: integer
          description: Level number (1-based)
        formulaValue:
          type: string
          description: Numeric value used in payment formula calculation
        createTime:
          type: string
          format: date-time
          description: Timestamp when the record was created
        updateTime:
          type: string
          format: date-time
          description: Timestamp when the record was last updated
        uuid:
          type: string
          nullable: true
          description: Universal unique identifier (UUID)
    LevelRequest:
      type: object
      properties:
        level:
          type: integer
          description: Level number (1-based)
        formulaValue:
          type: string
          description: Numeric value used in payment formula calculation
        uuid:
          type: string
          nullable: true
          description: Universally unique identifier
    LevelListResponse:
      type: object
      properties:
        total:
          type: integer
          description: Total number of items
        levels:
          type: array
          items:
            $ref: '#/components/schemas/Level'
          description: Payment levels configuration
    Tier:
      type: object
      properties:
        tierId:
          type: string
          description: Unique identifier of the tier
        groupId:
          type: string
          description: Identifier of the group
        name:
          type: string
          description: Display name
        ratio:
          type: string
          description: Ratio coefficient applied to payments
        users:
          type: integer
          description: Users
        volume:
          type: string
          description: Trade volume in lots
        createTime:
          type: string
          format: date-time
          description: Timestamp when the record was created
        updateTime:
          type: string
          format: date-time
          description: Timestamp when the record was last updated
        uuid:
          type: string
          nullable: true
          description: Universal unique identifier (UUID)
    TierRequest:
      type: object
      properties:
        name:
          type: string
          description: Display name
        ratio:
          type: string
          description: Ratio multiplier used in calculations
        users:
          type: integer
          description: List of associated users
        volume:
          type: string
          description: Trade volume threshold
        uuid:
          type: string
          nullable: true
          description: Universally unique identifier
    TierListResponse:
      type: object
      properties:
        total:
          type: integer
          description: Total number of items
        tiers:
          type: array
          items:
            $ref: '#/components/schemas/Tier'
          description: Payment tiers configuration
    Resource:
      type: object
      properties:
        resourceId:
          type: string
          description: Unique identifier of the resource
        groupId:
          type: string
          description: Identifier of the group
        languageCode:
          type: string
          description: Language code (ISO 639-1, e.g. en)
        key:
          type: string
          description: Key
        value:
          type: string
          description: Value
        createTime:
          type: string
          format: date-time
          description: Timestamp when the record was created
        updateTime:
          type: string
          format: date-time
          description: Timestamp when the record was last updated
    ResourceRequest:
      type: object
      properties:
        languageCode:
          type: string
          description: Language code (ISO 639-1, e.g. en)
        key:
          type: string
          description: Unique key identifier
        value:
          type: string
          description: Associated value
    ResourceListResponse:
      type: object
      properties:
        total:
          type: integer
          description: Total number of items
        resources:
          type: array
          items:
            $ref: '#/components/schemas/Resource'
          description: List of resources
    LinkSummary:
      type: object
      properties:
        linkId:
          type: string
          description: Identifier of the associated link
        name:
          type: string
          description: Display name
        uri:
          type: string
          format: uri
          description: URI of the link
    Link:
      type: object
      properties:
        linkId:
          type: string
          description: Unique identifier of the link
        name:
          type: string
          description: Display name
        uri:
          type: string
          format: uri
          description: Uri
        userId:
          type: string
          description: Identifier of the associated user
        languages:
          type: array
          items:
            $ref: '#/components/schemas/LinkLanguage'
          description: List of associated language entries
        createTime:
          type: string
          format: date-time
          description: Timestamp when the record was created
        updateTime:
          type: string
          format: date-time
          description: Timestamp when the record was last updated
        uuid:
          type: string
          nullable: true
          description: Universal unique identifier (UUID)
    LinkRequest:
      type: object
      properties:
        name:
          type: string
          description: Display name
        uri:
          type: string
          format: uri
          description: URI of the link
        uuid:
          type: string
          nullable: true
          description: Universally unique identifier
    LinkListResponse:
      type: object
      properties:
        total:
          type: integer
          description: Total number of items
        links:
          type: array
          items:
            $ref: '#/components/schemas/Link'
          description: List of links
    LinkLanguage:
      type: object
      properties:
        languageId:
          type: string
          description: Identifier of the associated language
        linkId:
          type: string
          description: Identifier of the associated link
        languageCode:
          type: string
          description: Language code (ISO 639-1, e.g. en)
        uri:
          type: string
          format: uri
          description: URI of the link
        createTime:
          type: string
          format: date-time
          description: Timestamp when the record was created
        updateTime:
          type: string
          format: date-time
          description: Timestamp when the record was last updated
    LinkLanguageRequest:
      type: object
      properties:
        languageCode:
          type: string
          description: Language code (ISO 639-1, e.g. en)
        uri:
          type: string
          format: uri
          description: URI of the link
    LinkLanguageListResponse:
      type: object
      properties:
        total:
          type: integer
          description: Total number of items
        languages:
          type: array
          items:
            $ref: '#/components/schemas/LinkLanguage'
          description: List of associated language entries
    Message:
      type: object
      properties:
        messageId:
          type: string
          description: Unique identifier of the message
        subject:
          type: string
          description: Subject of the message
        body:
          type: string
          description: Message body content
        createTime:
          type: string
          format: date-time
          description: Timestamp when the record was created
    MessageListResponse:
      type: object
      properties:
        total:
          type: integer
          description: Total number of items
        messages:
          type: array
          items:
            $ref: '#/components/schemas/Message'
          description: List of messages
    LocationService:
      type: object
      properties:
        serviceId:
          type: string
          description: Unique identifier of the service
        name:
          type: string
          description: Display name
        provider:
          type: string
          description: Service provider name
        createTime:
          type: string
          format: date-time
          description: Timestamp when the record was created
        updateTime:
          type: string
          format: date-time
          description: Timestamp when the record was last updated
        uuid:
          type: string
          nullable: true
          description: Universally unique identifier
    LocationServiceRequest:
      type: object
      properties:
        name:
          type: string
          description: Display name
        provider:
          type: string
          description: Service provider name
        uuid:
          type: string
          nullable: true
          description: Universally unique identifier
    LocationServiceListResponse:
      type: object
      properties:
        total:
          type: integer
          description: Total number of items
        services:
          type: array
          items:
            $ref: '#/components/schemas/LocationService'
          description: List of services
    Payment:
      type: object
      properties:
        paymentId:
          type: string
          description: Unique identifier of the payment
        paymentState:
          type: string
          description: Current payment processing state
        paymentAmount:
          type: string
          description: 'Payment amount: transaction amount'
        paymentCurrencyCode:
          type: string
          description: 'Payment currencyCode: currency code (iso 4217)'
        paymentCurrencyPrecision:
          type: integer
          description: Payment currencyPrecision
        paymentFormulaUnitPrecision:
          type: integer
          description: Payment formulaUnitPrecision
        paymentParentId:
          type: string
          nullable: true
          description: Identifier of the associated paymentParent
        paymentPreferencesGroupId:
          type: string
          nullable: true
          description: Identifier of the associated paymentPreferencesGroup
        tradeId:
          type: string
          description: Identifier of the associated trade
        createTime:
          type: string
          format: date-time
          description: Timestamp when the record was created
        updateTime:
          type: string
          format: date-time
          description: Timestamp when the record was last updated
    PaymentListResponse:
      type: object
      properties:
        total:
          type: integer
          description: Total number of items
        payments:
          type: array
          items:
            $ref: '#/components/schemas/Payment'
          description: List of payments
    Driver:
      type: object
      properties:
        driverId:
          type: string
          description: Unique identifier of the driver
        driverNumber:
          type: string
          description: Unique driver number
        address:
          type: string
          description: Street address
        credentials:
          $ref: '#/components/schemas/Credentials'
          description: Credentials
        name:
          type: string
          description: Display name
        provider:
          type: string
          description: Integration provider name
        version:
          type: integer
          description: Version string
        createTime:
          type: string
          format: date-time
          description: Timestamp when the record was created
        updateTime:
          type: string
          format: date-time
          description: Timestamp when the record was last updated
        uuid:
          type: string
          nullable: true
          description: Universal unique identifier (UUID)
    DriverRequest:
      type: object
      properties:
        provider:
          type: string
          description: Service provider name
        address:
          type: string
          description: Connection address (host:port)
        credentials:
          $ref: '#/components/schemas/CredentialsWithPassword'
          description: Authentication credentials for the service
        name:
          type: string
          description: Display name
        version:
          type: integer
          description: API or service version
        uuid:
          type: string
          nullable: true
          description: Universally unique identifier
    DriverListResponse:
      type: object
      properties:
        total:
          type: integer
          description: Total number of items
        drivers:
          type: array
          items:
            $ref: '#/components/schemas/Driver'
          description: List of drivers
    PlatformDriver:
      type: object
      properties:
        driverId:
          type: string
          description: Unique identifier of the platform driver
        driverNumber:
          type: string
          description: Unique driver number
        address:
          type: string
          description: Connection address (host:port)
        credentials:
          $ref: '#/components/schemas/Credentials'
          description: Authentication credentials for the service
        name:
          type: string
          description: Display name
        priority:
          type: integer
          description: Sort priority
        provider:
          type: string
          description: Service provider name
        version:
          type: integer
          description: API or service version
        createTime:
          type: string
          format: date-time
          description: Timestamp when the record was created
        updateTime:
          type: string
          format: date-time
          description: Timestamp when the record was last updated
        uuid:
          type: string
          nullable: true
          description: Universally unique identifier
    PlatformDriverRequest:
      type: object
      properties:
        provider:
          type: string
          description: Service provider name
        address:
          type: string
          description: Connection address (host:port)
        credentials:
          $ref: '#/components/schemas/CredentialsWithPassword'
          description: Authentication credentials for the service
        name:
          type: string
          description: Display name
        priority:
          type: integer
          description: Sort priority
        version:
          type: integer
          description: API or service version
        uuid:
          type: string
          nullable: true
          description: Universally unique identifier
    Method:
      type: object
      properties:
        methodId:
          type: string
          description: Unique identifier of the method
        name:
          type: string
          description: Display name
        provider:
          type: string
          description: Integration provider name
        createTime:
          type: string
          format: date-time
          description: Timestamp when the record was created
        updateTime:
          type: string
          format: date-time
          description: Timestamp when the record was last updated
        uuid:
          type: string
          nullable: true
          description: Universal unique identifier (UUID)
    MethodRequest:
      type: object
      properties:
        provider:
          type: string
          description: Service provider name
        drivers:
          type: array
          items:
            $ref: '#/components/schemas/DriverRequest'
          description: List of associated drivers
    MethodUpdateRequest:
      type: object
      properties:
        name:
          type: string
          description: Display name
        uuid:
          type: string
          nullable: true
          description: Universally unique identifier
    MethodListResponse:
      type: object
      properties:
        total:
          type: integer
          description: Total number of items
        methods:
          type: array
          items:
            $ref: '#/components/schemas/Method'
          description: List of methods
    Platform:
      type: object
      properties:
        platformId:
          type: string
          description: Unique identifier of the platform
        address:
          type: string
          description: Street address
        credentials:
          $ref: '#/components/schemas/Credentials'
          description: Credentials
        environment:
          type: string
          enum:
          - production
          - demo
          description: 'Account environment: live or demo'
        name:
          type: string
          description: Display name
        provider:
          type: string
          description: Integration provider name
        timeZone:
          type: string
          description: Time zone
        minPositionLifetime:
          type: integer
          description: Min position lifetime
        metrics:
          type: array
          items:
            $ref: '#/components/schemas/MetricItem'
          description: Aggregated metrics data
        createTime:
          type: string
          format: date-time
          description: Timestamp when the record was created
        updateTime:
          type: string
          format: date-time
          description: Timestamp when the record was last updated
        uuid:
          type: string
          nullable: true
          description: Universal unique identifier (UUID)
        workStatus:
          type: string
          enum:
          - enabled
          - disabled
          description: Work status
    PlatformRequest:
      type: object
      properties:
        environment:
          type: string
          enum:
          - production
          - demo
          description: Trading environment type (live or demo)
        provider:
          type: string
          description: Service provider name
        address:
          type: string
          description: Connection address (host:port)
        credentials:
          $ref: '#/components/schemas/CredentialsWithPassword'
          description: Authentication credentials for the service
        name:
          type: string
          description: Display name
        timeZone:
          type: string
          description: Timezone of the trading platform (e.g. Europe/London)
        minPositionLifetime:
          type: integer
          description: Minimum position lifetime in seconds required to qualify for
            payments
        drivers:
          type: array
          items:
            $ref: '#/components/schemas/PlatformDriverRequest'
          description: List of associated drivers
        uuid:
          type: string
          nullable: true
          description: Universally unique identifier
        workStatus:
          type: string
          enum:
          - enabled
          - disabled
          description: Current working status of the service
    PlatformListResponse:
      type: object
      properties:
        total:
          type: integer
          description: Total number of items
        platforms:
          type: array
          items:
            $ref: '#/components/schemas/Platform'
          description: List of platforms
    PlatformGroup:
      type: object
      properties:
        platformGroupId:
          type: string
          description: Identifier of the group within the trading platform
        platformId:
          type: string
          description: Identifier of the trading platform
        environment:
          type: string
          description: Trading environment type (live or demo)
        name:
          type: string
          description: Display name
        currency:
          type: string
          description: Currency code
        archived:
          type: boolean
          description: Whether the entity is archived
        lotMultiplier:
          type: string
          description: Lot size multiplier
        metrics:
          type: array
          items:
            $ref: '#/components/schemas/MetricItem'
          description: Trading performance metrics
        platform:
          type: object
          properties:
            platformId:
              type: string
            name:
              type: string
            provider:
              type: string
          description: Associated trading platform
        createTime:
          type: string
          format: date-time
          description: Timestamp when the record was created
        updateTime:
          type: string
          format: date-time
          description: Timestamp when the record was last updated
    PlatformGroupListResponse:
      type: object
      properties:
        total:
          type: integer
          description: Total number of items
        platformGroups:
          type: array
          items:
            $ref: '#/components/schemas/PlatformGroup'
          description: List of platformGroups
    PlatformConsumer:
      type: object
      properties:
        alias:
          type: string
          description: Human-readable alias for the consumer
        version:
          type: string
          description: API or service version
        message:
          type: string
          nullable: true
          description: Descriptive message
        workStatus:
          type: string
          enum:
          - enabled
          - disabled
          description: Current working status of the service
        webapiAddress:
          type: string
          description: WebAPI endpoint address
        webapiCredentials:
          $ref: '#/components/schemas/Credentials'
          description: WebAPI authentication credentials
        createTime:
          type: string
          format: date-time
          description: Timestamp when the record was created
        updateTime:
          type: string
          format: date-time
          description: Timestamp when the record was last updated
    PlatformConsumerRequest:
      type: object
      properties:
        alias:
          type: string
          description: Human-readable alias for the consumer
        version:
          type: string
          description: API or service version
        workStatus:
          type: string
          enum:
          - enabled
          - disabled
          description: Current working status of the service
        webapiAddress:
          type: string
          description: WebAPI endpoint address
        webapiCredentials:
          $ref: '#/components/schemas/CredentialsWithPassword'
          description: WebAPI authentication credentials
    Process:
      type: object
      properties:
        processId:
          type: string
          description: Unique identifier of the process
        pid:
          type: integer
          description: Pid
        name:
          type: string
          description: Display name
        arguments:
          type: string
          description: Arguments
        messages:
          type: integer
          description: Messages
        memory:
          type: integer
          description: Memory
        time:
          type: integer
          description: Time
        code:
          type: integer
          description: Short identifier code
        version:
          type: string
          description: Version string
        createTime:
          type: string
          format: date-time
          description: Timestamp when the record was created
        updateTime:
          type: string
          format: date-time
          description: Timestamp when the record was last updated
    ProcessRequest:
      type: object
      properties:
        name:
          type: string
          description: Display name
        verbosity:
          type: string
          example: v
          description: Logging verbosity level
        startTime:
          type: string
          format: date-time
          description: Start time of the processing range
        endTime:
          type: string
          format: date-time
          description: End time of the processing range
        platformId:
          type: string
          nullable: true
          description: Identifier of the trading platform
        tradingAccountNumber:
          type: string
          nullable: true
          description: Trading account number to process
    ProcessListResponse:
      type: object
      properties:
        total:
          type: integer
          description: Total number of items
        processes:
          type: array
          items:
            $ref: '#/components/schemas/Process'
          description: List of processes
    Contact:
      type: object
      properties:
        contactId:
          type: string
          description: Unique identifier of the contact
        key:
          type: string
          example: email
          description: Key
        value:
          type: string
          description: Value
        createTime:
          type: string
          format: date-time
          description: Timestamp when the record was created
        updateTime:
          type: string
          format: date-time
          description: Timestamp when the record was last updated
        uuid:
          type: string
          nullable: true
          description: Universal unique identifier (UUID)
    ContactRequest:
      type: object
      properties:
        key:
          type: string
          example: email
          description: Unique key identifier
        value:
          type: string
          description: Associated value
        uuid:
          type: string
          nullable: true
          description: Universally unique identifier
    ContactListResponse:
      type: object
      properties:
        total:
          type: integer
          description: Total number of items
        contacts:
          type: array
          items:
            $ref: '#/components/schemas/Contact'
          description: List of contacts
    Profile:
      type: object
      properties:
        profileId:
          type: string
          description: Unique identifier of the profile
        firstName:
          type: string
          nullable: true
          description: First name
        lastName:
          type: string
          nullable: true
          description: Last name
        middleName:
          type: string
          nullable: true
          description: Middle name
        countryNumericCode:
          type: string
          nullable: true
          description: Country numeric code
        enabled:
          type: boolean
          description: Indicates whether the item is active
        contacts:
          type: array
          items:
            $ref: '#/components/schemas/Contact'
          description: Contacts
        createTime:
          type: string
          format: date-time
          description: Timestamp when the record was created
        updateTime:
          type: string
          format: date-time
          description: Timestamp when the record was last updated
        uuid:
          type: string
          nullable: true
          description: Universal unique identifier (UUID)
    ProfileRequest:
      type: object
      properties:
        contacts:
          type: array
          items:
            $ref: '#/components/schemas/ContactRequest'
          description: List of contact details
        countryNumericCode:
          type: string
          nullable: true
          description: ISO 3166-1 numeric code of the country
        enabled:
          type: boolean
          description: Whether the entity is enabled
        firstName:
          type: string
          nullable: true
          description: First name
        lastName:
          type: string
          nullable: true
          description: Last name
        middleName:
          type: string
          nullable: true
          description: Middle name or patronymic
        uuid:
          type: string
          nullable: true
          description: Universally unique identifier
    ProfileUpdateRequest:
      type: object
      properties:
        enabled:
          type: boolean
          description: Whether the entity is enabled
        firstName:
          type: string
          nullable: true
          description: First name
        lastName:
          type: string
          nullable: true
          description: Last name
        middleName:
          type: string
          nullable: true
          description: Middle name or patronymic
        countryNumericCode:
          type: string
          nullable: true
          description: ISO 3166-1 numeric code of the country
        uuid:
          type: string
          nullable: true
          description: Universally unique identifier
    ProfileListResponse:
      type: object
      properties:
        total:
          type: integer
          description: Total number of items
        profiles:
          type: array
          items:
            $ref: '#/components/schemas/Profile'
          description: List of profiles
    QrColor:
      type: object
      properties:
        colorId:
          type: string
          description: Unique identifier of the QR color scheme
        name:
          type: string
          description: Display name
        priority:
          type: integer
          description: Sort priority
        background:
          type: string
          example: '#000000'
          description: Background color in hex format
        foreground:
          type: string
          example: '#ffffff'
          description: Foreground color in hex format
        createTime:
          type: string
          format: date-time
          description: Timestamp when the record was created
        updateTime:
          type: string
          format: date-time
          description: Timestamp when the record was last updated
    QrColorRequest:
      type: object
      properties:
        name:
          type: string
          description: Display name
        background:
          type: string
          description: Background color in hex format
        foreground:
          type: string
          description: Foreground color in hex format
        priority:
          type: integer
          description: Sort priority
    QrColorListResponse:
      type: object
      properties:
        total:
          type: integer
          description: Total number of items
        colors:
          type: array
          items:
            $ref: '#/components/schemas/QrColor'
          description: List of colors
    QrIcon:
      type: object
      properties:
        iconId:
          type: string
          description: Identifier of the icon
        name:
          type: string
          description: Display name
        priority:
          type: integer
          description: Sort priority
        image:
          type: string
          description: Base64-encoded image
        createTime:
          type: string
          format: date-time
          description: Timestamp when the record was created
        updateTime:
          type: string
          format: date-time
          description: Timestamp when the record was last updated
    QrIconRequest:
      type: object
      properties:
        name:
          type: string
          description: Display name
        priority:
          type: integer
          description: Sort priority
        image:
          type: string
          description: Base64-encoded image
    QrIconListResponse:
      type: object
      properties:
        total:
          type: integer
          description: Total number of items
        icons:
          type: array
          items:
            $ref: '#/components/schemas/QrIcon'
          description: List of icons
    Rate:
      type: object
      properties:
        rateId:
          type: string
          description: Unique identifier of the rate
        name:
          type: string
          description: Display name
        priority:
          type: integer
          description: Priority
        provider:
          type: string
          description: Integration provider name
        createTime:
          type: string
          format: date-time
          description: Timestamp when the record was created
        updateTime:
          type: string
          format: date-time
          description: Timestamp when the record was last updated
        uuid:
          type: string
          nullable: true
          description: Universal unique identifier (UUID)
    RateRequest:
      type: object
      properties:
        provider:
          type: string
          description: Service provider name
        drivers:
          type: array
          items:
            $ref: '#/components/schemas/DriverRequest'
          description: List of associated drivers
    RateUpdateRequest:
      type: object
      properties:
        priority:
          type: integer
          description: Sort priority
        name:
          type: string
          description: Display name
        uuid:
          type: string
          nullable: true
          description: Universally unique identifier
    RateListResponse:
      type: object
      properties:
        total:
          type: integer
          description: Total number of items
        rates:
          type: array
          items:
            $ref: '#/components/schemas/Rate'
          description: List of rates
    Relation:
      type: object
      properties:
        relationId:
          type: string
          description: Unique identifier of the relation
        childUserId:
          type: string
          description: Identifier of the associated childUser
        parentUserId:
          type: string
          description: Identifier of the associated parentUser
        childUser:
          $ref: '#/components/schemas/User'
          description: Child user
        parentUser:
          $ref: '#/components/schemas/User'
          description: Parent user
        createTime:
          type: string
          format: date-time
          description: Timestamp when the record was created
        updateTime:
          type: string
          format: date-time
          description: Timestamp when the record was last updated
        uuid:
          type: string
          nullable: true
          description: Universally unique identifier
    RelationRequest:
      type: object
      properties:
        childUserId:
          type: string
          description: Identifier of the child (client) user in the relation
        parentUserId:
          type: string
          description: Identifier of the parent (partner) user in the relation
        uuid:
          type: string
          nullable: true
          description: Universally unique identifier
    RelationListResponse:
      type: object
      properties:
        total:
          type: integer
          description: Total number of items
        relations:
          type: array
          items:
            $ref: '#/components/schemas/Relation'
          description: List of relations
    ReportMetricChange:
      type: object
      properties:
        actualValue:
          oneOf:
          - type: string
          - type: integer
          - type: number
          description: Current actual metric value
        absoluteChange:
          oneOf:
          - type: string
          - type: integer
          - type: number
          description: Absolute change from previous period
        relativeChange:
          type: string
          description: Relative (percentage) change from previous period
    ClickReportResponse:
      type: object
      properties:
        report:
          type: object
          properties:
            aggregation:
              type: object
              properties:
                clickConversionRate:
                  $ref: '#/components/schemas/ReportMetricChange'
                numberOfActiveUsers:
                  $ref: '#/components/schemas/ReportMetricChange'
                numberOfClicks:
                  $ref: '#/components/schemas/ReportMetricChange'
            data:
              type: array
              items:
                type: object
          description: Report data entries
    PaymentReportResponse:
      type: object
      properties:
        report:
          type: object
          properties:
            aggregation:
              type: object
              properties:
                numberOfActiveUsers:
                  $ref: '#/components/schemas/ReportMetricChange'
                numberOfActiveCustomers:
                  $ref: '#/components/schemas/ReportMetricChange'
                numberOfTrades:
                  $ref: '#/components/schemas/ReportMetricChange'
                tradingVolume:
                  $ref: '#/components/schemas/ReportMetricChange'
                paymentAmount:
                  $ref: '#/components/schemas/ReportMetricChange'
            data:
              type: array
              items:
                type: object
          description: Report data entries
    CpaStatsResponse:
      type: object
      properties:
        report:
          type: object
          properties:
            aggregation:
              type: object
              properties:
                registrations:
                  $ref: '#/components/schemas/ReportMetricChange'
                kyc:
                  $ref: '#/components/schemas/ReportMetricChange'
                firstTimeDeposit:
                  $ref: '#/components/schemas/ReportMetricChange'
                qualified:
                  $ref: '#/components/schemas/ReportMetricChange'
                pending:
                  $ref: '#/components/schemas/ReportMetricChange'
                rewardEarned:
                  $ref: '#/components/schemas/CpaRewardMetricChange'
          description: CPA acquisition-funnel counts and reward earned for the period
    CpaRewardMetricChange:
      type: object
      properties:
        actualValue:
          type: string
          description: Reward earned in the period, formatted to 2 decimal places
        absoluteChange:
          type: string
          description: Absolute change from the previous equal-length period, formatted to 2 decimal places
        currency:
          type: string
          description: Currency of the reward amount; empty string when there are no rewards
    PerformanceStatsResponse:
      type: object
      properties:
        report:
          type: object
          properties:
            aggregation:
              type: object
              properties:
                rebate:
                  $ref: '#/components/schemas/PerformanceMoneyMetric'
                notionalValue:
                  $ref: '#/components/schemas/PerformanceMoneyMetric'
                newClients:
                  $ref: '#/components/schemas/PerformanceCountMetric'
                activeTraders:
                  $ref: '#/components/schemas/PerformanceCountMetric'
                cpaReward:
                  $ref: '#/components/schemas/PerformanceMoneyMetric'
          description: Account performance KPIs for the period, each with the absolute change versus the previous equal-length window
    PerformanceMoneyMetric:
      type: object
      properties:
        actualValue:
          type: string
          description: Current-window amount, formatted to 2 decimal places
        absoluteChange:
          type: string
          description: Absolute change from the previous equal-length window, formatted to 2 decimal places
        currency:
          type: string
          description: Currency of the amount; empty string when there is no activity
    PerformanceCountMetric:
      type: object
      properties:
        actualValue:
          type: integer
          description: Current-window count
        absoluteChange:
          type: integer
          description: Absolute change from the previous equal-length window
    PerformanceTimeseriesResponse:
      type: object
      properties:
        report:
          type: object
          properties:
            series:
              type: array
              items:
                $ref: '#/components/schemas/PerformanceSeriesPoint'
              description: Ordered daily series for the requested indicator
    PerformanceSeriesPoint:
      type: object
      properties:
        day:
          type: string
          description: Calendar day in YYYY-MM-DD (UTC)
        value:
          type: string
          description: Value for the day, formatted as a fixed-precision string (money 2 decimals, counts 0 decimals)
    TopClientsResponse:
      type: object
      properties:
        report:
          type: object
          properties:
            data:
              type: array
              items:
                $ref: '#/components/schemas/TopClient'
              description: Ranked page of the partner's direct clients
            total:
              type: integer
              description: Total number of clients matching the request (pagination total)
    TopClient:
      type: object
      properties:
        clientExternalId:
          type: string
          description: The b2core client id (user_profiles.external_id); empty string when the profile has no external id
        volumeLots:
          $ref: '#/components/schemas/TopClientMetric'
        volumeUsd:
          $ref: '#/components/schemas/TopClientMetric'
        rebate:
          $ref: '#/components/schemas/TopClientMetric'
    TopClientMetric:
      type: object
      properties:
        actualValue:
          type: string
          description: Current-window value, formatted to 2 decimal places
        absoluteChange:
          type: string
          description: Absolute change versus the previous equal-length window, formatted to 2 decimal places; empty string for a non-comparative request
    Symbol:
      type: object
      properties:
        symbolId:
          type: string
          description: Unique identifier of the symbol
        symbolGroupId:
          type: string
          description: Identifier of the associated symbolGroup
        platformGroupId:
          type: string
          description: Identifier of the associated platformGroup
        platformId:
          type: string
          description: Identifier of the associated platform
        description:
          type: string
          description: Human-readable description
        name:
          type: string
          description: Display name
        symbol:
          type: string
          description: Currency or asset symbol
        quoteCurrencyCode:
          type: string
          description: Quote currency code
        contractSize:
          type: string
          description: Contract size for the symbol
        point:
          type: string
          description: Point
        environment:
          type: string
          enum:
          - production
          - demo
          description: 'Account environment: live or demo'
        platform:
          type: object
          properties:
            platformId:
              type: string
            name:
              type: string
            provider:
              type: string
          description: Associated platform object
        createTime:
          type: string
          format: date-time
          description: Timestamp when the record was created
        updateTime:
          type: string
          format: date-time
          description: Timestamp when the record was last updated
    SymbolListResponse:
      type: object
      properties:
        total:
          type: integer
          description: Total number of items
        symbols:
          type: array
          items:
            $ref: '#/components/schemas/Symbol'
          description: List of symbols
    SymbolPreference:
      type: object
      properties:
        preferenceId:
          type: string
          description: Unique identifier of the symbol preference
        formula:
          type: string
          example: max_amount
          description: Payment formula type
        levelTable:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
          description: Level table configuration for payment distribution
        ratio:
          type: string
          description: Ratio multiplier used in calculations
        unit:
          type: string
          description: Unit of measurement for the payment formula
        position:
          type: string
          enum:
          - open
          - close
          - both
          description: Trade position type (buy/sell)
        side:
          type: string
          enum:
          - buy
          - sell
          - both
          nullable: true
          description: Trade side (long/short)
        scope:
          type: object
          properties:
            groupId:
              type: string
            name:
              type: string
            uuid:
              type: string
              nullable: true
          description: Scope of the symbol preference
        precision:
          type: integer
          description: Number of decimal places
        createTime:
          type: string
          format: date-time
          description: Timestamp when the record was created
        updateTime:
          type: string
          format: date-time
          description: Timestamp when the record was last updated
        uuid:
          type: string
          nullable: true
          description: Universally unique identifier
    SymbolPreferenceRequest:
      type: object
      properties:
        groupId:
          type: string
          description: Identifier of the group
        formula:
          type: string
          description: Payment formula type
        ratio:
          type: string
          description: Ratio multiplier used in calculations
        levelTable:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
          description: Level table configuration for payment distribution
        position:
          type: string
          enum:
          - open
          - close
          - both
          description: Trade position type (buy/sell)
        side:
          type: string
          enum:
          - buy
          - sell
          - both
          nullable: true
          description: Trade side (long/short)
        unit:
          type: string
          description: Unit of measurement for the payment formula
        uuid:
          type: string
          nullable: true
          description: Universally unique identifier
    SymbolPreferenceListResponse:
      type: object
      properties:
        total:
          type: integer
          description: Total number of items
        preferences:
          type: array
          items:
            $ref: '#/components/schemas/SymbolPreference'
          description: List of preferences
    SymbolPreferenceSummary:
      type: object
      properties:
        instrument:
          type: string
          example: 'D40EUR#'
          description: Symbol name on the trading platform
        platform:
          type: object
          properties:
            platformId:
              type: string
            name:
              type: string
            provider:
              type: string
          description: Associated platform object
        scope:
          type: object
          properties:
            groupId:
              type: string
            name:
              type: string
            uuid:
              type: string
              nullable: true
          description: Payment plan (user group) this configuration belongs to
        formula:
          type: string
          example: max_amount
          nullable: true
          description: Payment formula type
        levelTable:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
          nullable: true
          description: Level table configuration for payment distribution
        ratio:
          type: string
          description: Ratio multiplier used in calculations
        unit:
          type: string
          nullable: true
          description: Unit of measurement for the payment formula
        position:
          type: string
          enum:
          - any
          - open
          - closed
          - unspecified
          description: Trade position the configuration applies to
        side:
          type: string
          enum:
          - any
          - buy
          - sell
          - unspecified
          description: Trade side the configuration applies to
        groupCount:
          type: integer
          description: Number of platform trading groups sharing this configuration
    SymbolPreferenceSummaryListResponse:
      type: object
      properties:
        total:
          type: integer
          description: Total number of items
        preferences:
          type: array
          items:
            $ref: '#/components/schemas/SymbolPreferenceSummary'
          description: List of payment plan configurations grouped by unique configuration
    SymbolGroup:
      type: object
      properties:
        symbolGroupId:
          type: string
          description: Unique identifier of the symbol group
        platformGroupId:
          type: string
          description: Identifier of the group within the trading platform
        platformId:
          type: string
          description: Identifier of the trading platform
        environment:
          type: string
          description: Trading environment type (live or demo)
        name:
          type: string
          description: Display name
        platformGroup:
          $ref: '#/components/schemas/PlatformGroup'
          description: Associated platform group
        createTime:
          type: string
          format: date-time
          description: Timestamp when the record was created
        updateTime:
          type: string
          format: date-time
          description: Timestamp when the record was last updated
    SymbolGroupListResponse:
      type: object
      properties:
        total:
          type: integer
          description: Total number of items
        symbolGroups:
          type: array
          items:
            $ref: '#/components/schemas/SymbolGroup'
          description: List of symbolGroups
    SystemPreference:
      type: object
      properties:
        key:
          type: string
          example: app.timezone
          description: Unique key identifier
        value:
          type: string
          example: UTC
          description: Associated value
    SystemPreferenceRequest:
      type: object
      properties:
        key:
          type: string
          description: Unique key identifier
        value:
          type: string
          description: Associated value
    SystemPreferenceListResponse:
      type: object
      properties:
        total:
          type: integer
          description: Total number of items
        preferences:
          type: array
          items:
            $ref: '#/components/schemas/SystemPreference'
          description: List of preferences
    TradePaymentSummary:
      type: object
      properties:
        paymentId:
          type: string
          description: Unique identifier of the payment
        paymentState:
          type: string
          description: Current state of the payment
        paymentAmount:
          type: string
          description: Calculated payment amount
        paymentCurrencyCode:
          type: string
          description: Currency code of the payment
        paymentCurrencyPrecision:
          type: integer
          description: Decimal precision of the payment currency
        paymentFormulaUnitPrecision:
          type: integer
          description: Decimal precision of the formula unit
        paymentParentId:
          type: string
          nullable: true
          description: Identifier of the parent payment (for multi-level)
        paymentPreferencesGroupId:
          type: string
          nullable: true
          description: Identifier of the payment preferences group
    Trade:
      type: object
      properties:
        tradeId:
          type: string
          description: Unique identifier of the trade
        tradeIdentifier:
          type: string
          description: Trade identifier
        tradeTime:
          type: string
          format: date-time
          description: Timestamp of the trade event
        paymentCount:
          type: integer
          description: Total number of payments
        payments:
          type: array
          items:
            $ref: '#/components/schemas/TradePaymentSummary'
          description: Payment s
        createTime:
          type: string
          format: date-time
          description: Timestamp when the record was created
        updateTime:
          type: string
          format: date-time
          description: Timestamp when the record was last updated
    TradeListResponse:
      type: object
      properties:
        total:
          type: integer
          description: Total number of items
        trades:
          type: array
          items:
            $ref: '#/components/schemas/Trade'
          description: List of trades
    Transaction:
      type: object
      properties:
        transactionId:
          type: string
          description: Unique identifier of the transaction
        transactionAmount:
          type: string
          description: Transaction amount
        transactionCurrencyCode:
          type: string
          description: Transaction currency code
        transactionCurrencySign:
          type: string
          description: Transaction currency sign
        transactionCurrencyPrecision:
          type: integer
          description: Transaction currency precision
        transactionSide:
          type: string
          description: Transaction side
        transactionIdentifier:
          type: string
          description: Transaction identifier
        transactionTime:
          type: string
          format: date-time
          description: Timestamp of the transaction event
        tradePlatformId:
          type: string
          nullable: true
          description: Identifier of the associated tradePlatform
        tradePlatformName:
          type: string
          nullable: true
          description: Trade platformName
        tradePlatformGroupName:
          type: string
          nullable: true
          description: Trade platformGroupName
        tradeIdentifier:
          type: string
          nullable: true
          description: Trade identifier
        tradeId:
          type: string
          nullable: true
          description: Identifier of the associated trade
        paymentGroupId:
          type: string
          nullable: true
          description: Identifier of the associated paymentGroup
    TransactionListResponse:
      type: object
      properties:
        total:
          type: integer
          description: Total number of items
        transactions:
          type: array
          items:
            $ref: '#/components/schemas/Transaction'
          description: List of transactions
    User:
      type: object
      properties:
        userId:
          type: string
          description: Unique identifier of the user
        profileId:
          type: string
          description: Identifier of the associated profile
        profile:
          $ref: '#/components/schemas/Profile'
          description: Associated user profile object
        groupId:
          type: string
          nullable: true
          description: Identifier of the associated group
        group:
          $ref: '#/components/schemas/Group'
          nullable: true
          description: Group
        enabled:
          type: boolean
          description: Whether the entity is enabled
        master:
          type: boolean
          description: Master
        masterMaxLevel:
          type: integer
          nullable: true
          description: Master max level
        masterRatio:
          type: string
          nullable: true
          description: Master ratio
        ratio:
          type: string
          description: Ratio coefficient applied to payments
        tag:
          type: string
          nullable: true
          description: Tag
        createTime:
          type: string
          format: date-time
          description: Timestamp when the record was created
        updateTime:
          type: string
          format: date-time
          description: Timestamp when the record was last updated
        uuid:
          type: string
          nullable: true
          description: Universal unique identifier (UUID)
    UserRequest:
      type: object
      properties:
        profileId:
          type: string
          description: Identifier of the associated user profile
        groupId:
          type: string
          nullable: true
          description: Identifier of the group
        master:
          type: boolean
          description: Whether the user is a master partner
        masterMaxLevel:
          type: integer
          nullable: true
          description: Maximum referral depth for master partner
        masterRatio:
          type: string
          nullable: true
          description: Commission ratio for master partner
        ratio:
          type: string
          description: Ratio multiplier used in calculations
        tag:
          type: string
          nullable: true
          description: Custom tag for categorization
        wallet:
          type: array
          items:
            type: object
            properties:
              currencyCode:
                type: string
              number:
                type: string
          description: Associated wallet configuration
        uuid:
          type: string
          nullable: true
          description: Universally unique identifier
    UserUpdateRequest:
      type: object
      properties:
        groupId:
          type: string
          nullable: true
          description: Identifier of the group
        enabled:
          type: boolean
          description: Whether the entity is enabled
        master:
          type: boolean
          description: Whether the user is a master partner
        masterMaxLevel:
          type: integer
          nullable: true
          description: Maximum referral depth for master partner
        masterRatio:
          type: string
          nullable: true
          description: Commission ratio for master partner
        ratio:
          type: string
          description: Ratio multiplier used in calculations
        uuid:
          type: string
          nullable: true
          description: Universally unique identifier
    UserListResponse:
      type: object
      properties:
        total:
          type: integer
          description: Total number of items
        users:
          type: array
          items:
            $ref: '#/components/schemas/User'
          description: List of users
    UserBanner:
      type: object
      properties:
        bannerId:
          type: string
          description: Unique identifier of the banner
        bannerName:
          type: string
          description: Display name of the banner
        cdnFileUrl:
          type: string
          format: uri
          description: CDN URL of the banner image file
        themeId:
          type: string
          description: Identifier of the associated theme
        themeName:
          type: string
          description: Display name of the theme
        languageId:
          type: string
          description: Identifier of the associated language
        languageName:
          type: string
          description: Display name of the language
        sizeId:
          type: string
          description: Identifier of the associated banner size
        sizeName:
          type: string
          description: Display name of the banner size
        width:
          type: integer
          description: Width in pixels
        height:
          type: integer
          description: Height in pixels
        linkId:
          type: string
          nullable: true
          description: Identifier of the associated link
        linkName:
          type: string
          nullable: true
          description: Display name of the link
        linkUri:
          type: string
          nullable: true
          description: URI associated with the link
    UserBannerListResponse:
      type: object
      properties:
        total:
          type: integer
          description: Total number of items
        banners:
          type: array
          items:
            $ref: '#/components/schemas/UserBanner'
          description: List of banners
    Wallet:
      type: object
      properties:
        walletId:
          type: string
          description: Unique identifier of the wallet
        methodId:
          type: string
          description: Identifier of the associated method
        method:
          $ref: '#/components/schemas/Method'
          description: Method
        number:
          type: string
          description: Account number on the trading platform
        currencyCode:
          type: string
          description: Currency code (ISO 4217)
        currencyPrecision:
          type: integer
          description: Currency precision
        currencySign:
          type: string
          description: Currency sign
        totalPaymentAmount:
          type: string
          description: Total payment amount
        userId:
          type: string
          description: Identifier of the associated user
        profileId:
          type: string
          description: Identifier of the associated profile
        createTime:
          type: string
          format: date-time
          description: Timestamp when the record was created
        updateTime:
          type: string
          format: date-time
          description: Timestamp when the record was last updated
        uuid:
          type: string
          nullable: true
          description: Universal unique identifier (UUID)
    WalletRequest:
      type: object
      properties:
        methodId:
          type: string
          description: Identifier of the payment method
        userId:
          type: string
          description: Identifier of the associated user
        currencyCode:
          type: string
          description: Currency code (e.g. USD, EUR)
        number:
          type: string
          description: Account number
        uuid:
          type: string
          nullable: true
          description: Universally unique identifier
    WalletUpdateRequest:
      type: object
      properties:
        number:
          type: string
          description: Account number
        uuid:
          type: string
          nullable: true
          description: Universally unique identifier
    WalletListResponse:
      type: object
      properties:
        total:
          type: integer
          description: Total number of items
        wallets:
          type: array
          items:
            $ref: '#/components/schemas/Wallet'
          description: List of wallets
    Client:
      type: object
      properties:
        clientId:
          type: string
          description: Unique identifier of the client
        name:
          type: string
          description: Display name
        secret:
          type: string
          description: OAuth client secret
        redirectUri:
          type: string
          format: uri
          nullable: true
          description: OAuth redirect URI
        createTime:
          type: string
          format: date-time
          description: Timestamp when the record was created
    ClientRequest:
      type: object
      properties:
        name:
          type: string
          description: Display name
        redirectUri:
          type: string
          format: uri
          nullable: true
          description: OAuth redirect URI
    ClientListResponse:
      type: object
      properties:
        total:
          type: integer
          description: Total number of items
        clients:
          type: array
          items:
            $ref: '#/components/schemas/Client'
          description: List of clients
    ExportSignatureResponse:
      type: object
      properties:
        signature:
          type: string
          description: Export signature for verification
        expires:
          type: integer
          description: Expiry timestamp of the signature
    CpaProgram:
      type: object
      properties:
        cpaProgramId:
          type: string
          description: Unique identifier of the CPA program
        name:
          type: string
          description: Display name
        isActive:
          type: boolean
          description: Whether the entity is currently active
        createTime:
          type: string
          format: date-time
          description: Timestamp when the record was created
        updateTime:
          type: string
          format: date-time
          description: Timestamp when the record was last updated
    CpaProgramRequest:
      type: object
      properties:
        name:
          type: string
          description: Display name
        isActive:
          type: boolean
          description: Whether the entity is currently active
    CpaProgramListResponse:
      type: object
      properties:
        total:
          type: integer
          description: Total number of items
        cpaPrograms:
          type: array
          items:
            $ref: '#/components/schemas/CpaProgram'
          description: List of cpaPrograms
    CpaPlan:
      type: object
      properties:
        planId:
          type: string
          description: Unique identifier of the CPA plan
        cpaProgramId:
          type: string
          description: Unique identifier of the CPA program
        name:
          type: string
          description: Display name
        amount:
          type: string
          description: Payment amount in the specified currency
        currencyCode:
          type: string
          description: Currency code (e.g. USD, EUR)
        createTime:
          type: string
          format: date-time
          description: Timestamp when the record was created
        updateTime:
          type: string
          format: date-time
          description: Timestamp when the record was last updated
    CpaPlanRequest:
      type: object
      properties:
        name:
          type: string
          description: Display name
        amount:
          type: string
          description: Payment amount in the specified currency
        currencyCode:
          type: string
          description: Currency code (e.g. USD, EUR)
    CpaPlanListResponse:
      type: object
      properties:
        total:
          type: integer
          description: Total number of items
        plans:
          type: array
          items:
            $ref: '#/components/schemas/CpaPlan'
          description: List of plans
    CpaCondition:
      type: object
      properties:
        conditionId:
          type: string
          description: Unique identifier of the CPA condition
        planId:
          type: string
          description: Unique identifier of the CPA plan
        type:
          type: string
          description: Type of the entity
        value:
          type: string
          description: Associated value
        createTime:
          type: string
          format: date-time
          description: Timestamp when the record was created
    CpaConditionRequest:
      type: object
      properties:
        type:
          type: string
          description: Type of the entity
        value:
          type: string
          description: Associated value
    CpaConditionListResponse:
      type: object
      properties:
        total:
          type: integer
          description: Total number of items
        conditions:
          type: array
          items:
            $ref: '#/components/schemas/CpaCondition'
          description: List of conditions
    CpaSubscription:
      type: object
      properties:
        subscriptionId:
          type: string
          description: Unique identifier of the CPA subscription
        cpaProgramId:
          type: string
          description: Unique identifier of the CPA program
        userId:
          type: string
          description: Identifier of the associated user
        createTime:
          type: string
          format: date-time
          description: Timestamp when the record was created
    CpaSubscriptionRequest:
      type: object
      properties:
        userId:
          type: string
          description: Identifier of the associated user
    CpaSubscriptionListResponse:
      type: object
      properties:
        total:
          type: integer
          description: Total number of items
        subscriptions:
          type: array
          items:
            $ref: '#/components/schemas/CpaSubscription'
          description: List of subscriptions
    CpaAcquisition:
      type: object
      properties:
        acquisitionId:
          type: string
          description: Unique identifier of the CPA acquisition
        cpaProgramId:
          type: string
          description: Unique identifier of the CPA program
        userId:
          type: string
          description: Identifier of the associated user
        clientId:
          type: integer
          description: OAuth client identifier
        status:
          type: string
          description: Current status of the entity
        createTime:
          type: string
          format: date-time
          description: Timestamp when the record was created
    CpaAcquisitionListResponse:
      type: object
      properties:
        total:
          type: integer
          description: Total number of items
        acquisitions:
          type: array
          items:
            $ref: '#/components/schemas/CpaAcquisition'
          description: List of acquisitions
    CpaPayment:
      type: object
      properties:
        cpaPaymentId:
          type: string
          description: Unique identifier of the CPA payment
        cpaProgramId:
          type: string
          description: Unique identifier of the CPA program
        planId:
          type: string
          description: Unique identifier of the CPA plan
        userId:
          type: string
          description: Identifier of the associated user
        amount:
          type: string
          description: Payment amount in the specified currency
        currencyCode:
          type: string
          description: Currency code (e.g. USD, EUR)
        status:
          type: string
          description: Current status of the entity
        createTime:
          type: string
          format: date-time
          description: Timestamp when the record was created
    CpaPaymentListResponse:
      type: object
      properties:
        total:
          type: integer
          description: Total number of items
        cpaPayments:
          type: array
          items:
            $ref: '#/components/schemas/CpaPayment'
          description: List of cpaPayments
    SavingsProgram:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier of the savings program
        name:
          type: string
          description: Display name
        description:
          type: string
          nullable: true
          description: Optional description
        currency:
          type: string
          description: Reward currency code (e.g. USD, EUR)
        isActive:
          type: boolean
          description: Whether the program is currently active
        levels:
          type: array
          items:
            $ref: '#/components/schemas/SavingsProgramLevel'
          description: Program levels (present only when loaded)
        createdBy:
          type: string
          description: Identifier of the actor who created the program
        updatedBy:
          type: string
          description: Identifier of the actor who last updated the program
        createdAt:
          type: string
          format: date-time
          nullable: true
          description: Timestamp when the record was created
        updatedAt:
          type: string
          format: date-time
          nullable: true
          description: Timestamp when the record was last updated
    SavingsProgramRequest:
      type: object
      required:
      - name
      - currency
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 255
          description: Display name
        description:
          type: string
          nullable: true
          maxLength: 4096
          description: Optional description
        currency:
          type: string
          description: Reward currency code (restricted to the configured allowed currencies)
    SavingsProgramUpdateRequest:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 255
          description: Display name
        description:
          type: string
          nullable: true
          maxLength: 4096
          description: Optional description
        isActive:
          type: boolean
          description: Whether the program is currently active
    SavingsProgramListResponse:
      type: object
      properties:
        total:
          type: integer
          description: Total number of items
        savingsPrograms:
          type: array
          items:
            $ref: '#/components/schemas/SavingsProgram'
          description: List of savingsPrograms
    SavingsProgramLevel:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier of the savings program level
        savingsProgramId:
          type: string
          format: uuid
          description: Unique identifier of the savings program
        level:
          type: integer
          description: Level ordinal
        rewardValue:
          type: string
          nullable: true
          description: Reward value expressed as a decimal string
        isActive:
          type: boolean
          description: Whether the level is currently active
        createdAt:
          type: string
          format: date-time
          nullable: true
          description: Timestamp when the record was created
        updatedAt:
          type: string
          format: date-time
          nullable: true
          description: Timestamp when the record was last updated
    SavingsProgramLevelRequest:
      type: object
      required:
      - level
      - rewardValue
      properties:
        level:
          type: integer
          minimum: 1
          description: Level ordinal
        rewardValue:
          type: number
          description: Reward value (greater than 0 and at most 100)
    SavingsProgramLevelUpdateRequest:
      type: object
      properties:
        level:
          type: integer
          minimum: 1
          description: Level ordinal
        rewardValue:
          type: number
          description: Reward value (greater than 0 and at most 100)
        isActive:
          type: boolean
          description: Whether the level is currently active
    SavingsProgramLevelListResponse:
      type: object
      properties:
        total:
          type: integer
          description: Total number of items
        savingsProgramLevels:
          type: array
          items:
            $ref: '#/components/schemas/SavingsProgramLevel'
          description: List of savingsProgramLevels
    SavingsAcquisitionProfile:
      type: object
      nullable: true
      properties:
        firstName:
          type: string
          nullable: true
          description: First name
        middleName:
          type: string
          nullable: true
          description: Middle name
        lastName:
          type: string
          nullable: true
          description: Last name
        contacts:
          type: array
          items:
            type: object
            properties:
              key:
                type: string
                description: Contact key
              value:
                type: string
                description: Contact value
          description: List of contacts
    SavingsAcquisitionEvent:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier of the acquisition event
        eventType:
          type: string
          enum:
          - savings_creation
          - savings_deposit
          description: Type of the acquisition event
        referenceId:
          type: string
          description: Reference identifier of the source entity
        occurredAt:
          type: string
          format: date-time
          nullable: true
          description: Timestamp when the event occurred
        metadata:
          type: object
          nullable: true
          additionalProperties: true
          description: Arbitrary event metadata
    SavingsAcquisition:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier of the savings acquisition
        clientExternalId:
          type: integer
          description: External identifier of the acquired client
        savingsProgramId:
          type: string
          format: uuid
          description: Unique identifier of the savings program
        partnerUserId:
          type: string
          format: uuid
          description: Identifier of the partner user
        events:
          type: array
          items:
            $ref: '#/components/schemas/SavingsAcquisitionEvent'
          description: Acquisition events (present only when loaded)
        partnerProfile:
          $ref: '#/components/schemas/SavingsAcquisitionProfile'
        createdAt:
          type: string
          format: date-time
          nullable: true
          description: Timestamp when the record was created
    SavingsAcquisitionListResponse:
      type: object
      properties:
        total:
          type: integer
          description: Total number of items
        savingsClientAcquisitions:
          type: array
          items:
            $ref: '#/components/schemas/SavingsAcquisition'
          description: List of savingsClientAcquisitions
    SavingsPayment:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier of the savings payment
        savingsClientAcquisitionId:
          type: string
          format: uuid
          description: Unique identifier of the savings client acquisition
        savingsProgramLevelId:
          type: string
          format: uuid
          description: Unique identifier of the savings program level
        partnerUserId:
          type: string
          format: uuid
          description: Identifier of the partner user
        clientExternalId:
          type: integer
          nullable: true
          description: External identifier of the acquired client
        savingsProgramId:
          type: string
          format: uuid
          nullable: true
          description: Unique identifier of the savings program
        programName:
          type: string
          nullable: true
          description: Name of the savings program
        level:
          type: integer
          description: Level ordinal
        periodDate:
          type: string
          format: date
          description: Accrual period date (YYYY-MM-DD)
        paymentAmount:
          type: string
          nullable: true
          description: Payment amount expressed as a decimal string
        paymentCurrencyCode:
          type: string
          description: Currency code (e.g. USD, EUR)
        status:
          type: string
          enum:
          - pending
          - processing
          - processed
          - succeeded
          - failed
          - cancelled
          description: Current status of the payment
        transactionState:
          type: string
          enum:
          - unconfirmed
          - confirmed
          - failed
          description: Current transaction state of the payment
        confirmedAt:
          type: string
          format: date-time
          nullable: true
          description: Timestamp when the payment was confirmed
        failedAt:
          type: string
          format: date-time
          nullable: true
          description: Timestamp when the payment failed
        externalOperationId:
          type: integer
          nullable: true
          description: External operation identifier
        failedPaymentId:
          type: integer
          nullable: true
          description: Identifier of the failed payment
        processedAt:
          type: string
          format: date-time
          nullable: true
          description: Timestamp when the payment was processed
        createdAt:
          type: string
          format: date-time
          nullable: true
          description: Timestamp when the record was created
        profile:
          $ref: '#/components/schemas/SavingsAcquisitionProfile'
    SavingsPaymentListResponse:
      type: object
      properties:
        total:
          type: integer
          description: Total number of items
        savingsPayments:
          type: array
          items:
            $ref: '#/components/schemas/SavingsPayment'
          description: List of savingsPayments
    Export:
      type: object
      properties:
        exportId:
          type: string
          description: Unique identifier of the export task
        status:
          type: string
          enum:
          - pending
          - processing
          - completed
          - failed
          description: Current status of the entity
        type:
          type: string
          description: Type of the entity
        fileUrl:
          type: string
          nullable: true
          description: URL of the exported file
        createTime:
          type: string
          format: date-time
          description: Timestamp when the record was created
        updateTime:
          type: string
          format: date-time
          description: Timestamp when the record was last updated
    ExportRequest:
      type: object
      properties:
        type:
          type: string
          description: Type of the entity
        filters:
          type: object
          additionalProperties: true
          description: Filter parameters applied to the export
    ExportListResponse:
      type: object
      properties:
        total:
          type: integer
          description: Total number of items
        exports:
          type: array
          items:
            $ref: '#/components/schemas/Export'
          description: List of exports
    Reassignment:
      type: object
      properties:
        reassignmentId:
          type: string
          format: uuid
          description: Unique identifier of the reassignment
        type:
          type: string
          enum:
          - children
          - single_user
          description: "children — move all sub-IBs and clients; single_user — move a specific subject user"
        status:
          type: string
          enum:
          - awaiting_confirmation
          - pending
          - processing
          - chains_rebuilding
          - completed
          - cancelled
          - failed
          description: Current status of the reassignment
        sourceUserId:
          type: string
          format: uuid
          description: IB user whose clients/sub-IBs are being reassigned
        targetUserId:
          type: string
          format: uuid
          description: IB user who will receive the reassigned clients/sub-IBs
        subjectUserId:
          type: string
          format: uuid
          nullable: true
          description: Specific user being moved (required for single_user type)
        sourceUser:
          $ref: '#/components/schemas/ReassignmentUser'
        targetUser:
          $ref: '#/components/schemas/ReassignmentUser'
        subjectUser:
          allOf:
          - $ref: '#/components/schemas/ReassignmentUser'
          nullable: true
        movedRelations:
          type: array
          items:
            $ref: '#/components/schemas/MovedRelation'
          description: List of relations that will be moved upon confirmation
        promotionTargetUserId:
          type: string
          format: uuid
          nullable: true
          description: Set when target is a direct sub-IB of source — that sub-IB gets promoted
        errorMessage:
          type: string
          nullable: true
          description: Error details if the reassignment failed
        createTime:
          type: string
          format: date-time
          description: Timestamp when the record was created
        updateTime:
          type: string
          format: date-time
          description: Timestamp when the record was last updated
    ReassignmentRequest:
      type: object
      required:
      - type
      - sourceUserId
      - targetUserId
      properties:
        type:
          type: string
          enum:
          - children
          - single_user
          description: "children — move all sub-IBs and clients; single_user — move a specific subject user"
        sourceUserId:
          type: string
          format: uuid
          description: IB user whose clients/sub-IBs are being reassigned
        targetUserId:
          type: string
          format: uuid
          description: IB user who will receive the reassigned clients/sub-IBs
        subjectUserId:
          type: string
          format: uuid
          description: Required when type is single_user — the specific user to move
    ReassignmentUser:
      type: object
      properties:
        userId:
          type: string
          format: uuid
        email:
          type: string
          format: email
        name:
          type: string
    MovedRelation:
      type: object
      properties:
        childUserId:
          type: string
          format: uuid
          description: User ID of the relation being moved
        name:
          type: string
        email:
          type: string
          format: email
        isSubIb:
          type: boolean
          description: Whether this relation is a sub-IB (true) or a client (false)
        profileUuid:
          type: string
          format: uuid
        directClients:
          type: integer
          description: Number of direct clients under this relation
        oldRelationId:
          type: string
          format: uuid
        newRelationId:
          type: string
          format: uuid
    ReassignmentListResponse:
      type: object
      properties:
        total:
          type: integer
          description: Total number of items
        reassignments:
          type: array
          items:
            $ref: '#/components/schemas/Reassignment'
          description: List of reassignments
    SyncChain:
      type: object
      properties:
        syncChainId:
          type: string
          description: Unique identifier of the sync chain
        status:
          type: string
          description: Current status of the entity
        createTime:
          type: string
          format: date-time
          description: Timestamp when the record was created
        updateTime:
          type: string
          format: date-time
          description: Timestamp when the record was last updated
    SyncChainRequest:
      type: object
      properties:
        type:
          type: string
          description: Type of the entity
        platformId:
          type: string
          nullable: true
          description: Identifier of the trading platform
    SyncChainListResponse:
      type: object
      properties:
        total:
          type: integer
          description: Total number of items
        syncChains:
          type: array
          items:
            $ref: '#/components/schemas/SyncChain'
          description: List of syncChains
    PaymentCursorResponse:
      type: object
      properties:
        nextCursor:
          type: string
          nullable: true
          description: Cursor token for fetching the next page of results
        payments:
          type: array
          items:
            $ref: '#/components/schemas/Payment'
          description: List of payment records
    TradeCursorResponse:
      type: object
      properties:
        nextCursor:
          type: string
          nullable: true
          description: Cursor token for fetching the next page of results
        trades:
          type: array
          items:
            $ref: '#/components/schemas/Trade'
          description: List of trade records
    TradeReportResponse:
      type: object
      properties:
        report:
          type: object
          properties:
            aggregation:
              type: object
              properties:
                numberOfTrades:
                  $ref: '#/components/schemas/ReportMetricChange'
                tradingVolume:
                  $ref: '#/components/schemas/ReportMetricChange'
            data:
              type: array
              items:
                type: object
          description: Report data entries
tags:
- name: Auth
  description: Authentication and token management
- name: Accounts
  description: Trading accounts management
- name: Addresses
  description: IP address policy management
- name: Authentications
  description: Authentication log
- name: Authorizations
  description: OAuth2 authorization management
- name: Banners
  description: Marketing banner management
- name: Campaigns
  description: Marketing campaign management
- name: Chains
  description: Partner chain/node management
- name: Clicks
  description: Click tracking
- name: Clients
  description: OAuth2 client application management
- name: Countries
  description: Country management
- name: Currencies
  description: Currency management
- name: Groups
  description: Payment group, level, tier, and localization management
- name: Links
  description: Referral link management
- name: Location
  description: Geolocation service management
- name: Messages
  description: System message log
- name: Microservices
  description: WRC microservice diagnostics
- name: Methods
  description: Payment method management
- name: Monitoring
  description: System monitoring
- name: Operations
  description: Deposit and withdrawal operations
- name: Payments
  description: Partner payment records
- name: Platforms
  description: Trading platform management
- name: Preferences
  description: System preference management
- name: Processes
  description: Background process management
- name: Profiles
  description: User profile management
- name: QRCodes
  description: QR code generation and configuration
- name: Rates
  description: Rate provider management
- name: Reassignments
  description: |
    Partner reassignment management — move clients and sub-IBs from one IB to another.

    ## Call flow

    1. **Create** (`POST /reassignments`) — creates a reassignment in `awaiting_confirmation` status.
       The response includes `movedRelations`: a preview of all users/sub-IBs that will be moved.
    2. **Review** — inspect `movedRelations` to verify the expected changes before committing.
    3. **Confirm** (`POST /reassignments/{reassignmentId}/confirm`) — executes the reassignment. Status transitions: `pending` → `processing` → `chains_rebuilding` → `completed`.
    4. **Cancel** (`POST /reassignments/{reassignmentId}/cancel`) — cancels the reassignment without making any changes.

    ## Reassignment types

    | Type | Description |
    |------|-------------|
    | `children` | Moves **all** direct sub-IBs and clients from the source IB to the target IB |
    | `single_user` | Moves a **specific** user (`subjectUserId`) from the source IB to the target IB |

    ## Constraints

    - Both `sourceUserId` and `targetUserId` must be IB users (assigned to a user group).
    - `sourceUserId` and `targetUserId` must be different users.
    - For `single_user`: `subjectUserId` is required and must have an active relation with the source IB.
    - For `children`: target IB cannot be a deeper descendant of the source IB (only a direct sub-IB is allowed).
- name: Regions
  description: Geographic region management
- name: Relations
  description: Partner-client relation management
- name: Reports
  description: Analytics reports
- name: Symbols
  description: Trading symbol management and payment plans
- name: System
  description: System utilities
- name: Trades
  description: Trade records
- name: Transactions
  description: Transaction records
- name: Users
  description: IB user management
- name: Wallets
  description: Wallet management
- name: CpaPrograms
  description: CPA program management
- name: Savings
  description: Savings program, level, acquisition, and payment management (admin and partner-facing)
- name: Partner
  description: Partner-facing CPA and subscription endpoints
- name: Exports
  description: Async export management
- name: SyncChains
  description: Sync chain management
