Saxo Bank ClosedPositions API

Read only end points serving closed positions and the underlying closed positions making up the net closed position. The set of closed positions is restricted by the supplied query parameters as well as whether or not the identity represented by the authorization token has access to the account on which the positions are posted. * A user of a client will have access to accounts under that client * A user of an IB or WLC will have access to accounts on that client or clients there under * An employee has access to all accounts * A request containing a TradingFloor "Federated Access" token will have access to the account specified in that token. * If access is granted on the basis of the TradingFloor "Federated Access" token, then the number of fields will be a subset of the full set of fields shown in the specification for the response.

OpenAPI Specification

saxo-closedpositions-api-openapi.yml Raw ↑
openapi: 3.0.1
info:
  title: Services.AutoTrading Account Values ClosedPositions API
  description: 'The AutoTrading service group provides endpoints for interacting with Saxo Bank''s SaxoSelect offering.Through these interfaces a client application can get Saxo Select trade leaders, portfolios and investments. Portfolio investments can be created and modifed.<div class=well style=''border: 1px solid rgb(204, 82, 0); border-image: none; background-color: rgb(255, 209, 179);padding:1px;''><strong> Note:</strong> </br>This service is subject to special licensing agreements and not generally available to all OpenAPI applications.</div>'
  version: 2.4.138+710c760591
  x-framework-version: 38.0.2+439c5b0ec3
  x-machine: SIMOAWEB11-DK2
servers:
- url: https://gateway.saxobank.com/sim/openapi
tags:
- name: ClosedPositions
  description: "Read only end points serving closed positions and the underlying closed positions making up the net closed position.\n            The set of closed positions is restricted by the supplied query parameters as well as whether or not the identity \n            represented by the authorization token has access to the account on which the positions are posted.\n\n*   A user of a client will have access to accounts under that client\n*   A user of an IB or WLC will have access to accounts on that client or clients there under \n*   An employee has access to all accounts\n*   A request containing a TradingFloor \"Federated Access\" token will have access to the account specified in that token.\n*   If access is granted on the basis of the TradingFloor \"Federated Access\" token, then the number of fields will be a subset \n                of the full set of fields shown in the specification for the response."
