{
  "opencollection": "1.0.0",
  "info": {
    "name": "Services.AutoTrading Account Values ClosedPositions API",
    "version": "2.4.138+710c760591"
  },
  "items": [
    {
      "info": {
        "name": "ClosedPositions",
        "type": "folder"
      },
      "items": [
        {
          "info": {
            "name": "Remove multiple subscriptions",
            "type": "http"
          },
          "http": {
            "method": "DELETE",
            "url": "https://gateway.saxobank.com/sim/openapi/port/v1/closedpositions/subscriptions/:ContextId",
            "params": [
              {
                "name": "ContextId",
                "value": "29931122",
                "type": "path",
                "description": "The context id part of the streaming session (used to identify the subscription within a streaming session)."
              },
              {
                "name": "Tag",
                "value": "2345223",
                "type": "query",
                "description": "Optional. Remove only subscriptions that are marked with specified tag."
              }
            ],
            "auth": {
              "type": "oauth2",
              "flow": "authorization_code",
              "authorizationUrl": "https://sim.logonvalidation.net/authorize",
              "accessTokenUrl": "https://sim.logonvalidation.net/token",
              "credentials": {
                "clientId": "{{clientId}}",
                "clientSecret": "{{clientSecret}}"
              }
            }
          },
          "docs": "Removes multiple all subscriptions for the current session on this resource, and frees all resources on the server."
        },
        {
          "info": {
            "name": "Change the closed positions subscription page size",
            "type": "http"
          },
          "http": {
            "method": "PATCH",
            "url": "https://gateway.saxobank.com/sim/openapi/port/v1/closedpositions/subscriptions/:ContextId/:ReferenceId",
            "params": [
              {
                "name": "ContextId",
                "value": "29931122",
                "type": "path",
                "description": "The context id part of the streaming session."
              },
              {
                "name": "ReferenceId",
                "value": "P54123",
                "type": "path",
                "description": "Unique ID of the subscription"
              }
            ],
            "body": {
              "type": "json",
              "data": "{}"
            },
            "auth": {
              "type": "oauth2",
              "flow": "authorization_code",
              "authorizationUrl": "https://sim.logonvalidation.net/authorize",
              "accessTokenUrl": "https://sim.logonvalidation.net/token",
              "credentials": {
                "clientId": "{{clientId}}",
                "clientSecret": "{{clientSecret}}"
              }
            }
          },
          "docs": "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."
        },
        {
          "info": {
            "name": "Remove subscription",
            "type": "http"
          },
          "http": {
            "method": "DELETE",
            "url": "https://gateway.saxobank.com/sim/openapi/port/v1/closedpositions/subscriptions/:ContextId/:ReferenceId",
            "params": [
              {
                "name": "ContextId",
                "value": "29931122",
                "type": "path",
                "description": "The context id part of the streaming session (used to identify the subscription within a streaming session)."
              },
              {
                "name": "ReferenceId",
                "value": "0f8fad5b-d9cb-469f-a165-70867728950e",
                "type": "path",
                "description": "Unique id of the subscription"
              }
            ],
            "auth": {
              "type": "oauth2",
              "flow": "authorization_code",
              "authorizationUrl": "https://sim.logonvalidation.net/authorize",
              "accessTokenUrl": "https://sim.logonvalidation.net/token",
              "credentials": {
                "clientId": "{{clientId}}",
                "clientSecret": "{{clientSecret}}"
              }
            }
          },
          "docs": "Removes subscription for the current session identified by subscription id.."
        },
        {
          "info": {
            "name": "Create a subscription on a list of closed positions and make it active",
            "type": "http"
          },
          "http": {
            "method": "POST",
            "url": "https://gateway.saxobank.com/sim/openapi/port/v1/closedpositions/subscriptions",
            "params": [
              {
                "name": "$top",
                "value": "1",
                "type": "query",
                "description": "The number of entries to return from the beginning of the collection"
              }
            ],
            "body": {
              "type": "json",
              "data": "{}"
            },
            "auth": {
              "type": "oauth2",
              "flow": "authorization_code",
              "authorizationUrl": "https://sim.logonvalidation.net/authorize",
              "accessTokenUrl": "https://sim.logonvalidation.net/token",
              "credentials": {
                "clientId": "{{clientId}}",
                "clientSecret": "{{clientSecret}}"
              }
            }
          },
          "docs": "Sets up a subscription and returns an initial snapshot of list of closed positions specified by the parameters in the request."
        },
        {
          "info": {
            "name": "Get detailed information for a single position",
            "type": "http"
          },
          "http": {
            "method": "GET",
            "url": "https://gateway.saxobank.com/sim/openapi/port/v1/closedpositions/:ClosedPositionId/details",
            "params": [
              {
                "name": "AccountGroupKey",
                "value": "stringValue",
                "type": "query",
                "description": "The key of the account group to which the closed positions belongs."
              },
              {
                "name": "AccountKey",
                "value": "01b64edf-da03-4145-bf33-ae21527d4c86",
                "type": "query",
                "description": "The key of the account to which the closed positions belongs."
              },
              {
                "name": "ClientKey",
                "value": "493b43a5-fe85-4d1f-9071-dd4a9d4e42a4",
                "type": "query",
                "description": "The key of the client to which the closesd positions belongs."
              },
              {
                "name": "ClosedPositionId",
                "value": "",
                "type": "path",
                "description": "Unique id of the position."
              }
            ],
            "auth": {
              "type": "oauth2",
              "flow": "authorization_code",
              "authorizationUrl": "https://sim.logonvalidation.net/authorize",
              "accessTokenUrl": "https://sim.logonvalidation.net/token",
              "credentials": {
                "clientId": "{{clientId}}",
                "clientSecret": "{{clientSecret}}"
              }
            }
          },
          "docs": "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}."
        },
        {
          "info": {
            "name": "Get a single position",
            "type": "http"
          },
          "http": {
            "method": "GET",
            "url": "https://gateway.saxobank.com/sim/openapi/port/v1/closedpositions/:ClosedPositionId",
            "params": [
              {
                "name": "AccountGroupKey",
                "value": "stringValue",
                "type": "query",
                "description": "The key of the account group to which the closed positions belongs."
              },
              {
                "name": "AccountKey",
                "value": "01b64edf-da03-4145-bf33-ae21527d4c86",
                "type": "query",
                "description": "The key of the account to which the closed positions belongs."
              },
              {
                "name": "ClientKey",
                "value": "493b43a5-fe85-4d1f-9071-dd4a9d4e42a4",
                "type": "query",
                "description": "The key of the client to which the closesd positions belongs."
              },
              {
                "name": "ClosedPositionId",
                "value": "",
                "type": "path",
                "description": "Unique id of the position."
              },
              {
                "name": "FieldGroups",
                "value": "DisplayAndFormat",
                "type": "query",
                "description": "Specifies which data to return. Default is [ClosedPosition]"
              }
            ],
            "auth": {
              "type": "oauth2",
              "flow": "authorization_code",
              "authorizationUrl": "https://sim.logonvalidation.net/authorize",
              "accessTokenUrl": "https://sim.logonvalidation.net/token",
              "credentials": {
                "clientId": "{{clientId}}",
                "clientSecret": "{{clientSecret}}"
              }
            }
          },
          "docs": "Get a single position."
        },
        {
          "info": {
            "name": "Get closed positions for a client, to which the logged in user belongs",
            "type": "http"
          },
          "http": {
            "method": "GET",
            "url": "https://gateway.saxobank.com/sim/openapi/port/v1/closedpositions/me",
            "params": [
              {
                "name": "$skip",
                "value": "1",
                "type": "query",
                "description": "The number of entries to skip from the beginning of the collection"
              },
              {
                "name": "$top",
                "value": "1",
                "type": "query",
                "description": "The number of entries to return from the beginning of the collection"
              },
              {
                "name": "FieldGroups",
                "value": "",
                "type": "query",
                "description": "Specifies which data to return. Default is [ClosedPosition]."
              }
            ],
            "auth": {
              "type": "oauth2",
              "flow": "authorization_code",
              "authorizationUrl": "https://sim.logonvalidation.net/authorize",
              "accessTokenUrl": "https://sim.logonvalidation.net/token",
              "credentials": {
                "clientId": "{{clientId}}",
                "clientSecret": "{{clientSecret}}"
              }
            }
          },
          "docs": "Returns a list of closed positions fulfilling the criteria specified by the query string parameters."
        },
        {
          "info": {
            "name": "Get closed positions for a client, accountGroup or account",
            "type": "http"
          },
          "http": {
            "method": "GET",
            "url": "https://gateway.saxobank.com/sim/openapi/port/v1/closedpositions",
            "params": [
              {
                "name": "$skip",
                "value": "1",
                "type": "query",
                "description": "The number of entries to skip from the beginning of the collection"
              },
              {
                "name": "$top",
                "value": "1",
                "type": "query",
                "description": "The number of entries to return from the beginning of the collection"
              },
              {
                "name": "AccountGroupKey",
                "value": "stringValue",
                "type": "query",
                "description": "The key of the account group to which the closed positions belongs."
              },
              {
                "name": "AccountKey",
                "value": "01b64edf-da03-4145-bf33-ae21527d4c86",
                "type": "query",
                "description": "The key of the account to which the closed positions belongs."
              },
              {
                "name": "ClientKey",
                "value": "493b43a5-fe85-4d1f-9071-dd4a9d4e42a4",
                "type": "query",
                "description": "The key of the client to which the closesd positions belongs."
              },
              {
                "name": "ClosedPositionId",
                "value": "stringValue",
                "type": "query",
                "description": "The id of the closed position to which the closedposition belongs"
              },
              {
                "name": "FieldGroups",
                "value": "DisplayAndFormat",
                "type": "query",
                "description": "Specifies which data to return. Default is [ClosedPosition]"
              }
            ],
            "auth": {
              "type": "oauth2",
              "flow": "authorization_code",
              "authorizationUrl": "https://sim.logonvalidation.net/authorize",
              "accessTokenUrl": "https://sim.logonvalidation.net/token",
              "credentials": {
                "clientId": "{{clientId}}",
                "clientSecret": "{{clientSecret}}"
              }
            }
          },
          "docs": "Returns a list of closed positions fulfilling the criteria specified by the query string parameters."
        }
      ]
    }
  ],
  "bundled": true
}