openapi: 3.1.0
info:
  version: 2.3.0
  title: B2CORE API
  description: The B2CORE API provides a standards-based REST interface which enables application developers to interact in a powerful and secure way with B2CORE. Using B2CORE API, clients can pass verification, open and archive trading accounts, make deposits and withdrawals, retrieve real-time data and much more. Requests to the API follow a RESTful convention using standard HTTP verbs against various B2CORE resources to return JSON formatted responses. Developers may call the API directly over HTTPS using the language of their choice (C, PHP, SwiftUI, etc).
security:
  - bearerAuth: []
tags:
  - name: Auth
  - name: Auth History
  - name: Accounts
  - name: Addresses
  - name: Applications
  - name: B2Copy
  - name: Bonuses
  - name: Clients
  - name: Countries
  - name: Jurisdictions
  - name: Deposits
  - name: Documents
  - name: Phones
  - name: Marketing Data
  - name: Transactions
  - name: Users
  - name: Verifications
  - name: Withdrawals
  - name: Tags
  - name: Clients File Directories
  - name: Rates
  - name: Savings
paths:
  /api/v2/accounts:
    get:
      operationId: getAccountCollection
      parameters:
        - $ref: '#/components/parameters/language'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
        - $ref: '#/components/parameters/order'
        -
          description: Sorts the items by a specified value
          example: createTime
          in: query
          name: sort_by
          required: false
          schema:
            default: createTime
            enum:
              - createTime
              - updateTime
            type: string
        -
          description: Filters the items by a specified value
          in: query
          name: filter
          required: false
          schema:
            properties:
              clientId:
                type: integer
              platformId:
                type: integer
              productId:
                type: integer
          style: deepObject
      responses:
        "200":
          content:
            application/json:
              schema:
                type: object
                properties:
                  total:
                    type: integer
                  data:
                    items:
                      $ref: '#/components/schemas/Account'
                    type: array
          description: OK
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Get Accounts
      tags:
        - Accounts
    post:
      operationId: createAccountResource
      parameters:
        - $ref: '#/components/parameters/language'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                clientId:
                  example: 1
                  type: integer
                  nullable: false
                productCurrencyId:
                  example: 1
                  type: integer
                  nullable: false
                leverage:
                  type: number
                  example: 0
                alreadyExistingPlatformAccount:
                  type: boolean
                  example: true
                accountNumber:
                  type: string
                  example: "111111"
              required:
                - productCurrencyId
                - clientId
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Account'
          description: Created
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Create a new Account
      tags:
        - Accounts
  /api/v2/accounts/{accountId}:
    get:
      operationId: getAccountResource
      parameters:
        - $ref: '#/components/parameters/language'
        -
          description: Account ID
          example: 1
          in: path
          name: accountId
          required: true
          schema:
            type: integer
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Account'
          description: OK
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Get Account Details
      tags:
        - Accounts
    put:
      operationId: putAccountResource
      parameters:
        - $ref: '#/components/parameters/language'
        -
          description: Account ID
          example: 1
          in: path
          name: accountId
          required: true
          schema:
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                caption:
                  example: 'Bitcoin'
                  type: string
                  nullable: false
                rights:
                  items:
                    type: integer
                    example: 2
                  example: [2, 8, 32]
                  type: array
              required:
                - caption
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Account'
          description: OK
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Update Account
      tags:
        - Accounts
    patch:
      operationId: patchAccountResource
      parameters:
        - $ref: '#/components/parameters/language'
        -
          description: Account ID
          example: 1
          in: path
          name: accountId
          required: true
          schema:
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                caption:
                  example: 'Bitcoin'
                  type: string
                  nullable: false
                rights:
                  items:
                    type: integer
                    example: 2
                  example: [2, 8, 32]
                  type: array
              required:
                - caption
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Account'
          description: OK
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Update Account
      tags:
        - Accounts
  /api/v2/accounts/{accountId}/archive:
    post:
      operationId: postArchiveAccount
      parameters:
        - $ref: '#/components/parameters/language'
        -
          description: Account ID
          example: 1
          in: path
          name: accountId
          required: true
          schema:
            type: integer
      responses:
        "200":
          $ref: '#/components/responses/NoContent'
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Archive Account
      tags:
        - Accounts
  /api/v2/accounts/{accountId}/unarchive:
    post:
      operationId: postUnarchiveAccount
      parameters:
        -
          description: Account ID
          example: 1
          in: path
          name: accountId
          required: true
          schema:
            type: integer
      responses:
        "200":
          $ref: '#/components/responses/NoContent'
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Unarchive Account
      tags:
        - Accounts
  /api/v2/accounts/{accountId}/balance:
    get:
      operationId: getAccountBalance
      parameters:
        - $ref: '#/components/parameters/language'
        -
          description: Account ID
          example: 1
          in: path
          name: accountId
          required: true
          schema:
            type: integer
      responses:
        "200":
          content:
            application/json:
              schema:
                type: object
                properties:
                  balance:
                    type: string
                    example: "500.00"
          description: OK
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Get Account Balance
      tags:
        - Accounts
    patch:
      operationId: patchAccountBalance
      parameters:
        - $ref: '#/components/parameters/language'
        -
          description: Account ID
          example: 1
          in: path
          name: accountId
          required: true
          schema:
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                amount:
                  type: string
                  example: "20.00"
              required: [amount]
      responses:
        "204":
          $ref: '#/components/responses/NoContent'
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Update Account Balance
      tags:
        - Accounts
    put:
      operationId: putAccountBalance
      parameters:
        - $ref: '#/components/parameters/language'
        -
          description: Account ID
          example: 1
          in: path
          name: accountId
          required: true
          schema:
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                amount:
                  type: number
                  minimum: 0
                  exclusiveMinimum: true
              required: [amount]
      responses:
        "204":
          $ref: '#/components/responses/NoContent'
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Update Account Balance
      tags:
        - Accounts
  /api/v2/accounts/{accountId}/preferences:
    get:
      operationId: getAccountPreferences
      parameters:
        - $ref: '#/components/parameters/language'
        -
          description: Account ID
          example: 1
          in: path
          name: accountId
          required: true
          schema:
            type: integer
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccountPreferences'
          description: OK
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Get Account Preferences
      tags:
        - Accounts
  /api/v2/addresses:
    get:
      operationId: getAddressCollection
      parameters:
        - $ref: '#/components/parameters/language'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
        - $ref: '#/components/parameters/order'
        -
          description: Sorts the items by a specified value
          example: createTime
          in: query
          name: sort_by
          required: false
          schema:
            default: createTime
            enum:
              - createTime
              - updateTime
            type: string
        -
          description: Filters the items by a specified value
          in: query
          name: filter
          required: false
          schema:
            properties:
              address:
                example: "47 W 13th St, New York, NY 10011, USA"
                type: string
              clientId:
                type: integer
              postcode:
                example: "0200 - 9729"
                type: string
              type:
                example: "residential"
                type: string
                enum:
                  - "residential"
                  - "billing"
                  - "mailing"
          style: deepObject
      responses:
        "200":
          content:
            application/json:
              schema:
                type: object
                properties:
                  total:
                    type: integer
                  data:
                    items:
                      $ref: '#/components/schemas/Address'
                    type: array
          description: OK
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Get Address
      tags:
        - Addresses
    post:
      operationId: createAddressResource
      parameters:
        - $ref: '#/components/parameters/language'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                address:
                  example: "47 W 13th St, New York, NY 10011, USA"
                  type: string
                city:
                  example: "New York"
                  type: string
                countryCode:
                  type: integer
                postcode:
                  example: "0200 - 9729"
                  type: string
                state:
                  example: "New York"
                  type: string
                type:
                  example: "residential"
                  type: string
                clientId:
                  type: integer
              required:
                - countryCode
                - type
                - clientId
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Address'
          description: Created
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Create a new Address
      tags:
        - Addresses
  /api/v2/addresses/{address}:
    get:
      operationId: getAddressResource
      parameters:
        - $ref: '#/components/parameters/language'
        -
          description: Adress ID
          example: 1
          in: path
          name: address
          required: true
          schema:
            type: integer
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Address'
          description: OK
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Get Address Details
      tags:
        - Addresses
    put:
      operationId: putAddressResource
      parameters:
        - $ref: '#/components/parameters/language'
        -
          description: Address ID
          example: 1
          in: path
          name: address
          required: true
          schema:
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                address:
                  example: "47 W 13th St, New York, NY 10011, USA"
                  type: string
                city:
                  example: "New York"
                  type: string
                countryCode:
                  type: integer
                postcode:
                  example: "0200 - 9729"
                  type: string
                state:
                  example: "New York"
                  type: string
                type:
                  example: "residential"
                  type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Address'
          description: OK
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Update Address
      tags:
        - Addresses
    patch:
      operationId: patchAddressResource
      parameters:
        - $ref: '#/components/parameters/language'
        -
          description: Address ID
          example: 1
          in: path
          name: address
          required: true
          schema:
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                address:
                  example: "47 W 13th St, New York, NY 10011, USA"
                  type: string
                city:
                  example: "New York"
                  type: string
                countryCode:
                  type: integer
                postcode:
                  example: "0200 - 9729"
                  type: string
                state:
                  example: "New York"
                  type: string
                type:
                  example: "residential"
                  type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Address'
          description: OK
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Update Address
      tags:
        - Addresses
    delete:
      operationId: deleteAddressResource
      parameters:
        - description: Address ID
          example: 1
          in: path
          name: address
          required: true
          schema:
            type: integer
      responses:
        "204":
          $ref: '#/components/responses/NoContent'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Delete Address
      tags:
        - Addresses
  /api/v2/applications:
    get:
      operationId: getApplicationCollection
      parameters:
        - $ref: '#/components/parameters/language'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
        - name: with
          in: query
          required: false
          description: 'Additional fields. Example: "interact"'
          schema:
            type: string
        - name: filter
          description: Filters the items by a specified value
          in: query
          required: false
          schema:
            properties:
              id:
                $ref: '#/components/schemas/nullableInteger'
              clientId:
                $ref: '#/components/schemas/nullableInteger'
              type:
                example: "verification"
                type: string
              statusId:
                $ref: '#/components/schemas/nullableInteger'
              fromCreatedAt:
                type: string
                format: date-time
                description: Filter applications created from this date (RFC3339 format)
                example: "2025-01-01T00:00:00Z"
              toCreatedAt:
                type: string
                format: date-time
                description: Filter applications created until this date (RFC3339 format)
                example: "2025-12-31T23:59:59Z"
              fromProcessedAt:
                type: string
                format: date-time
                description: Filter applications processed from this date (RFC3339 format)
                example: "2025-01-01T00:00:00Z"
              toProcessedAt:
                type: string
                format: date-time
                description: Filter applications processed until this date (RFC3339 format)
                example: "2025-12-31T23:59:59Z"
          style: deepObject
      responses:
        "200":
          content:
            application/json:
              schema:
                type: object
                properties:
                  total:
                    type: integer
                  data:
                    items:
                      $ref: '#/components/schemas/Request'
                    type: array
          description: OK
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Get Applications
      tags:
        - Applications
  /api/v2/applications/{application}:
    get:
      operationId: getApplicationResource
      parameters:
        - $ref: '#/components/parameters/language'
        -
          description: Application ID
          example: 1
          in: path
          name: application
          required: true
          schema:
            type: integer
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Request'
          description: OK
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Get Application Details
      tags:
        - Applications
  /api/v2/applications/{application}/approve:
    post:
      operationId: approveApplicationsResource
      parameters:
        - $ref: '#/components/parameters/language'
        -
          description: Application ID
          example: 1
          in: path
          name: application
          required: true
          schema:
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              oneOf:
                - type: array
                  items:
                    type: string
                  description: "empty array"
                - type: object
                  properties:
                    data:
                      type: array
                      items:
                        type: string
      responses:
        "200":
          $ref: '#/components/responses/NoContent'
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Approve Application
      tags:
        - Applications
  /api/v2/applications/{application}/reject:
    post:
      operationId: rejectApplicationResource
      parameters:
        - $ref: '#/components/parameters/language'
        -
          description: Application ID
          example: 1
          in: path
          name: application
          required: true
          schema:
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                data:
                  type: array
                  items:
                    type: string
                resolutionId:
                  type: integer
                resolutionType:
                  type: integer
              required:
                - resolutionId
      responses:
        "200":
          $ref: '#/components/responses/NoContent'
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Reject Application
      tags:
        - Applications
  /api/v2/applications/{application}/comments:
    get:
      operationId: getApplicationComments
      parameters:
        -
          description: Application ID
          example: 1
          in: path
          name: application
          required: true
          schema:
            type: integer
      responses:
        "200":
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: integer
                      description: Comment ID
                      example: 25
                    text:
                      type: string
                      description: Comment text
                      example: "This application requires additional verification"
                    authorId:
                      type: integer
                      description: Author user ID
                      example: 5
                    createdAt:
                      type: string
                      format: date-time
                      description: Comment creation timestamp
                      example: "2025-11-19T10:30:00.000Z"
          description: OK
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Get Application Comments
      tags:
        - Applications
    post:
      operationId: addApplicationComment
      parameters:
        -
          description: Application ID
          example: 1
          in: path
          name: application
          required: true
          schema:
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                text:
                  type: string
                  description: Comment text
                  example: "This application requires additional verification"
              required:
                - text
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: integer
                    description: Comment ID
                    example: 25
          description: Created
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Add Comment to Application
      tags:
        - Applications
  /api/v2/applications/{application}/payment-systems-assistance/move-to-success:
    post:
      operationId: paymentSystemsAssistanceMoveToSuccess
      summary: Move Payment Systems Assistance Application to Success
      description: |
        Moves an application to success status.
        - For deposit/static_deposit: `final_amount` is required in data
        - For withdrawal: data should be empty object (amount taken from original withdrawal)
      tags:
        - Applications
      parameters:
        - $ref: '#/components/parameters/language'
        - name: application
          description: Application ID
          example: 1
          in: path
          required: true
          schema:
            type: integer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PaymentSystemsAssistanceMoveToSuccessRequest'
      responses:
        "204":
          $ref: '#/components/responses/NoContent'
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
  /api/v2/applications/{application}/payment-systems-assistance/move-to-in-progress:
    post:
      operationId: paymentSystemsAssistanceMoveToInProgress
      summary: Move Payment Systems Assistance Application to In Progress
      description: |
        Moves an application to in-progress status.
        - For deposit/withdrawal: `external_id` may be required if identifier is not already verified
        - For static_deposit: data should be empty object
      tags:
        - Applications
      parameters:
        - $ref: '#/components/parameters/language'
        - name: application
          description: Application ID
          example: 1
          in: path
          required: true
          schema:
            type: integer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PaymentSystemsAssistanceMoveToInProgressRequest'
      responses:
        "204":
          $ref: '#/components/responses/NoContent'
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
  /api/v2/applications/{application}/payment-systems-assistance/move-to-failed:
    post:
      operationId: paymentSystemsAssistanceMoveToFailed
      summary: Move Payment Systems Assistance Application to Failed
      description: Moves an application to failed status with error details.
      tags:
        - Applications
      parameters:
        - $ref: '#/components/parameters/language'
        - name: application
          description: Application ID
          example: 1
          in: path
          required: true
          schema:
            type: integer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PaymentSystemsAssistanceMoveToFailedRequest'
      responses:
        "204":
          $ref: '#/components/responses/NoContent'
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
  /api/v2/b2copy/accounts/create:
    post:
      operationId: createB2CopyInvestmentAccount
      summary: Create a B2Copy investment account
      description: Creates a B2Copy investment account for a client by linking an existing trading platform account.
      tags:
        - B2Copy
      parameters:
        - $ref: '#/components/parameters/language'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - clientId
                - investmentPlatformId
                - accountNumber
                - productCurrencyId
                - isMaster
              properties:
                clientId:
                  type: integer
                  example: 1
                  description: ID of the client to create the account for.
                investmentPlatformId:
                  type: integer
                  example: 1
                  description: ID of the investment platform (must be enabled).
                accountNumber:
                  type: string
                  example: "111111"
                  description: Account number on the trading platform.
                productCurrencyId:
                  type: integer
                  example: 1
                  description: ID of the product currency (must be enabled).
                isMaster:
                  type: boolean
                  example: true
                  description: Whether the account is a master (strategy) account. Use `false` for investor accounts.
                accountName:
                  type: string
                  maxLength: 255
                  example: "My Strategy"
                  description: Optional display name for the investment account.
                accountDescription:
                  type: string
                  maxLength: 1000
                  example: "A conservative trading strategy."
                  description: Optional description of the investment account.
                alreadyExistingInTRAccount:
                  type: integer
                  nullable: true
                  example: 42
                  description: ID of an already-existing Trader's Room account to link, if applicable.
                leverage:
                  type: integer
                  nullable: true
                  example: 100
                  description: Leverage value for the account.
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/B2CopyInvestmentAccount'
          description: OK
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
  /api/v2/bonuses:
    get:
      operationId: getBonusesCollection
      parameters:
        - $ref: '#/components/parameters/language'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
        - $ref: '#/components/parameters/order'
        -
          description: Sorts the items by a specified value
          example: createTime
          in: query
          name: sort_by
          required: false
          schema:
            default: createTime
            enum:
              - createTime
            type: string
        -
          description: Filters the items by a specified value
          in: query
          name: filter
          required: false
          schema:
            properties:
              state:
                type: integer
              account:
                type: integer
              clientEmail:
                example: "example@gmail.com"
                type: string
              clientId:
                type: integer
              clientName:
                example: "Mary Smith"
                type: string
          style: deepObject
      responses:
        "200":
          content:
            application/json:
              schema:
                type: object
                properties:
                  total:
                    type: integer
                  data:
                    items:
                      $ref: '#/components/schemas/Bonus'
                    type: array
          description: OK
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Get Bonuses
      tags:
        - Bonuses
    post:
      operationId: createBonusResource
      parameters:
        - $ref: '#/components/parameters/language'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                accountId:
                  type: integer
                amount:
                  example: 55.55
                  nullable: true
                  type: number
                lifetime:
                  type: integer
                dynamicLots:
                  example: 55.55
                  nullable: true
                  type: number
                enableAutoCredit:
                  type: boolean
                scalpingThreshold:
                  type: integer
                enableTrade:
                  type: boolean
                disabledGroups:
                  example: ["EURJPY"]
                  type: array
                  items:
                    type: string
              required:
                - accountId
                - amount
                - lifetime
                - dynamicLots
                - enableAutoCredit
                - scalpingThreshold
                - enableTrade
                - disabledGroups
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Bonus'
          description: Created
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Create a new Bonus
      tags:
        - Bonuses
  /api/v2/bonuses/{bonusId}:
    get:
      operationId: getBonusResource
      parameters:
        - $ref: '#/components/parameters/language'
        -
          description: Bonus ID
          example: 1
          in: path
          name: bonusId
          required: true
          schema:
            type: integer
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Bonus'
          description: OK
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Get Bonus Details
      tags:
        - Bonuses
    put:
      operationId: putBonusResource
      parameters:
        - $ref: '#/components/parameters/language'
        -
          description: Bonus ID
          example: 1
          in: path
          name: bonusId
          required: true
          schema:
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                fictiveVolumeComplete:
                  example: 55.55
                  nullable: true
                  type: number
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Bonus'
          description: OK
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Update Bonus
      tags:
        - Bonuses
    patch:
      operationId: patchBonusResource
      parameters:
        - $ref: '#/components/parameters/language'
        -
          description: Bonus ID
          example: 1
          in: path
          name: bonusId
          required: true
          schema:
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                fictiveVolumeComplete:
                  example: 55.55
                  nullable: true
                  type: number
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Bonus'
          description: OK
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Update Bonus
      tags:
        - Bonuses
    delete:
      operationId: deleteBonusResource
      parameters:
        - description: Bonus ID
          example: 1
          in: path
          name: bonusId
          required: true
          schema:
            type: integer
      responses:
        "204":
          $ref: '#/components/responses/NoContent'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Delete Bonus
      tags:
        - Bonuses
  /api/v2/bonuses/{bonusId}/continue:
    post:
      operationId: continueBonusResource
      parameters:
        - $ref: '#/components/parameters/language'
        -
          description: Bonus ID
          example: 1
          in: path
          name: bonusId
          required: true
          schema:
            type: integer
      responses:
        "200":
          $ref: '#/components/responses/NoContent'
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Continue Bonus
      tags:
        - Bonuses
  /api/v2/bonuses/{bonusId}/hold:
    post:
      operationId: holdBonusResource
      parameters:
        - $ref: '#/components/parameters/language'
        -
          description: Bonus ID
          example: 1
          in: path
          name: bonusId
          required: true
          schema:
            type: integer
      responses:
        "200":
          $ref: '#/components/responses/NoContent'
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Hold Bonus
      tags:
        - Bonuses
  /api/v2/bonuses/{bonusId}/reactivate:
    post:
      operationId: reactivateBonusResource
      parameters:
        - $ref: '#/components/parameters/language'
        -
          description: Bonus ID
          example: 1
          in: path
          name: bonusId
          required: true
          schema:
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                lifetime:
                  example: 55.55
                  type: number
      responses:
        "200":
          $ref: '#/components/responses/NoContent'
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Reactivate Bonus
      tags:
        - Bonuses
  /api/v2/bonuses/{bonusId}/revoke:
    post:
      operationId: revokeBonusResource
      parameters:
        - $ref: '#/components/parameters/language'
        -
          description: Bonus ID
          example: 1
          in: path
          name: bonusId
          required: true
          schema:
            type: integer
      responses:
        "200":
          $ref: '#/components/responses/NoContent'
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Revoke Bonus
      tags:
        - Bonuses
  /api/v2/bonuses/presets:
    get:
      operationId: getBonusPresetsCollection
      parameters:
        - $ref: '#/components/parameters/language'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
        - $ref: '#/components/parameters/order'
        -
          description: Sorts the items by a specified value
          example: createTime
          in: query
          name: sort_by
          required: false
          schema:
            default: createTime
            enum:
              - createTime
            type: string
        -
          description: Filters the items by a specified value
          in: query
          name: filter
          required: false
          schema:
            properties:
              default:
                type: boolean
                deprecated: true
              platform:
                example: "MetaTrader4"
                type: string
              name:
                example: "Preset"
                type: string
          style: deepObject
      responses:
        "200":
          content:
            application/json:
              schema:
                type: object
                properties:
                  total:
                    type: integer
                  data:
                    items:
                      $ref: '#/components/schemas/BonusPreset'
                    type: array
          description: OK
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Get Bonus Presets
      tags:
        - Bonuses
    post:
      operationId: createBonusPresetResource
      parameters:
        - $ref: '#/components/parameters/language'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                platformId:
                  type: integer
                name:
                  example: "Preset"
                  type: string
                default:
                  type: boolean
                  deprecated: true
                lifetime:
                  type: integer
                dynamicLots:
                  example: 55.55
                  nullable: true
                  type: number
                enableAutoCredit:
                  type: boolean
                scalpingThreshold:
                  type: integer
                enableTrade:
                  type: boolean
                disabledGroups:
                  example: ["EURJPY"]
                  type: array
                  items:
                    type: string
              required:
                - platformId
                - name
                - lifetime
                - dynamicLots
                - enableAutoCredit
                - scalpingThreshold
                - enableTrade
                - disabledGroups
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BonusPreset'
          description: Created
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Create a new Bonus Preset
      tags:
        - Bonuses
  /api/v2/bonuses/presets/{presetId}:
    get:
      operationId: getBonusPresetResource
      parameters:
        - $ref: '#/components/parameters/language'
        -
          description: Preset ID
          example: 1
          in: path
          name: presetId
          required: true
          schema:
            type: integer
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BonusPreset'
          description: OK
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Get Bonus Preset Details
      tags:
        - Bonuses
    put:
      operationId: putBonusPresetResource
      parameters:
        - $ref: '#/components/parameters/language'
        -
          description: Preset ID
          example: 1
          in: path
          name: presetId
          required: true
          schema:
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  example: "Preset"
                  type: string
                priority:
                  type: integer
                default:
                  type: boolean
                  deprecated: true
                lifetime:
                  type: integer
                dynamicLots:
                  example: 55.55
                  nullable: true
                  type: number
                enableAutoCredit:
                  type: boolean
                scalpingThreshold:
                  type: integer
                enableTrade:
                  type: boolean
                disabledGroups:
                  example: ["EURJPY"]
                  type: array
                  items:
                    type: string
              required:
                - name
                - priority
                - lifetime
                - dynamicLots
                - enableAutoCredit
                - scalpingThreshold
                - enableTrade
                - disabledGroups
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BonusPreset'
          description: OK
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Update Bonus Preset
      tags:
        - Bonuses
    patch:
      operationId: patchBonusPresetResource
      parameters:
        - $ref: '#/components/parameters/language'
        -
          description: Preset ID
          example: 1
          in: path
          name: presetId
          required: true
          schema:
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  example: "Preset"
                  type: string
                priority:
                  type: integer
                default:
                  type: boolean
                  deprecated: true
                lifetime:
                  type: integer
                dynamicLots:
                  example: 55.55
                  nullable: true
                  type: number
                enableAutoCredit:
                  type: boolean
                scalpingThreshold:
                  type: integer
                enableTrade:
                  type: boolean
                disabledGroups:
                  example: ["EURJPY"]
                  type: array
                  items:
                    type: string
              required:
                - name
                - priority
                - lifetime
                - dynamicLots
                - enableAutoCredit
                - scalpingThreshold
                - enableTrade
                - disabledGroups
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BonusPreset'
          description: OK
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Update Bonus Preset
      tags:
        - Bonuses
    delete:
      operationId: deleteBonusPresetResource
      parameters:
        - description: Preset ID
          example: 1
          in: path
          name: presetId
          required: true
          schema:
            type: integer
      responses:
        "204":
          $ref: '#/components/responses/NoContent'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Delete a Bonus Preset
      tags:
        - Bonuses
  /api/v2/bonuses/temporary:
    get:
      operationId: getBonusTemporaryCollection
      parameters:
        - $ref: '#/components/parameters/language'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
        - $ref: '#/components/parameters/order'
        -
          description: Sorts the items by a specified value
          example: createTime
          in: query
          name: sort_by
          required: false
          schema:
            default: createTime
            enum:
              - createTime
            type: string
        -
          description: Filters the items by a specified value
          in: query
          name: filter
          required: false
          schema:
            properties:
              id:
                type: integer
              name:
                example: "Preset"
                type: string
          style: deepObject
      responses:
        "200":
          content:
            application/json:
              schema:
                type: object
                properties:
                  total:
                    type: integer
                  data:
                    items:
                      $ref: '#/components/schemas/BonusTemporary'
                    type: array
          description: OK
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Get Bonus Temporary
      tags:
        - Bonuses
    post:
      operationId: createBonusTemporaryResource
      parameters:
        - $ref: '#/components/parameters/language'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                platformId:
                  type: integer
                name:
                  example: "Preset"
                  type: string
                amount:
                  example: 55.55
                  nullable: true
                  type: number
                currencyCode:
                  type: integer
                platformGroups:
                  example: ["EURJPY"]
                  type: array
                  items:
                    type: string
                expiredAt:
                  example: "11.11.2023 23:21"
                  type: string
                lifetime:
                  type: integer
                dynamicLots:
                  example: 55.55
                  nullable: true
                  type: number
                enableAutoCredit:
                  type: boolean
                scalpingThreshold:
                  type: integer
                enableTrade:
                  type: boolean
                disabledGroups:
                  example: ["EURJPY"]
                  type: array
                  items:
                    type: string
              required:
                - platformId
                - name
                - amount
                - currencyCode
                - platformGroups
                - expiredAt
                - lifetime
                - dynamicLots
                - enableAutoCredit
                - scalpingThreshold
                - enableTrade
                - disabledGroups
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BonusTemporary'
          description: Created
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Create a new Bonus Temporary
      tags:
        - Bonuses
  /api/v2/bonuses/temporary/{temporaryId}:
    get:
      operationId: getBonusTemporaryResource
      parameters:
        - $ref: '#/components/parameters/language'
        -
          description: Temporary ID
          example: 1
          in: path
          name: temporaryId
          required: true
          schema:
            type: integer
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BonusTemporary'
          description: OK
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Get Bonus Temporary Details
      tags:
        - Bonuses
    put:
      operationId: putBonusTemporaryResource
      parameters:
        - $ref: '#/components/parameters/language'
        -
          description: Temporary ID
          example: 1
          in: path
          name: temporaryId
          required: true
          schema:
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  example: "Preset"
                  type: string
                amount:
                  example: 55.55
                  nullable: true
                  type: number
                platformGroups:
                  example: ["EURJPY"]
                  type: array
                  items:
                    type: string
                expiredAt:
                  example: "11.11.2023 23:21"
                  type: string
                lifetime:
                  type: integer
                dynamicLots:
                  example: 55.55
                  nullable: true
                  type: number
                enableAutoCredit:
                  type: boolean
                scalpingThreshold:
                  type: integer
                enableTrade:
                  type: boolean
                disabledGroups:
                  example: ["EURJPY"]
                  type: array
                  items:
                    type: string
              required:
                - name
                - amount
                - platformGroups
                - expiredAt
                - lifetime
                - dynamicLots
                - enableAutoCredit
                - scalpingThreshold
                - enableTrade
                - disabledGroups
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BonusTemporary'
          description: OK
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Update Bonus Temporary
      tags:
        - Bonuses
    patch:
      operationId: patchBonusTemporaryResource
      parameters:
        - $ref: '#/components/parameters/language'
        -
          description: Temporary ID
          example: 1
          in: path
          name: temporaryId
          required: true
          schema:
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  example: "Preset"
                  type: string
                amount:
                  example: 55.55
                  nullable: true
                  type: number
                platformGroups:
                  example: ["EURJPY"]
                  type: array
                  items:
                    type: string
                expiredAt:
                  example: "11.11.2023 23:21"
                  type: string
                lifetime:
                  type: integer
                dynamicLots:
                  example: 55.55
                  nullable: true
                  type: number
                enableAutoCredit:
                  type: boolean
                scalpingThreshold:
                  type: integer
                enableTrade:
                  type: boolean
                disabledGroups:
                  example: ["EURJPY"]
                  type: array
                  items:
                    type: string
              required:
                - name
                - amount
                - platformGroups
                - expiredAt
                - lifetime
                - dynamicLots
                - enableAutoCredit
                - scalpingThreshold
                - enableTrade
                - disabledGroups
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BonusTemporary'
          description: OK
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Update Bonus Temporary
      tags:
        - Bonuses
    delete:
      operationId: deleteBonusTemporaryTypeResource
      parameters:
        - description: Temporary ID
          example: 1
          in: path
          name: temporaryId
          required: true
          schema:
            type: integer
      responses:
        "204":
          $ref: '#/components/responses/NoContent'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Delete a Bonus Temporary
      tags:
        - Bonuses
  /api/v2/clients/authorizations:
    get:
      operationId: getClientAuthorizationsCollection
      parameters:
        - $ref: '#/components/parameters/language'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
        - $ref: '#/components/parameters/order'
        -
          description: Sorts the items by a specified value
          example: authDateTime
          in: query
          name: sort_by
          required: false
          schema:
            default: authDateTime
            enum:
              - authDateTime
            type: string
        -
          description: Filters the items by a specified value
          in: query
          name: filter
          required: false
          schema:
            properties:
              clientId:
                type: integer
              ip:
                type: string
              status:
                type: string
                example: "success"
                enum:
                  - "success"
                  - "failure"
          style: deepObject
      responses:
        "200":
          content:
            application/json:
              schema:
                type: object
                properties:
                  total:
                    type: integer
                  data:
                    items:
                      $ref: '#/components/schemas/AuthorizationHistory'
                    type: array
          description: OK
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Get Client Authorization History
      tags:
        - Auth History
  /api/v2/clients/authorizations/{authorizationId}:
    get:
      operationId: getAuthorizationHistoryRecord
      parameters:
        - $ref: '#/components/parameters/language'
        -
          description: Id of Authorization history record
          example: 1
          in: path
          name: authorizationId
          required: true
          schema:
            type: integer
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthorizationHistory'
          description: OK
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Get Client Authorization History Record By Id
      tags:
        - Auth History
  /api/v2/clients:
    get:
      operationId: getClientCollection
      parameters:
        - $ref: '#/components/parameters/language'
        - limit:
            description: Sets the limit
            example: 10
            in: query
            name: limit
            required: false
            schema:
              default: 10
              minimum: 1
              maximum: 500
              type: integer
        - $ref: '#/components/parameters/offset'
        - $ref: '#/components/parameters/order'
        -
          description: Sorts the items by a specified value
          example: createTime
          in: query
          name: sort_by
          required: false
          schema:
            default: createTime
            enum:
              - createTime
              - updateTime
            type: string
        -
          description: Filters the items by a specified value
          in: query
          name: filter
          required: false
          schema:
            properties:
              clientId:
                type: integer
              emails:
                example: "foo@bar.com,bar@baz.com"
                type: string
              name:
                example: "Sergey"
                type: string
              nickname:
                example: "Voronov"
                type: string
              accountNumber:
                type: string
                example: "123123123"
              managerIds:
                example: "1, 2, 3"
                type: string
              countryCodes:
                example: "1, 2, 3"
                type: string
              city:
                example: "New York"
                type: string
              statusIds:
                example: "1, 2, 3"
                type: string
              internalTypeIds:
                example: "1, 2, 3"
                type: string
              companyShortName:
                example: "Company name"
                type: string
              companyFullName:
                example: "Company full name"
                type: string
              riskLevelIds:
                example: "1, 2, 3"
                type: string
              typeIds:
                example: "1, 2, 3"
                type: string
              verificationLevelIds:
                example: 1
                type: integer
              fromUpdateTime:
                $ref: '#/components/schemas/dateTime'
              toUpdateTime:
                $ref: '#/components/schemas/dateTime'
          style: deepObject
      responses:
        "200":
          content:
            application/json:
              schema:
                type: object
                properties:
                  total:
                    type: integer
                  data:
                    items:
                      $ref: '#/components/schemas/Client'
                    type: array
          description: OK
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Get Clients
      tags:
        - Clients
    post:
      operationId: createClientResource
      parameters:
        - $ref: '#/components/parameters/language'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                info:
                  type: object
                  example: {'givenName': 'Mary', familyName: 'Smith'}
                addresses:
                  type: array
                  example:
                    - country_code: 826,
                      state: '-'
                      city: London
                      postal_code: NW18QZ
                phones:
                  type: array
                  example:
                    - phone: '+44 20 7946 0958'
                email:
                  example: "example@gmail.com"
                  type: string
                type:
                  example: 1
                  type: integer
                passwordHash:
                  type: string
                  example: "$2y$10$VHiZjDxmeJbEHY6HEsxkduMjYNuBzjbNe8F.QbF4FM6W8k1CfVXcK"
                  description: "Password hash generated using Bcrypt algorithm. Always 60 characters long"
              required:
                - info
                - addresses
                - phones
                - email
                - type
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Client'
          description: Created
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Create a new Client
      tags:
        - Clients
  /api/v2/clients/{clientId}:
    get:
      operationId: getClientResource
      parameters:
        - $ref: '#/components/parameters/language'
        -
          description: Client ID
          example: 1
          in: path
          name: clientId
          required: true
          schema:
            type: integer
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Client'
          description: OK
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Get Client Details
      tags:
        - Clients
    patch:
      operationId: updateClientResource
      parameters:
        - $ref: '#/components/parameters/language'
        -
          description: Client ID
          example: 1
          in: path
          name: clientId
          required: true
          schema:
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                tfaProvidersForDisable:
                  type: array
                  items:
                    type: string
                    example: sms
                givenName:
                  type: string
                  example: "Nick"
                familyName:
                  type: string
                  example: "Green"
                middleName:
                  type: string
                  example: "Smith"
                birthday:
                  $ref: "#/components/schemas/dateTime"
                maxAccountsDemo:
                  type: integer
                  example: 1
                maxAccountsTrade:
                  type: integer
                  example: 1
                sex:
                  type: integer
                  example: 1
                  enum:
                    - 0
                    - 1
                    - 2
                  description: "0 - Undefined, 1 - Male, 2 - Female"
                countryCode:
                  type: integer
                  example: 1000
                typeId:
                  example: 1
                  type: integer
                managerId:
                  example: 1
                  type: integer
                levelId:
                  example: 1
                  type: integer
                company:
                  type: string
                  example: "Wendy's"
                companyFull:
                  type: string
                  example: "Wendy's shop"
                companyRegistration:
                  type: string
                  example: "Wendy's shop inc"
                nickname:
                  type: string
                  example: "mrgreen1982"
                locale:
                  type: string
                  example: "en_EN"
                applicationColor:
                  type: string
                  example: "#FFFFFF"
                email:
                  type: string
                  example: "mrgreem@mail.com"
                additionalData:
                  type: array
                  items:
                    type: object
                tags:
                  type: array
                  items:
                    type: string
                verificationDisabled:
                  type: integer
                  enum:
                    - 1
                    - 0
                internalType:
                  type: integer
                  enum:
                    - 4
                    - 3
                    - 2
                    - 1
                    - 0
                  description: "0 - default, 1 - b2b, 2 - demo, 3 - exchange, 4 - agent"
                status:
                  type: integer
                  enum:
                    - 1
                    - 10
                    - 20
                    - 0
                  description: "1 - active, 10 - banned, 20 - deleted, 0 - inactive"
                avatar:
                  type: string
                  format: binary
                  description:  "Profile photo image file. Allowed mime types: 'image/jpg,image/png'. Max - 10240. Dimensions:max_width=4500,max_height=4500"
                riskLevel:
                  type: integer
                  enum:
                    - 0
                    - 1
                    - 2
                  description: "0 - low, 2- middle, 3- hight"
                jurisdictionId:
                  example: 1
                  type: integer
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Client'
          description: OK
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Update Client Details
      tags:
        - Clients
  /api/v2/clients/{client}/password:
    patch:
      operationId: patchClientPasswordResource
      parameters:
        - $ref: '#/components/parameters/language'
        - description: Client ID
          example: 1
          in: path
          name: client
          required: true
          schema:
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                password:
                  example: "Qwerty123"
                  type: string
                send_mail:
                  example: true
                  type: boolean
              required:
                - password
                - send_mail
      responses:
        "200":
          $ref: '#/components/responses/NoContent'
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Update Password
      tags:
        - Clients
    put:
      operationId: putClientPasswordResource
      parameters:
        - $ref: '#/components/parameters/language'
        - description: Client ID
          example: 1
          in: path
          name: client
          required: true
          schema:
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                password:
                  example: "Qwerty123"
                  type: string
                send_mail:
                  example: true
                  type: boolean
              required:
                - password
                - send_mail
      responses:
        "200":
          $ref: '#/components/responses/NoContent'
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Update Password
      tags:
        - Clients
  /api/v2/clients/{clientId}/reset-password:
    post:
      operationId: storeResetClientPassword
      parameters:
        - $ref: '#/components/parameters/language'
        -
          in: path
          name: clientId
          description: Client Id
          required: true
          example: 1
          schema:
            type: integer
      responses:
        "204":
          $ref: '#/components/responses/NoContent'
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Reset Client Password
      tags:
        - Clients
  /api/v2/clients/{clientId}/marketing-data:
    get:
      operationId: getClientMarketingDataCollection
      parameters:
        - $ref: '#/components/parameters/language'
        -
          in: path
          name: clientId
          description: Client Id
          required: true
          example: 1
          schema:
            type: integer
      responses:
        "200":
          content:
            application/json:
              schema:
                type: object
                properties:
                  total:
                    type: integer
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/ClientMarketingData'
          description: OK
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Get Client Marketing Data
      tags:
        - Marketing Data
    put:
      operationId: replaceClientMarketingData
      description: Replaces the client marketing data. Mutable fields missing from the payload are removed; immutable fields are kept and cannot be changed once set.
      parameters:
        - $ref: '#/components/parameters/language'
        -
          in: path
          name: clientId
          description: Client Id
          required: true
          example: 1
          schema:
            type: integer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ClientMarketingDataInput'
      responses:
        "200":
          content:
            application/json:
              schema:
                type: object
                properties:
                  total:
                    type: integer
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/ClientMarketingData'
          description: OK
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Replace Client Marketing Data
      tags:
        - Marketing Data
    patch:
      operationId: patchClientMarketingData
      description: Upserts the given client marketing data. Only the provided keys are inserted or updated; other fields are kept. Immutable fields cannot be changed once set.
      parameters:
        - $ref: '#/components/parameters/language'
        -
          in: path
          name: clientId
          description: Client Id
          required: true
          example: 1
          schema:
            type: integer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ClientMarketingDataInput'
      responses:
        "200":
          content:
            application/json:
              schema:
                type: object
                properties:
                  total:
                    type: integer
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/ClientMarketingData'
          description: OK
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Patch Client Marketing Data
      tags:
        - Marketing Data
  /api/v2/clients/types:
    get:
      operationId: getClientTypeCollection
      parameters:
        - $ref: '#/components/parameters/language'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
        - $ref: '#/components/parameters/order'
        - description: Sorts the items by a specified value
          example: createTime
          in: query
          name: sort_by
          required: false
          schema:
            default: createTime
            enum:
              - createTime
            type: string
        - description: Filters the items by a specified value
          in: query
          name: filter
          required: false
          schema:
            properties:
              enabled:
                type: boolean
              group:
                example: "individual"
                type: string
                enum:
                  - "individual"
                  - "corporative"
              name:
                example: "Individual"
                type: string
          style: deepObject
      responses:
        "200":
          content:
            application/json:
              schema:
                type: object
                properties:
                  total:
                    type: integer
                  data:
                    items:
                      $ref: '#/components/schemas/TypeClient'
                    type: array
          description: OK
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Get Client Types
      tags:
        - Clients
  /api/v2/clients/types/{type}:
    get:
      operationId: getClientTypeResource
      parameters:
        - $ref: '#/components/parameters/language'
        - description: Type ID
          example: 1
          in: path
          name: type
          required: true
          schema:
            type: integer
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TypeClient'
          description: OK
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Get Client Type Details
      tags:
        - Clients
  /api/v2/clients/check-credentials:
    post:
      operationId: checkClientCredentials
      summary: Check Client Credentials
      description: Allows to check client credentials by passing email and password. Returns client data if credentials are correct.
      tags:
        - Clients
      requestBody:
        description: Client credentials
        content:
          application/json:
            schema:
              type: object
              required:
                - email
                - password
              properties:
                email:
                  type: string
                  example: "alice@example.com"
                password:
                  type: string
                  example: "Pa$$w0rd"
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: object
                additionalProperties: false
                required:
                  - client
                properties:
                  client:
                    type: object
                    required:
                      - id
                      - email
                    additionalProperties: false
                    properties:
                      id:
                        type: integer
                        example: 42
                      email:
                        type: string
                        example: "alice@example.com"
        "400":
          $ref: '#/components/responses/BadRequest'
          description: Wrong credentials
        "404":
          $ref: '#/components/responses/NotFound'
  /api/v2/clients/magic-link:
    post:
      operationId: createMagicLink
      summary: Create MagicLink auth token
      description: Allows to create a temporary token for client authentication.
      tags:
        - Clients
      requestBody:
        description: Client data
        content:
          application/json:
            schema:
              type: object
              required:
                - clientId
              properties:
                clientId:
                  type: integer
                  example: 42
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: object
                additionalProperties: false
                required:
                  - data
                properties:
                  data:
                    type: object
                    additionalProperties: false
                    required:
                      - clientId
                      - token
                      - expiresAt
                    properties:
                      clientId:
                        type: integer
                        example: 42
                      token:
                        type: string
                        example: "72ba22e4e785575c747c9404294addef4b4cd46bd8eaa7acc8ab88b5f72a2b36"
                      expiresAt:
                        type: string
                        example: "2025-03-30T16:50:00+00:00"
        "400":
          $ref: '#/components/responses/BadRequest'
          description: Wrong Client ID

  /api/v2/countries:
    get:
      operationId: getCountryCollection
      parameters:
        - $ref: '#/components/parameters/language'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
        - $ref: '#/components/parameters/order'
        -
          description: Sorts the items by a specified value
          example: name
          in: query
          name: sort_by
          required: false
          schema:
            enum:
              - alpha2Code
              - alpha3Code
              - numericCode
              - name
              - isEnabled
            type: string
        -
          description: Filters the items by a specified value
          in: query
          name: filter
          required: false
          schema:
            properties:
              alpha2Code:
                example: "GB"
                type: string
              alpha3Code:
                example: "GBR"
                type: string
              numericCode:
                example: "826"
                type: string
              name:
                example: "United Kingdom"
                type: string
              isEnabled:
                example: true
                type: boolean
          style: deepObject
      responses:
        "200":
          content:
            application/json:
              schema:
                type: object
                properties:
                  total:
                    type: integer
                  data:
                    items:
                      $ref: '#/components/schemas/CountryListItem'
                    type: array
          description: OK
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Get Countries
      tags:
        - Countries
  /api/v2/deposits:
    post:
      operationId: makeDeposit
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  description: |
                    Optional idempotency key. MUST be a UUID version 7. When provided, repeated requests
                    with the same `id` will not create a duplicate deposit; the second call returns
                    HTTP 409 Conflict.
                  type: string
                  format: uuid
                  pattern: '^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$'
                  example: 0193fbd2-7c91-7a4c-9d3a-3f2c8a8a4f01
                accountId:
                  type: integer
                methodId:
                  type: integer
                amount:
                  nullable: false
                  type: number
                  example: 100
                providerCommission:
                  $ref: '#/components/schemas/decimal'
                vendorCommission:
                  $ref: '#/components/schemas/decimal'
                invoice:
                  type: string
                  nullable: true
                  maxLength: 255
                  example: "INV-2026-001"
                blockchainTransaction:
                  type: string
                  nullable: true
                  maxLength: 255
                  example: "0xabc123def456"
              required:
                - accountId
                - methodId
                - amount
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Transaction'
          description: Created
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "409":
          $ref: '#/components/responses/Conflict'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Make deposit
      tags:
        - Deposits
  /api/v2/deposits/wallets:
    get:
      operationId: getDepositWalletCollection
      parameters:
        - $ref: '#/components/parameters/language'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
        - $ref: '#/components/parameters/order'
        -
          description: Sorts the items by a specified value
          example: createTime
          in: query
          name: sort_by
          required: false
          schema:
            default: createTime
            enum:
              - createTime
              - updateTime
            type: string
        -
          description: Filters the items by a specified value
          in: query
          name: filter
          required: false
          schema:
            properties:
              clientId:
                oneOf:
                  - type: integer
                  - type: string
                    pattern: '^\d+$'
                description: Filter by client ID
              address:
                type: string
                description: Search by wallet address
              message:
                type: string
                description: Search by wallet message/memo
              methodId:
                oneOf:
                  - type: integer
                  - type: string
                    pattern: '^\d+$'
                description: Filter by payment method ID
              currencyCode:
                oneOf:
                  - type: integer
                  - type: string
                    pattern: '^\d+$'
                description: Filter by currency code
          style: deepObject
      responses:
        "200":
          content:
            application/json:
              schema:
                type: object
                properties:
                  total:
                    type: integer
                  data:
                    items:
                      $ref: '#/components/schemas/DepositWallet'
                    type: array
          description: OK
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Get Deposit Wallets
      tags:
        - Deposits
  /api/v2/transfers:
    post:
      operationId: createTransferResource
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                clientId:
                  type: integer
                  description: "Client ID"
                  example: 1
                sourceId:
                  type: integer
                  example: 2
                  description: "Source Account ID"
                destinationId:
                  type: integer
                  example: 3
                  description: "Destination Account ID"
                amount:
                  $ref: '#/components/schemas/decimal'
              required:
                - clientId
                - sourceId
                - destinationId
                - amount
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Transaction'
          description: OK
        "202":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Transaction'
          description: OK
      summary: Create Transfer
      tags:
        - Transactions
  /api/v2/documents:
    get:
      operationId: getDocumentCollection
      parameters:
        - $ref: '#/components/parameters/language'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
        -
          description: Filters the items by a specified value
          in: query
          name: filter
          required: false
          schema:
            properties:
              clientId:
                type: integer
          style: deepObject
      responses:
        "200":
          content:
            application/json:
              schema:
                type: object
                properties:
                  total:
                    type: integer
                  data:
                    items:
                      $ref: '#/components/schemas/Document'
                    type: array
          description: OK
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Get Document
      tags:
        - Documents
    post:
      operationId: createDocumentResource
      parameters:
        - $ref: '#/components/parameters/language'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                clientId:
                  type: integer
                file:
                  type: string
                  format: binary
                status:
                  example: "new"
                  type: string
                  enum:
                    - "new"
                    - "approved"
                    - "rejected"
                typeId:
                  type: integer
              required:
                - clientId
                - file
                - status
                - typeId
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Document'
          description: Created
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Create a new Document
      tags:
        - Documents
  /api/v2/documents/{document}:
    get:
      operationId: getDocumentResource
      parameters:
        - $ref: '#/components/parameters/language'
        -
          description: Document ID
          example: 1
          in: path
          name: document
          required: true
          schema:
            type: integer
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Document'
          description: OK
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Get Document Details
      tags:
        - Documents
    delete:
      operationId: deleteDocumentResource
      parameters:
        -
          description: Document ID
          example: 1
          in: path
          name: document
          required: true
          schema:
            type: integer
      responses:
        "204":
          description: No Content
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Delete Document
      tags:
        - Documents
  /api/v2/phones:
    get:
      operationId: getPhoneCollection
      parameters:
        - $ref: '#/components/parameters/language'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
        - $ref: '#/components/parameters/order'
        -
          description: Sorts the items by a specified value
          example: createTime
          in: query
          name: sort_by
          required: false
          schema:
            default: createTime
            enum:
              - createTime
              - updateTime
            type: string
        -
          description: Filters the items by a specified value
          in: query
          name: filter
          required: false
          schema:
            properties:
              clientId:
                type: integer
              confirmed:
                type: boolean
              ext:
                example: "812"
                type: string
              number:
                example: "+79992082115"
                type: string
          style: deepObject
      responses:
        "200":
          content:
            application/json:
              schema:
                type: object
                properties:
                  total:
                    type: integer
                  data:
                    items:
                      $ref: '#/components/schemas/Phone'
                    type: array
          description: OK
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Get Phones
      tags:
        - Phones
    post:
      operationId: createPhoneResource
      parameters:
        - $ref: '#/components/parameters/language'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                clientId:
                  $ref: '#/components/schemas/nullableInteger'
                default:
                  type: boolean
                ext:
                  example: "812"
                  type: string
                number:
                  example: "+79992082115"
                  type: string
              required:
                - clientId
                - default
                - number
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Phone'
          description: Created
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Create a new Phone
      tags:
        - Phones
  /api/v2/phones/{phone}:
    get:
      operationId: getPhoneResource
      parameters:
        - $ref: '#/components/parameters/language'
        -
          description: Phone ID
          example: 1
          in: path
          name: phone
          required: true
          schema:
            type: integer
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Phone'
          description: OK
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Get Phone Details
      tags:
        - Phones
    put:
      operationId: putPhoneResource
      parameters:
        - $ref: '#/components/parameters/language'
        -
          description: Phone ID
          example: 1
          in: path
          name: phone
          required: true
          schema:
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                default:
                  type: boolean
                confirmed:
                  type: boolean
                ext:
                  example: "812"
                  type: string
                number:
                  example: "+79992082115"
                  type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Phone'
          description: OK
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Update Phone
      tags:
        - Phones
    patch:
      operationId: patchPhoneResource
      parameters:
        - $ref: '#/components/parameters/language'
        -
          description: Phone ID
          example: 1
          in: path
          name: phone
          required: true
          schema:
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                default:
                  type: boolean
                confirmed:
                  type: boolean
                ext:
                  example: "812"
                  type: string
                number:
                  example: "+79992082115"
                  type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Phone'
          description: OK
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Update Phone
      tags:
        - Phones
    delete:
      operationId: deletePhoneResource
      parameters:
        - description: Phone ID
          example: 1
          in: path
          name: phone
          required: true
          schema:
            type: integer
      responses:
        "204":
          $ref: '#/components/responses/NoContent'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Delete a Phone
      tags:
        - Phones
  /api/v2/refresh:
    post:
      operationId: refresh
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                refreshToken:
                  example: "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiIxIiwiaWF0IjoxNjU2MDY3MTU0LCJleHAiOjE2NTYxMDMxNTQsImlzcyI6Imh0dHBzOlwvXC9hcC52ZW5kb3IuY29tIn0.u6HuS_oQ4udk2EEUa-7XutJ0CAKIZty1OcFaqTckLRGYEr3xcWXZEHCfrhDl31N6_t0XP6_m-ESue_NoWx_f1sGMv6XMT0pPg1NQ1XJ1JJ4slaeEWjSuGIl8_Jbj-20zZOvwzUZbed7UQg0jUM11OUt0l1jVVSF19vKJJpVGFDYMIOHkS7tlFeKiypReYRd2af-Pf_au1v6vG3V42SFpZER3eKqALZkoT617B35enJdtUqmyrRgb_rCIOCwAHQdUcOuosyBUk9U-Cz3WEoHx5nqtvFVAeXKqlbn0Cbqk4joFt1FY8nUqlyVZNI9E3-dbjFPzod8Vej6rkAVd312M3w"
                  type: string
              required:
                - refreshToken
      responses:
        "200":
          content:
            application/json:
              schema:
                type: object
                properties:
                  accessToken:
                    type: object
                    properties:
                      token:
                        example: "wyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiIxIiwiaWF0IjoxNjU2MDY3MTU0LCJleHAiOjE2NTYxMDMxNTQsImlzcyI6Imh0dHBzOlwvXC9hcC52ZW5kb3IuY29tIn0.u6HuS_oQ4udk2EEUa-7XutJ0CAKIZty1OcFaqTckLRGYEr3xcWXZEHCfrhDl31N6_t0XP6_m-ESue_NoWx_f1sGMv6XMT0pPg1NQ1XJ1JJ4slaeEWjSuGIl8_Jbj-20zZOvwzUZbed7UQg0jUM11OUt0l1jVVSF19vKJJpVGFDYMIOHkS7tlFeKiypReYRd2af-Pf_au1v6vG3V42SFpZER3eKqALZkoT617B35enJdtUqmyrRgb_rCIOCwAHQdUcOuosyBUk9U-Cz3WEoHx5nqtvFVAeXKqlbn0Cbqk4joFt1FY8nUqlyVZNI9E3-dbjFPzod8Vej6rkAVd312M3w"
                        type: string
                      createdAt:
                        $ref: '#/components/schemas/dateTime'
                      expiresAt:
                        $ref: '#/components/schemas/dateTime'
                  refreshToken:
                    type: object
                    properties:
                      token:
                        example: "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiIxIiwiaWF0IjoxNjU2MDY3MTU0LCJleHAiOjE2NTYxMDMxNTQsImlzcyI6Imh0dHBzOlwvXC9hcC52ZW5kb3IuY29tIn0.u6HuS_oQ4udk2EEUa-7XutJ0CAKIZty1OcFaqTckLRGYEr3xcWXZEHCfrhDl31N6_t0XP6_m-ESue_NoWx_f1sGMv6XMT0pPg1NQ1XJ1JJ4slaeEWjSuGIl8_Jbj-20zZOvwzUZbed7UQg0jUM11OUt0l1jVVSF19vKJJpVGFDYMIOHkS7tlFeKiypReYRd2af-Pf_au1v6vG3V42SFpZER3eKqALZkoT617B35enJdtUqmyrRgb_rCIOCwAHQdUcOuosyBUk9U-Cz3WEoHx5nqtvFVAeXKqlbn0Cbqk4joFt1FY8nUqlyVZNI9E3-dbjFPzod8Vej6rkAVd312M3w"
                        type: string
                      createdAt:
                        $ref: '#/components/schemas/dateTime'
                      expiresAt:
                        $ref: '#/components/schemas/dateTime'
          description: OK
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Refresh the Access Token
      tags:
        - Auth
  /api/v2/signin:
    post:
      security: []
      operationId: signIn
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                email:
                  example: "foo@bar.com"
                  type: string
                password:
                  example: "Secret123"
                  type: string
              required:
                - email
                - password
      responses:
        "200":
          content:
            application/json:
              schema:
                type: object
                properties:
                  2faRequired:
                    example: false
                    type: boolean
                    deprecated: true
                    description: "Always false. There is no 2FA for Machine-Machine auth."
                  accessToken:
                    type: object
                    properties:
                      token:
                        example: "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiIxIiwiaWF0IjoxNjU2MDY3MTU0LCJleHAiOjE2NTYxMDMxNTQsImlzcyI6Imh0dHBzOlwvXC9hcC52ZW5kb3IuY29tIn0.u6HuS_oQ4udk2EEUa-7XutJ0CAKIZty1OcFaqTckLRGYEr3xcWXZEHCfrhDl31N6_t0XP6_m-ESue_NoWx_f1sGMv6XMT0pPg1NQ1XJ1JJ4slaeEWjSuGIl8_Jbj-20zZOvwzUZbed7UQg0jUM11OUt0l1jVVSF19vKJJpVGFDYMIOHkS7tlFeKiypReYRd2af-Pf_au1v6vG3V42SFpZER3eKqALZkoT617B35enJdtUqmyrRgb_rCIOCwAHQdUcOuosyBUk9U-Cz3WEoHx5nqtvFVAeXKqlbn0Cbqk4joFt1FY8nUqlyVZNI9E3-dbjFPzod8Vej6rkAVd312M3w"
                        type: string
                      createdAt:
                        $ref: '#/components/schemas/dateTime'
                      expiresAt:
                        $ref: '#/components/schemas/dateTime'
                    description: Response with disabled 2fa
                  refreshToken:
                    type: object
                    properties:
                      token:
                        example: "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiIxIiwiaWF0IjoxNjU2MDY3MTU0LCJleHAiOjE2NTYxMDMxNTQsImlzcyI6Imh0dHBzOlwvXC9hcC52ZW5kb3IuY29tIn0.u6HuS_oQ4udk2EEUa-7XutJ0CAKIZty1OcFaqTckLRGYEr3xcWXZEHCfrhDl31N6_t0XP6_m-ESue_NoWx_f1sGMv6XMT0pPg1NQ1XJ1JJ4slaeEWjSuGIl8_Jbj-20zZOvwzUZbed7UQg0jUM11OUt0l1jVVSF19vKJJpVGFDYMIOHkS7tlFeKiypReYRd2af-Pf_au1v6vG3V42SFpZER3eKqALZkoT617B35enJdtUqmyrRgb_rCIOCwAHQdUcOuosyBUk9U-Cz3WEoHx5nqtvFVAeXKqlbn0Cbqk4joFt1FY8nUqlyVZNI9E3-dbjFPzod8Vej6rkAVd312M3w"
                        type: string
                      createdAt:
                        $ref: '#/components/schemas/dateTime'
                      expiresAt:
                        $ref: '#/components/schemas/dateTime'
                    description: Response with disabled 2fa
                required:
                  - 2faRequired
          description: OK
        "400":
          $ref: '#/components/responses/BadRequest'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Sign In
      tags:
        - Auth
  /api/v2/signout:
    post:
      operationId: signOut
      responses:
        "200":
          $ref: '#/components/responses/NoContent'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Sign Out
      tags:
        - Auth
  /api/v2/exchanges:
    post:
      operationId: createExchangeResource
      parameters:
        - $ref: '#/components/parameters/language'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                sourceId:
                  type: integer
                  example: 1
                destinationId:
                  type: integer
                  example: 2
                type:
                  type: string
                  enum: ["source", "destination", "rate"]
                  example: "source"
                amount:
                  type: string
                  nullable: true
                  example: "100.50"
                destinationAmount:
                  type: string
                  nullable: true
                  example: "95.25"
                rate:
                  type: string
                  nullable: true
                  example: "1.055"
                writeOff:
                  type: string
                  nullable: true
                  example: "100.50"
                enroll:
                  type: string
                  nullable: true
                  example: "95.25"
              required:
                - sourceId
                - destinationId
                - type
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Transaction'
          description: Created
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Create a new Exchange
      tags:
        - Transactions
  /api/v2/transactions:
    get:
      operationId: getTransactionCollection
      parameters:
        - $ref: '#/components/parameters/language'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
        - $ref: '#/components/parameters/order'
        -
          description: Sorts the items by a specified value
          example: createTime
          in: query
          name: sort_by
          required: false
          schema:
            default: createTime
            enum:
              - createTime
            type: string
        -
          description: Filters the items by a specified value
          in: query
          name: filter
          required: false
          schema:
            properties:
              accountId:
                $ref: '#/components/schemas/nullableInteger'
              clientId:
                $ref: '#/components/schemas/nullableInteger'
              creditAccountNumber:
                $ref: '#/components/schemas/nullableInteger'
              debitAccountNumber:
                $ref: '#/components/schemas/nullableInteger'
              status:
                $ref: '#/components/schemas/TransactionStatus'
              type:
                $ref: '#/components/schemas/TransactionType'
              fromCreateTime:
                $ref: '#/components/schemas/dateTime'
              toCreateTime:
                $ref: '#/components/schemas/dateTime'
              fromProcessedTime:
                $ref: '#/components/schemas/dateTime'
              toProcessedTime:
                $ref: '#/components/schemas/dateTime'
          style: deepObject
      responses:
        "200":
          content:
            application/json:
              schema:
                type: object
                properties:
                  total:
                    type: integer
                  data:
                    items:
                      $ref: '#/components/schemas/Transaction'
                    type: array
          description: OK
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Get Transactions
      tags:
        - Transactions
  /api/v2/transactions/{transactionId}:
    get:
      operationId: getTransactionResource
      parameters:
        - $ref: '#/components/parameters/language'
        -
          description: Transaction ID
          example: "1"
          in: path
          name: transactionId
          required: true
          schema:
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Transaction'
          description: OK
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Get Transaction Details
      tags:
        - Transactions
    put:
      operationId: putTransactionResource
      parameters:
        - $ref: '#/components/parameters/language'
        -
          description: Transaction ID
          example: 1
          in: path
          name: transactionId
          required: true
          schema:
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                verificationStatus:
                  $ref: '#/components/schemas/DepositVerificationStatus'
                providerCommission:
                  $ref: '#/components/schemas/decimal'
                commission:
                  $ref: '#/components/schemas/decimal'
                blockchainTransaction:
                  example: Lorem ipsum
                  type: string
                  maxLength: 40
                foreignExchangeRate:
                  $ref: '#/components/schemas/nullableDecimal'
                internalComment:
                  example: Lorem ipsum dolor sit amet
                  type: string
                resultDate:
                  type: string
                  example: '2020-01-01 00:00:00'
                dealingStatus:
                  $ref: '#/components/schemas/WithdrawalDealingStatus'
                complianceStatus:
                  $ref: '#/components/schemas/WithdrawalComplianceStatus'
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Transaction'
          description: OK
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Update Transaction
      tags:
        - Transactions
    patch:
      operationId: patchTransactionResource
      parameters:
        - $ref: '#/components/parameters/language'
        -
          description: Transaction ID
          example: 1
          in: path
          name: transactionId
          required: true
          schema:
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                verificationStatus:
                  $ref: '#/components/schemas/DepositVerificationStatus'
                providerCommission:
                  $ref: '#/components/schemas/decimal'
                commission:
                  $ref: '#/components/schemas/decimal'
                blockchainTransaction:
                  example: Lorem ipsum
                  type: string
                  maxLength: 40
                foreignExchangeRate:
                  $ref: '#/components/schemas/nullableDecimal'
                internalComment:
                  example: Lorem ipsum dolor sit amet
                  type: string
                resultDate:
                  type: string
                  example: '2020-01-01 00:00:00'
                dealingStatus:
                  $ref: '#/components/schemas/WithdrawalDealingStatus'
                complianceStatus:
                  $ref: '#/components/schemas/WithdrawalComplianceStatus'
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Transaction'
          description: OK
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Update Transaction
      tags:
        - Transactions
  /api/v2/transactions/{transactionId}/check:
    post:
      operationId: checkTransaction
      parameters:
        - $ref: '#/components/parameters/language'
        -
          description: Transaction ID
          example: 1
          in: path
          name: transactionId
          required: true
          schema:
            type: integer
      responses:
        "202":
          $ref: '#/components/responses/NoContent'
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Check Transaction
      tags:
        - Transactions
  /api/v2/transactions/types:
    get:
      operationId: getTransactionTypeCollection
      parameters:
        - $ref: '#/components/parameters/language'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
      responses:
        "200":
          content:
            application/json:
              schema:
                type: object
                properties:
                  total:
                    type: integer
                  data:
                    items:
                      $ref: '#/components/schemas/OperationType'
                    type: array
          description: OK
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Get Transaction Types
      tags:
        - Transactions
  /api/v2/transactions/types/{type}:
    get:
      operationId: getTransactionTypeResource
      parameters:
        - $ref: '#/components/parameters/language'
        -
          description: Type ID
          example: 1
          in: path
          name: type
          required: true
          schema:
            type: integer
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OperationType'
          description: OK
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Get Transaction Type Details
      tags:
        - Transactions
    put:
      operationId: putTransactionTypeResource
      parameters:
        - $ref: '#/components/parameters/language'
        -
          description: Type ID
          example: 1
          in: path
          name: type
          required: true
          schema:
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                caption:
                  example: "caption"
                  type: string
                enabled:
                  type: boolean
                options:
                  type: array
                  items:
                    type: object
                    example: {"operation_status": ["0"]}
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OperationType'
          description: OK
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Update Transaction Type
      tags:
        - Transactions
    patch:
      operationId: patchTransactionTypeResource
      parameters:
        - $ref: '#/components/parameters/language'
        -
          description: Type ID
          example: 1
          in: path
          name: type
          required: true
          schema:
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                caption:
                  example: "caption"
                  type: string
                enabled:
                  type: boolean
                options:
                  type: array
                  items:
                    type: object
                    example: {"operation_status": ["0"]}
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OperationType'
          description: OK
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Update Transaction Type
      tags:
        - Transactions
  /api/v2/users:
    get:
      operationId: getUserCollection
      parameters:
        - $ref: '#/components/parameters/language'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
        -
          description: Filters the items by a specified value
          in: query
          name: filter
          required: false
          schema:
            properties:
              name:
                example: "Mary"
                type: string
              email:
                example: "foo@bar.com"
                type: string
              active:
                example: 1
                minimum: 0
                maximum: 1
                type: integer
          style: deepObject
      responses:
        "200":
          content:
            application/json:
              schema:
                type: object
                additionalProperties: false
                properties:
                  total:
                    type: integer
                    example: 20
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/User'
          description: OK
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Get Users
      tags:
        - Users
  /api/v2/users/{user}:
    get:
      operationId: getUserResource
      parameters:
        - $ref: '#/components/parameters/language'
        -
          description: User ID
          example: 1
          in: path
          name: user
          required: true
          schema:
            type: integer
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/User'
          description: OK
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Get User Details
      tags:
        - Users
  /api/v2/verifications:
    get:
      operationId: getVerificationCollection
      parameters:
        - $ref: '#/components/parameters/language'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
        - $ref: '#/components/parameters/order'
        -
          description: Sorts the items by a specified value
          example: createTime
          in: query
          name: sort_by
          required: false
          schema:
            default: createTime
            enum:
              - createTime
            type: string
        -
          description: Filters the items by a specified value
          in: query
          name: filter
          required: false
          schema:
            properties:
              clientId:
                $ref: '#/components/schemas/nullableInteger'
          style: deepObject
      responses:
        "200":
          content:
            application/json:
              schema:
                type: object
                properties:
                  total:
                    type: integer
                  data:
                    items:
                      $ref: '#/components/schemas/Verification'
                    type: array
          description: OK
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Get Verification
      tags:
        - Verifications
  /api/v2/verifications/{verificationId}:
    get:
      operationId: getVerificationResource
      parameters:
        - $ref: '#/components/parameters/language'
        -
          description: Verification ID
          example: "1"
          in: path
          name: verificationId
          required: true
          schema:
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Verification'
          description: OK
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Get Verification Details
      tags:
        - Verifications
  /api/v2/withdrawals:
    post:
      operationId: makeWithdrawal
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  description: |
                    Optional idempotency key. MUST be a UUID version 7. When provided, repeated requests
                    with the same `id` will not create a duplicate withdrawal; the second call returns
                    HTTP 409 Conflict.
                  type: string
                  format: uuid
                  pattern: '^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$'
                  example: 0193fbd2-7c91-7a4c-9d3a-3f2c8a8a4f01
                accountId:
                  type: integer
                methodId:
                  type: integer
                amount:
                  nullable: false
                  type: number
                  example: 100
                providerCommission:
                  $ref: '#/components/schemas/decimal'
                vendorCommission:
                  $ref: '#/components/schemas/decimal'
              required:
                - accountId
                - methodId
                - amount
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Transaction'
          description: Created
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "409":
          $ref: '#/components/responses/Conflict'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Make withdrawal
      tags:
        - Withdrawals
  /api/v2/jurisdictions:
    get:
      operationId: getJurisdictionCollection
      responses:
        "200":
          content:
            application/json:
              schema:
                type: object
                properties:
                  total:
                    type: integer
                  data:
                    items:
                      $ref: '#/components/schemas/Jurisdiction'
                    type: array
          description: OK
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Get Jurisdictions
      tags:
        - Jurisdictions

  /api/v2/tags:
    get:
      operationId: getTagCollection
      parameters:
        - $ref: '#/components/parameters/language'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
        - $ref: '#/components/parameters/order'
        -
          description: Sorts the items by a specified value
          example: createTime
          in: query
          name: sort_by
          required: false
          schema:
            default: createTime
            enum:
              - createTime
            type: string
        -
          description: Filters the items by a specified value
          in: query
          name: filter
          required: false
          schema:
            properties:
              type:
                type: string
                enum:
                  - clients
                default: clients
          style: deepObject
      responses:
        "200":
          content:
            application/json:
              schema:
                type: object
                properties:
                  total:
                    type: integer
                  data:
                    items:
                      $ref: '#/components/schemas/Tag'
                    type: array
          description: OK
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Get Tags
      tags:
        - Tags
  /api/v2/rates/providers:
    get:
      operationId: getRateProviderCollection
      parameters:
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/offset'
        - $ref: '#/components/parameters/order'
        -
          description: Sorts the items by a specified value
          example: priority
          in: query
          name: sort_by
          required: false
          schema:
            default: priority
            enum:
              - priority
              - createTime
            type: string
        -
          description: Filters the items by a specified value
          in: query
          name: filter
          required: false
          schema:
            properties:
              provider:
                type: string
                description: Filter by provider type
              enabled:
                type: boolean
                description: Filter by enabled status
          style: deepObject
      responses:
        "200":
          content:
            application/json:
              schema:
                type: object
                properties:
                  total:
                    type: integer
                  data:
                    items:
                      $ref: '#/components/schemas/RateProvider'
                    type: array
          description: OK
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Get Rate Providers
      tags:
        - Rates
  /api/v2/rates/custom/{id}:
    post:
      operationId: updateCustomRateProvider
      parameters:
        -
          description: Rate Provider ID
          example: 1
          in: path
          name: id
          required: true
          schema:
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                rate:
                  type: string
                  description: The custom rate value
                  example: "1.2345"
                baseCurrency:
                  type: string
                  description: The base currency alpha code
                  example: "USD"
                  nullable: true
                  maxLength: 10
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateProvider'
          description: OK
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Update Custom Rate Provider
      tags:
        - Rates
  /clients/{clientId}/folders:
    post:
      operationId: storeClientFolder
      parameters:
        - $ref: '#/components/parameters/language'
        - in: path
          name: clientId
          description: Client Id
          required: true
          example: 1
          schema:
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                caption:
                  example: "Folder"
                  maxLength: 255
                  nullable: false
                  type: string
                directoryId:
                  type: integer
      responses:
        "201":
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: integer
                  name:
                    type: string
                    example: Folder
                  clientId:
                    type: integer
                  directoryId:
                    $ref: '#/components/schemas/nullableInteger'
                  treeFolderId:
                    $ref: '#/components/schemas/nullableInteger'
          description: Created
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      summary: Store Client Folder
      tags:
        - Clients File Directories
  /api/v2/savings/plans:
    get:
      summary: Get a list of savings plans
      description: Use this method to get a list of all savings plans.
      parameters:
        - description: Client ID
          example: "1"
          in: query
          name: clientId
          required: false
          schema:
            type: string
        - description: Status
          example: "active"
          in: query
          name: status
          required: false
          schema:
            type: string
            enum:
              - "active"
              - "cancelled"
              - "completed"
        - description: Strategy
          example: "fixed"
          in: query
          name: strategy
          required: false
          schema:
            type: string
            enum:
              - "fixed"
              - "flexible"
        - description: Preset ID
          example: "46280343-9089-4faf-9f5c-de90691d1db5"
          in: query
          name: presetId
          required: false
          schema:
            type: string
        - description: Created at FROM
          example: "2025-04-30T10:20:16%2B00:00"
          in: query
          name: fromCreateTime
          required: false
          schema:
            type: string
        - description: Created at TO
          example: "2025-06-30T10:20:16%2B00:00"
          in: query
          name: toCreateTime
          required: false
          schema:
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    items:
                      $ref: '#/components/schemas/SavingsPlan'
                    type: array
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      tags:
        - Savings
  /api/v2/savings/plans/{plan_id}:
    get:
      summary: Get a list of savings plans
      description: Use this method to get a list of all savings plans.
      parameters:
        - description: Savings plan ID
          example: "abc3fdb0-2002-4ede-a2d2-57d279b64608"
          in: path
          name: plan_id
          required: true
          schema:
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SavingsPlanExtended'
        "400":
          $ref: '#/components/responses/BadRequest'
        "401":
          $ref: '#/components/responses/Unauthorized'
        "403":
          $ref: '#/components/responses/Forbidden'
        "404":
          $ref: '#/components/responses/NotFound'
        "429":
          $ref: '#/components/responses/TooManyRequests'
        "503":
          $ref: '#/components/responses/ServiceUnavailable'
      tags:
        - Savings