paths:
  /port/v1/closedpositions/subscriptions/{ContextId}:
    delete:
      tags:
      - ClosedPositions
      summary: Remove multiple subscriptions
      description: Removes multiple all subscriptions for the current session on this resource, and frees all resources on the server.
      operationId: ClosedPositionsV1DeleteSubscriptions
      parameters:
      - name: ContextId
        in: path
        description: The context id part of the streaming session (used to identify the subscription within a streaming session).
        required: true
        schema:
          type: string
        example: '29931122'
      - name: Tag
        in: query
        description: Optional. Remove only subscriptions that are marked with specified tag.
        schema:
          type: string
        example: '2345223'
      responses:
        '204':
          description: No Content
        '202':
          description: Subscription delete request will be processed eventually.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
      - OpenApiOAuthSecurityScheme: []
      - OpenApiJWTSecurityScheme: []
      x-required-permissions:
        personal: Subscribe
        community: Subscribe
  /port/v1/closedpositions/subscriptions/{ContextId}/{ReferenceId}:
    delete:
      tags:
      - ClosedPositions
      summary: Remove subscription
      description: Removes subscription for the current session identified by subscription id..
      operationId: ClosedPositionsV1DeleteSubscription
      parameters:
      - name: ContextId
        in: path
        description: The context id part of the streaming session (used to identify the subscription within a streaming session).
        required: true
        schema:
          type: string
        example: '29931122'
      - name: ReferenceId
        in: path
        description: Unique id of the subscription
        required: true
        schema:
          type: string
        example: 0f8fad5b-d9cb-469f-a165-70867728950e
      responses:
        '204':
          description: No Content
        '202':
          description: Subscription delete request will be processed eventually.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
      - OpenApiOAuthSecurityScheme: []
      - OpenApiJWTSecurityScheme: []
      x-required-permissions:
        personal: Subscribe
        community: Subscribe
    patch:
      tags:
      - ClosedPositions
      summary: Change the closed positions subscription page size
      description: Extends or reduces the page size, number of positions shown, on a running closed positions subscription. When expanding the page size, the subsequent closed positions are streamed so to avoid race conditions.
      operationId: ClosedPositionsV1UpdateClosedPositionSubscriptionPagesize
      parameters:
      - name: ContextId
        in: path
        description: The context id part of the streaming session.
        required: true
        schema:
          type: string
        example: '29931122'
      - name: ReferenceId
        in: path
        description: Unique ID of the subscription
        required: true
        schema:
          type: string
        example: P54123
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PositionPagingSubscriptionUpdateRequest'
            example:
              NewPageSize: 99
      responses:
        '204':
          description: No Content
        '202':
          description: Subscription change will be processed and respose will be streamed.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
      - OpenApiOAuthSecurityScheme: []
      - OpenApiJWTSecurityScheme: []
      x-required-permissions:
        personal: Subscribe
        community: Subscribe
  /port/v1/closedpositions/subscriptions:
    post:
      tags:
      - ClosedPositions
      summary: Create a subscription on a list of closed positions and make it active
      description: Sets up a subscription and returns an initial snapshot of list of closed positions specified by the parameters in the request.
      operationId: ClosedPositionsV1AddActiveSubscription
      parameters:
      - name: $top
        in: query
        description: The number of entries to return from the beginning of the collection
        schema:
          minimum: 0
          type: integer
          format: int32
          default: 0
        example: 1
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ClosedPositionsSubscriptionRequest'
            example:
              Arguments:
                AccountGroupKey: LZTc7DdejXODf-WSl2aCyQ==
                AccountKey: LZTc7DdejXODf-WSl2aCyQ==
                ClientKey: 7m4I|vtYLUnEGg77o9uQhw==
                ClosedPositionId: 139597294-139694249
                FieldGroups:
                - ClosedPosition
              ContextId: '20221030064907102'
              Format: application/json
              ReferenceId: CP35618
              RefreshRate: 1000
              Tag: PAGE1
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClosedPositionsSubscriptionResponse'
              example:
                Format: application/json
                InactivityTimeout: 120
                ReferenceId: CP50382
                RefreshRate: 1000
                Snapshot:
                  Data:
                  - ClosedPosition:
                      AccountId: 192134INET
                      Amount: 300000
                      AssetType: FxSpot
                      BuyOrSell: Buy
                      ClientId: '654321'
                      ClosedProfitLoss: 9597
                      ClosedProfitLossInBaseCurrency: 9597
                      ClosingMarketValue: 0
                      ClosingMarketValueInBaseCurrency: 0
                      ClosingMethod: Explicit
                      ClosingPositionId: '139694249'
                      ClosingPrice: 1.09139
                      ConversionRateInstrumentToBaseSettledClosing: false
                      ConversionRateInstrumentToBaseSettledOpening: true
                      ExecutionTimeClose: '2017-05-02T00:00:00Z'
                      ExecutionTimeOpen: '2017-04-12T00:00:00Z'
                      OpeningPositionId: '139597294'
                      OpenPrice: 1.0594
                      Uic: 21
                    ClosedPositionUniqueId: 139597294-139694249
                    NetPositionId: EURUSD_FxSpot
                State: Active
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                required:
                - ErrorCode
                - Message
                type: object
                properties:
                  ErrorCode:
                    enum:
                    - InvalidClientId
                    - InvalidInput
                    - InvalidModelState
                    - NoValidInput
                    - SubscriptionExceedesPositionsLimit
                    - UnsupportedSubscriptionFormat
                    type: string
                    example: None
                    x-enum-descriptions:
                      InvalidModelState: Error code returned when model state is invalid.
                      UnsupportedSubscriptionFormat: Error code returned when a subscription format that isn't supported by the publisher is requested.
                      InvalidClientId: Indicates that the requested client id was invalid.
                      InvalidInput: An error was encountered when processing given input parameters.
                      NoValidInput: No valid input values passed.
                      SubscriptionExceedesPositionsLimit: Too many positions requested. Streaming updates are only allowed on a limited number of positions.
                  Message:
                    type: string
                  ModelState:
                    $ref: '#/components/schemas/ModelStateDictionary'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                required:
                - ErrorCode
                - Message
                type: object
                properties:
                  ErrorCode:
                    enum:
                    - SubscriptionLimitExceeded
                    type: string
                    example: None
                    x-enum-descriptions:
                      SubscriptionLimitExceeded: Error code returned when more than the maximum allowed number of subscriptions for a specified type, is exceeded.
                  Message:
                    type: string
                  ModelState:
                    $ref: '#/components/schemas/ModelStateDictionary'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
      - OpenApiOAuthSecurityScheme: []
      - OpenApiJWTSecurityScheme: []
      x-required-permissions:
        personal: Subscribe
        community: Subscribe
      x-streaming-type:
        $ref: '#/components/schemas/ClosedPositionResponseArray'
  /port/v1/closedpositions/{ClosedPositionId}/details:
    get:
      tags:
      - ClosedPositions
      summary: Get detailed information for a single position
      description: "Obsolete Gets detailed information about a single position as specified by the query parameters.\n            NOTE: This endpoint will be deprecated by November 2022. All functionality has been migrated to /port/v1/closedpositions/{ClosedPositionId}."
      operationId: ClosedPositionsV1GetPositionDetails
      parameters:
      - name: AccountGroupKey
        in: query
        description: The key of the account group to which the closed positions belongs.
        schema:
          title: The key of the account group to which the closed positions belongs.
          minLength: 1
          type: string
          x-type-name: AccountGroupKey
        example: stringValue
      - name: AccountKey
        in: query
        description: The key of the account to which the closed positions belongs.
        schema:
          title: The key of the account to which the closed positions belongs.
          minLength: 1
          type: string
          x-type-name: AccountKey
        example: 01b64edf-da03-4145-bf33-ae21527d4c86
      - name: ClientKey
        in: query
        description: The key of the client to which the closesd positions belongs.
        required: true
        schema:
          title: The key of the client to which the closesd positions belongs.
          minLength: 1
          type: string
          x-type-name: ClientKey
        example: 493b43a5-fe85-4d1f-9071-dd4a9d4e42a4
      - name: ClosedPositionId
        in: path
        description: Unique id of the position.
        required: true
        schema:
          type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClosedPositionDetailedResponse'
              example:
                ClosedPosition:
                  AccountId: 192134INET
                  Amount: 300000
                  AssetType: FxSpot
                  BuyOrSell: Buy
                  ClientId: '654321'
                  ClosedProfitLoss: 9597
                  ClosedProfitLossInBaseCurrency: 9597
                  ClosingMarketValue: 0
                  ClosingMarketValueInBaseCurrency: 0
                  ClosingMethod: Explicit
                  ClosingPositionId: '139694249'
                  ClosingPrice: 1.09139
                  ConversionRateInstrumentToBaseSettledClosing: false
                  ConversionRateInstrumentToBaseSettledOpening: true
                  ExecutionTimeClose: '2017-05-02T00:00:00Z'
                  ExecutionTimeOpen: '2017-04-12T00:00:00Z'
                  OpeningPositionId: '139597294'
                  OpenPrice: 1.0594
                  Uic: 21
                ClosedPositionDetails:
                  CurrencyConversionRateInstrumentToBaseClosing: 1
                  CurrencyConversionRateInstrumentToBaseOpening: 1
                  ValueDateClose: '2017-05-04T00:00:00Z'
                  ValueDateOpen: '2017-05-04T00:00:00Z'
                ClosedPositionUniqueId: 139597294-139694249
                DisplayAndFormat:
                  Currency: USD
                  Decimals: 4
                  Description: Euro/US Dollar
                  Format: AllowDecimalPips
                  Symbol: EURUSD
                Exchange:
                  Description: Inter Bank
                  ExchangeId: SBFX
                  IsOpen: true
                NetPositionId: EURUSD_FxSpot
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                required:
                - ErrorCode
                - Message
                type: object
                properties:
                  ErrorCode:
                    enum:
                    - InvalidClientId
                    - PositionIdNotSpecified
                    type: string
                    example: None
                    x-enum-descriptions:
                      PositionIdNotSpecified: Position not specified.
                      InvalidClientId: Indicates that the requested client id was invalid.
                  Message:
                    type: string
                  ModelState:
                    $ref: '#/components/schemas/ModelStateDictionary'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      deprecated: true
      security:
      - OpenApiOAuthSecurityScheme: []
      - OpenApiJWTSecurityScheme: []
      x-required-permissions:
        personal: Read
        community: Read
  /port/v1/closedpositions/{ClosedPositionId}:
    get:
      tags:
      - ClosedPositions
      summary: Get a single position
      description: Get a single position.
      operationId: ClosedPositionsV1GetClosedPosition
      parameters:
      - name: AccountGroupKey
        in: query
        description: The key of the account group to which the closed positions belongs.
        schema:
          title: The key of the account group to which the closed positions belongs.
          minLength: 1
          type: string
          x-type-name: AccountGroupKey
        example: stringValue
      - name: AccountKey
        in: query
        description: The key of the account to which the closed positions belongs.
        schema:
          title: The key of the account to which the closed positions belongs.
          minLength: 1
          type: string
          x-type-name: AccountKey
        example: 01b64edf-da03-4145-bf33-ae21527d4c86
      - name: ClientKey
        in: query
        description: The key of the client to which the closesd positions belongs.
        required: true
        schema:
          title: The key of the client to which the closesd positions belongs.
          minLength: 1
          type: string
          x-type-name: ClientKey
        example: 493b43a5-fe85-4d1f-9071-dd4a9d4e42a4
      - name: ClosedPositionId
        in: path
        description: Unique id of the position.
        required: true
        schema:
          type: string
      - name: FieldGroups
        in: query
        description: Specifies which data to return. Default is [ClosedPosition]
        schema:
          title: Specifies which data to return. Default is [ClosedPosition]
          type: array
          items:
            $ref: '#/components/schemas/ClosedPositionFieldGroup'
        example:
        - DisplayAndFormat
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClosedPositionResponse'
              example:
                ClosedPosition:
                  AccountId: 192134INET
                  Amount: 300000
                  AssetType: FxSpot
                  BuyOrSell: Buy
                  ClientId: '654321'
                  ClosedProfitLoss: 9597
                  ClosedProfitLossInBaseCurrency: 9597
                  ClosingMarketValue: 0
                  ClosingMarketValueInBaseCurrency: 0
                  ClosingMethod: Explicit
                  ClosingPositionId: '139694249'
                  ClosingPrice: 1.09139
                  ConversionRateInstrumentToBaseSettledClosing: false
                  ConversionRateInstrumentToBaseSettledOpening: true
                  ExecutionTimeClose: '2017-05-02T00:00:00Z'
                  ExecutionTimeOpen: '2017-04-12T00:00:00Z'
                  OpeningPositionId: '139597294'
                  OpenPrice: 1.0594
                  Uic: 21
                ClosedPositionUniqueId: 139597294-139694249
                NetPositionId: EURUSD_FxSpot
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                required:
                - ErrorCode
                - Message
                type: object
                properties:
                  ErrorCode:
                    enum:
                    - InvalidClientId
                    - PositionIdNotSpecified
                    type: string
                    example: None
                    x-enum-descriptions:
                      PositionIdNotSpecified: Position not specified.
                      InvalidClientId: Indicates that the requested client id was invalid.
                  Message:
                    type: string
                  ModelState:
                    $ref: '#/components/schemas/ModelStateDictionary'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
      - OpenApiOAuthSecurityScheme: []
      - OpenApiJWTSecurityScheme: []
      x-required-permissions:
        personal: Read
        community: Read
  /port/v1/closedpositions/me:
    get:
      tags:
      - ClosedPositions
      summary: Get closed positions for a client, to which the logged in user belongs
      description: Returns a list of closed positions fulfilling the criteria specified by the query string parameters.
      operationId: GET_ClosedPositionsV1GetClosedPositions
      parameters:
      - name: $skip
        in: query
        description: The number of entries to skip from the beginning of the collection
        schema:
          minimum: 0
          type: integer
          format: int32
        example: 1
      - name: $top
        in: query
        description: The number of entries to return from the beginning of the collection
        schema:
          minimum: 0
          type: integer
          format: int32
          default: 0
        example: 1
      - name: FieldGroups
        in: query
        description: Specifies which data to return. Default is [ClosedPosition].
        required: true
        schema:
          type: array
          items:
            $ref: '#/components/schemas/ClosedPositionFieldGroup'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClosedPositionResponseListResult'
              example:
                __next: /openapi/port/....../?$top=1&$skip=1
                Data:
                - ClosedPosition:
                    AccountId: 192134INET
                    Amount: 300000
                    AssetType: FxSpot
                    BuyOrSell: Buy
                    ClientId: '654321'
                    ClosedProfitLoss: 9597
                    ClosedProfitLossInBaseCurrency: 9597
                    ClosingMarketValue: 0
                    ClosingMarketValueInBaseCurrency: 0
                    ClosingMethod: Explicit
                    ClosingPositionId: '139694249'
                    ClosingPrice: 1.09139
                    ConversionRateInstrumentToBaseSettledClosing: false
                    ConversionRateInstrumentToBaseSettledOpening: true
                    ExecutionTimeClose: '2017-05-02T00:00:00Z'
                    ExecutionTimeOpen: '2017-04-12T00:00:00Z'
                    OpeningPositionId: '139597294'
                    OpenPrice: 1.0594
                    Uic: 21
                  ClosedPositionUniqueId: 139597294-139694249
                  NetPositionId: EURUSD_FxSpot
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
      - OpenApiOAuthSecurityScheme: []
      - OpenApiJWTSecurityScheme: []
      x-required-permissions:
        personal: Read
        community: Read
  /port/v1/closedpositions:
    get:
      tags:
      - ClosedPositions
      summary: Get closed positions for a client, accountGroup or account
      description: Returns a list of closed positions fulfilling the criteria specified by the query string parameters.
      operationId: ClosedPositionsV1GetClosedPositions
      parameters:
      - name: $skip
        in: query
        description: The number of entries to skip from the beginning of the collection
        schema:
          minimum: 0
          type: integer
          format: int32
        example: 1
      - name: $top
        in: query
        description: The number of entries to return from the beginning of the collection
        schema:
          minimum: 0
          type: integer
          format: int32
          default: 0
        example: 1
      - name: AccountGroupKey
        in: query
        description: The key of the account group to which the closed positions belongs.
        schema:
          title: The key of the account group to which the closed positions belongs.
          minLength: 1
          type: string
          x-type-name: AccountGroupKey
        example: stringValue
      - name: AccountKey
        in: query
        description: The key of the account to which the closed positions belongs.
        schema:
          title: The key of the account to which the closed positions belongs.
          minLength: 1
          type: string
          x-type-name: AccountKey
        example: 01b64edf-da03-4145-bf33-ae21527d4c86
      - name: ClientKey
        in: query
        description: The key of the client to which the closesd positions belongs.
        required: true
        schema:
          title: The key of the client to which the closesd positions belongs.
          minLength: 1
          type: string
          x-type-name: ClientKey
        example: 493b43a5-fe85-4d1f-9071-dd4a9d4e42a4
      - name: ClosedPositionId
        in: query
        description: The id of the closed position to which the closedposition belongs
        schema:
          title: The id of the closed position to which the closedposition belongs
          type: string
        example: stringValue
      - name: FieldGroups
        in: query
        description: Specifies which data to return. Default is [ClosedPosition]
        schema:
          title: Specifies which data to return. Default is [ClosedPosition]
          type: array
          items:
            $ref: '#/components/schemas/ClosedPositionFieldGroup'
        example:
        - DisplayAndFormat
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClosedPositionResponseListResult'
              example:
                __next: /openapi/port/....../?$top=1&$skip=1
                Data:
                - ClosedPosition:
                    AccountId: 192134INET
                    Amount: 300000
                    AssetType: FxSpot
                    BuyOrSell: Buy
                    ClientId: '654321'
                    ClosedProfitLoss: 9597
                    ClosedProfitLossInBaseCurrency: 9597
                    ClosingMarketValue: 0
                    ClosingMarketValueInBaseCurrency: 0
                    ClosingMethod: Explicit
                    ClosingPositionId: '139694249'
                    ClosingPrice: 1.09139
                    ConversionRateInstrumentToBaseSettledClosing: false
                    ConversionRateInstrumentToBaseSettledOpening: true
                    ExecutionTimeClose: '2017-05-02T00:00:00Z'
                    ExecutionTimeOpen: '2017-04-12T00:00:00Z'
                    OpeningPositionId: '139597294'
                    OpenPrice: 1.0594
                    Uic: 21
                  ClosedPositionUniqueId: 139597294-139694249
                  NetPositionId: EURUSD_FxSpot
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                required:
                - ErrorCode
                - Message
                type: object
                properties:
                  ErrorCode:
                    enum:
                    - ClosedPositionNotAccessibleInEndOfDayNettingMode
                    - InvalidClientId
                    - InvalidExchangeId
                    - NoValidInput
                    type: string
                    example: None
                    x-enum-descriptions:
                      NoValidInput: No valid input values passed.
                      InvalidClientId: Indicates that the requested client id was invalid.
                      InvalidExchangeId: The provided exchange id is invalid.
                      ClosedPositionNotAccessibleInEndOfDayNettingMode: ClosedPosition is not accessible in EndOfDay netting mode of the client
                  Message:
                    type: string
                  ModelState:
                    $ref: '#/components/schemas/ModelStateDictionary'
        '204':
          description: No Content
        '401':
          $ref: '#/components/responses/Unauthorized'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
        '429':
          $ref: '#/components/responses/TooManyRequests'
      security:
      - OpenApiOAuthSecurityScheme: []
      - OpenApiJWTSecurityScheme: []
      x-required-permissions:
        personal: Read
        community: Read
