---
openapi: 3.0.1
info:
  title: Trading API v3
  description: APIs related to trading operations
  version: v3
paths:
  /frontoffice/api/v3/ui/templates:
    get:
      tags:
        - TemplateControllerV
      description: "Required operations: trading-ui"
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/BBP.TradingServer.TradingApi.Models.Ui.Template.ApiFindTemplate.Response
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BBP.Platform.Http.ErrorData'
  /frontoffice/api/v3/guest/ui/templates:
    get:
      tags:
        - GuestTemplateControllerV
      description: >-
        Anonymous counterpart of /frontoffice/api/v3/ui/templates. No
        authentication and no required operations. Returns the same templates
        and the same schema, except that widgets disabled by the broker are
        excluded from each tab.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/BBP.TradingServer.TradingApi.Models.Ui.Template.ApiFindTemplate.Response
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.Ui.Template.ApiFindTemplate.Response:
      type: object
      properties:
        templates:
          type: array
          items:
            $ref: >-
              #/components/schemas/BBP.TradingServer.TradingApi.Models.Ui.Template.ApiFindTemplate.Template
      additionalProperties: false
    BBP.TradingServer.TradingApi.Models.Ui.Template.ApiFindTemplate.Template:
      required:
        - id
        - isDefault
        - name
        - tabs
      type: object
      properties:
        id:
          minLength: 1
          type: string
        name:
          minLength: 1
          type: string
        isDefault:
          type: boolean
        tabs:
          type: array
          items:
            $ref: >-
              #/components/schemas/BBP.TradingServer.TradingApi.Models.Ui.Template.ApiFindTemplate.Tab
      additionalProperties: false
    BBP.TradingServer.TradingApi.Models.Ui.Template.ApiFindTemplate.Tab:
      required:
        - id
        - selectedWidgetId
        - sizes
        - widgets
      type: object
      properties:
        id:
          minLength: 1
          type: string
        selectedWidgetId:
          minLength: 1
          type: string
        sizes:
          $ref: >-
            #/components/schemas/BBP.TradingServer.TradingApi.Models.Ui.Template.ApiFindTemplate.Sizes
        widgets:
          type: array
          items:
            $ref: >-
              #/components/schemas/BBP.TradingServer.TradingApi.Models.Ui.Template.ApiFindTemplate.Widget
      additionalProperties: false
    BBP.TradingServer.TradingApi.Models.Ui.Template.ApiFindTemplate.Sizes:
      required:
        - cols
        - rows
        - x
        - 'y'
      type: object
      properties:
        x:
          type: integer
          format: int32
        'y':
          type: integer
          format: int32
        cols:
          type: integer
          format: int32
        rows:
          type: integer
          format: int32
        layerIndex:
          type: integer
          format: int32
          nullable: true
      additionalProperties: false
    BBP.TradingServer.TradingApi.Models.Ui.Template.ApiFindTemplate.Widget:
      required:
        - id
        - type
      type: object
      properties:
        id:
          minLength: 1
          type: string
        type:
          minLength: 1
          type: string
          readOnly: true
      additionalProperties: false