components:
  parameters:
    language:
      example: ja
      in: header
      name: accept-language
      required: false
      schema:
        type: string
    limit:
      description: Sets the limit
      example: 10
      in: query
      name: limit
      required: false
      schema:
        default: 10
        minimum: 1
        maximum: 500
        type: integer
    offset:
      description: Sets the offset
      example: 0
      in: query
      name: offset
      required: false
      schema:
        default: 0
        minimum: 0
        type: integer
    order:
      description: Sorts the items in ascending or descending order
      example: desc
      in: query
      name: sort_order
      required: false
      schema:
        default: desc
        enum:
          - asc
          - desc
        type: string
  responses:
    BadRequest:
      content:
        application/json:
          schema:
            properties:
              error:
                properties:
                  message:
                    example: Bad Request
                    type: string
                  code:
                    example: 0
                    type: integer
                    enum:
                      - 0
                      - 1
                    description: "1 - showable message, 0 - default message (Bad Request)"
                  details:
                    items:
                      properties:
                        issue:
                          example: "The selected value is invalid."
                          type: string
                        field:
                          example: "parameter"
                          type: string
                      type: object
                    type: array
                type: object
      description: Bad Request
    Conflict:
      content:
        application/json:
          schema:
            properties:
              error:
                properties:
                  message:
                    example: Conflict
                    type: string
                type: object
      description: Conflict
    Forbidden:
      content:
        application/json:
          schema:
            properties:
              error:
                properties:
                  message:
                    example: Forbidden
                    type: string
                type: object
      description: Forbidden
    NoContent:
      description: No Content
    NotFound:
      content:
        application/json:
          schema:
            properties:
              error:
                properties:
                  message:
                    example: Not Found
                    type: string
                type: object
      description: Not Found
    ServiceUnavailable:
      content:
        application/json:
          schema:
            properties:
              error:
                properties:
                  message:
                    example: Service Unavailable
                    type: string
                type: object
      description: Service Unavailable
    TooManyRequests:
      content:
        application/json:
          schema:
            properties:
              error:
                properties:
                  message:
                    example: Too Many Requests
                    type: string
                type: object
      description: Too Many Requests
    Unauthorized:
      content:
        application/json:
          schema:
            properties:
              error:
                properties:
                  message:
                    example: Unauthorized
                    type: string
                type: object
      description: Unauthorized
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http
  schemas:
    dateTime:
      example: '2022-01-01T00:00:00+00:00'
      format: date-time
      type: string
    decimal:
      example: "1.000000000000000000"
      format: double
      type: string
    nullableDateTime:
      oneOf:
        - type: string
          example: '2022-01-01T00:00:00+00:00'
        - type: "null"
    nullableDecimal:
      example: "1.000000000000000000"
      format: double
      nullable: true
      type: string
    nullableInteger:
      example: 1
      nullable: true
      type: integer
    Account:
      type: object
      properties:
        accountId:
          type: integer
        accountNumber:
          example: "12345678"
          type: string
        displayNumber:
          type: string
          description: The human-readable account number displayed to the user.
          example: "12345678"
        clientId:
          type: integer
        caption:
          type: string
          example: Bitcoin
        currency:
          $ref: '#/components/schemas/Currency'
        group:
          $ref: '#/components/schemas/AccountGroup'
        name:
          example: "USD"
          type: string
        archive:
          type: boolean
          example: false
        permissions:
          example: ["deposit", "trade", "withdrawal"]
          type: array
          items:
            $ref: '#/components/schemas/AccountPermission'
        platform:
          $ref: '#/components/schemas/PlatformEmbedded'
        product:
          $ref: '#/components/schemas/AccountProduct'
        statement:
          $ref: '#/components/schemas/Statement'
        type:
          example: "trade"
          nullable: true
          type: string
        archiveTime:
          $ref: '#/components/schemas/nullableDateTime'
        createTime:
          $ref: '#/components/schemas/nullableDateTime'
        updateTime:
          $ref: '#/components/schemas/nullableDateTime'
          description: |
            Time when the account was last updated. Reflects changes to attributes such as caption, rights, or archive flag; does not change on balance updates.
    B2CopyInvestmentAccount:
      type: object
      properties:
        id:
          type: integer
          example: 1
        is_master:
          type: boolean
          example: true
          description: Whether the account is a master (strategy) account.
        status:
          type: boolean
          example: false
          description: Whether the account is currently active.
        account_name:
          type: string
          nullable: true
          example: "My Strategy"
        account_description:
          type: string
          nullable: true
          example: "A conservative trading strategy."
        active_since:
          $ref: '#/components/schemas/nullableDateTime'
        minimum_deposit:
          type: number
          example: 0
        type:
          type: integer
          nullable: true
          example: 1
        closed_positions_limit:
          type: integer
          example: 100
        subscription_code:
          type: string
          nullable: true
          example: "ABC123"
        b2copy_id:
          type: integer
          nullable: true
          example: 42
        show_opened_positions:
          type: boolean
          example: true
        show_closed_positions:
          type: boolean
          example: true
        show_investor_opened_positions:
          type: boolean
          example: true
        show_investor_closed_positions:
          type: boolean
          example: true
        hide_time_positions:
          type: boolean
          example: false
        hide_investor_time_positions:
          type: boolean
          example: false
        options:
          type: object
          nullable: true
          description: Platform-specific configuration options.
        created_at:
          $ref: '#/components/schemas/nullableDateTime'
        updated_at:
          $ref: '#/components/schemas/nullableDateTime'
    AccountGroup:
      nullable: true
      type: object
      properties:
        id:
          type: integer
        name:
          example: "Fiat"
          type: string
    AccountPermission:
      type: string
      example: trade
      enum:
        - deposit
        - enabled
        - exchange
        - trade
        - transferDeposit
        - transferWithdrawal
        - visible
        - withdrawal
    AccountPreferences:
      type: object
      properties:
        leverage:
          $ref: '#/components/schemas/nullableInteger'
    AccountProduct:
      type: object
      properties:
        id:
          type: integer
        name:
          example: "Forex"
          type: string
    Address:
      type: object
      properties:
        id:
          type: integer
        address:
          example: "47 W 13th St, New York, NY 10011, USA"
          type: string
        city:
          example: "New York"
          type: string
        country:
          $ref: '#/components/schemas/Country'
        postcode:
          example: "0200 - 9729"
          type: string
        state:
          example: "New York"
          type: string
        type:
          example: "residential"
          type: string
          enum:
            - "residential"
            - "billing"
            - "mailing"
        clientId:
          type: integer
        createTime:
          $ref: '#/components/schemas/nullableDateTime'
        updateTime:
          $ref: '#/components/schemas/nullableDateTime'
    Application:
      nullable: true
      type: object
      properties:
        id:
          type: integer
        status:
          $ref: '#/components/schemas/ApplicationStatus'
        type:
          $ref: '#/components/schemas/ApplicationType'
        createTime:
          $ref: '#/components/schemas/nullableDateTime'
        processedTime:
          $ref: '#/components/schemas/nullableDateTime'
    ApplicationStatus:
      example: approved
      enum:
        - approved
        - inProgress
        - new
        - pending
        - rejected
      type: string
    ApplicationType:
      example: withdrawal
      enum:
        - account
        - address
        - archive
        - clientType
        - deposit
        - investment
        - partner
        - profile
        - transfer
        - verification
        - withdrawal
      nullable: true
      type: string
    AuthorizationHistory:
      type: object
      properties:
        id:
          type: integer
        client:
          type: object
          properties:
            id:
              type: integer
            fullName:
              type: string
              example: "John Doe"
            email:
              type: string
              example: "foo@bar.com"
        ip:
          type: string
          example: "192.168.1.1"
        authDateTime:
          $ref: '#/components/schemas/dateTime'
        status:
          type: string
          example: "success"
          enum:
            - "success"
            - "failure"
    Bonus:
      type: object
      properties:
        id:
          type: integer
        caption:
          oneOf:
            - type: string
              example: "Bonus caption"
            - type: "null"
        clientId:
          type: integer
        clientName:
          example: "Mary Smith"
          type: string
        clientEmail:
          example: "example@gmail.com"
          type: string
        account:
          example: "<a href=\"https://ap.vendor.com/accounts/edit/56\">2100237412</a>"
          type: string
        email:
          oneOf:
            - type: string
              example: "<a href=\"https://ap.vendor.com/accounts/edit/56\">jepy@mailinator.com</a>"
            - type: "null"
        amount:
          example: "0.000"
          type: string
        initialAmount:
          example: "100.00000000"
          type: string
          description: The original bonus amount at the time of creation
        volumeComplete:
          example: "0.00"
          type: string
        temporaryBonus:
          oneOf:
            - type: string
              example: "Bonus"
            - type: "null"
        currencyExp:
          type: integer
        fictiveVolumeComplete:
          example: "1.11"
          type: string
        lifetime:
          type: integer
        enableAutoCredit:
          type: boolean
        scalpingThreshold:
          example: 1
          type: integer
        enableTrade:
          type: boolean
        disabledGroups:
          example: ["EURJPY"]
          type: array
          items:
            type: string
        dynamicLots:
          example: "1.000"
          type: string
        status:
          example: "Expired"
          type: string
        activatedAt:
          $ref: '#/components/schemas/nullableDateTime'
        createdAt:
          $ref: '#/components/schemas/nullableDateTime'
        updatedAt:
          $ref: '#/components/schemas/nullableDateTime'
        createdBy:
          oneOf:
            - type: integer
              example: 123
            - type: "null"
          description: ID of the administrator who created the bonus
    BonusPreset:
      type: object
      properties:
        id:
          type: integer
        platform:
          example: "MetaTrader4"
          type: string
        name:
          example: "Preset"
          type: string
        priority:
          type: integer
        default:
          type: boolean
          deprecated: true
        lifetime:
          type: integer
        dynamicLots:
          example: "0.000"
          type: string
        enableAutoCredit:
          type: boolean
        scalpingThreshold:
          type: integer
        disabledGroups:
          example: "EURJPY, USDEUR"
          type: string
        enableTrade:
          type: boolean
        createdAt:
          $ref: '#/components/schemas/nullableDateTime'
        updatedAt:
          $ref: '#/components/schemas/nullableDateTime'
    BonusTemporary:
      type: object
      properties:
        id:
          type: integer
        amount:
          example: "0.000"
          type: string
        name:
          example: "Preset"
          type: string
        default:
          example: "55.55"
          type: string
        currency:
          example: "GBP"
          type: string
        dynamicLots:
          example: "1.00"
          type: string
        platform:
          example: "MetaTrader4"
          type: string
        platformGroups:
          example: ["EURJPY"]
          type: array
          items:
            type: string
        lifetime:
          type: integer
        enableAutoCredit:
          type: boolean
        scalpingThreshold:
          example: 1
          type: integer
        disabledGroups:
          example: ["EURJPY"]
          type: array
          items:
            type: string
        enableTrade:
          type: boolean
        expiredAt:
          $ref: '#/components/schemas/nullableDateTime'
        createdAt:
          $ref: '#/components/schemas/nullableDateTime'
        updatedAt:
          $ref: '#/components/schemas/nullableDateTime'
      required:
        - id
        - amount
        - name
        - dynamicLots
        - currency
        - platform
        - platformGroups
        - lifetime
        - enableAutoCredit
        - scalpingThreshold
        - disabledGroups
        - enableTrade
        - expiredAt
        - createdAt
        - updatedAt
    ClientAccounts:
      type: object
      properties:
        accountId:
          example: 6
          type: integer
        accountNumber:
          example: "3"
          type: string
        displayNumber:
          type: string
          example: "3"
    Client:
      type: object
      properties:
        analytics:
          type: array
          items:
            type: object
            properties:
              property:
                type: string
                example: umt
              value:
                type: string
                example: "1111"
        clientId:
          type: integer
        accounts:
          type: array
          items:
            type: object
            properties:
              accountId:
                type: integer
                example: 1
              accountNumber:
                type: string
                example: "123123"
              displayNumber:
                type: string
                example: "123123"
              createTime:
                $ref: "#/components/schemas/dateTime"
        birthday:
          $ref: '#/components/schemas/nullableDateTime'
        city:
          type: string
          nullable: true
        country:
          $ref: '#/components/schemas/CountryNullable'
        company:
          $ref: '#/components/schemas/CompanyNullable'
        email:
          example: "foo@bar.com"
          type: string
        internalType:
          $ref: '#/components/schemas/InternalType'
        firstName:
          example: Mary
          nullable: true
          type: string
        lastName:
          example: Smith
          nullable: true
          type: string
        middleName:
          example: "Jane"
          nullable: true
          type: string
        name:
          example: "Mary Jane Smith"
          nullable: false
          type: string
        nickname:
          example: "Voronov"
          nullable: true
          type: string
        locale:
          description: Locale code
          example: ja_JP
          nullable: true
          type: string
        manager:
          $ref: '#/components/schemas/ManagerNullable'
        phone:
          example: "+7 999 200 00 00"
          nullable: true
          type: string
        riskLevel:
          $ref: '#/components/schemas/RiskLevel'
        status:
          $ref: '#/components/schemas/ClientStatus'
        tags:
          type: array
          items:
            type: string
        type:
          $ref: '#/components/schemas/ClientType'
        verificationLevel:
          $ref: '#/components/schemas/LevelVerification'
        jurisdictionId:
          $ref: '#/components/schemas/nullableInteger'
        loggedAt:
          $ref: '#/components/schemas/nullableDateTime'
        createTime:
          $ref: '#/components/schemas/nullableDateTime'
        updateTime:
          $ref: '#/components/schemas/nullableDateTime'
        limits:
          description: Account limits configured for the client.
          type: object
          properties:
            maxDemoTradingAccounts:
              $ref: '#/components/schemas/nullableInteger'
            maxLiveTradingAccounts:
              $ref: '#/components/schemas/nullableInteger'
        rights:
          description: Client abilities (rights) effectively granted to the client.
          type: array
          items:
            $ref: '#/components/schemas/ClientAbility'
    ClientAbility:
      type: object
      required:
        - name
        - isEnabled
      properties:
        name:
          description: Ability name.
          example: deposit
          type: string
        isEnabled:
          description: Whether the ability is currently granted to the client.
          example: true
          type: boolean
    ClientStatus:
      example: active
      enum:
        - active
        - banned
        - deleted
        - inactive
      type: string
    ClientType:
      nullable: true
      type: object
      properties:
        id:
          type: integer
        name:
          example: "Individual"
          type: string
    CompanyNullable:
      type: object
      nullable: true
      properties:
        fullName:
          example: "full name company"
          nullable: true
          type: string
        shortName:
          example: "short name company"
          nullable: true
          type: string
    Country:
      type: object
      properties:
        countryId:
          example: 8
          nullable: true
          type: integer
        alpha2Code:
          example: "US"
          nullable: true
          type: string
        alpha3Code:
          example: "USA"
          nullable: true
          type: string
        countryName:
          example: "United States"
          nullable: true
          type: string
        numericCode:
          example: "840"
          nullable: true
          type: string
    CountryListItem:
      type: object
      properties:
        id:
          example: 826
          type: integer
        name:
          example: "United Kingdom"
          type: string
        alpha2Code:
          example: "GB"
          type: string
        alpha3Code:
          example: "GBR"
          type: string
        numericCode:
          example: "826"
          type: string
        isEnabled:
          example: true
          type: boolean
    CountryNullable:
      type: object
      nullable: true
      properties:
        countryId:
          example: 8
          nullable: true
          type: integer
        alpha2Code:
          example: "US"
          nullable: true
          type: string
        alpha3Code:
          example: "USA"
          nullable: true
          type: string
        countryName:
          example: "United States"
          nullable: true
          type: string
        numericCode:
          example: "840"
          nullable: true
          type: string
    Currency:
      type: object
      properties:
        alphabeticCode:
          example: USD
          type: string
        minorUnit:
          example: 2
          type: integer
        name:
          example: US Dollar
          type: string
        numericCode:
          example: 840
          type: integer
    DepositMeta:
      nullable: true
      type: object
      properties:
        id:
          example: 479
          type: integer
          description: The deposit meta identifier.
        blockchainTransaction:
          example: "Lorem ipsum"
          type: string
          nullable: true
        comment:
          example: "Lorem ipsum dolor sit amet"
          type: string
          nullable: true
        invoice:
          example: "gNqHzjlhrw"
          type: string
          nullable: true
        providerCommission:
          $ref: '#/components/schemas/decimal'
        providerOptions:
          example:
            - key: beneficiary_name
              value: John Smith
            - key: bank_account_number
              value: "12345678"
            - key: bank_name
              value: Citibank
            - key: bank_address
              value: 388 Greenwich Street, New York, NY 10013, USA
          type: array
          items:
            $ref: '#/components/schemas/KeyValuePair'
        verificationStatus:
          $ref: '#/components/schemas/DepositVerificationStatus'
        createTime:
          $ref: '#/components/schemas/nullableDateTime'
        invoiceTime:
          $ref: '#/components/schemas/nullableDateTime'
        updateTime:
          $ref: '#/components/schemas/nullableDateTime'
    DepositVerificationStatus:
      example: approved
      enum:
        - approved
        - new
        - pending
      type: string
    DepositWallet:
      type: object
      properties:
        id:
          type: integer
          description: Wallet ID
        clientId:
          type: integer
          description: Client ID
        accountId:
          type: integer
          description: Account ID
        methodId:
          type: integer
          description: Payment method ID
        currencyCode:
          type: integer
          description: Currency code
        address:
          type: string
          example: "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa"
          description: Crypto wallet address
        message:
          type: string
          example: "memo123"
          description: Wallet memo/message/tag
        type:
          type: ['string', 'null']
          description: Wallet type
        blockchainLabel:
          type: ['string', 'null']
          example: "Ethereum (ERC-20)"
          description: Human-readable label of the blockchain the address belongs to
        createTime:
          $ref: '#/components/schemas/nullableDateTime'
        updateTime:
          $ref: '#/components/schemas/nullableDateTime'
    Document:
      type: object
      properties:
        id:
          type: integer
        type:
          $ref: '#/components/schemas/DocumentType'
        status:
          example: "approved"
          nullable: true
          type: string
        applicationId:
          $ref: '#/components/schemas/nullableInteger'
        files:
          example:
            - id: 8
              file: "y/1662913861_photo_2022-09-08_11-23-06.jpg"
          type: array
          items:
            $ref: '#/components/schemas/Files'
        createTime:
          $ref: '#/components/schemas/nullableDateTime'
    DocumentGroup:
      type: object
      properties:
        id:
          type: integer
        description:
          example: "Documents by corporate clients"
          type: string
        enabled:
          type: boolean
        name:
          example: "corporate"
          maxLength: 255
          type: string
        priority:
          example: 1
          default: 1
          minimum: 1
          type: integer
        type:
          example: "one"
          type: string
          enum:
            - "one"
            - "all"
    DocumentType:
      type: object
      properties:
        id:
          type: integer
        description:
          example: "Types of documents by corporate clients"
          type: string
        enabled:
          type: boolean
        example:
          example: "example"
          maxLength: 255
          type: string
        group:
          $ref: '#/components/schemas/DocumentGroup'
        maxFiles:
          example: 10
          maximum: 255
          type: integer
        name:
          example: "corporate"
          maxLength: 255
          type: string
        priority:
          example: 1
          default: 1
          minimum: 1
          type: integer
    Files:
      type: object
      properties:
        id:
          example: 8
          type: integer
        file:
          example: "y/1662913861_photo_2022-09-08_11-23-06.jpg"
          type: string
    InternalType:
      example: default
      enum:
        - agent
        - b2b
        - default
        - demo
        - exchange
      type: string
    KeyValuePair:
      type: object
      properties:
        key:
          example: "bank_name"
          type: string
        name:
          example: "Citibank"
          nullable: true
          type: string
    LevelVerification:
      nullable: true
      type: object
      properties:
        id:
          type: integer
        name:
          example: "Level 1"
          type: string
    ManagerNullable:
      type: object
      nullable: true
      properties:
        id:
          type: integer
        enabled:
          type: boolean
        email:
          example: "foo@bar.com"
          nullable: false
          type: string
        name:
          oneOf:
            - example: "John Smith"
              type: string
        title:
          example: "mr."
          type: string
        phone:
          example: "+995577755422"
          type: string
        resources:
          type: array
          items:
            $ref: '#/components/schemas/Resource'
        createTime:
          $ref: '#/components/schemas/nullableDateTime'
    Method:
      nullable: true
      type: object
      properties:
        id:
          type: integer
        name:
          example: "PayPal"
          type: string
        groups:
          type: array
          description: The list of groups to which the method belongs.
          items:
            type: object
            properties:
              id:
                type: integer
                description: The group identifier.
                example: 1
              name:
                type: string
                description: The group name.
                example: Crypto
    OperationType:
      type: object
      properties:
        id:
          type: integer
        name:
          example: "name"
          maxLength: 255
          type: string
        caption:
          example: "name"
          maxLength: 255
          type: string
        options:
          type: object
          nullable: true
        class:
          example: "class"
          maxLength: 255
          nullable: true
          type: string
        enabled:
          type: boolean
    Phone:
      type: object
      properties:
        id:
          type: integer
        clientId:
          $ref: '#/components/schemas/nullableInteger'
        confirmed:
          type: boolean
        default:
          type: boolean
        ext:
          example: "812"
          nullable: true
          type: string
        number:
          example: "+79992082113"
          type: string
        createTime:
          $ref: '#/components/schemas/nullableDateTime'
        updateTime:
          $ref: '#/components/schemas/nullableDateTime'
    ClientMarketingData:
      type: object
      properties:
        key:
          type: string
          example: utm_source
        title:
          type: string
          example: UTM Source
        group:
          oneOf:
            - type: string
              example: attribution_and_tracking
            - type: "null"
        dataType:
          oneOf:
            - type: string
              enum:
                - string
                - url
                - datetime
                - boolean
                - integer
                - decimal
                - enum
            - type: "null"
        mutability:
          oneOf:
            - type: string
              enum:
                - mutable
                - immutable
            - type: "null"
        value:
          type: string
          example: google
        createTime:
          $ref: '#/components/schemas/nullableDateTime'
        updateTime:
          $ref: '#/components/schemas/nullableDateTime'
    ClientMarketingDataInput:
      type: object
      required:
        - items
      properties:
        items:
          type: array
          items:
            type: object
            required:
              - key
              - value
            properties:
              key:
                type: string
                maxLength: 64
                example: utm_source
              value:
                type: string
                maxLength: 2048
                example: google
    PlatformEmbedded:
      type: object
      properties:
        id:
          type: integer
          example: 1
        name:
          example: "MT5"
          type: string
        type:
          example: "MetaTrader5"
          enum:
            - personal
            - wrapper
            - B2TraderBrokeragePlatform
            - cTrader
            - Centroid
            - MatchTrader
            - MetaTraderStandalone
            - MetaTrader5
            - MetaTrader4
            - TradeLocker
            - OneZero
            - PrimeXM
        caption:
          example: "MetaTrader 5"
          type: string
    Request:
      nullable: true
      type: object
      properties:
        id:
          type: integer
        client:
          $ref: '#/components/schemas/Client'
        ip:
          example: "127.0 0.1"
          type: string
        type:
          example: "Verification"
          type: string
        status:
          minItems: 1
          type: object
          properties:
            key:
              type: string
              example: "REJECTED"
            name:
              type: string
              example: "Rejected"
        resolution:
          $ref: '#/components/schemas/Resolution'
        personalAccounts:
          type: array
          items:
            $ref: '#/components/schemas/ClientAccounts'
        tradeAccounts:
          type: array
          items:
            $ref: '#/components/schemas/ClientAccounts'
        accountId:
          $ref: '#/components/schemas/nullableInteger'
        amount:
          $ref: '#/components/schemas/nullableDecimal'
        method:
          example: "localizedCaption"
          nullable: true
          type: string
        transactionId:
          $ref: '#/components/schemas/nullableInteger'
        currency:
          example: USD
          nullable: true
          type: string
        dealingApproved:
          example: approved
          nullable: true
          type: string
        complianceApproved:
          example: approved
          nullable: true
          type: string
        liquidityAccount:
          example: "4423423"
          nullable: true
          type: string
        createdAt:
          $ref: '#/components/schemas/dateTime'
        processedAt:
          $ref: '#/components/schemas/dateTime'
        interact:
          type: object
    Resolution:
      nullable: true
      type: object
      properties:
        id:
          type: integer
        enabled:
          type: boolean
        name:
          example: "Document rejected"
          type: string
        type:
          $ref: '#/components/schemas/ResolutionType'
    ResolutionTransaction:
      nullable: true
      type: object
      properties:
        id:
          type: integer
        name:
          example: "Lorem ipsum"
          type: string
    ResolutionType:
      nullable: true
      type: object
      properties:
        id:
          type: integer
        enabled:
          type: boolean
        name:
          example: "Resolution Type"
          type: string
    Resource:
      type: object
      properties:
        key:
          type: string
          example: 'caption'
        locale:
          type: string
          example: 'ru_RU'
        value:
          type: string
          example: 'Lorem'
    RiskLevel:
      example: low
      nullable: true
      enum:
        - "low"
        - "middle"
        - "high"
        - null
      type: string
    Statement:
      nullable: true
      type: object
      properties:
        availableBalance:
          $ref: '#/components/schemas/nullableDecimal'
        currentBalance:
          $ref: '#/components/schemas/nullableDecimal'
        credit:
          $ref: '#/components/schemas/nullableDecimal'
        equity:
          $ref: '#/components/schemas/nullableDecimal'
        freeMargin:
          $ref: '#/components/schemas/nullableDecimal'
        hold:
          $ref: '#/components/schemas/nullableDecimal'
        margin:
          $ref: '#/components/schemas/nullableDecimal'
        marginLevel:
          $ref: '#/components/schemas/nullableDecimal'
        pnl:
          $ref: '#/components/schemas/nullableDecimal'
        updateTime:
          $ref: '#/components/schemas/nullableDateTime'
    Jurisdiction:
      example:
        id: 1
        caption: "Jurisdiction caption"
        description: "Jurisdiction description"
      type: object
      properties:
        id:
          type: integer
        caption:
          type: string
          example: "Jurisdiction caption"
        description:
          type: string
          example: "Jurisdiction description"

    Tag:
      example:
        id: 1
        name: "my_tag"
      type: object
      properties:
        id:
          type: integer
        name:
          maxLength: 255
          type: string
    Transaction:
      type: object
      properties:
        clientId:
          oneOf:
            - type: integer
              example: 1
            - type: "null"
        transactionId:
          $ref: '#/components/schemas/nullableInteger'
        creditDetails:
          type: object
          description: "The destination-side details. For deposits, this is the amount credited after conversion. The account is null when no destination account exists."
          properties:
            account:
              oneOf:
                - $ref: '#/components/schemas/Account'
                - type: "null"
            amount:
              $ref: '#/components/schemas/decimal'
            commission:
              $ref: '#/components/schemas/decimal'
            currency:
              $ref: '#/components/schemas/Currency'
        debitDetails:
          type: object
          description: "The source-side details. For deposits, this is the original amount before conversion. The account is null when no source account exists."
          properties:
            account:
              oneOf:
                - $ref: '#/components/schemas/Account'
                - type: "null"
            amount:
              $ref: '#/components/schemas/decimal'
            commission:
              $ref: '#/components/schemas/decimal'
            currency:
              $ref: '#/components/schemas/Currency'
        foreignExchangeRate:
          $ref: '#/components/schemas/nullableDecimal'
        meta:
          oneOf:
            - $ref: '#/components/schemas/DepositMeta'
            - $ref: '#/components/schemas/WithdrawalMeta'
            - type: "null"
        method:
          oneOf:
            - $ref: '#/components/schemas/Method'
            - type: "null"
        application:
          oneOf:
            - $ref: '#/components/schemas/Application'
            - type: "null"
        resolution:
          oneOf:
            - $ref: '#/components/schemas/ResolutionTransaction'
            - type: "null"
        status:
          $ref: '#/components/schemas/TransactionStatus'
        type:
          $ref: '#/components/schemas/TransactionType'
        createTime:
          $ref: '#/components/schemas/nullableDateTime'
        updateTime:
          $ref: '#/components/schemas/nullableDateTime'
        processedTime:
          $ref: '#/components/schemas/nullableDateTime'
    TransactionStatus:
      example: done
      enum:
        - cancelled
        - done
        - failed
        - hold
        - holdFailed
        - inProgress
        - new
        - partial
        - pending
        - rejected
        - refund
        - refundFailed
        - trade
      type: string
    TransactionType:
      example: withdrawal
      enum:
        - deposit
        - exchange
        - partner
        - transfer
        - withdrawal
      nullable: true
      type: string
    TypeClient:
      type: object
      properties:
        id:
          type: integer
        default:
          type: boolean
        enabled:
          type: boolean
        name:
          example: "Individual"
          maxLength: 255
          type: string
        group:
          example: "individual"
          type: string
          enum:
            - "individual"
            - "corporative"
        wizard:
          type: boolean
        resources:
          type: array
          items:
            $ref: '#/components/schemas/Resource'
    WithdrawalComplianceStatus:
      example: approved
      enum:
        - approved
        - declined
        - pending
      type: string
    WithdrawalDealingStatus:
      example: approved
      enum:
        - approved
        - declined
        - pending
      type: string
    WithdrawalMeta:
      nullable: true
      type: object
      properties:
        id:
          example: 479
          type: integer
          description: The withdrawal meta identifier.
        blockchainTransaction:
          example: Lorem ipsum
          nullable: true
          type: string
        comment:
          example: Lorem ipsum dolor sit amet
          nullable: true
          type: string
        complianceStatus:
          $ref: '#/components/schemas/WithdrawalComplianceStatus'
        dealingStatus:
          $ref: '#/components/schemas/WithdrawalDealingStatus'
        invoice:
          example: rUIOOOGHTL
          nullable: true
          type: string
        providerCommission:
          $ref: '#/components/schemas/decimal'
        providerOptions:
          example:
            - key: beneficiary_name
              value: John Smith
            - key: bank_account_number
              value: "12345678"
            - key: bank_name
              value: Citibank
            - key: bank_address
              value: 388 Greenwich Street, New York, NY 10013, USA
          type: array
          items:
            $ref: '#/components/schemas/KeyValuePair'
        createTime:
          $ref: '#/components/schemas/nullableDateTime'
        invoiceTime:
          $ref: '#/components/schemas/nullableDateTime'
        updateTime:
          $ref: '#/components/schemas/nullableDateTime'
    User:
      type: object
      required:
        - id
        - name
        - email
        - phone
        - active
        - tfa
        - ipWhitelist
        - groups
        - clientTags
        - canViewMaskedData
      properties:
        id:
          type: integer
        name:
          type: string
          example: "Mary"
        email:
          type: string
          example: "foo@bar.com"
        phone:
          oneOf:
            - type: string
              example: "+18043257762"
            - type: "null"
        active:
          type: boolean
        tfa:
          type: boolean
        ipWhitelist:
          type: array
          minItems: 0
          uniqueItems: true
          items:
            type: string
            example: "79.24.241.198"
          example: ["79.24.241.198", "20.65.174.119"]
        groups:
          minItems: 1
          type: array
          items:
            type: object
            example:
              id: 1
              name: "Administrators"
            properties:
              id:
                type: integer
              name:
                type: string
                maxLength: 255
          uniqueItems: true
        clientTags:
          minItems: 0
          type: array
          items:
            $ref: '#/components/schemas/Tag'
          uniqueItems: true
        canViewMaskedData:
          type: boolean
    Verification:
      type: object
      properties:
        id:
          type: integer
        clientId:
          type: integer
        currentLevel:
          type: object
          properties:
            id:
              type: integer
            name:
              example: "Level 0"
              type: string
        previousLevel:
          type: object
          nullable: true
          properties:
            id:
              type: integer
            name:
              example: "Level 1"
              type: string
        reason:
          type: object
          properties:
            name:
              example: "created"
              type: string
        userId:
          example: "1"
          type: string
          nullable: true
        createTime:
          $ref: '#/components/schemas/nullableDateTime'
    SavingsPlan:
      type: object
      title: Savings Plan
      description: 'The savings plan details:'
      additionalProperties: false
      required:
        - id
        - clientId
        - presetId
        - name
        - walletAccountNumber
        - status
        - strategy
        - details
        - createdAt
      properties:
        id:
          type: string
          format: uuid
          description: The universally unique identifier (UUID) of a plan.
          example: 49825070-d077-419e-bbec-6b9a65381901
          minLength: 36
          maxLength: 36
        clientId:
          type: int
          description: Client ID.
          example: 1
        presetId:
          type: string
          format: uuid
          description: The universally unique identifier (UUID) of a savings preset based on which the plan is created.
          minLength: 36
          maxLength: 36
          example: 09d5ce50-5fe8-469f-b6c4-c39698f98c22
        walletAccountNumber:
          type: string
          description: "The number of a client's wallet."
          example: '4815162342'
          minLength: 1
          maxLength: 36
          readOnly: true
        status:
          type: string
          description: The plan status.
          enum:
            - active
            - cancelled
            - completed
          example: active
          readOnly: true
        strategy:
          type: string
          description: "The savings strategy. Possible values:\r\n\r\n- fixed — a savings program with a fixed interest rate\r\n\r\n- flexible — a savings program with a flexible interest rate"
          example: fixed
          enum:
            - fixed
            - flexible
          readOnly: true
        details:
          oneOf:
            - $ref: '#/components/schemas/SavingsPlanFixedStrategyDetails'
            - $ref: '#/components/schemas/SavingsPlanFlexibleStrategyDetails'
        createdAt:
          type: string
          format: date-time
          description: The date and time when a plan was created.
          example: '2023-11-17T11:30:01Z'
    SavingsPlanPayment:
      type: object
      title: Savings Payment
      description: 'The details about interest payments included in a savings plan:'
      additionalProperties: false
      required:
        - id
        - amount
        - status
        - dueDate
        - paidDate
      properties:
        id:
          type: string
          format: uuid
          description: The payment identifier.
          example: fb10d982-c922-4ecf-9f0f-61527c29d0ac
          minLength: 36
          maxLength: 36
          readOnly: true
        amount:
          type: number
          format: double
          description: The interest amount.
          minimum: 0
          exclusiveMinimum: true
          example: 2.5
          readOnly: true
        status:
          type: string
          description: "The payment status. Possible statuses:\r\n\r\n- scheduled — indicates that a payment is scheduled but hasn’t yet been made\r\n\r\n- paid — indicates that a payment has been made to a client\r\n\r\n- cancelled — indicates that a payment was cancelled because the savings plan was cancelled\r\n\r\n- failed — indicates that a payment failed"
          minLength: 1
          example: scheduled
          enum:
            - scheduled
            - paid
            - cancelled
            - failed
          readOnly: true
        dueDate:
          type: string
          format: date-time
          description: The date and time when an interest payment is scheduled to be made.
          readOnly: true
        paidDate:
          format: date-time
          type:
            - string
            - 'null'
          pattern: '2023-12-17T11:30:00Z'
          description: For interest payments to which the *paid* status is assigned, the actual date and time when a payment was made to a client.
          nullable: true
          readOnly: true
    SavingsFlexibleStrategyTier:
      type: object
      title: Savings Plan Tier
      description: 'The details about the tiers used to apply flexible interest rates:'
      additionalProperties: false
      required:
        - from
        - interestRate
      properties:
        from:
          type: number
          format: double
          description: The minimum amount that clients must invest to get an interest rate assigned to the tier.
          example: 100.5
          minimum: 0
          readOnly: true
        interestRate:
          type: number
          format: double
          description: The annual interest rate, in percentage, assigned to the tier.
          example: 3
          minimum: 0
          readOnly: true
    SavingsPresetFixedStrategyDetails:
      type: object
      description: 'The details of a savings program with the *fixed* strategy:'
      additionalProperties: false
      required:
        - currencyAlpha
        - investmentAmount
        - cancellationPenalty
        - admissionFee
        - startAt
        - maturityAt
      properties:
        currencyAlpha:
          type: string
          example: 'USD'
          readOnly: true
        investmentAmount:
          type: number
          description: 'The amount that must be contributed to a savings program. When subscribing to the program, the investment amount is deducted from a client wallet denominated in the currency of the savings program. If a client has more than one wallet denominated in the program currency, the client can select a wallet from which the investment amount should be deducted.'
          minimum: 1
          example: 1000
          format: double
          readOnly: true
        cancellationPenalty:
          type: number
          minimum: 0
          example: 800
          format: double
          description: "The penalty amount charged to a client if the client wants to withdraw the amount invested to a savings program before the end of the plan length.\r\n\r\nThe penalty amount can't exceed the investment amount, but it can be set to 0 (zero) indicating that no penalty is charged for early withdrawal."
        admissionFee:
          type: number
          example: 1.0e-11
          format: double
          readOnly: true
        startAt:
          format: date-time
          type:
            - string
            - 'null'
          pattern: '2023-12-17T11:30:00Z'
          nullable: true
          readOnly: true
        maturityAt:
          format: date-time
          type:
            - string
            - 'null'
          pattern: '2023-12-17T11:30:00Z'
          nullable: true
          readOnly: true
    SavingsPlanFixedStrategyDetails:
      type: object
      description: 'The details of a savings program with the *fixed* strategy:'
      additionalProperties: false
      required:
        - currencyAlpha
        - investmentAmount
        - cancellationPenalty
        - admissionFee
        - startAt
        - maturityAt
      properties:
        currencyAlpha:
          type: string
          description: The alphabetic code of a currency applied to a savings program, as per ISO 4217.
          example: USD
          readOnly: true
        investmentAmount:
          type: number
          format: double
          description: The amount that must be contributed to a savings program.
          example: 1000.5
          minimum: 0
          exclusiveMinimum: true
          readOnly: true
        admissionFee:
          type: number
          format: double
          description: "The fee amount that a client must pay for participation in a savings program. When subscribing to the program, the admission fee along with the investment amount is deducted from a client wallet.\r\n\r\nThe admission fee can be set to 0 (zero) indicating that clients can subscribe to the program for free."
          example: 50
          minimum: 0
          readOnly: true
        cancellationPenalty:
          type: number
          format: double
          description: "The penalty amount charged to a client if the client wants to withdraw the amount invested to a savings program before the end of the plan length.\r\n\r\nThe penalty amount can't exceed the investment amount, but it can be set to 0 (zero) indicating that no penalty is charged for early withdrawal."
          example: 100
          minimum: 0
          readOnly: true
        startAt:
          type: string
          format: date-time
          description: The start date and time of a savings program.
          example: '2023-11-17T11:30:01Z'
          readOnly: true
        maturityAt:
          type: string
          format: date-time
          description: The end date and time of a savings program.
          example: '2023-11-17T10:30:01Z'
          readOnly: true
    SavingsPlanFlexibleStrategyDetails:
      type: object
      description: 'The details of a savings program with the *flexible* strategy:'
      additionalProperties: false
      required:
        - startAt
        - cancellationPenaltyPeriodEndAt
        - currencyAlpha
        - investmentAmount
        - tiers
      properties:
        currencyAlpha:
          type: string
          description: The alphabetic code of a currency applied to a savings program, as per ISO 4217.
          example: USD
          readOnly: true
        investmentAmount:
          type: number
          format: double
          description: The amount that must be contributed to a savings program.
          example: 1000.5
          minimum: 0
          exclusiveMinimum: true
          readOnly: true
        minAdditionalInvestmentAmount:
          type: number
          description: 'The minimum amount that clients can add to the initial investment.'
          minimum: 1
          example: 500
          format: double
          readOnly: true
        admissionFee:
          type: number
          format: double
          description: "The fee amount that a client must pay for participation in a savings program. When subscribing to the program, the admission fee along with the investment amount is deducted from a client wallet.\r\n\r\nThe admission fee can be set to 0 (zero) indicating that clients can subscribe to the program for free."
          example: 50
          minimum: 0
          readOnly: true
        cancellationPenalty:
          type: number
          format: double
          description: "The penalty amount charged to a client if the client withdraws their invested funds before the end of the penalty period.\r\n\r\nThe penalty amount can't exceed the minimum investment amount, but it can be set to 0 (zero) indicating that no penalty is charged for early withdrawal."
          example: 100
          minimum: 0
          readOnly: true
        cancellationPenaltyType:
          type: string
          enum:
            - 'fixed'
            - 'percentage'
          description: "Cancellation Penalty calculation type"
          readOnly: true
        startAt:
          type: string
          format: date-time
          description: The start date and time of a savings program.
          example: '2023-11-17T11:30:01Z'
          readOnly: true
        cancellationPenaltyPeriodEndAt:
          type: string
          format: date-time
          description: "The end date and time of the penalty period. After this period, clients are free to withdraw their invested funds without a penalty."
          example: '2023-11-17T10:30:01Z'
          readOnly: true
        tiers:
          type: array
          items:
            $ref: '#/components/schemas/SavingsFlexibleStrategyTier'
    SavingsPlanExtended:
      type: object
      title: Savings Plan
      description: 'The savings plan details with extended properties'
      additionalProperties: false
      required:
        - id
        - clientId
        - presetId
        - name
        - walletAccountNumber
        - status
        - strategy
        - details
        - createdAt
      properties:
        id:
          type: string
          format: uuid
          description: The universally unique identifier (UUID) of a plan.
          example: 49825070-d077-419e-bbec-6b9a65381901
          minLength: 36
          maxLength: 36
        clientId:
          type: int
          description: Client ID.
          example: 1
        presetId:
          type: string
          format: uuid
          description: The universally unique identifier (UUID) of a savings preset based on which the plan is created.
          minLength: 36
          maxLength: 36
          example: 09d5ce50-5fe8-469f-b6c4-c39698f98c22
        walletAccountNumber:
          type: string
          description: "The number of a client's wallet."
          example: '4815162342'
          minLength: 1
          maxLength: 36
          readOnly: true
        status:
          type: string
          description: The plan status.
          enum:
            - active
            - cancelled
            - completed
          example: active
          readOnly: true
        strategy:
          type: string
          description: "The savings strategy. Possible values:\r\n\r\n- fixed — a savings program with a fixed interest rate\r\n\r\n- flexible — a savings program with a flexible interest rate"
          example: fixed
          enum:
            - fixed
            - flexible
          readOnly: true
        details:
          oneOf:
            - $ref: '#/components/schemas/SavingsPlanFixedStrategyDetails'
            - $ref: '#/components/schemas/SavingsPlanFlexibleStrategyDetails'
        createdAt:
          type: string
          format: date-time
          description: The date and time when a plan was created.
          example: '2023-11-17T11:30:01Z'
        payments:
          type: array
          items:
            $ref: '#/components/schemas/SavingsPlanPayment'
    RateProvider:
      type: object
      properties:
        id:
          type: integer
          description: Rate provider ID
          example: 1
        name:
          type: string
          description: Rate provider name
          example: "custom_rate"
        provider:
          type: string
          description: Provider type
          example: "custom"
        enabled:
          type: boolean
          description: Whether the provider is enabled
          example: true
        priority:
          type: integer
          description: Provider priority (lower is higher priority)
          example: 1
        fromCurrencies:
          oneOf:
            - type: array
              items:
                type: string
            - type: "null"
          description: Source currencies supported by this provider
          example: ["USD", "EUR"]
        toCurrencies:
          oneOf:
            - type: array
              items:
                type: string
            - type: "null"
          description: Destination currencies supported by this provider
          example: ["BTC", "ETH"]
        lifetime:
          type: integer
          description: Rate lifetime in seconds
          example: 0
        options:
          oneOf:
            - $ref: '#/components/schemas/RateProviderOptions'
            - type: "null"
        createTime:
          $ref: '#/components/schemas/nullableDateTime'
        updateTime:
          $ref: '#/components/schemas/nullableDateTime'
    RateProviderOptions:
      type: object
      description: Provider-specific options (only available for custom provider)
      properties:
        rate:
          oneOf:
            - type: string
            - type: "null"
          description: Custom rate value
          example: "1.2345"
        baseCurrency:
          oneOf:
            - type: string
            - type: "null"
          description: Base currency alpha code
          example: "USD"
    PaymentSystemsAssistanceApplicationType:
      type: string
      enum:
        - deposit
        - withdrawal
        - static_deposit
      description: Type of payment systems assistance application
    PaymentSystemsAssistanceMoveToSuccessRequest:
      oneOf:
        - $ref: '#/components/schemas/PaymentSystemsAssistanceMoveToSuccessDeposit'
        - $ref: '#/components/schemas/PaymentSystemsAssistanceMoveToSuccessWithdrawal'
        - $ref: '#/components/schemas/PaymentSystemsAssistanceMoveToSuccessStaticDeposit'
    PaymentSystemsAssistanceMoveToSuccessDeposit:
      title: Deposit
      type: object
      required:
        - type
        - data
      properties:
        type:
          type: string
          enum: [deposit]
        data:
          type: object
          required:
            - final_amount
          properties:
            final_amount:
              type: string
              pattern: '^\d+(\.\d+)?$'
              description: Final deposit amount as decimal string
              example: "100.50"
    PaymentSystemsAssistanceMoveToSuccessWithdrawal:
      title: Withdrawal
      type: object
      required:
        - type
        - data
      properties:
        type:
          type: string
          enum: [withdrawal]
        data:
          type: object
          description: Empty object, amount taken from original withdrawal
    PaymentSystemsAssistanceMoveToSuccessStaticDeposit:
      title: Static Deposit
      type: object
      required:
        - type
        - data
      properties:
        type:
          type: string
          enum: [static_deposit]
        data:
          type: object
          required:
            - final_amount
          properties:
            final_amount:
              type: string
              pattern: '^\d+(\.\d+)?$'
              description: Final static deposit amount as decimal string
              example: "100.50"
    PaymentSystemsAssistanceMoveToInProgressRequest:
      oneOf:
        - $ref: '#/components/schemas/PaymentSystemsAssistanceMoveToInProgressDeposit'
        - $ref: '#/components/schemas/PaymentSystemsAssistanceMoveToInProgressWithdrawal'
        - $ref: '#/components/schemas/PaymentSystemsAssistanceMoveToInProgressStaticDeposit'
    PaymentSystemsAssistanceMoveToInProgressDeposit:
      title: Deposit
      type: object
      required:
        - type
        - data
      properties:
        type:
          type: string
          enum: [deposit]
        data:
          type: object
          properties:
            external_id:
              type: string
              maxLength: 255
              description: External payment system identifier (required if not already verified)
    PaymentSystemsAssistanceMoveToInProgressWithdrawal:
      title: Withdrawal
      type: object
      required:
        - type
        - data
      properties:
        type:
          type: string
          enum: [withdrawal]
        data:
          type: object
          properties:
            external_id:
              type: string
              maxLength: 255
              description: External payment system identifier (required if not already verified)
    PaymentSystemsAssistanceMoveToInProgressStaticDeposit:
      title: Static Deposit
      type: object
      required:
        - type
        - data
      properties:
        type:
          type: string
          enum: [static_deposit]
        data:
          type: object
          description: Empty object, no external_id needed for static deposit
    PaymentSystemsAssistanceMoveToFailedRequest:
      type: object
      required:
        - type
        - data
      properties:
        type:
          $ref: '#/components/schemas/PaymentSystemsAssistanceApplicationType'
        data:
          type: object
          required:
            - error_code
          properties:
            error_code:
              type: string
              enum: [operationFailed, operationNotFound, other]
              description: Error code indicating the reason for failure
            error_description:
              type: string
              maxLength: 255
              description: Human-readable error description