components:
  schemas:
    PositionPagingSubscriptionUpdateRequest:
      title: A parameter wrapper for position subscription paging update operations.
      type: object
      properties:
        NewPageSize:
          title: Extends or reduces the page size, number of positions shown, on a running positions subscription.
          type: integer
          format: int32
          example: 99
      additionalProperties: false
      example:
        NewPageSize: 99
    InstrumentExchangeDetails:
      title: Information about an exchange and its trading hours.
      type: object
      properties:
        Description:
          title: Full name/description of the exchange
          type: string
          example: stringValue
        ExchangeId:
          title: Short exchange code.
          type: string
          example: stringValue
        IsOpen:
          title: Indicates if the exchange is currently open for trading
          type: boolean
          example: true
        TimeZoneId:
          title: Exchange's TimeZone
          type: string
          example: stringValue
      additionalProperties: false
      example:
        Description: stringValue
        ExchangeId: stringValue
        IsOpen: true
        TimeZoneId: stringValue
    ClosedPositionDetailedResponse:
      title: Describes an open position in detail
      required:
      - ClosedPositionUniqueId
      type: object
      properties:
        ClosedPosition:
          title: ClosedPosition info
          allOf:
          - $ref: '#/components/schemas/ClosedPosition'
        ClosedPositionDetails:
          title: Additional details related to the position.
          allOf:
          - $ref: '#/components/schemas/ClosedPositionDetails'
        ClosedPositionUniqueId:
          title: Unique id of the closed position based on OpeningPositionId and ClosingPositionId - Required for subscription to provide a key.
          type: string
          example: stringValue
        DisplayAndFormat:
          title: '[Community] Information about the instrument of the closed position and how to display it.'
          allOf:
          - $ref: '#/components/schemas/InstrumentDisplayAndFormat'
        Exchange:
          title: Information about the instrument's exchange and trading status.
          allOf:
          - $ref: '#/components/schemas/InstrumentExchangeDetails'
        NetPositionId:
          title: NetPosition ID
          type: string
          example: stringValue
      additionalProperties: false
      example:
        ClosedPosition:
          AccountId: 192134INET
          Amount: 300000
          AssetType: FxSpot
          BuyOrSell: Buy
          ClientId: '654321'
          ClosedProfitLoss: 9597
          ClosedProfitLossInBaseCurrency: 9597
          ClosingMarketValue: 0
          ClosingMarketValueInBaseCurrency: 0
          ClosingMethod: Explicit
          ClosingPositionId: '139694249'
          ClosingPrice: 1.09139
          ConversionRateInstrumentToBaseSettledClosing: false
          ConversionRateInstrumentToBaseSettledOpening: true
          ExecutionTimeClose: '2017-05-02T00:00:00Z'
          ExecutionTimeOpen: '2017-04-12T00:00:00Z'
          OpeningPositionId: '139597294'
          OpenPrice: 1.0594
          U

# --- truncated at 32 KB (71 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/saxo/refs/heads/main/openapi/saxo-closedpositions-api-openapi.yml