---
openapi: 3.0.1
info:
  title: Trading API v4
  description: APIs related to trading operations
  version: v4
paths:
  /frontoffice/api/v4/account-margin-settings/assets:
    get:
      tags:
        - AccountMarginSettingsControllerV
      description: "Required operations: trading-ui"
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/BBP.TradingServer.TradingApi.Models.AccountMarginSettings.ApiGetAccountMarginSettingsAssetsV4.ResponseV4
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BBP.Platform.Http.ErrorData'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BBP.Platform.Http.ErrorData'
  /frontoffice/api/v4/account-margin-settings/assets/{assetId}:
    post:
      tags:
        - AccountMarginSettingsControllerV
      description: "Required operations: trading-ui"
      parameters:
        - name: assetId
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/BBP.TradingServer.TradingApi.Models.AccountMarginSettings.ApiPostAccountMarginSettingsAssetsV4.Response
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BBP.Platform.Http.ErrorData'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BBP.Platform.Http.ErrorData'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BBP.Platform.Http.ErrorData'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BBP.Platform.Http.ErrorData'
    delete:
      tags:
        - AccountMarginSettingsControllerV
      description: "Required operations: trading-ui"
      parameters:
        - name: assetId
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/BBP.TradingServer.TradingApi.Models.AccountMarginSettings.ApiDeleteAccountMarginSettingsAssetsV4.Response
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BBP.Platform.Http.ErrorData'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BBP.Platform.Http.ErrorData'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BBP.Platform.Http.ErrorData'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BBP.Platform.Http.ErrorData'
components:
  schemas:
    BBP.Platform.Http.ErrorData:
      type: object
      properties:
        code:
          type: string
        message:
          type: string
        details:
          $ref: '#/components/schemas/BBP.Platform.Http.ErrorData.ErrorDetails'
      additionalProperties: false
    BBP.Platform.Http.ErrorData.ErrorDetails:
      type: object
      properties:
        source:
          type: string
          nullable: true
        message:
          type: string
          nullable: true
        stackTrace:
          type: string
          nullable: true
      additionalProperties: false
    BBP.TradingServer.TradingApi.Models.Enums.ApiStopOrderStatus:
      enum:
        - WaitingForActivation
        - Activated
        - Rejected
      type: string
    BBP.TradingServer.TradingApi.Models.AccountMarginSettings.ApiGetAccountMarginSettingsAssetsV4.ResponseV4:
      type: object
      properties:
        assets:
          type: array
          items:
            $ref: >-
              #/components/schemas/BBP.TradingServer.TradingApi.Models.AccountMarginSettings.ApiGetAccountMarginSettingsAssetsV4.ResponseV4Item
      additionalProperties: false
    BBP.TradingServer.TradingApi.Models.AccountMarginSettings.ApiGetAccountMarginSettingsAssetsV4.ResponseV4Item:
      type: object
      properties:
        assetId:
          type: string
        assetName:
          type: string
        available:
          type: string
        total:
          type: string
        marginRatio:
          type: string
        isSelected:
          type: boolean
      additionalProperties: false
    BBP.TradingServer.TradingApi.Models.AccountMarginSettings.ApiPostAccountMarginSettingsAssetsV4.Response:
      type: object
      additionalProperties: false
    BBP.TradingServer.TradingApi.Models.CfdStopOrder.v4.ApiCfdStopOrderResponseModelV4:
      type: object
      properties:
        orderId:
          type: string
        status:
          $ref: >-
            #/components/schemas/BBP.TradingServer.TradingApi.Models.Enums.ApiStopOrderStatus
      additionalProperties: false
    BBP.TradingServer.TradingApi.Models.AccountMarginSettings.ApiDeleteAccountMarginSettingsAssetsV4.Response:
      type: object
      additionalProperties: false
