snaptrade-typescript-sdk 8.6.0 → 8.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -12
- package/dist/api/portfolio-management-api.d.ts +0 -47
- package/dist/api/portfolio-management-api.js +0 -103
- package/dist/configuration.js +1 -1
- package/dist/models/session-event.d.ts +6 -0
- package/dist/models/symbol.d.ts +7 -0
- package/package.json +4 -1
- package/.konfig/generate-id.txt +0 -1
- package/.konfigignore +0 -3
- package/api/account-information-api-custom.ts +0 -3
- package/api/account-information-api.ts +0 -1062
- package/api/api-disclaimer-api-custom.ts +0 -3
- package/api/api-disclaimer-api.ts +0 -183
- package/api/api-status-api-custom.ts +0 -3
- package/api/api-status-api.ts +0 -128
- package/api/authentication-api-custom.ts +0 -3
- package/api/authentication-api.ts +0 -568
- package/api/connections-api-custom.ts +0 -3
- package/api/connections-api.ts +0 -544
- package/api/error-logs-api-custom.ts +0 -3
- package/api/error-logs-api.ts +0 -174
- package/api/options-api-custom.ts +0 -3
- package/api/options-api.ts +0 -739
- package/api/portfolio-management-api-custom.ts +0 -3
- package/api/portfolio-management-api.ts +0 -3301
- package/api/reference-data-api-custom.ts +0 -3
- package/api/reference-data-api.ts +0 -1031
- package/api/trading-api-custom.ts +0 -3
- package/api/trading-api.ts +0 -1304
- package/api/transactions-and-reporting-api-custom.ts +0 -3
- package/api/transactions-and-reporting-api.ts +0 -408
- package/api.ts +0 -27
- package/base.ts +0 -70
- package/client-custom.ts +0 -5
- package/client.ts +0 -59
- package/common.ts +0 -163
- package/configuration.ts +0 -131
- package/docs/AccountInformationApi.md +0 -469
- package/docs/ApiDisclaimerApi.md +0 -65
- package/docs/ApiStatusApi.md +0 -59
- package/docs/AuthenticationApi.md +0 -293
- package/docs/ConnectionsApi.md +0 -237
- package/docs/ErrorLogsApi.md +0 -63
- package/docs/OptionsApi.md +0 -314
- package/docs/PortfolioManagementApi.md +0 -1786
- package/docs/ReferenceDataApi.md +0 -570
- package/docs/TradingApi.md +0 -600
- package/docs/TransactionsAndReportingApi.md +0 -141
- package/index.test.ts +0 -177
- package/index.ts +0 -18
- package/jest.config.ts +0 -11
- package/models/account-holdings-account.ts +0 -61
- package/models/account-holdings.ts +0 -61
- package/models/account-order-record-status.ts +0 -48
- package/models/account-order-record.ts +0 -151
- package/models/account-simple.ts +0 -52
- package/models/account-sync-status.ts +0 -32
- package/models/account.ts +0 -91
- package/models/action.ts +0 -30
- package/models/apidisclaimer-accept-request.ts +0 -29
- package/models/authentication-login-snap-trade-user200-response.ts +0 -31
- package/models/balance.ts +0 -40
- package/models/brokerage-authorization-type-read-only-brokerage.ts +0 -43
- package/models/brokerage-authorization-type-read-only.ts +0 -68
- package/models/brokerage-authorization-type.ts +0 -39
- package/models/brokerage-authorization.ts +0 -82
- package/models/brokerage-symbol.ts +0 -61
- package/models/brokerage-type.ts +0 -37
- package/models/brokerage.ts +0 -136
- package/models/calculated-trade.ts +0 -40
- package/models/cash-restriction.ts +0 -63
- package/models/connections-session-events200-response-inner.ts +0 -25
- package/models/currency.ts +0 -43
- package/models/delete-user-response.ts +0 -37
- package/models/dividend-at-date.ts +0 -43
- package/models/encrypted-response-encrypted-message-data.ts +0 -43
- package/models/encrypted-response.ts +0 -38
- package/models/exchange-rate-pairs.ts +0 -46
- package/models/exchange.ts +0 -73
- package/models/excluded-asset.ts +0 -34
- package/models/index.ts +0 -109
- package/models/jwt.ts +0 -31
- package/models/login-redirect-uri.ts +0 -35
- package/models/manual-trade-and-impact.ts +0 -49
- package/models/manual-trade-balance.ts +0 -49
- package/models/manual-trade-form.ts +0 -80
- package/models/manual-trade-symbol.ts +0 -64
- package/models/manual-trade.ts +0 -88
- package/models/model-asset-class-details.ts +0 -41
- package/models/model-asset-class-target.ts +0 -34
- package/models/model-asset-class.ts +0 -37
- package/models/model-portfolio-asset-class.ts +0 -40
- package/models/model-portfolio-details.ts +0 -50
- package/models/model-portfolio-security.ts +0 -40
- package/models/model-portfolio.ts +0 -52
- package/models/model400-failed-request-response.ts +0 -37
- package/models/model401-failed-request-response.ts +0 -37
- package/models/model403-failed-request-response.ts +0 -37
- package/models/model404-failed-request-response.ts +0 -37
- package/models/monthly-dividends.ts +0 -40
- package/models/net-contributions.ts +0 -43
- package/models/net-dividend.ts +0 -46
- package/models/option-chain-inner-chain-per-root-inner-chain-per-strike-price-inner.ts +0 -43
- package/models/option-chain-inner-chain-per-root-inner.ts +0 -46
- package/models/option-chain-inner.ts +0 -58
- package/models/option-leg.ts +0 -53
- package/models/option-strategy-legs-inner.ts +0 -47
- package/models/option-strategy.ts +0 -61
- package/models/options-get-option-strategy-request.ts +0 -51
- package/models/options-holdings.ts +0 -67
- package/models/options-place-option-strategy-request.ts +0 -57
- package/models/options-position.ts +0 -73
- package/models/options-symbol.ts +0 -94
- package/models/order-type.ts +0 -32
- package/models/partner-data.ts +0 -100
- package/models/past-value.ts +0 -43
- package/models/performance-custom.ts +0 -154
- package/models/portfolio-group-info.ts +0 -115
- package/models/portfolio-group-position.ts +0 -46
- package/models/portfolio-group-settings.ts +0 -58
- package/models/portfolio-group.ts +0 -37
- package/models/position-symbol.ts +0 -64
- package/models/position.ts +0 -64
- package/models/redirect-tokenand-pin.ts +0 -37
- package/models/security-type.ts +0 -49
- package/models/session-event.ts +0 -74
- package/models/snap-trade-apidisclaimer-accept-status.ts +0 -37
- package/models/snap-trade-holdings-account-account-id.ts +0 -82
- package/models/snap-trade-holdings-account.ts +0 -79
- package/models/snap-trade-holdings-total-value.ts +0 -37
- package/models/snap-trade-login-user-request-body.ts +0 -61
- package/models/snap-trade-register-user-request-body.ts +0 -35
- package/models/status.ts +0 -43
- package/models/strategy-impact-legs-inner.ts +0 -67
- package/models/strategy-impact.ts +0 -94
- package/models/strategy-order-place-orders-inner-legs-inner.ts +0 -67
- package/models/strategy-order-place-orders-inner.ts +0 -286
- package/models/strategy-order-place.ts +0 -40
- package/models/strategy-order-record.ts +0 -133
- package/models/strategy-quotes-greek.ts +0 -55
- package/models/strategy-quotes.ts +0 -67
- package/models/sub-period-return-rate.ts +0 -43
- package/models/symbol-query.ts +0 -29
- package/models/symbol.ts +0 -67
- package/models/symbols-quotes.ts +0 -64
- package/models/target-asset.ts +0 -62
- package/models/time-in-force.ts +0 -31
- package/models/trade-execution-status.ts +0 -105
- package/models/trade-impact.ts +0 -61
- package/models/trade.ts +0 -88
- package/models/trading-cancel-user-account-order-request.ts +0 -29
- package/models/trading-place-ocoorder-request.ts +0 -35
- package/models/transactions-status.ts +0 -35
- package/models/underlying-symbol.ts +0 -76
- package/models/universal-activity.ts +0 -127
- package/models/universal-symbol-ticker.ts +0 -82
- package/models/universal-symbol.ts +0 -80
- package/models/user-error-log.ts +0 -61
- package/models/user-idand-secret.ts +0 -37
- package/models/user-settings.ts +0 -88
- package/models/usexchange.ts +0 -79
- package/pagination/page-types.ts +0 -34
- package/pagination/page.ts +0 -58
- package/pagination/pageable.ts +0 -113
- package/pagination/paginate.ts +0 -41
- package/requestAfterHook.ts +0 -53
- package/requestBeforeHook.ts +0 -15
- package/tsconfig.json +0 -22
- package/tsconfig.test.json +0 -6
|
@@ -1,1786 +0,0 @@
|
|
|
1
|
-
# PortfolioManagementApi
|
|
2
|
-
|
|
3
|
-
All URIs are relative to *https://api.snaptrade.com/api/v1*
|
|
4
|
-
|
|
5
|
-
Method | HTTP request | Description
|
|
6
|
-
------------- | ------------- | -------------
|
|
7
|
-
[**addPortfolioExcludedAsset**](PortfolioManagementApi.md#addPortfolioExcludedAsset) | **POST** /portfolioGroups/{portfolioGroupId}/excludedassets | Adds an asset to exclude to a portfolio group
|
|
8
|
-
[**create**](PortfolioManagementApi.md#create) | **POST** /portfolioGroups | Create new portfolio group
|
|
9
|
-
[**createAssetClass**](PortfolioManagementApi.md#createAssetClass) | **POST** /modelAssetClass | Create a new model asset class
|
|
10
|
-
[**createModelPortfolio**](PortfolioManagementApi.md#createModelPortfolio) | **POST** /modelPortfolio | Creates a new model portfolio
|
|
11
|
-
[**deleteAssetClass**](PortfolioManagementApi.md#deleteAssetClass) | **DELETE** /modelAssetClass/{modelAssetClassId} | Deletes a model asset class
|
|
12
|
-
[**deleteExcludedAsset**](PortfolioManagementApi.md#deleteExcludedAsset) | **DELETE** /portfolioGroups/{portfolioGroupId}/excludedassets/{symbolId} | Unexclude an asset from a portfolio group
|
|
13
|
-
[**deleteModelPortfolioById**](PortfolioManagementApi.md#deleteModelPortfolioById) | **DELETE** /modelPortfolio/{modelPortfolioId} | Deletes a model portfolio
|
|
14
|
-
[**deletePortfoli**](PortfolioManagementApi.md#deletePortfoli) | **DELETE** /portfolioGroups/{portfolioGroupId} | Remove a target portfolio.
|
|
15
|
-
[**deletePortfolioTargetById**](PortfolioManagementApi.md#deletePortfolioTargetById) | **DELETE** /portfolioGroups/{portfolioGroupId}/targets/{targetAssetId} | Remove a TargetAsset.
|
|
16
|
-
[**detailAssetClass**](PortfolioManagementApi.md#detailAssetClass) | **GET** /modelAssetClass/{modelAssetClassId} | Get details of a model asset class
|
|
17
|
-
[**getCalculatedTradeById**](PortfolioManagementApi.md#getCalculatedTradeById) | **GET** /portfolioGroups/{portfolioGroupId}/calculatedtrades/{calculatedTradeId}/{TradeId} | Return an individual trade
|
|
18
|
-
[**getModelDetailsById**](PortfolioManagementApi.md#getModelDetailsById) | **GET** /modelPortfolio/{modelPortfolioId} | Get details of a model portfolio
|
|
19
|
-
[**getPortfolioBalances**](PortfolioManagementApi.md#getPortfolioBalances) | **GET** /portfolioGroups/{portfolioGroupId}/balances | Get sum of cash balances in portfolio group
|
|
20
|
-
[**getPortfolioDetailsById**](PortfolioManagementApi.md#getPortfolioDetailsById) | **GET** /portfolioGroups/{portfolioGroupId} | Get details of a target portfolio
|
|
21
|
-
[**getPortfolioInfo**](PortfolioManagementApi.md#getPortfolioInfo) | **GET** /portfolioGroups/{portfolioGroupId}/info | Return a whole bunch of relevant information relating to a portfolio group.
|
|
22
|
-
[**getPortfolioPositions**](PortfolioManagementApi.md#getPortfolioPositions) | **GET** /portfolioGroups/{portfolioGroupId}/positions | Get total of each postions owned in portfolio group
|
|
23
|
-
[**getPortfolioSettings**](PortfolioManagementApi.md#getPortfolioSettings) | **GET** /portfolioGroups/{portfolioGroupId}/settings | Get portfolio group settings
|
|
24
|
-
[**getPortfolioTargetById**](PortfolioManagementApi.md#getPortfolioTargetById) | **GET** /portfolioGroups/{portfolioGroupId}/targets/{targetAssetId} | Get a specific target from a portfolio group
|
|
25
|
-
[**getPortfolioTargets**](PortfolioManagementApi.md#getPortfolioTargets) | **GET** /portfolioGroups/{portfolioGroupId}/targets | Get all target assets under the specified PortfolioGroup.
|
|
26
|
-
[**getPortoflioExcludedAssets**](PortfolioManagementApi.md#getPortoflioExcludedAssets) | **GET** /portfolioGroups/{portfolioGroupId}/excludedassets | Get an array of excluded assets associated with a portfolio group\\
|
|
27
|
-
[**importModelPortfolio**](PortfolioManagementApi.md#importModelPortfolio) | **POST** /portfolioGroups/{portfolioGroupId}/import | Import target allocation based on portfolio group
|
|
28
|
-
[**list**](PortfolioManagementApi.md#list) | **GET** /portfolioGroups | List all portfolio groups
|
|
29
|
-
[**listAssetClasses**](PortfolioManagementApi.md#listAssetClasses) | **GET** /modelAssetClass | List of model asset class
|
|
30
|
-
[**listCalculatedTrades**](PortfolioManagementApi.md#listCalculatedTrades) | **GET** /portfolioGroups/{portfolioGroupId}/calculatedtrades | List of trades to make to rebalance portfolio group
|
|
31
|
-
[**listModelPortfolio**](PortfolioManagementApi.md#listModelPortfolio) | **GET** /modelPortfolio | List of model portfolio
|
|
32
|
-
[**listPortfolioAccounts**](PortfolioManagementApi.md#listPortfolioAccounts) | **GET** /portfolioGroups/{portfolioGroupId}/accounts | Get all accounts associated with a portfolio group
|
|
33
|
-
[**modifyModelPortfolioById**](PortfolioManagementApi.md#modifyModelPortfolioById) | **POST** /modelPortfolio/{modelPortfolioId} | Updates model portfolio object
|
|
34
|
-
[**savePortfolio**](PortfolioManagementApi.md#savePortfolio) | **PATCH** /portfolioGroups/{portfolioGroupId} | Update an existing target portfolio.
|
|
35
|
-
[**searchPortfolioSymbols**](PortfolioManagementApi.md#searchPortfolioSymbols) | **POST** /portfolioGroups/{portfolioGroupId}/symbols | Search for symbols limited to brokerages under the specified portfolio group
|
|
36
|
-
[**setPortfolioTargets**](PortfolioManagementApi.md#setPortfolioTargets) | **POST** /portfolioGroups/{portfolioGroupId}/targets | Set a new list of target assets under the specified PortfolioGroup. All existing target assets under this portfolio group will be replaced with the new list.
|
|
37
|
-
[**updateAssetClass**](PortfolioManagementApi.md#updateAssetClass) | **POST** /modelAssetClass/{modelAssetClassId} | Updates model asset class objects
|
|
38
|
-
[**updatePortfolioSettings**](PortfolioManagementApi.md#updatePortfolioSettings) | **PATCH** /portfolioGroups/{portfolioGroupId}/settings | Updates portfolio group settings
|
|
39
|
-
[**updatePortfolioTargetById**](PortfolioManagementApi.md#updatePortfolioTargetById) | **PATCH** /portfolioGroups/{portfolioGroupId}/targets/{targetAssetId} | Update a TargetAsset under the specified PortfolioGroup.
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
# **addPortfolioExcludedAsset**
|
|
43
|
-
|
|
44
|
-
#### **POST** /portfolioGroups/{portfolioGroupId}/excludedassets
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
### Example
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
```typescript
|
|
51
|
-
import { Snaptrade } from "snaptrade-typescript-sdk"
|
|
52
|
-
|
|
53
|
-
const snaptrade = new Snaptrade({
|
|
54
|
-
// Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
|
|
55
|
-
// basePath: "https://api.snaptrade.com/api/v1",
|
|
56
|
-
consumerKey: "YOUR_CONSUMER_KEY",
|
|
57
|
-
clientId: "YOUR_CLIENT_ID",
|
|
58
|
-
})
|
|
59
|
-
|
|
60
|
-
const addPortfolioExcludedAssetResponse = await snaptrade.portfolioManagement.addPortfolioExcludedAsset({
|
|
61
|
-
"portfolioGroupId": "portfolioGroupId_example",
|
|
62
|
-
"id": "2bcd7cc3-e922-4976-bce1-9858296801c3",
|
|
63
|
-
"symbol": "VAB.TO",
|
|
64
|
-
"raw_symbol": "VAB",
|
|
65
|
-
"description": "VANGUARD CDN AGGREGATE BOND INDEX ETF",
|
|
66
|
-
})
|
|
67
|
-
|
|
68
|
-
console.log(addPortfolioExcludedAssetResponse)
|
|
69
|
-
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
### Parameters
|
|
74
|
-
|
|
75
|
-
Name | Type | Description | Notes
|
|
76
|
-
------------- | ------------- | ------------- | -------------
|
|
77
|
-
**universalSymbol** | **UniversalSymbol**| |
|
|
78
|
-
**portfolioGroupId** | [**string**] | The ID of the PortfolioGroup under which to exclude an asset. | defaults to undefined
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
### Return type
|
|
82
|
-
|
|
83
|
-
**ExcludedAsset**
|
|
84
|
-
|
|
85
|
-
### HTTP request headers
|
|
86
|
-
|
|
87
|
-
- **Content-Type**: application/json
|
|
88
|
-
- **Accept**: application/json
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
### HTTP response details
|
|
92
|
-
| Status code | Description | Response headers |
|
|
93
|
-
|-------------|-------------|------------------|
|
|
94
|
-
**200** | An asset is excluded from calculations in portfolio group. | - |
|
|
95
|
-
|
|
96
|
-
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
97
|
-
|
|
98
|
-
# **create**
|
|
99
|
-
|
|
100
|
-
#### **POST** /portfolioGroups
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
### Example
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
```typescript
|
|
107
|
-
import { Snaptrade } from "snaptrade-typescript-sdk"
|
|
108
|
-
|
|
109
|
-
const snaptrade = new Snaptrade({
|
|
110
|
-
// Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
|
|
111
|
-
// basePath: "https://api.snaptrade.com/api/v1",
|
|
112
|
-
consumerKey: "YOUR_CONSUMER_KEY",
|
|
113
|
-
clientId: "YOUR_CLIENT_ID",
|
|
114
|
-
})
|
|
115
|
-
|
|
116
|
-
const createResponse = await snaptrade.portfolioManagement.create({
|
|
117
|
-
"userId": "John.doe@snaptrade.com",
|
|
118
|
-
"userSecret": "USERSECRET123",
|
|
119
|
-
"id": "2bcd7cc3-e922-4976-bce1-9858296801c3",
|
|
120
|
-
"name": "Combined Retirement Portfolio",
|
|
121
|
-
})
|
|
122
|
-
|
|
123
|
-
console.log(createResponse)
|
|
124
|
-
|
|
125
|
-
```
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
### Parameters
|
|
129
|
-
|
|
130
|
-
Name | Type | Description | Notes
|
|
131
|
-
------------- | ------------- | ------------- | -------------
|
|
132
|
-
**requestBody** | **{ [key: string]: any; }**| |
|
|
133
|
-
**userId** | [**string**] | | defaults to undefined
|
|
134
|
-
**userSecret** | [**string**] | | defaults to undefined
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
### Return type
|
|
138
|
-
|
|
139
|
-
**Array<PortfolioGroup>**
|
|
140
|
-
|
|
141
|
-
### HTTP request headers
|
|
142
|
-
|
|
143
|
-
- **Content-Type**: application/json
|
|
144
|
-
- **Accept**: application/json
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
### HTTP response details
|
|
148
|
-
| Status code | Description | Response headers |
|
|
149
|
-
|-------------|-------------|------------------|
|
|
150
|
-
**200** | A new PortfolioGroup is created. | - |
|
|
151
|
-
**400** | The input data is missing or invalid. | - |
|
|
152
|
-
**0** | Unexpected error. | - |
|
|
153
|
-
|
|
154
|
-
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
155
|
-
|
|
156
|
-
# **createAssetClass**
|
|
157
|
-
|
|
158
|
-
#### **POST** /modelAssetClass
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
### Example
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
```typescript
|
|
165
|
-
import { Snaptrade } from "snaptrade-typescript-sdk"
|
|
166
|
-
|
|
167
|
-
const snaptrade = new Snaptrade({
|
|
168
|
-
// Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
|
|
169
|
-
// basePath: "https://api.snaptrade.com/api/v1",
|
|
170
|
-
consumerKey: "YOUR_CONSUMER_KEY",
|
|
171
|
-
clientId: "YOUR_CLIENT_ID",
|
|
172
|
-
})
|
|
173
|
-
|
|
174
|
-
const createAssetClassResponse = await snaptrade.portfolioManagement.createAssetClass()
|
|
175
|
-
|
|
176
|
-
console.log(createAssetClassResponse)
|
|
177
|
-
|
|
178
|
-
```
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
### Parameters
|
|
182
|
-
This endpoint does not need any parameter.
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
### Return type
|
|
186
|
-
|
|
187
|
-
**ModelAssetClassDetails**
|
|
188
|
-
|
|
189
|
-
### HTTP request headers
|
|
190
|
-
|
|
191
|
-
- **Content-Type**: Not defined
|
|
192
|
-
- **Accept**: application/json
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
### HTTP response details
|
|
196
|
-
| Status code | Description | Response headers |
|
|
197
|
-
|-------------|-------------|------------------|
|
|
198
|
-
**200** | A new asset class is created. | - |
|
|
199
|
-
|
|
200
|
-
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
201
|
-
|
|
202
|
-
# **createModelPortfolio**
|
|
203
|
-
|
|
204
|
-
#### **POST** /modelPortfolio
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
### Example
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
```typescript
|
|
211
|
-
import { Snaptrade } from "snaptrade-typescript-sdk"
|
|
212
|
-
|
|
213
|
-
const snaptrade = new Snaptrade({
|
|
214
|
-
// Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
|
|
215
|
-
// basePath: "https://api.snaptrade.com/api/v1",
|
|
216
|
-
consumerKey: "YOUR_CONSUMER_KEY",
|
|
217
|
-
clientId: "YOUR_CLIENT_ID",
|
|
218
|
-
})
|
|
219
|
-
|
|
220
|
-
const createModelPortfolioResponse = await snaptrade.portfolioManagement.createModelPortfolio()
|
|
221
|
-
|
|
222
|
-
console.log(createModelPortfolioResponse)
|
|
223
|
-
|
|
224
|
-
```
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
### Parameters
|
|
228
|
-
This endpoint does not need any parameter.
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
### Return type
|
|
232
|
-
|
|
233
|
-
**ModelPortfolioDetails**
|
|
234
|
-
|
|
235
|
-
### HTTP request headers
|
|
236
|
-
|
|
237
|
-
- **Content-Type**: Not defined
|
|
238
|
-
- **Accept**: application/json
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
### HTTP response details
|
|
242
|
-
| Status code | Description | Response headers |
|
|
243
|
-
|-------------|-------------|------------------|
|
|
244
|
-
**200** | A new model portfolio is created. | - |
|
|
245
|
-
|
|
246
|
-
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
247
|
-
|
|
248
|
-
# **deleteAssetClass**
|
|
249
|
-
|
|
250
|
-
#### **DELETE** /modelAssetClass/{modelAssetClassId}
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
### Example
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
```typescript
|
|
257
|
-
import { Snaptrade } from "snaptrade-typescript-sdk"
|
|
258
|
-
|
|
259
|
-
const snaptrade = new Snaptrade({
|
|
260
|
-
// Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
|
|
261
|
-
// basePath: "https://api.snaptrade.com/api/v1",
|
|
262
|
-
consumerKey: "YOUR_CONSUMER_KEY",
|
|
263
|
-
clientId: "YOUR_CLIENT_ID",
|
|
264
|
-
})
|
|
265
|
-
|
|
266
|
-
const deleteAssetClassResponse = await snaptrade.portfolioManagement.deleteAssetClass({
|
|
267
|
-
"modelAssetClassId": "2bcd7cc3-e922-4976-bce1-9858296801c3",
|
|
268
|
-
})
|
|
269
|
-
|
|
270
|
-
console.log(deleteAssetClassResponse)
|
|
271
|
-
|
|
272
|
-
```
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
### Parameters
|
|
276
|
-
|
|
277
|
-
Name | Type | Description | Notes
|
|
278
|
-
------------- | ------------- | ------------- | -------------
|
|
279
|
-
**modelAssetClassId** | [**string**] | The ID of the model asset class to delete. | defaults to undefined
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
### Return type
|
|
283
|
-
|
|
284
|
-
void (empty response body)
|
|
285
|
-
|
|
286
|
-
### HTTP request headers
|
|
287
|
-
|
|
288
|
-
- **Content-Type**: Not defined
|
|
289
|
-
- **Accept**: Not defined
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
### HTTP response details
|
|
293
|
-
| Status code | Description | Response headers |
|
|
294
|
-
|-------------|-------------|------------------|
|
|
295
|
-
**204** | No content | - |
|
|
296
|
-
|
|
297
|
-
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
298
|
-
|
|
299
|
-
# **deleteExcludedAsset**
|
|
300
|
-
|
|
301
|
-
#### **DELETE** /portfolioGroups/{portfolioGroupId}/excludedassets/{symbolId}
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
### Example
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
```typescript
|
|
308
|
-
import { Snaptrade } from "snaptrade-typescript-sdk"
|
|
309
|
-
|
|
310
|
-
const snaptrade = new Snaptrade({
|
|
311
|
-
// Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
|
|
312
|
-
// basePath: "https://api.snaptrade.com/api/v1",
|
|
313
|
-
consumerKey: "YOUR_CONSUMER_KEY",
|
|
314
|
-
clientId: "YOUR_CLIENT_ID",
|
|
315
|
-
})
|
|
316
|
-
|
|
317
|
-
const deleteExcludedAssetResponse = await snaptrade.portfolioManagement.deleteExcludedAsset({
|
|
318
|
-
"portfolioGroupId": "portfolioGroupId_example",
|
|
319
|
-
"symbolId": "symbolId_example",
|
|
320
|
-
})
|
|
321
|
-
|
|
322
|
-
console.log(deleteExcludedAssetResponse)
|
|
323
|
-
|
|
324
|
-
```
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
### Parameters
|
|
328
|
-
|
|
329
|
-
Name | Type | Description | Notes
|
|
330
|
-
------------- | ------------- | ------------- | -------------
|
|
331
|
-
**portfolioGroupId** | [**string**] | The ID of the PortfolioGroup under which to unexclude an asset. | defaults to undefined
|
|
332
|
-
**symbolId** | [**string**] | The ID of the excluded asset Symbol to delete. | defaults to undefined
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
### Return type
|
|
336
|
-
|
|
337
|
-
void (empty response body)
|
|
338
|
-
|
|
339
|
-
### HTTP request headers
|
|
340
|
-
|
|
341
|
-
- **Content-Type**: Not defined
|
|
342
|
-
- **Accept**: Not defined
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
### HTTP response details
|
|
346
|
-
| Status code | Description | Response headers |
|
|
347
|
-
|-------------|-------------|------------------|
|
|
348
|
-
**200** | Excluded asset deleted | - |
|
|
349
|
-
|
|
350
|
-
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
351
|
-
|
|
352
|
-
# **deleteModelPortfolioById**
|
|
353
|
-
|
|
354
|
-
#### **DELETE** /modelPortfolio/{modelPortfolioId}
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
### Example
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
```typescript
|
|
361
|
-
import { Snaptrade } from "snaptrade-typescript-sdk"
|
|
362
|
-
|
|
363
|
-
const snaptrade = new Snaptrade({
|
|
364
|
-
// Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
|
|
365
|
-
// basePath: "https://api.snaptrade.com/api/v1",
|
|
366
|
-
consumerKey: "YOUR_CONSUMER_KEY",
|
|
367
|
-
clientId: "YOUR_CLIENT_ID",
|
|
368
|
-
})
|
|
369
|
-
|
|
370
|
-
const deleteModelPortfolioByIdResponse = await snaptrade.portfolioManagement.deleteModelPortfolioById({
|
|
371
|
-
"modelPortfolioId": "2bcd7cc3-e922-4976-bce1-9858296801c3",
|
|
372
|
-
})
|
|
373
|
-
|
|
374
|
-
console.log(deleteModelPortfolioByIdResponse)
|
|
375
|
-
|
|
376
|
-
```
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
### Parameters
|
|
380
|
-
|
|
381
|
-
Name | Type | Description | Notes
|
|
382
|
-
------------- | ------------- | ------------- | -------------
|
|
383
|
-
**modelPortfolioId** | [**string**] | The ID of the model portfolio to delete. | defaults to undefined
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
### Return type
|
|
387
|
-
|
|
388
|
-
void (empty response body)
|
|
389
|
-
|
|
390
|
-
### HTTP request headers
|
|
391
|
-
|
|
392
|
-
- **Content-Type**: Not defined
|
|
393
|
-
- **Accept**: Not defined
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
### HTTP response details
|
|
397
|
-
| Status code | Description | Response headers |
|
|
398
|
-
|-------------|-------------|------------------|
|
|
399
|
-
**204** | No content | - |
|
|
400
|
-
|
|
401
|
-
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
402
|
-
|
|
403
|
-
# **deletePortfoli**
|
|
404
|
-
|
|
405
|
-
#### **DELETE** /portfolioGroups/{portfolioGroupId}
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
### Example
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
```typescript
|
|
412
|
-
import { Snaptrade } from "snaptrade-typescript-sdk"
|
|
413
|
-
|
|
414
|
-
const snaptrade = new Snaptrade({
|
|
415
|
-
// Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
|
|
416
|
-
// basePath: "https://api.snaptrade.com/api/v1",
|
|
417
|
-
consumerKey: "YOUR_CONSUMER_KEY",
|
|
418
|
-
clientId: "YOUR_CLIENT_ID",
|
|
419
|
-
})
|
|
420
|
-
|
|
421
|
-
const deletePortfoliResponse = await snaptrade.portfolioManagement.deletePortfoli({
|
|
422
|
-
"portfolioGroupId": "portfolioGroupId_example",
|
|
423
|
-
})
|
|
424
|
-
|
|
425
|
-
console.log(deletePortfoliResponse)
|
|
426
|
-
|
|
427
|
-
```
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
### Parameters
|
|
431
|
-
|
|
432
|
-
Name | Type | Description | Notes
|
|
433
|
-
------------- | ------------- | ------------- | -------------
|
|
434
|
-
**portfolioGroupId** | [**string**] | The ID of the PortfolioGroup to delete. | defaults to undefined
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
### Return type
|
|
438
|
-
|
|
439
|
-
**PortfolioGroup**
|
|
440
|
-
|
|
441
|
-
### HTTP request headers
|
|
442
|
-
|
|
443
|
-
- **Content-Type**: Not defined
|
|
444
|
-
- **Accept**: application/json
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
### HTTP response details
|
|
448
|
-
| Status code | Description | Response headers |
|
|
449
|
-
|-------------|-------------|------------------|
|
|
450
|
-
**200** | The PortfolioGroup object which was deleted. | - |
|
|
451
|
-
**400** | The specified portfolioGroupId is invalid (not a UUID string). | - |
|
|
452
|
-
**404** | The specified portfolioGroupId was not found. | - |
|
|
453
|
-
**0** | Unexpected error. | - |
|
|
454
|
-
|
|
455
|
-
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
456
|
-
|
|
457
|
-
# **deletePortfolioTargetById**
|
|
458
|
-
|
|
459
|
-
#### **DELETE** /portfolioGroups/{portfolioGroupId}/targets/{targetAssetId}
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
### Example
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
```typescript
|
|
466
|
-
import { Snaptrade } from "snaptrade-typescript-sdk"
|
|
467
|
-
|
|
468
|
-
const snaptrade = new Snaptrade({
|
|
469
|
-
// Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
|
|
470
|
-
// basePath: "https://api.snaptrade.com/api/v1",
|
|
471
|
-
consumerKey: "YOUR_CONSUMER_KEY",
|
|
472
|
-
clientId: "YOUR_CLIENT_ID",
|
|
473
|
-
})
|
|
474
|
-
|
|
475
|
-
const deletePortfolioTargetByIdResponse = await snaptrade.portfolioManagement.deletePortfolioTargetById({
|
|
476
|
-
"portfolioGroupId": "portfolioGroupId_example",
|
|
477
|
-
"targetAssetId": "targetAssetId_example",
|
|
478
|
-
})
|
|
479
|
-
|
|
480
|
-
console.log(deletePortfolioTargetByIdResponse)
|
|
481
|
-
|
|
482
|
-
```
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
### Parameters
|
|
486
|
-
|
|
487
|
-
Name | Type | Description | Notes
|
|
488
|
-
------------- | ------------- | ------------- | -------------
|
|
489
|
-
**portfolioGroupId** | [**string**] | The ID of the PortfolioGroup under which to remove the target asset. | defaults to undefined
|
|
490
|
-
**targetAssetId** | [**string**] | The ID of the TargetAsset to delete. | defaults to undefined
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
### Return type
|
|
494
|
-
|
|
495
|
-
**TargetAsset**
|
|
496
|
-
|
|
497
|
-
### HTTP request headers
|
|
498
|
-
|
|
499
|
-
- **Content-Type**: Not defined
|
|
500
|
-
- **Accept**: application/json
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
### HTTP response details
|
|
504
|
-
| Status code | Description | Response headers |
|
|
505
|
-
|-------------|-------------|------------------|
|
|
506
|
-
**200** | The TargetAsset object which was deleted. | - |
|
|
507
|
-
**400** | The specified portfolioGroupId or targetAssetId is invalid (not a UUID string) or the input data is invalid. | - |
|
|
508
|
-
**404** | The specified portfolioGroupId or targetAssetId was not found. | - |
|
|
509
|
-
**0** | Unexpected error. | - |
|
|
510
|
-
|
|
511
|
-
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
512
|
-
|
|
513
|
-
# **detailAssetClass**
|
|
514
|
-
|
|
515
|
-
#### **GET** /modelAssetClass/{modelAssetClassId}
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
### Example
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
```typescript
|
|
522
|
-
import { Snaptrade } from "snaptrade-typescript-sdk"
|
|
523
|
-
|
|
524
|
-
const snaptrade = new Snaptrade({
|
|
525
|
-
// Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
|
|
526
|
-
// basePath: "https://api.snaptrade.com/api/v1",
|
|
527
|
-
consumerKey: "YOUR_CONSUMER_KEY",
|
|
528
|
-
clientId: "YOUR_CLIENT_ID",
|
|
529
|
-
})
|
|
530
|
-
|
|
531
|
-
const detailAssetClassResponse = await snaptrade.portfolioManagement.detailAssetClass({
|
|
532
|
-
"modelAssetClassId": "2bcd7cc3-e922-4976-bce1-9858296801c3",
|
|
533
|
-
})
|
|
534
|
-
|
|
535
|
-
console.log(detailAssetClassResponse)
|
|
536
|
-
|
|
537
|
-
```
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
### Parameters
|
|
541
|
-
|
|
542
|
-
Name | Type | Description | Notes
|
|
543
|
-
------------- | ------------- | ------------- | -------------
|
|
544
|
-
**modelAssetClassId** | [**string**] | The ID of the model asset class to get. | defaults to undefined
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
### Return type
|
|
548
|
-
|
|
549
|
-
**ModelAssetClassDetails**
|
|
550
|
-
|
|
551
|
-
### HTTP request headers
|
|
552
|
-
|
|
553
|
-
- **Content-Type**: Not defined
|
|
554
|
-
- **Accept**: application/json
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
### HTTP response details
|
|
558
|
-
| Status code | Description | Response headers |
|
|
559
|
-
|-------------|-------------|------------------|
|
|
560
|
-
**200** | Details of a particular model asset class | - |
|
|
561
|
-
|
|
562
|
-
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
563
|
-
|
|
564
|
-
# **getCalculatedTradeById**
|
|
565
|
-
|
|
566
|
-
#### **GET** /portfolioGroups/{portfolioGroupId}/calculatedtrades/{calculatedTradeId}/{TradeId}
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
### Example
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
```typescript
|
|
573
|
-
import { Snaptrade } from "snaptrade-typescript-sdk"
|
|
574
|
-
|
|
575
|
-
const snaptrade = new Snaptrade({
|
|
576
|
-
// Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
|
|
577
|
-
// basePath: "https://api.snaptrade.com/api/v1",
|
|
578
|
-
consumerKey: "YOUR_CONSUMER_KEY",
|
|
579
|
-
clientId: "YOUR_CLIENT_ID",
|
|
580
|
-
})
|
|
581
|
-
|
|
582
|
-
const getCalculatedTradeByIdResponse = await snaptrade.portfolioManagement.getCalculatedTradeById({
|
|
583
|
-
"portfolioGroupId": "portfolioGroupId_example",
|
|
584
|
-
"calculatedTradeId": "calculatedTradeId_example",
|
|
585
|
-
"tradeId": "tradeId_example",
|
|
586
|
-
})
|
|
587
|
-
|
|
588
|
-
console.log(getCalculatedTradeByIdResponse)
|
|
589
|
-
|
|
590
|
-
```
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
### Parameters
|
|
594
|
-
|
|
595
|
-
Name | Type | Description | Notes
|
|
596
|
-
------------- | ------------- | ------------- | -------------
|
|
597
|
-
**portfolioGroupId** | [**string**] | The ID of the PortfolioGroup to perform rebalancing calculations | defaults to undefined
|
|
598
|
-
**calculatedTradeId** | [**string**] | The ID of calculated trade to get account impact | defaults to undefined
|
|
599
|
-
**tradeId** | [**string**] | The ID of trade object | defaults to undefined
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
### Return type
|
|
603
|
-
|
|
604
|
-
**Array<Trade>**
|
|
605
|
-
|
|
606
|
-
### HTTP request headers
|
|
607
|
-
|
|
608
|
-
- **Content-Type**: Not defined
|
|
609
|
-
- **Accept**: application/json
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
### HTTP response details
|
|
613
|
-
| Status code | Description | Response headers |
|
|
614
|
-
|-------------|-------------|------------------|
|
|
615
|
-
**200** | Trade objects | - |
|
|
616
|
-
|
|
617
|
-
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
618
|
-
|
|
619
|
-
# **getModelDetailsById**
|
|
620
|
-
|
|
621
|
-
#### **GET** /modelPortfolio/{modelPortfolioId}
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
### Example
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
```typescript
|
|
628
|
-
import { Snaptrade } from "snaptrade-typescript-sdk"
|
|
629
|
-
|
|
630
|
-
const snaptrade = new Snaptrade({
|
|
631
|
-
// Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
|
|
632
|
-
// basePath: "https://api.snaptrade.com/api/v1",
|
|
633
|
-
consumerKey: "YOUR_CONSUMER_KEY",
|
|
634
|
-
clientId: "YOUR_CLIENT_ID",
|
|
635
|
-
})
|
|
636
|
-
|
|
637
|
-
const getModelDetailsByIdResponse = await snaptrade.portfolioManagement.getModelDetailsById({
|
|
638
|
-
"modelPortfolioId": "2bcd7cc3-e922-4976-bce1-9858296801c3",
|
|
639
|
-
})
|
|
640
|
-
|
|
641
|
-
console.log(getModelDetailsByIdResponse)
|
|
642
|
-
|
|
643
|
-
```
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
### Parameters
|
|
647
|
-
|
|
648
|
-
Name | Type | Description | Notes
|
|
649
|
-
------------- | ------------- | ------------- | -------------
|
|
650
|
-
**modelPortfolioId** | [**string**] | The ID of the model portfolio to get. | defaults to undefined
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
### Return type
|
|
654
|
-
|
|
655
|
-
**ModelPortfolioDetails**
|
|
656
|
-
|
|
657
|
-
### HTTP request headers
|
|
658
|
-
|
|
659
|
-
- **Content-Type**: Not defined
|
|
660
|
-
- **Accept**: application/json
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
### HTTP response details
|
|
664
|
-
| Status code | Description | Response headers |
|
|
665
|
-
|-------------|-------------|------------------|
|
|
666
|
-
**200** | Details of a particular model portfolio. | - |
|
|
667
|
-
|
|
668
|
-
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
669
|
-
|
|
670
|
-
# **getPortfolioBalances**
|
|
671
|
-
|
|
672
|
-
#### **GET** /portfolioGroups/{portfolioGroupId}/balances
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
### Example
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
```typescript
|
|
679
|
-
import { Snaptrade } from "snaptrade-typescript-sdk"
|
|
680
|
-
|
|
681
|
-
const snaptrade = new Snaptrade({
|
|
682
|
-
// Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
|
|
683
|
-
// basePath: "https://api.snaptrade.com/api/v1",
|
|
684
|
-
consumerKey: "YOUR_CONSUMER_KEY",
|
|
685
|
-
clientId: "YOUR_CLIENT_ID",
|
|
686
|
-
})
|
|
687
|
-
|
|
688
|
-
const getPortfolioBalancesResponse = await snaptrade.portfolioManagement.getPortfolioBalances({
|
|
689
|
-
"portfolioGroupId": "portfolioGroupId_example",
|
|
690
|
-
})
|
|
691
|
-
|
|
692
|
-
console.log(getPortfolioBalancesResponse)
|
|
693
|
-
|
|
694
|
-
```
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
### Parameters
|
|
698
|
-
|
|
699
|
-
Name | Type | Description | Notes
|
|
700
|
-
------------- | ------------- | ------------- | -------------
|
|
701
|
-
**portfolioGroupId** | [**string**] | The ID of the PortfolioGroup under which to create the target asset. | defaults to undefined
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
### Return type
|
|
705
|
-
|
|
706
|
-
**Array<Balance>**
|
|
707
|
-
|
|
708
|
-
### HTTP request headers
|
|
709
|
-
|
|
710
|
-
- **Content-Type**: Not defined
|
|
711
|
-
- **Accept**: application/json
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
### HTTP response details
|
|
715
|
-
| Status code | Description | Response headers |
|
|
716
|
-
|-------------|-------------|------------------|
|
|
717
|
-
**200** | Sum of cash balances across accounts in portfolio group by currency | - |
|
|
718
|
-
**400** | The specified portfolioGroupId is invalid (not a UUID string) or the input data is invalid. | - |
|
|
719
|
-
**404** | The specified portfolioGroupId was not found. | - |
|
|
720
|
-
**0** | Unexpected error. | - |
|
|
721
|
-
|
|
722
|
-
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
723
|
-
|
|
724
|
-
# **getPortfolioDetailsById**
|
|
725
|
-
|
|
726
|
-
#### **GET** /portfolioGroups/{portfolioGroupId}
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
### Example
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
```typescript
|
|
733
|
-
import { Snaptrade } from "snaptrade-typescript-sdk"
|
|
734
|
-
|
|
735
|
-
const snaptrade = new Snaptrade({
|
|
736
|
-
// Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
|
|
737
|
-
// basePath: "https://api.snaptrade.com/api/v1",
|
|
738
|
-
consumerKey: "YOUR_CONSUMER_KEY",
|
|
739
|
-
clientId: "YOUR_CLIENT_ID",
|
|
740
|
-
})
|
|
741
|
-
|
|
742
|
-
const getPortfolioDetailsByIdResponse = await snaptrade.portfolioManagement.getPortfolioDetailsById({
|
|
743
|
-
"portfolioGroupId": "portfolioGroupId_example",
|
|
744
|
-
})
|
|
745
|
-
|
|
746
|
-
console.log(getPortfolioDetailsByIdResponse)
|
|
747
|
-
|
|
748
|
-
```
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
### Parameters
|
|
752
|
-
|
|
753
|
-
Name | Type | Description | Notes
|
|
754
|
-
------------- | ------------- | ------------- | -------------
|
|
755
|
-
**portfolioGroupId** | [**string**] | The ID of the PortfolioGroup to get. | defaults to undefined
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
### Return type
|
|
759
|
-
|
|
760
|
-
**PortfolioGroup**
|
|
761
|
-
|
|
762
|
-
### HTTP request headers
|
|
763
|
-
|
|
764
|
-
- **Content-Type**: Not defined
|
|
765
|
-
- **Accept**: */*
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
### HTTP response details
|
|
769
|
-
| Status code | Description | Response headers |
|
|
770
|
-
|-------------|-------------|------------------|
|
|
771
|
-
**200** | Successfully gets a target portfolio | - |
|
|
772
|
-
**0** | Unexpected error | - |
|
|
773
|
-
|
|
774
|
-
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
775
|
-
|
|
776
|
-
# **getPortfolioInfo**
|
|
777
|
-
|
|
778
|
-
#### **GET** /portfolioGroups/{portfolioGroupId}/info
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
### Example
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
```typescript
|
|
785
|
-
import { Snaptrade } from "snaptrade-typescript-sdk"
|
|
786
|
-
|
|
787
|
-
const snaptrade = new Snaptrade({
|
|
788
|
-
// Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
|
|
789
|
-
// basePath: "https://api.snaptrade.com/api/v1",
|
|
790
|
-
consumerKey: "YOUR_CONSUMER_KEY",
|
|
791
|
-
clientId: "YOUR_CLIENT_ID",
|
|
792
|
-
})
|
|
793
|
-
|
|
794
|
-
const getPortfolioInfoResponse = await snaptrade.portfolioManagement.getPortfolioInfo({
|
|
795
|
-
"portfolioGroupId": "portfolioGroupId_example",
|
|
796
|
-
})
|
|
797
|
-
|
|
798
|
-
console.log(getPortfolioInfoResponse)
|
|
799
|
-
|
|
800
|
-
```
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
### Parameters
|
|
804
|
-
|
|
805
|
-
Name | Type | Description | Notes
|
|
806
|
-
------------- | ------------- | ------------- | -------------
|
|
807
|
-
**portfolioGroupId** | [**string**] | The ID of the PortfolioGroup under which to create the target asset. | defaults to undefined
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
### Return type
|
|
811
|
-
|
|
812
|
-
**PortfolioGroupInfo**
|
|
813
|
-
|
|
814
|
-
### HTTP request headers
|
|
815
|
-
|
|
816
|
-
- **Content-Type**: Not defined
|
|
817
|
-
- **Accept**: application/json
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
### HTTP response details
|
|
821
|
-
| Status code | Description | Response headers |
|
|
822
|
-
|-------------|-------------|------------------|
|
|
823
|
-
**200** | Portfolio group target allocation has been updated | - |
|
|
824
|
-
**0** | Unexpected error. | - |
|
|
825
|
-
|
|
826
|
-
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
827
|
-
|
|
828
|
-
# **getPortfolioPositions**
|
|
829
|
-
|
|
830
|
-
#### **GET** /portfolioGroups/{portfolioGroupId}/positions
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
### Example
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
```typescript
|
|
837
|
-
import { Snaptrade } from "snaptrade-typescript-sdk"
|
|
838
|
-
|
|
839
|
-
const snaptrade = new Snaptrade({
|
|
840
|
-
// Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
|
|
841
|
-
// basePath: "https://api.snaptrade.com/api/v1",
|
|
842
|
-
consumerKey: "YOUR_CONSUMER_KEY",
|
|
843
|
-
clientId: "YOUR_CLIENT_ID",
|
|
844
|
-
})
|
|
845
|
-
|
|
846
|
-
const getPortfolioPositionsResponse = await snaptrade.portfolioManagement.getPortfolioPositions({
|
|
847
|
-
"portfolioGroupId": "portfolioGroupId_example",
|
|
848
|
-
})
|
|
849
|
-
|
|
850
|
-
console.log(getPortfolioPositionsResponse)
|
|
851
|
-
|
|
852
|
-
```
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
### Parameters
|
|
856
|
-
|
|
857
|
-
Name | Type | Description | Notes
|
|
858
|
-
------------- | ------------- | ------------- | -------------
|
|
859
|
-
**portfolioGroupId** | [**string**] | The ID of the PortfolioGroup under which to create the target asset. | defaults to undefined
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
### Return type
|
|
863
|
-
|
|
864
|
-
**Array<PortfolioGroupPosition>**
|
|
865
|
-
|
|
866
|
-
### HTTP request headers
|
|
867
|
-
|
|
868
|
-
- **Content-Type**: Not defined
|
|
869
|
-
- **Accept**: application/json
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
### HTTP response details
|
|
873
|
-
| Status code | Description | Response headers |
|
|
874
|
-
|-------------|-------------|------------------|
|
|
875
|
-
**200** | Totals of each postions owned in portfolio group | - |
|
|
876
|
-
**400** | The specified portfolioGroupId is invalid (not a UUID string) or the input data is invalid. | - |
|
|
877
|
-
**404** | The specified portfolioGroupId was not found. | - |
|
|
878
|
-
**0** | Unexpected error. | - |
|
|
879
|
-
|
|
880
|
-
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
881
|
-
|
|
882
|
-
# **getPortfolioSettings**
|
|
883
|
-
|
|
884
|
-
#### **GET** /portfolioGroups/{portfolioGroupId}/settings
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
### Example
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
```typescript
|
|
891
|
-
import { Snaptrade } from "snaptrade-typescript-sdk"
|
|
892
|
-
|
|
893
|
-
const snaptrade = new Snaptrade({
|
|
894
|
-
// Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
|
|
895
|
-
// basePath: "https://api.snaptrade.com/api/v1",
|
|
896
|
-
consumerKey: "YOUR_CONSUMER_KEY",
|
|
897
|
-
clientId: "YOUR_CLIENT_ID",
|
|
898
|
-
})
|
|
899
|
-
|
|
900
|
-
const getPortfolioSettingsResponse = await snaptrade.portfolioManagement.getPortfolioSettings({
|
|
901
|
-
"portfolioGroupId": "portfolioGroupId_example",
|
|
902
|
-
})
|
|
903
|
-
|
|
904
|
-
console.log(getPortfolioSettingsResponse)
|
|
905
|
-
|
|
906
|
-
```
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
### Parameters
|
|
910
|
-
|
|
911
|
-
Name | Type | Description | Notes
|
|
912
|
-
------------- | ------------- | ------------- | -------------
|
|
913
|
-
**portfolioGroupId** | [**string**] | The ID of the PortfolioGroup under which to get the settings. | defaults to undefined
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
### Return type
|
|
917
|
-
|
|
918
|
-
**PortfolioGroupSettings**
|
|
919
|
-
|
|
920
|
-
### HTTP request headers
|
|
921
|
-
|
|
922
|
-
- **Content-Type**: Not defined
|
|
923
|
-
- **Accept**: application/json
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
### HTTP response details
|
|
927
|
-
| Status code | Description | Response headers |
|
|
928
|
-
|-------------|-------------|------------------|
|
|
929
|
-
**200** | Settings of portfolio group | - |
|
|
930
|
-
**0** | Unexpected error | - |
|
|
931
|
-
|
|
932
|
-
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
933
|
-
|
|
934
|
-
# **getPortfolioTargetById**
|
|
935
|
-
|
|
936
|
-
#### **GET** /portfolioGroups/{portfolioGroupId}/targets/{targetAssetId}
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
### Example
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
```typescript
|
|
943
|
-
import { Snaptrade } from "snaptrade-typescript-sdk"
|
|
944
|
-
|
|
945
|
-
const snaptrade = new Snaptrade({
|
|
946
|
-
// Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
|
|
947
|
-
// basePath: "https://api.snaptrade.com/api/v1",
|
|
948
|
-
consumerKey: "YOUR_CONSUMER_KEY",
|
|
949
|
-
clientId: "YOUR_CLIENT_ID",
|
|
950
|
-
})
|
|
951
|
-
|
|
952
|
-
const getPortfolioTargetByIdResponse = await snaptrade.portfolioManagement.getPortfolioTargetById({
|
|
953
|
-
"portfolioGroupId": "portfolioGroupId_example",
|
|
954
|
-
"targetAssetId": "targetAssetId_example",
|
|
955
|
-
})
|
|
956
|
-
|
|
957
|
-
console.log(getPortfolioTargetByIdResponse)
|
|
958
|
-
|
|
959
|
-
```
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
### Parameters
|
|
963
|
-
|
|
964
|
-
Name | Type | Description | Notes
|
|
965
|
-
------------- | ------------- | ------------- | -------------
|
|
966
|
-
**portfolioGroupId** | [**string**] | The ID of the PortfolioGroup under which to get the target asset. | defaults to undefined
|
|
967
|
-
**targetAssetId** | [**string**] | The ID of the TargetAsset to get. | defaults to undefined
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
### Return type
|
|
971
|
-
|
|
972
|
-
**TargetAsset**
|
|
973
|
-
|
|
974
|
-
### HTTP request headers
|
|
975
|
-
|
|
976
|
-
- **Content-Type**: Not defined
|
|
977
|
-
- **Accept**: */*
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
### HTTP response details
|
|
981
|
-
| Status code | Description | Response headers |
|
|
982
|
-
|-------------|-------------|------------------|
|
|
983
|
-
**200** | Successfully get target asset. | - |
|
|
984
|
-
**0** | Unexpected errors | - |
|
|
985
|
-
|
|
986
|
-
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
987
|
-
|
|
988
|
-
# **getPortfolioTargets**
|
|
989
|
-
|
|
990
|
-
#### **GET** /portfolioGroups/{portfolioGroupId}/targets
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
### Example
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
```typescript
|
|
997
|
-
import { Snaptrade } from "snaptrade-typescript-sdk"
|
|
998
|
-
|
|
999
|
-
const snaptrade = new Snaptrade({
|
|
1000
|
-
// Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
|
|
1001
|
-
// basePath: "https://api.snaptrade.com/api/v1",
|
|
1002
|
-
consumerKey: "YOUR_CONSUMER_KEY",
|
|
1003
|
-
clientId: "YOUR_CLIENT_ID",
|
|
1004
|
-
})
|
|
1005
|
-
|
|
1006
|
-
const getPortfolioTargetsResponse = await snaptrade.portfolioManagement.getPortfolioTargets({
|
|
1007
|
-
"portfolioGroupId": "portfolioGroupId_example",
|
|
1008
|
-
})
|
|
1009
|
-
|
|
1010
|
-
console.log(getPortfolioTargetsResponse)
|
|
1011
|
-
|
|
1012
|
-
```
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
### Parameters
|
|
1016
|
-
|
|
1017
|
-
Name | Type | Description | Notes
|
|
1018
|
-
------------- | ------------- | ------------- | -------------
|
|
1019
|
-
**portfolioGroupId** | [**string**] | The ID of the PortfolioGroup under which to create the target asset. | defaults to undefined
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
### Return type
|
|
1023
|
-
|
|
1024
|
-
**Array<TargetAsset>**
|
|
1025
|
-
|
|
1026
|
-
### HTTP request headers
|
|
1027
|
-
|
|
1028
|
-
- **Content-Type**: Not defined
|
|
1029
|
-
- **Accept**: application/json
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
### HTTP response details
|
|
1033
|
-
| Status code | Description | Response headers |
|
|
1034
|
-
|-------------|-------------|------------------|
|
|
1035
|
-
**200** | All target assets owned by the specified PortfolioGroup. | - |
|
|
1036
|
-
**400** | The specified portfolioGroupId is invalid (not a UUID string) or the input data is invalid. | - |
|
|
1037
|
-
**404** | The specified portfolioGroupId was not found. | - |
|
|
1038
|
-
**0** | Unexpected error. | - |
|
|
1039
|
-
|
|
1040
|
-
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
1041
|
-
|
|
1042
|
-
# **getPortoflioExcludedAssets**
|
|
1043
|
-
|
|
1044
|
-
#### **GET** /portfolioGroups/{portfolioGroupId}/excludedassets
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
### Example
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
```typescript
|
|
1051
|
-
import { Snaptrade } from "snaptrade-typescript-sdk"
|
|
1052
|
-
|
|
1053
|
-
const snaptrade = new Snaptrade({
|
|
1054
|
-
// Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
|
|
1055
|
-
// basePath: "https://api.snaptrade.com/api/v1",
|
|
1056
|
-
consumerKey: "YOUR_CONSUMER_KEY",
|
|
1057
|
-
clientId: "YOUR_CLIENT_ID",
|
|
1058
|
-
})
|
|
1059
|
-
|
|
1060
|
-
const getPortoflioExcludedAssetsResponse = await snaptrade.portfolioManagement.getPortoflioExcludedAssets({
|
|
1061
|
-
"portfolioGroupId": "portfolioGroupId_example",
|
|
1062
|
-
})
|
|
1063
|
-
|
|
1064
|
-
console.log(getPortoflioExcludedAssetsResponse)
|
|
1065
|
-
|
|
1066
|
-
```
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
### Parameters
|
|
1070
|
-
|
|
1071
|
-
Name | Type | Description | Notes
|
|
1072
|
-
------------- | ------------- | ------------- | -------------
|
|
1073
|
-
**portfolioGroupId** | [**string**] | The ID of the PortfolioGroup under which the excluded assets are linked. | defaults to undefined
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
### Return type
|
|
1077
|
-
|
|
1078
|
-
**Array<ExcludedAsset>**
|
|
1079
|
-
|
|
1080
|
-
### HTTP request headers
|
|
1081
|
-
|
|
1082
|
-
- **Content-Type**: Not defined
|
|
1083
|
-
- **Accept**: application/json
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
### HTTP response details
|
|
1087
|
-
| Status code | Description | Response headers |
|
|
1088
|
-
|-------------|-------------|------------------|
|
|
1089
|
-
**200** | Array of excluded assets linked to portfolio group | - |
|
|
1090
|
-
**0** | Unexpected error | - |
|
|
1091
|
-
|
|
1092
|
-
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
1093
|
-
|
|
1094
|
-
# **importModelPortfolio**
|
|
1095
|
-
|
|
1096
|
-
#### **POST** /portfolioGroups/{portfolioGroupId}/import
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
### Example
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
```typescript
|
|
1103
|
-
import { Snaptrade } from "snaptrade-typescript-sdk"
|
|
1104
|
-
|
|
1105
|
-
const snaptrade = new Snaptrade({
|
|
1106
|
-
// Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
|
|
1107
|
-
// basePath: "https://api.snaptrade.com/api/v1",
|
|
1108
|
-
consumerKey: "YOUR_CONSUMER_KEY",
|
|
1109
|
-
clientId: "YOUR_CLIENT_ID",
|
|
1110
|
-
})
|
|
1111
|
-
|
|
1112
|
-
const importModelPortfolioResponse = await snaptrade.portfolioManagement.importModelPortfolio({
|
|
1113
|
-
"portfolioGroupId": "portfolioGroupId_example",
|
|
1114
|
-
})
|
|
1115
|
-
|
|
1116
|
-
console.log(importModelPortfolioResponse)
|
|
1117
|
-
|
|
1118
|
-
```
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
### Parameters
|
|
1122
|
-
|
|
1123
|
-
Name | Type | Description | Notes
|
|
1124
|
-
------------- | ------------- | ------------- | -------------
|
|
1125
|
-
**portfolioGroupId** | [**string**] | The ID of the PortfolioGroup under which to create the target asset. | defaults to undefined
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
### Return type
|
|
1129
|
-
|
|
1130
|
-
**Array<TargetAsset>**
|
|
1131
|
-
|
|
1132
|
-
### HTTP request headers
|
|
1133
|
-
|
|
1134
|
-
- **Content-Type**: Not defined
|
|
1135
|
-
- **Accept**: application/json
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
### HTTP response details
|
|
1139
|
-
| Status code | Description | Response headers |
|
|
1140
|
-
|-------------|-------------|------------------|
|
|
1141
|
-
**200** | Portfolio group target allocation has been updated | - |
|
|
1142
|
-
**0** | Unexpected error. | - |
|
|
1143
|
-
|
|
1144
|
-
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
1145
|
-
|
|
1146
|
-
# **list**
|
|
1147
|
-
|
|
1148
|
-
#### **GET** /portfolioGroups
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
### Example
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
```typescript
|
|
1155
|
-
import { Snaptrade } from "snaptrade-typescript-sdk"
|
|
1156
|
-
|
|
1157
|
-
const snaptrade = new Snaptrade({
|
|
1158
|
-
// Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
|
|
1159
|
-
// basePath: "https://api.snaptrade.com/api/v1",
|
|
1160
|
-
consumerKey: "YOUR_CONSUMER_KEY",
|
|
1161
|
-
clientId: "YOUR_CLIENT_ID",
|
|
1162
|
-
})
|
|
1163
|
-
|
|
1164
|
-
const listResponse = await snaptrade.portfolioManagement.list({
|
|
1165
|
-
"userId": "John.doe@snaptrade.com",
|
|
1166
|
-
"userSecret": "USERSECRET123",
|
|
1167
|
-
})
|
|
1168
|
-
|
|
1169
|
-
console.log(listResponse)
|
|
1170
|
-
|
|
1171
|
-
```
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
### Parameters
|
|
1175
|
-
|
|
1176
|
-
Name | Type | Description | Notes
|
|
1177
|
-
------------- | ------------- | ------------- | -------------
|
|
1178
|
-
**userId** | [**string**] | | defaults to undefined
|
|
1179
|
-
**userSecret** | [**string**] | | defaults to undefined
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
### Return type
|
|
1183
|
-
|
|
1184
|
-
**Array<PortfolioGroup>**
|
|
1185
|
-
|
|
1186
|
-
### HTTP request headers
|
|
1187
|
-
|
|
1188
|
-
- **Content-Type**: Not defined
|
|
1189
|
-
- **Accept**: application/json
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
### HTTP response details
|
|
1193
|
-
| Status code | Description | Response headers |
|
|
1194
|
-
|-------------|-------------|------------------|
|
|
1195
|
-
**200** | A list of all PortfolioGroup objects for the authenticated user. | - |
|
|
1196
|
-
**0** | Unexpected error. | - |
|
|
1197
|
-
|
|
1198
|
-
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
1199
|
-
|
|
1200
|
-
# **listAssetClasses**
|
|
1201
|
-
|
|
1202
|
-
#### **GET** /modelAssetClass
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
### Example
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
```typescript
|
|
1209
|
-
import { Snaptrade } from "snaptrade-typescript-sdk"
|
|
1210
|
-
|
|
1211
|
-
const snaptrade = new Snaptrade({
|
|
1212
|
-
// Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
|
|
1213
|
-
// basePath: "https://api.snaptrade.com/api/v1",
|
|
1214
|
-
consumerKey: "YOUR_CONSUMER_KEY",
|
|
1215
|
-
clientId: "YOUR_CLIENT_ID",
|
|
1216
|
-
})
|
|
1217
|
-
|
|
1218
|
-
const listAssetClassesResponse = await snaptrade.portfolioManagement.listAssetClasses()
|
|
1219
|
-
|
|
1220
|
-
console.log(listAssetClassesResponse)
|
|
1221
|
-
|
|
1222
|
-
```
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
### Parameters
|
|
1226
|
-
This endpoint does not need any parameter.
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
### Return type
|
|
1230
|
-
|
|
1231
|
-
**Array<ModelAssetClassDetails>**
|
|
1232
|
-
|
|
1233
|
-
### HTTP request headers
|
|
1234
|
-
|
|
1235
|
-
- **Content-Type**: Not defined
|
|
1236
|
-
- **Accept**: application/json
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
### HTTP response details
|
|
1240
|
-
| Status code | Description | Response headers |
|
|
1241
|
-
|-------------|-------------|------------------|
|
|
1242
|
-
**200** | A list of all model asset class objects for the authenticated user. | - |
|
|
1243
|
-
|
|
1244
|
-
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
1245
|
-
|
|
1246
|
-
# **listCalculatedTrades**
|
|
1247
|
-
|
|
1248
|
-
#### **GET** /portfolioGroups/{portfolioGroupId}/calculatedtrades
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
### Example
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
```typescript
|
|
1255
|
-
import { Snaptrade } from "snaptrade-typescript-sdk"
|
|
1256
|
-
|
|
1257
|
-
const snaptrade = new Snaptrade({
|
|
1258
|
-
// Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
|
|
1259
|
-
// basePath: "https://api.snaptrade.com/api/v1",
|
|
1260
|
-
consumerKey: "YOUR_CONSUMER_KEY",
|
|
1261
|
-
clientId: "YOUR_CLIENT_ID",
|
|
1262
|
-
})
|
|
1263
|
-
|
|
1264
|
-
const listCalculatedTradesResponse = await snaptrade.portfolioManagement.listCalculatedTrades({
|
|
1265
|
-
"portfolioGroupId": "portfolioGroupId_example",
|
|
1266
|
-
})
|
|
1267
|
-
|
|
1268
|
-
console.log(listCalculatedTradesResponse)
|
|
1269
|
-
|
|
1270
|
-
```
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
### Parameters
|
|
1274
|
-
|
|
1275
|
-
Name | Type | Description | Notes
|
|
1276
|
-
------------- | ------------- | ------------- | -------------
|
|
1277
|
-
**portfolioGroupId** | [**string**] | The ID of the PortfolioGroup to perform rebalancing calculations | defaults to undefined
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
### Return type
|
|
1281
|
-
|
|
1282
|
-
**CalculatedTrade**
|
|
1283
|
-
|
|
1284
|
-
### HTTP request headers
|
|
1285
|
-
|
|
1286
|
-
- **Content-Type**: Not defined
|
|
1287
|
-
- **Accept**: application/json
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
### HTTP response details
|
|
1291
|
-
| Status code | Description | Response headers |
|
|
1292
|
-
|-------------|-------------|------------------|
|
|
1293
|
-
**200** | Calculated trades to make | - |
|
|
1294
|
-
|
|
1295
|
-
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
1296
|
-
|
|
1297
|
-
# **listModelPortfolio**
|
|
1298
|
-
|
|
1299
|
-
#### **GET** /modelPortfolio
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
### Example
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
```typescript
|
|
1306
|
-
import { Snaptrade } from "snaptrade-typescript-sdk"
|
|
1307
|
-
|
|
1308
|
-
const snaptrade = new Snaptrade({
|
|
1309
|
-
// Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
|
|
1310
|
-
// basePath: "https://api.snaptrade.com/api/v1",
|
|
1311
|
-
consumerKey: "YOUR_CONSUMER_KEY",
|
|
1312
|
-
clientId: "YOUR_CLIENT_ID",
|
|
1313
|
-
})
|
|
1314
|
-
|
|
1315
|
-
const listModelPortfolioResponse = await snaptrade.portfolioManagement.listModelPortfolio()
|
|
1316
|
-
|
|
1317
|
-
console.log(listModelPortfolioResponse)
|
|
1318
|
-
|
|
1319
|
-
```
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
### Parameters
|
|
1323
|
-
This endpoint does not need any parameter.
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
### Return type
|
|
1327
|
-
|
|
1328
|
-
**Array<ModelPortfolioDetails>**
|
|
1329
|
-
|
|
1330
|
-
### HTTP request headers
|
|
1331
|
-
|
|
1332
|
-
- **Content-Type**: Not defined
|
|
1333
|
-
- **Accept**: application/json
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
### HTTP response details
|
|
1337
|
-
| Status code | Description | Response headers |
|
|
1338
|
-
|-------------|-------------|------------------|
|
|
1339
|
-
**200** | A list of all model portfolio objects for the authenticated user. | - |
|
|
1340
|
-
|
|
1341
|
-
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
1342
|
-
|
|
1343
|
-
# **listPortfolioAccounts**
|
|
1344
|
-
|
|
1345
|
-
#### **GET** /portfolioGroups/{portfolioGroupId}/accounts
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
### Example
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
```typescript
|
|
1352
|
-
import { Snaptrade } from "snaptrade-typescript-sdk"
|
|
1353
|
-
|
|
1354
|
-
const snaptrade = new Snaptrade({
|
|
1355
|
-
// Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
|
|
1356
|
-
// basePath: "https://api.snaptrade.com/api/v1",
|
|
1357
|
-
consumerKey: "YOUR_CONSUMER_KEY",
|
|
1358
|
-
clientId: "YOUR_CLIENT_ID",
|
|
1359
|
-
})
|
|
1360
|
-
|
|
1361
|
-
const listPortfolioAccountsResponse = await snaptrade.portfolioManagement.listPortfolioAccounts({
|
|
1362
|
-
"portfolioGroupId": "portfolioGroupId_example",
|
|
1363
|
-
})
|
|
1364
|
-
|
|
1365
|
-
console.log(listPortfolioAccountsResponse)
|
|
1366
|
-
|
|
1367
|
-
```
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
### Parameters
|
|
1371
|
-
|
|
1372
|
-
Name | Type | Description | Notes
|
|
1373
|
-
------------- | ------------- | ------------- | -------------
|
|
1374
|
-
**portfolioGroupId** | [**string**] | The ID of the PortfolioGroup under which the accounts are linked. | defaults to undefined
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
### Return type
|
|
1378
|
-
|
|
1379
|
-
**Array<Account>**
|
|
1380
|
-
|
|
1381
|
-
### HTTP request headers
|
|
1382
|
-
|
|
1383
|
-
- **Content-Type**: Not defined
|
|
1384
|
-
- **Accept**: application/json
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
### HTTP response details
|
|
1388
|
-
| Status code | Description | Response headers |
|
|
1389
|
-
|-------------|-------------|------------------|
|
|
1390
|
-
**200** | Accounts linked to portfolio group | - |
|
|
1391
|
-
**0** | Unexpected error | - |
|
|
1392
|
-
|
|
1393
|
-
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
1394
|
-
|
|
1395
|
-
# **modifyModelPortfolioById**
|
|
1396
|
-
|
|
1397
|
-
#### **POST** /modelPortfolio/{modelPortfolioId}
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
### Example
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
```typescript
|
|
1404
|
-
import { Snaptrade } from "snaptrade-typescript-sdk"
|
|
1405
|
-
|
|
1406
|
-
const snaptrade = new Snaptrade({
|
|
1407
|
-
// Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
|
|
1408
|
-
// basePath: "https://api.snaptrade.com/api/v1",
|
|
1409
|
-
consumerKey: "YOUR_CONSUMER_KEY",
|
|
1410
|
-
clientId: "YOUR_CLIENT_ID",
|
|
1411
|
-
})
|
|
1412
|
-
|
|
1413
|
-
const modifyModelPortfolioByIdResponse = await snaptrade.portfolioManagement.modifyModelPortfolioById({
|
|
1414
|
-
"modelPortfolioId": "2bcd7cc3-e922-4976-bce1-9858296801c3",
|
|
1415
|
-
})
|
|
1416
|
-
|
|
1417
|
-
console.log(modifyModelPortfolioByIdResponse)
|
|
1418
|
-
|
|
1419
|
-
```
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
### Parameters
|
|
1423
|
-
|
|
1424
|
-
Name | Type | Description | Notes
|
|
1425
|
-
------------- | ------------- | ------------- | -------------
|
|
1426
|
-
**modelPortfolioDetails** | **ModelPortfolioDetails**| Use this endpoint change model asset class name and to add or remove a model portfolio security/model portfolio asset class. <br /><br /> * The model portfolio name and model portfolio model type is required. <br /> * The model portfolio model type must be either 0 or 1. [0 -> Securities based, 1 -> Asset Class based] <br /><br /> * If the model portfolio type is 0, the model portfolio asset class must be an empty array. <br /> * If the model portfolio type is 1, the model portfolio security must be an empty array. <br /><br /> * When updating the model portfolio security, the percent is required. Only the symbol id is required for the symbol object <br /> * When updating the model portfolio asset classes, the percent is required. Only the model asset class id is required for the model asset class object <br /><br /> * To remove all model portfolio securities or model portfolio asset class, set then to an empty array |
|
|
1427
|
-
**modelPortfolioId** | [**string**] | The ID of the model portfolio to update. | defaults to undefined
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
### Return type
|
|
1431
|
-
|
|
1432
|
-
void (empty response body)
|
|
1433
|
-
|
|
1434
|
-
### HTTP request headers
|
|
1435
|
-
|
|
1436
|
-
- **Content-Type**: application/json
|
|
1437
|
-
- **Accept**: Not defined
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
### HTTP response details
|
|
1441
|
-
| Status code | Description | Response headers |
|
|
1442
|
-
|-------------|-------------|------------------|
|
|
1443
|
-
**200** | Updates model portfolio object with data from request body. | - |
|
|
1444
|
-
|
|
1445
|
-
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
1446
|
-
|
|
1447
|
-
# **savePortfolio**
|
|
1448
|
-
|
|
1449
|
-
#### **PATCH** /portfolioGroups/{portfolioGroupId}
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
### Example
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
```typescript
|
|
1456
|
-
import { Snaptrade } from "snaptrade-typescript-sdk"
|
|
1457
|
-
|
|
1458
|
-
const snaptrade = new Snaptrade({
|
|
1459
|
-
// Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
|
|
1460
|
-
// basePath: "https://api.snaptrade.com/api/v1",
|
|
1461
|
-
consumerKey: "YOUR_CONSUMER_KEY",
|
|
1462
|
-
clientId: "YOUR_CLIENT_ID",
|
|
1463
|
-
})
|
|
1464
|
-
|
|
1465
|
-
const savePortfolioResponse = await snaptrade.portfolioManagement.savePortfolio({
|
|
1466
|
-
"portfolioGroupId": "portfolioGroupId_example",
|
|
1467
|
-
"id": "2bcd7cc3-e922-4976-bce1-9858296801c3",
|
|
1468
|
-
"name": "Combined Retirement Portfolio",
|
|
1469
|
-
})
|
|
1470
|
-
|
|
1471
|
-
console.log(savePortfolioResponse)
|
|
1472
|
-
|
|
1473
|
-
```
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
### Parameters
|
|
1477
|
-
|
|
1478
|
-
Name | Type | Description | Notes
|
|
1479
|
-
------------- | ------------- | ------------- | -------------
|
|
1480
|
-
**requestBody** | **{ [key: string]: any; }**| |
|
|
1481
|
-
**portfolioGroupId** | [**string**] | The ID of the PortfolioGroup to update. | defaults to undefined
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
### Return type
|
|
1485
|
-
|
|
1486
|
-
**PortfolioGroup**
|
|
1487
|
-
|
|
1488
|
-
### HTTP request headers
|
|
1489
|
-
|
|
1490
|
-
- **Content-Type**: application/json
|
|
1491
|
-
- **Accept**: application/json
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
### HTTP response details
|
|
1495
|
-
| Status code | Description | Response headers |
|
|
1496
|
-
|-------------|-------------|------------------|
|
|
1497
|
-
**200** | The PortfolioGroup object which was updated. | - |
|
|
1498
|
-
**400** | The specified portfolioGroupId is invalid (not a UUID string) or the input data is invalid. | - |
|
|
1499
|
-
**404** | The specified portfolioGroupId was not found. | - |
|
|
1500
|
-
**0** | Unexpected error. | - |
|
|
1501
|
-
|
|
1502
|
-
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
1503
|
-
|
|
1504
|
-
# **searchPortfolioSymbols**
|
|
1505
|
-
|
|
1506
|
-
#### **POST** /portfolioGroups/{portfolioGroupId}/symbols
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
### Example
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
```typescript
|
|
1513
|
-
import { Snaptrade } from "snaptrade-typescript-sdk"
|
|
1514
|
-
|
|
1515
|
-
const snaptrade = new Snaptrade({
|
|
1516
|
-
// Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
|
|
1517
|
-
// basePath: "https://api.snaptrade.com/api/v1",
|
|
1518
|
-
consumerKey: "YOUR_CONSUMER_KEY",
|
|
1519
|
-
clientId: "YOUR_CLIENT_ID",
|
|
1520
|
-
})
|
|
1521
|
-
|
|
1522
|
-
const searchPortfolioSymbolsResponse = await snaptrade.portfolioManagement.searchPortfolioSymbols({
|
|
1523
|
-
"portfolioGroupId": "portfolioGroupId_example",
|
|
1524
|
-
"substring": "apple",
|
|
1525
|
-
})
|
|
1526
|
-
|
|
1527
|
-
console.log(searchPortfolioSymbolsResponse)
|
|
1528
|
-
|
|
1529
|
-
```
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
### Parameters
|
|
1533
|
-
|
|
1534
|
-
Name | Type | Description | Notes
|
|
1535
|
-
------------- | ------------- | ------------- | -------------
|
|
1536
|
-
**symbolQuery** | **SymbolQuery**| |
|
|
1537
|
-
**portfolioGroupId** | [**string**] | The ID of the PortfolioGroup to search under | defaults to undefined
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
### Return type
|
|
1541
|
-
|
|
1542
|
-
**Array<UniversalSymbol>**
|
|
1543
|
-
|
|
1544
|
-
### HTTP request headers
|
|
1545
|
-
|
|
1546
|
-
- **Content-Type**: application/json
|
|
1547
|
-
- **Accept**: application/json
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
### HTTP response details
|
|
1551
|
-
| Status code | Description | Response headers |
|
|
1552
|
-
|-------------|-------------|------------------|
|
|
1553
|
-
**200** | A list of UniversalSymbol objects which match the specified substring | - |
|
|
1554
|
-
**0** | Unexpected error. | - |
|
|
1555
|
-
|
|
1556
|
-
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
1557
|
-
|
|
1558
|
-
# **setPortfolioTargets**
|
|
1559
|
-
|
|
1560
|
-
#### **POST** /portfolioGroups/{portfolioGroupId}/targets
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
### Example
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
```typescript
|
|
1567
|
-
import { Snaptrade } from "snaptrade-typescript-sdk"
|
|
1568
|
-
|
|
1569
|
-
const snaptrade = new Snaptrade({
|
|
1570
|
-
// Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
|
|
1571
|
-
// basePath: "https://api.snaptrade.com/api/v1",
|
|
1572
|
-
consumerKey: "YOUR_CONSUMER_KEY",
|
|
1573
|
-
clientId: "YOUR_CLIENT_ID",
|
|
1574
|
-
})
|
|
1575
|
-
|
|
1576
|
-
const setPortfolioTargetsResponse = await snaptrade.portfolioManagement.setPortfolioTargets({
|
|
1577
|
-
'portfolioGroupId': "portfolioGroupId_example",
|
|
1578
|
-
'requestBody': [
|
|
1579
|
-
{
|
|
1580
|
-
"id": "2bcd7cc3-e922-4976-bce1-9858296801c3",
|
|
1581
|
-
"percent": 90,
|
|
1582
|
-
"is_supported": true,
|
|
1583
|
-
"is_excluded": true,
|
|
1584
|
-
}
|
|
1585
|
-
],
|
|
1586
|
-
})
|
|
1587
|
-
|
|
1588
|
-
console.log(setPortfolioTargetsResponse)
|
|
1589
|
-
|
|
1590
|
-
```
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
### Parameters
|
|
1594
|
-
|
|
1595
|
-
Name | Type | Description | Notes
|
|
1596
|
-
------------- | ------------- | ------------- | -------------
|
|
1597
|
-
**targetAsset** | **Array<TargetAsset>**| |
|
|
1598
|
-
**portfolioGroupId** | [**string**] | The ID of the PortfolioGroup under which to create the target asset. | defaults to undefined
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
### Return type
|
|
1602
|
-
|
|
1603
|
-
**Array<TargetAsset>**
|
|
1604
|
-
|
|
1605
|
-
### HTTP request headers
|
|
1606
|
-
|
|
1607
|
-
- **Content-Type**: application/json
|
|
1608
|
-
- **Accept**: application/json
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
### HTTP response details
|
|
1612
|
-
| Status code | Description | Response headers |
|
|
1613
|
-
|-------------|-------------|------------------|
|
|
1614
|
-
**200** | A new target asset or set of target assets is created. | - |
|
|
1615
|
-
**400** | The specified portfolioGroupId is invalid (not a UUID string) or the input data is invalid. | - |
|
|
1616
|
-
**404** | The specified portfolioGroupId was not found. | - |
|
|
1617
|
-
**0** | Unexpected error. | - |
|
|
1618
|
-
|
|
1619
|
-
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
1620
|
-
|
|
1621
|
-
# **updateAssetClass**
|
|
1622
|
-
|
|
1623
|
-
#### **POST** /modelAssetClass/{modelAssetClassId}
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
### Example
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
```typescript
|
|
1630
|
-
import { Snaptrade } from "snaptrade-typescript-sdk"
|
|
1631
|
-
|
|
1632
|
-
const snaptrade = new Snaptrade({
|
|
1633
|
-
// Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
|
|
1634
|
-
// basePath: "https://api.snaptrade.com/api/v1",
|
|
1635
|
-
consumerKey: "YOUR_CONSUMER_KEY",
|
|
1636
|
-
clientId: "YOUR_CLIENT_ID",
|
|
1637
|
-
})
|
|
1638
|
-
|
|
1639
|
-
const updateAssetClassResponse = await snaptrade.portfolioManagement.updateAssetClass({
|
|
1640
|
-
"modelAssetClassId": "2bcd7cc3-e922-4976-bce1-9858296801c3",
|
|
1641
|
-
})
|
|
1642
|
-
|
|
1643
|
-
console.log(updateAssetClassResponse)
|
|
1644
|
-
|
|
1645
|
-
```
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
### Parameters
|
|
1649
|
-
|
|
1650
|
-
Name | Type | Description | Notes
|
|
1651
|
-
------------- | ------------- | ------------- | -------------
|
|
1652
|
-
**modelAssetClassDetails** | **ModelAssetClassDetails**| Use this endpoint change model asset class name and to add or remove a model asset class target. <br /><br /> * Only the model asset class name is required for the model asset class object. <br /> * Only the symbol id is required for the symbol object in the model asset class target object. <br /> * To remove all model asset class targets, set the model asset class target as an empty array |
|
|
1653
|
-
**modelAssetClassId** | [**string**] | The ID of the model asset class to update. | defaults to undefined
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
### Return type
|
|
1657
|
-
|
|
1658
|
-
void (empty response body)
|
|
1659
|
-
|
|
1660
|
-
### HTTP request headers
|
|
1661
|
-
|
|
1662
|
-
- **Content-Type**: application/json
|
|
1663
|
-
- **Accept**: Not defined
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
### HTTP response details
|
|
1667
|
-
| Status code | Description | Response headers |
|
|
1668
|
-
|-------------|-------------|------------------|
|
|
1669
|
-
**200** | Updates model asset class with data from request body. | - |
|
|
1670
|
-
|
|
1671
|
-
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
1672
|
-
|
|
1673
|
-
# **updatePortfolioSettings**
|
|
1674
|
-
|
|
1675
|
-
#### **PATCH** /portfolioGroups/{portfolioGroupId}/settings
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
### Example
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
```typescript
|
|
1682
|
-
import { Snaptrade } from "snaptrade-typescript-sdk"
|
|
1683
|
-
|
|
1684
|
-
const snaptrade = new Snaptrade({
|
|
1685
|
-
// Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
|
|
1686
|
-
// basePath: "https://api.snaptrade.com/api/v1",
|
|
1687
|
-
consumerKey: "YOUR_CONSUMER_KEY",
|
|
1688
|
-
clientId: "YOUR_CLIENT_ID",
|
|
1689
|
-
})
|
|
1690
|
-
|
|
1691
|
-
const updatePortfolioSettingsResponse = await snaptrade.portfolioManagement.updatePortfolioSettings({
|
|
1692
|
-
"portfolioGroupId": "portfolioGroupId_example",
|
|
1693
|
-
})
|
|
1694
|
-
|
|
1695
|
-
console.log(updatePortfolioSettingsResponse)
|
|
1696
|
-
|
|
1697
|
-
```
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
### Parameters
|
|
1701
|
-
|
|
1702
|
-
Name | Type | Description | Notes
|
|
1703
|
-
------------- | ------------- | ------------- | -------------
|
|
1704
|
-
**portfolioGroupId** | [**string**] | The ID of the PortfolioGroup under which to patch the settings. | defaults to undefined
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
### Return type
|
|
1708
|
-
|
|
1709
|
-
**PortfolioGroupSettings**
|
|
1710
|
-
|
|
1711
|
-
### HTTP request headers
|
|
1712
|
-
|
|
1713
|
-
- **Content-Type**: Not defined
|
|
1714
|
-
- **Accept**: */*
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
### HTTP response details
|
|
1718
|
-
| Status code | Description | Response headers |
|
|
1719
|
-
|-------------|-------------|------------------|
|
|
1720
|
-
**200** | Settings of portfolio group | - |
|
|
1721
|
-
**0** | Unexpected error | - |
|
|
1722
|
-
|
|
1723
|
-
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
1724
|
-
|
|
1725
|
-
# **updatePortfolioTargetById**
|
|
1726
|
-
|
|
1727
|
-
#### **PATCH** /portfolioGroups/{portfolioGroupId}/targets/{targetAssetId}
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
### Example
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
```typescript
|
|
1734
|
-
import { Snaptrade } from "snaptrade-typescript-sdk"
|
|
1735
|
-
|
|
1736
|
-
const snaptrade = new Snaptrade({
|
|
1737
|
-
// Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
|
|
1738
|
-
// basePath: "https://api.snaptrade.com/api/v1",
|
|
1739
|
-
consumerKey: "YOUR_CONSUMER_KEY",
|
|
1740
|
-
clientId: "YOUR_CLIENT_ID",
|
|
1741
|
-
})
|
|
1742
|
-
|
|
1743
|
-
const updatePortfolioTargetByIdResponse = await snaptrade.portfolioManagement.updatePortfolioTargetById({
|
|
1744
|
-
"portfolioGroupId": "portfolioGroupId_example",
|
|
1745
|
-
"targetAssetId": "targetAssetId_example",
|
|
1746
|
-
"id": "2bcd7cc3-e922-4976-bce1-9858296801c3",
|
|
1747
|
-
"percent": 90,
|
|
1748
|
-
"is_supported": true,
|
|
1749
|
-
"is_excluded": true,
|
|
1750
|
-
})
|
|
1751
|
-
|
|
1752
|
-
console.log(updatePortfolioTargetByIdResponse)
|
|
1753
|
-
|
|
1754
|
-
```
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
### Parameters
|
|
1758
|
-
|
|
1759
|
-
Name | Type | Description | Notes
|
|
1760
|
-
------------- | ------------- | ------------- | -------------
|
|
1761
|
-
**targetAsset** | **TargetAsset**| |
|
|
1762
|
-
**portfolioGroupId** | [**string**] | The ID of the PortfolioGroup under which to patch the target asset. | defaults to undefined
|
|
1763
|
-
**targetAssetId** | [**string**] | The ID of the TargetAsset to patch. | defaults to undefined
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
### Return type
|
|
1767
|
-
|
|
1768
|
-
**TargetAsset**
|
|
1769
|
-
|
|
1770
|
-
### HTTP request headers
|
|
1771
|
-
|
|
1772
|
-
- **Content-Type**: application/json
|
|
1773
|
-
- **Accept**: application/json
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
### HTTP response details
|
|
1777
|
-
| Status code | Description | Response headers |
|
|
1778
|
-
|-------------|-------------|------------------|
|
|
1779
|
-
**200** | The target asset is updated. | - |
|
|
1780
|
-
**400** | The specified portfolioGroupId or targetAssetId is invalid (not a UUID string) or the input data is invalid. | - |
|
|
1781
|
-
**404** | The specified portfolioGroupId or targetAssetId was not found. | - |
|
|
1782
|
-
**0** | Unexpected error. | - |
|
|
1783
|
-
|
|
1784
|
-
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
1785
|
-
|
|
1786
|
-
|