---
openapi: 3.0.1
info:
  title: Trading API v4
  description: APIs related to trading operations
  version: v4
paths:
  /frontoffice/api/v4/markets-categories:
    get:
      tags:
        - MarketCategoriesControllerV
      description: "Required operations: trading-ui"
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/BBP.TradingServer.TradingApi.Models.MarketCategories.ApiGetMarketCategoriesContract.Response
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BBP.Platform.Http.ErrorData'
  /frontoffice/api/v4/guest/markets-categories:
    get:
      tags:
        - GuestMarketCategoriesControllerV
      description: >-
        Anonymous counterpart of GET /frontoffice/api/v4/markets-categories. No
        authentication and no required operations. Returns the same schema with
        the category tree pruned to subtrees that contain at least one
        guest-visible market, using the same active-market filter as GET
        /frontoffice/api/v5/guest/markets.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/BBP.TradingServer.TradingApi.Models.MarketCategories.ApiGetMarketCategoriesContract.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.MarketCategories.ApiGetMarketCategoriesContract.Response:
      type: object
      properties:
        categories:
          type: array
          items:
            $ref: >-
              #/components/schemas/BBP.TradingServer.TradingApi.Models.MarketCategories.ApiMarketCategory
      additionalProperties: false
    BBP.TradingServer.TradingApi.Models.MarketCategories.ApiMarketCategory:
      required:
        - id
        - name
      type: object
      properties:
        id:
          minLength: 1
          type: string
        name:
          minLength: 1
          type: string
        categories:
          type: array
          items:
            $ref: >-
              #/components/schemas/BBP.TradingServer.TradingApi.Models.MarketCategories.ApiMarketCategory
      additionalProperties: false
