Endpoint Parameters

  • Request parameters

    Name Type Origin Description
    Arguments NetPositionRequest Body Arguments for the subscription request.
    ContextId String Body The streaming context id that this request is associated with. This parameter must only contain letters (a-z) and numbers (0-9) as well as - (dash) and _ (underscore). It is case insensitive. Max length is 50 characters.
    Format String Body Optional Media type (RFC 2046) of the serialized data updates that are streamed to the client. Currently only application/json and application/x-protobuf is supported. If an unrecognized format is specified, the subscription end point will return HTTP status code 400 - Bad format.
    ReferenceId String Body Mandatory client specified reference id for the subscription. This parameter must only contain alphanumberic characters as well as - (dash) and _ (underscore). Cannot start with _. It is case insensitive. Max length is 50 characters.
    RefreshRate Integer Body Optional custom refresh rate, measured in milliseconds, between each data update. Note that it is not possible to get a refresh rate lower than the rate specified in the customer service level agreement (SLA).
    ReplaceReferenceId String Body Reference id of the subscription that should be replaced.
    Tag String Body Optional client specified tag used for grouping subscriptions.
  • Response Parameters

    View Response Codes
    Name Type Description
    ContextId String The streaming context id that this response is associated with.
    Format String The media type (RFC 2046), of the serialized data updates that are streamed to the client.
    InactivityTimeout Integer The time (in seconds) that the client should accept the subscription to be inactive before considering it invalid.
    ReferenceId String The reference id that (along with streaming context id and session id) identifies the subscription (within the context of a specific service/subscription type)
    RefreshRate Integer Actual refresh rate assigned to the subscription according to the customers SLA.
    Snapshot NetPositionResponseListResult Snapshot of the current data on hand, when subscription was created.
    State String This property is kept for backwards compatibility.
    Tag String Client specified tag assigned to the subscription, if specified in the request.
  • Streaming Response Parameters

    Name Type Description
    DisplayAndFormat InstrumentDisplayAndFormat [Community] Information about the instrument of the net position and how to display it.
    Exchange InstrumentExchangeDetails Information about the exchange where this instrument or the underlying instrument is traded.
    Greeks Greeks Greeks for option(s) i.e. FX Option, Contract Options and Contract Options CFD .
    NetPositionBase NetPositionStatic Static part of net position information
    NetPositionId String [Community] The id of the net position. This can be used to fetch the open positions of a net position from the Positions service.
    NetPositionView NetPositionDynamic Dynamic part of net position information.
    UnderlyingDisplayAndFormat InstrumentDisplayAndFormat Information about the underlying instrument of the net position and how to display it.
  • Request Example

    Request URL
    POST /port/v1/netpositions/subscriptions
    Request Body
    {
      "Arguments": {
        "AccountGroupKey": "LZTc7DdejXODf-WSl2aCyQ==",
        "AccountKey": "LZTc7DdejXODf-WSl2aCyQ==",
        "ClientKey": "7m4I|vtYLUnEGg77o9uQhw==",
        "FieldGroups": [
          "NetPositionView",
          "NetPositionBase"
        ],
        "NetPositionId": "EURUSD 41761NY 1.3765 C",
        "PriceMode": "RegularTradingHours"
      },
      "ContextId": "20241214061921958",
      "Format": "application/json",
      "ReferenceId": "NP55597",
      "RefreshRate": 1000,
      "Tag": "PAGE1"
    }
    
  • Response Example

    Response body
    {
      "ContextId": "stringValue",
      "Format": "stringValue",
      "InactivityTimeout": 99,
      "ReferenceId": "stringValue",
      "RefreshRate": 99,
      "Snapshot": {
        "__next": "/openapi/port/....../?$top=1&$skip=1",
        "Data": [
          {
            "NetPositionBase": {
              "AccountId": "192134INET",
              "Amount": 100000,
              "AssetType": "FxSpot",
              "CanBeClosed": true,
              "ClientId": "654321",
              "HasForceOpenPositions": false,
              "IsMarketOpen": false,
              "NonTradableReason": "None",
              "NumberOfRelatedOrders": 0,
              "OpeningDirection": "Buy",
              "OpenIpoOrdersCount": 0,
              "OpenOrdersCount": 0,
              "OpenTriggerOrdersCount": 0,
              "PositionsAccount": "192134INET",
              "SinglePositionStatus": "Open",
              "Uic": 31,
              "ValueDate": "2017-05-04T00:00:00Z"
            },
            "NetPositionId": "GPBUSD_FXSpot",
            "NetPositionView": {
              "AverageOpenPrice": 1.32167,
              "AverageOpenPriceIncludingCosts": 1.32172,
              "CalculationReliability": "Ok",
              "CurrentPrice": 1.29188,
              "CurrentPriceDelayMinutes": 15,
              "CurrentPriceType": "Mid",
              "Exposure": 100000,
              "ExposureInBaseCurrency": 129205,
              "InstrumentPriceDayPercentChange": 0.27,
              "PositionCount": 1,
              "PositionsNotClosedCount": 0,
              "ProfitLossOnTrade": -2979,
              "Status": "Open",
              "TradeCostsTotal": 0,
              "TradeCostsTotalInBaseCurrency": 0
            }
          }
        ]
      },
      "State": "Active",
      "Tag": "stringValue"
    }
    
  • Streaming Response Example

    Response body
    {
      "NetPositionBase": {
        "AccountId": "192134INET",
        "Amount": 100000,
        "AssetType": "FxSpot",
        "CanBeClosed": true,
        "ClientId": "654321",
        "HasForceOpenPositions": false,
        "IsMarketOpen": false,
        "NonTradableReason": "None",
        "NumberOfRelatedOrders": 0,
        "OpeningDirection": "Buy",
        "OpenIpoOrdersCount": 0,
        "OpenOrdersCount": 0,
        "OpenTriggerOrdersCount": 0,
        "PositionsAccount": "192134INET",
        "SinglePositionStatus": "Open",
        "Uic": 31,
        "ValueDate": "2017-05-04T00:00:00+00:00"
      },
      "NetPositionId": "GPBUSD_FXSpot",
      "NetPositionView": {
        "AverageOpenPrice": 1.32167,
        "AverageOpenPriceIncludingCosts": 1.32172,
        "CalculationReliability": "Ok",
        "CurrentPrice": 1.29188,
        "CurrentPriceDelayMinutes": 15,
        "CurrentPriceType": "Mid",
        "Exposure": 100000,
        "ExposureInBaseCurrency": 129205,
        "InstrumentPriceDayPercentChange": 0.27,
        "PositionCount": 1,
        "PositionsNotClosedCount": 0,
        "ProfitLossOnTrade": -2979,
        "Status": "Open",
        "TradeCostsTotal": 0,
        "TradeCostsTotalInBaseCurrency": 0
      }
    }