snaptrade-typescript-sdk 8.7.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.
Files changed (167) hide show
  1. package/README.md +1 -2
  2. package/dist/api/portfolio-management-api.d.ts +0 -47
  3. package/dist/api/portfolio-management-api.js +0 -103
  4. package/dist/configuration.js +1 -1
  5. package/package.json +4 -1
  6. package/.konfig/generate-id.txt +0 -1
  7. package/.konfigignore +0 -3
  8. package/api/account-information-api-custom.ts +0 -3
  9. package/api/account-information-api.ts +0 -1062
  10. package/api/api-disclaimer-api-custom.ts +0 -3
  11. package/api/api-disclaimer-api.ts +0 -183
  12. package/api/api-status-api-custom.ts +0 -3
  13. package/api/api-status-api.ts +0 -128
  14. package/api/authentication-api-custom.ts +0 -3
  15. package/api/authentication-api.ts +0 -568
  16. package/api/connections-api-custom.ts +0 -3
  17. package/api/connections-api.ts +0 -544
  18. package/api/error-logs-api-custom.ts +0 -3
  19. package/api/error-logs-api.ts +0 -174
  20. package/api/options-api-custom.ts +0 -3
  21. package/api/options-api.ts +0 -739
  22. package/api/portfolio-management-api-custom.ts +0 -3
  23. package/api/portfolio-management-api.ts +0 -3301
  24. package/api/reference-data-api-custom.ts +0 -3
  25. package/api/reference-data-api.ts +0 -1031
  26. package/api/trading-api-custom.ts +0 -3
  27. package/api/trading-api.ts +0 -1304
  28. package/api/transactions-and-reporting-api-custom.ts +0 -3
  29. package/api/transactions-and-reporting-api.ts +0 -408
  30. package/api.ts +0 -27
  31. package/base.ts +0 -70
  32. package/client-custom.ts +0 -5
  33. package/client.ts +0 -59
  34. package/common.ts +0 -163
  35. package/configuration.ts +0 -131
  36. package/docs/AccountInformationApi.md +0 -469
  37. package/docs/ApiDisclaimerApi.md +0 -64
  38. package/docs/ApiStatusApi.md +0 -58
  39. package/docs/AuthenticationApi.md +0 -293
  40. package/docs/ConnectionsApi.md +0 -238
  41. package/docs/ErrorLogsApi.md +0 -62
  42. package/docs/OptionsApi.md +0 -312
  43. package/docs/PortfolioManagementApi.md +0 -1785
  44. package/docs/ReferenceDataApi.md +0 -568
  45. package/docs/TradingApi.md +0 -596
  46. package/docs/TransactionsAndReportingApi.md +0 -144
  47. package/index.test.ts +0 -177
  48. package/index.ts +0 -18
  49. package/jest.config.ts +0 -11
  50. package/models/account-holdings-account.ts +0 -61
  51. package/models/account-holdings.ts +0 -61
  52. package/models/account-order-record-status.ts +0 -48
  53. package/models/account-order-record.ts +0 -151
  54. package/models/account-simple.ts +0 -52
  55. package/models/account-sync-status.ts +0 -32
  56. package/models/account.ts +0 -91
  57. package/models/action.ts +0 -30
  58. package/models/apidisclaimer-accept-request.ts +0 -29
  59. package/models/authentication-login-snap-trade-user200-response.ts +0 -31
  60. package/models/balance.ts +0 -40
  61. package/models/brokerage-authorization-type-read-only-brokerage.ts +0 -43
  62. package/models/brokerage-authorization-type-read-only.ts +0 -68
  63. package/models/brokerage-authorization-type.ts +0 -39
  64. package/models/brokerage-authorization.ts +0 -82
  65. package/models/brokerage-symbol.ts +0 -61
  66. package/models/brokerage-type.ts +0 -37
  67. package/models/brokerage.ts +0 -136
  68. package/models/calculated-trade.ts +0 -40
  69. package/models/cash-restriction.ts +0 -63
  70. package/models/connections-session-events200-response-inner.ts +0 -25
  71. package/models/currency.ts +0 -43
  72. package/models/delete-user-response.ts +0 -37
  73. package/models/dividend-at-date.ts +0 -43
  74. package/models/encrypted-response-encrypted-message-data.ts +0 -43
  75. package/models/encrypted-response.ts +0 -38
  76. package/models/exchange-rate-pairs.ts +0 -46
  77. package/models/exchange.ts +0 -73
  78. package/models/excluded-asset.ts +0 -34
  79. package/models/index.ts +0 -109
  80. package/models/jwt.ts +0 -31
  81. package/models/login-redirect-uri.ts +0 -35
  82. package/models/manual-trade-and-impact.ts +0 -49
  83. package/models/manual-trade-balance.ts +0 -49
  84. package/models/manual-trade-form.ts +0 -80
  85. package/models/manual-trade-symbol.ts +0 -64
  86. package/models/manual-trade.ts +0 -88
  87. package/models/model-asset-class-details.ts +0 -41
  88. package/models/model-asset-class-target.ts +0 -34
  89. package/models/model-asset-class.ts +0 -37
  90. package/models/model-portfolio-asset-class.ts +0 -40
  91. package/models/model-portfolio-details.ts +0 -50
  92. package/models/model-portfolio-security.ts +0 -40
  93. package/models/model-portfolio.ts +0 -52
  94. package/models/model400-failed-request-response.ts +0 -37
  95. package/models/model401-failed-request-response.ts +0 -37
  96. package/models/model403-failed-request-response.ts +0 -37
  97. package/models/model404-failed-request-response.ts +0 -37
  98. package/models/monthly-dividends.ts +0 -40
  99. package/models/net-contributions.ts +0 -43
  100. package/models/net-dividend.ts +0 -46
  101. package/models/option-chain-inner-chain-per-root-inner-chain-per-strike-price-inner.ts +0 -43
  102. package/models/option-chain-inner-chain-per-root-inner.ts +0 -46
  103. package/models/option-chain-inner.ts +0 -58
  104. package/models/option-leg.ts +0 -53
  105. package/models/option-strategy-legs-inner.ts +0 -47
  106. package/models/option-strategy.ts +0 -61
  107. package/models/options-get-option-strategy-request.ts +0 -51
  108. package/models/options-holdings.ts +0 -67
  109. package/models/options-place-option-strategy-request.ts +0 -57
  110. package/models/options-position.ts +0 -73
  111. package/models/options-symbol.ts +0 -94
  112. package/models/order-type.ts +0 -32
  113. package/models/partner-data.ts +0 -100
  114. package/models/past-value.ts +0 -43
  115. package/models/performance-custom.ts +0 -154
  116. package/models/portfolio-group-info.ts +0 -115
  117. package/models/portfolio-group-position.ts +0 -46
  118. package/models/portfolio-group-settings.ts +0 -58
  119. package/models/portfolio-group.ts +0 -37
  120. package/models/position-symbol.ts +0 -64
  121. package/models/position.ts +0 -64
  122. package/models/redirect-tokenand-pin.ts +0 -37
  123. package/models/security-type.ts +0 -49
  124. package/models/session-event.ts +0 -80
  125. package/models/snap-trade-apidisclaimer-accept-status.ts +0 -37
  126. package/models/snap-trade-holdings-account-account-id.ts +0 -82
  127. package/models/snap-trade-holdings-account.ts +0 -79
  128. package/models/snap-trade-holdings-total-value.ts +0 -37
  129. package/models/snap-trade-login-user-request-body.ts +0 -61
  130. package/models/snap-trade-register-user-request-body.ts +0 -35
  131. package/models/status.ts +0 -43
  132. package/models/strategy-impact-legs-inner.ts +0 -67
  133. package/models/strategy-impact.ts +0 -94
  134. package/models/strategy-order-place-orders-inner-legs-inner.ts +0 -67
  135. package/models/strategy-order-place-orders-inner.ts +0 -286
  136. package/models/strategy-order-place.ts +0 -40
  137. package/models/strategy-order-record.ts +0 -133
  138. package/models/strategy-quotes-greek.ts +0 -55
  139. package/models/strategy-quotes.ts +0 -67
  140. package/models/sub-period-return-rate.ts +0 -43
  141. package/models/symbol-query.ts +0 -29
  142. package/models/symbol.ts +0 -76
  143. package/models/symbols-quotes.ts +0 -64
  144. package/models/target-asset.ts +0 -62
  145. package/models/time-in-force.ts +0 -31
  146. package/models/trade-execution-status.ts +0 -105
  147. package/models/trade-impact.ts +0 -61
  148. package/models/trade.ts +0 -88
  149. package/models/trading-cancel-user-account-order-request.ts +0 -29
  150. package/models/trading-place-ocoorder-request.ts +0 -35
  151. package/models/transactions-status.ts +0 -35
  152. package/models/underlying-symbol.ts +0 -76
  153. package/models/universal-activity.ts +0 -127
  154. package/models/universal-symbol-ticker.ts +0 -82
  155. package/models/universal-symbol.ts +0 -80
  156. package/models/user-error-log.ts +0 -61
  157. package/models/user-idand-secret.ts +0 -37
  158. package/models/user-settings.ts +0 -88
  159. package/models/usexchange.ts +0 -79
  160. package/pagination/page-types.ts +0 -34
  161. package/pagination/page.ts +0 -58
  162. package/pagination/pageable.ts +0 -113
  163. package/pagination/paginate.ts +0 -41
  164. package/requestAfterHook.ts +0 -53
  165. package/requestBeforeHook.ts +0 -15
  166. package/tsconfig.json +0 -22
  167. package/tsconfig.test.json +0 -6
@@ -1,596 +0,0 @@
1
- # TradingApi
2
-
3
- All URIs are relative to *https://api.snaptrade.com/api/v1*
4
-
5
- Method | HTTP request | Description
6
- ------------- | ------------- | -------------
7
- [**cancelUserAccountOrder**](TradingApi.md#cancelUserAccountOrder) | **POST** /accounts/{accountId}/orders/cancel | Cancel open order in account
8
- [**getCalculatedTradeImpactById**](TradingApi.md#getCalculatedTradeImpactById) | **GET** /portfolioGroups/{portfolioGroupId}/calculatedtrades/{calculatedTradeId}/modify/{tradeId} | Return details of a specific trade before it\'s placed
9
- [**getCalculatedTradesImpact**](TradingApi.md#getCalculatedTradesImpact) | **GET** /portfolioGroups/{portfolioGroupId}/calculatedtrades/{calculatedTradeId}/impact | Return the impact of placing a series of trades on the portfolio
10
- [**getOrderImpact**](TradingApi.md#getOrderImpact) | **POST** /trade/impact | Check impact of trades on account.
11
- [**getUserAccountQuotes**](TradingApi.md#getUserAccountQuotes) | **GET** /accounts/{accountId}/quotes | Get symbol quotes
12
- [**modifyCalculatedTradeById**](TradingApi.md#modifyCalculatedTradeById) | **PATCH** /portfolioGroups/{portfolioGroupId}/calculatedtrades/{calculatedTradeId}/modify/{tradeId} | Modify units of a trade before it is placed
13
- [**placeCalculatedTrades**](TradingApi.md#placeCalculatedTrades) | **POST** /portfolioGroups/{portfolioGroupId}/calculatedtrades/{calculatedTradeId}/placeOrders | Place orders for the CalculatedTrades in series
14
- [**placeForceOrder**](TradingApi.md#placeForceOrder) | **POST** /trade/place | Place a trade with NO validation.
15
- [**placeOCOOrder**](TradingApi.md#placeOCOOrder) | **POST** /trade/oco | Place a OCO (One Cancels Other) order
16
- [**placeOrder**](TradingApi.md#placeOrder) | **POST** /trade/{tradeId} | Place order
17
-
18
-
19
- # **cancelUserAccountOrder**
20
-
21
- #### **POST** /accounts/{accountId}/orders/cancel
22
-
23
-
24
- ### Example
25
-
26
-
27
- ```typescript
28
- import { Snaptrade } from "snaptrade-typescript-sdk";
29
-
30
- const snaptrade = new Snaptrade({
31
- // Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
32
- // basePath: "https://api.snaptrade.com/api/v1",
33
- consumerKey: "YOUR_CONSUMER_KEY",
34
- clientId: "YOUR_CLIENT_ID",
35
- });
36
-
37
- const cancelUserAccountOrderResponse =
38
- await snaptrade.trading.cancelUserAccountOrder({
39
- userId: "John.doe@snaptrade.com",
40
- userSecret: "USERSECRET123",
41
- accountId: "accountId_example",
42
- brokerage_order_id: "2bcd7cc3-e922-4976-bce1-9858296801c3",
43
- });
44
-
45
- console.log(cancelUserAccountOrderResponse);
46
- ```
47
-
48
-
49
- ### Parameters
50
-
51
- Name | Type | Description | Notes
52
- ------------- | ------------- | ------------- | -------------
53
- **tradingCancelUserAccountOrderRequest** | **TradingCancelUserAccountOrderRequest**| The Order ID to be canceled |
54
- **userId** | [**string**] | | defaults to undefined
55
- **userSecret** | [**string**] | | defaults to undefined
56
- **accountId** | [**string**] | The ID of the account get positions. | defaults to undefined
57
-
58
-
59
- ### Return type
60
-
61
- **AccountOrderRecord**
62
-
63
- ### HTTP request headers
64
-
65
- - **Content-Type**: application/json
66
- - **Accept**: application/json
67
-
68
-
69
- ### HTTP response details
70
- | Status code | Description | Response headers |
71
- |-------------|-------------|------------------|
72
- **200** | Order Record of canceled order | - |
73
- **400** | Unable to cancel open order. Please verify status in brokerage account | - |
74
- **500** | Unexpected error | - |
75
-
76
- [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
77
-
78
- # **getCalculatedTradeImpactById**
79
-
80
- #### **GET** /portfolioGroups/{portfolioGroupId}/calculatedtrades/{calculatedTradeId}/modify/{tradeId}
81
-
82
-
83
- ### Example
84
-
85
-
86
- ```typescript
87
- import { Snaptrade } from "snaptrade-typescript-sdk";
88
-
89
- const snaptrade = new Snaptrade({
90
- // Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
91
- // basePath: "https://api.snaptrade.com/api/v1",
92
- consumerKey: "YOUR_CONSUMER_KEY",
93
- clientId: "YOUR_CLIENT_ID",
94
- });
95
-
96
- const getCalculatedTradeImpactByIdResponse =
97
- await snaptrade.trading.getCalculatedTradeImpactById({
98
- portfolioGroupId: "portfolioGroupId_example",
99
- calculatedTradeId: "calculatedTradeId_example",
100
- tradeId: "tradeId_example",
101
- });
102
-
103
- console.log(getCalculatedTradeImpactByIdResponse);
104
- ```
105
-
106
-
107
- ### Parameters
108
-
109
- Name | Type | Description | Notes
110
- ------------- | ------------- | ------------- | -------------
111
- **portfolioGroupId** | [**string**] | The ID of the PortfolioGroup to perform rebalancing calculations | defaults to undefined
112
- **calculatedTradeId** | [**string**] | The ID of calculated trade to get account impact | defaults to undefined
113
- **tradeId** | [**string**] | The ID of trade object | defaults to undefined
114
-
115
-
116
- ### Return type
117
-
118
- **Trade**
119
-
120
- ### HTTP request headers
121
-
122
- - **Content-Type**: Not defined
123
- - **Accept**: application/json
124
-
125
-
126
- ### HTTP response details
127
- | Status code | Description | Response headers |
128
- |-------------|-------------|------------------|
129
- **200** | Trade object | - |
130
-
131
- [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
132
-
133
- # **getCalculatedTradesImpact**
134
-
135
- #### **GET** /portfolioGroups/{portfolioGroupId}/calculatedtrades/{calculatedTradeId}/impact
136
-
137
-
138
- ### Example
139
-
140
-
141
- ```typescript
142
- import { Snaptrade } from "snaptrade-typescript-sdk";
143
-
144
- const snaptrade = new Snaptrade({
145
- // Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
146
- // basePath: "https://api.snaptrade.com/api/v1",
147
- consumerKey: "YOUR_CONSUMER_KEY",
148
- clientId: "YOUR_CLIENT_ID",
149
- });
150
-
151
- const getCalculatedTradesImpactResponse =
152
- await snaptrade.trading.getCalculatedTradesImpact({
153
- portfolioGroupId: "portfolioGroupId_example",
154
- calculatedTradeId: "calculatedTradeId_example",
155
- });
156
-
157
- console.log(getCalculatedTradesImpactResponse);
158
- ```
159
-
160
-
161
- ### Parameters
162
-
163
- Name | Type | Description | Notes
164
- ------------- | ------------- | ------------- | -------------
165
- **portfolioGroupId** | [**string**] | The ID of the PortfolioGroup to perform rebalancing calculations | defaults to undefined
166
- **calculatedTradeId** | [**string**] | The ID of calculated trade to get account impact | defaults to undefined
167
-
168
-
169
- ### Return type
170
-
171
- **Array<TradeImpact>**
172
-
173
- ### HTTP request headers
174
-
175
- - **Content-Type**: Not defined
176
- - **Accept**: application/json
177
-
178
-
179
- ### HTTP response details
180
- | Status code | Description | Response headers |
181
- |-------------|-------------|------------------|
182
- **200** | Impact of trades to make | - |
183
-
184
- [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
185
-
186
- # **getOrderImpact**
187
-
188
- #### **POST** /trade/impact
189
-
190
-
191
- ### Example
192
-
193
-
194
- ```typescript
195
- import { Snaptrade } from "snaptrade-typescript-sdk";
196
-
197
- const snaptrade = new Snaptrade({
198
- // Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
199
- // basePath: "https://api.snaptrade.com/api/v1",
200
- consumerKey: "YOUR_CONSUMER_KEY",
201
- clientId: "YOUR_CLIENT_ID",
202
- });
203
-
204
- const getOrderImpactResponse = await snaptrade.trading.getOrderImpact({
205
- userId: "John.doe@snaptrade.com",
206
- userSecret: "USERSECRET123",
207
- account_id: "2bcd7cc3-e922-4976-bce1-9858296801c3",
208
- action: "BUY",
209
- order_type: "Limit",
210
- price: 31.33,
211
- stop: 31.33,
212
- time_in_force: "Day",
213
- universal_symbol_id: "2bcd7cc3-e922-4976-bce1-9858296801c3",
214
- });
215
-
216
- console.log(getOrderImpactResponse);
217
- ```
218
-
219
-
220
- ### Parameters
221
-
222
- Name | Type | Description | Notes
223
- ------------- | ------------- | ------------- | -------------
224
- **manualTradeForm** | **ManualTradeForm**| |
225
- **userId** | [**string**] | | defaults to undefined
226
- **userSecret** | [**string**] | | defaults to undefined
227
-
228
-
229
- ### Return type
230
-
231
- **ManualTradeAndImpact**
232
-
233
- ### HTTP request headers
234
-
235
- - **Content-Type**: application/json
236
- - **Accept**: application/json
237
-
238
-
239
- ### HTTP response details
240
- | Status code | Description | Response headers |
241
- |-------------|-------------|------------------|
242
- **200** | Return trade object and it\&#39;s impact on the account | - |
243
- **400** | Missing or wrong data format provided in request body | - |
244
- **403** | User does not have permissions to place trades | - |
245
- **500** | Unexpected Error | - |
246
-
247
- [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
248
-
249
- # **getUserAccountQuotes**
250
-
251
- #### **GET** /accounts/{accountId}/quotes
252
-
253
-
254
- ### Example
255
-
256
-
257
- ```typescript
258
- import { Snaptrade } from "snaptrade-typescript-sdk";
259
-
260
- const snaptrade = new Snaptrade({
261
- // Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
262
- // basePath: "https://api.snaptrade.com/api/v1",
263
- consumerKey: "YOUR_CONSUMER_KEY",
264
- clientId: "YOUR_CLIENT_ID",
265
- });
266
-
267
- const getUserAccountQuotesResponse =
268
- await snaptrade.trading.getUserAccountQuotes({
269
- userId: "John.doe@snaptrade.com",
270
- userSecret: "USERSECRET123",
271
- symbols: "symbols_example",
272
- accountId: "accountId_example",
273
- });
274
-
275
- console.log(getUserAccountQuotesResponse);
276
- ```
277
-
278
-
279
- ### Parameters
280
-
281
- Name | Type | Description | Notes
282
- ------------- | ------------- | ------------- | -------------
283
- **userId** | [**string**] | | defaults to undefined
284
- **userSecret** | [**string**] | | defaults to undefined
285
- **symbols** | [**string**] | List of universal_symbol_id or tickers to get quotes for. | defaults to undefined
286
- **accountId** | [**string**] | The ID of the account to get quotes. | defaults to undefined
287
- **useTicker** | [**boolean**] | Should be set to True if providing tickers. | (optional) defaults to undefined
288
-
289
-
290
- ### Return type
291
-
292
- **SymbolsQuotes**
293
-
294
- ### HTTP request headers
295
-
296
- - **Content-Type**: Not defined
297
- - **Accept**: application/json
298
-
299
-
300
- ### HTTP response details
301
- | Status code | Description | Response headers |
302
- |-------------|-------------|------------------|
303
- **200** | Returns quotes object with different prices | - |
304
- **500** | Unexpected error | - |
305
-
306
- [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
307
-
308
- # **modifyCalculatedTradeById**
309
-
310
- #### **PATCH** /portfolioGroups/{portfolioGroupId}/calculatedtrades/{calculatedTradeId}/modify/{tradeId}
311
-
312
-
313
- ### Example
314
-
315
-
316
- ```typescript
317
- import { Snaptrade } from "snaptrade-typescript-sdk";
318
-
319
- const snaptrade = new Snaptrade({
320
- // Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
321
- // basePath: "https://api.snaptrade.com/api/v1",
322
- consumerKey: "YOUR_CONSUMER_KEY",
323
- clientId: "YOUR_CLIENT_ID",
324
- });
325
-
326
- const modifyCalculatedTradeByIdResponse =
327
- await snaptrade.trading.modifyCalculatedTradeById({
328
- portfolioGroupId: "portfolioGroupId_example",
329
- calculatedTradeId: "calculatedTradeId_example",
330
- tradeId: "tradeId_example",
331
- id: "2bcd7cc3-e922-4976-bce1-9858296801c3",
332
- action: "BUY",
333
- units: 6,
334
- price: 24.81,
335
- sequence: 1,
336
- });
337
-
338
- console.log(modifyCalculatedTradeByIdResponse);
339
- ```
340
-
341
-
342
- ### Parameters
343
-
344
- Name | Type | Description | Notes
345
- ------------- | ------------- | ------------- | -------------
346
- **trade** | **Trade**| |
347
- **portfolioGroupId** | [**string**] | The ID of the PortfolioGroup to perform rebalancing calculations | defaults to undefined
348
- **calculatedTradeId** | [**string**] | The ID of calculated trade to get account impact | defaults to undefined
349
- **tradeId** | [**string**] | The ID of trade object | defaults to undefined
350
-
351
-
352
- ### Return type
353
-
354
- **Trade**
355
-
356
- ### HTTP request headers
357
-
358
- - **Content-Type**: application/json
359
- - **Accept**: application/json
360
-
361
-
362
- ### HTTP response details
363
- | Status code | Description | Response headers |
364
- |-------------|-------------|------------------|
365
- **200** | Modified trade object | - |
366
-
367
- [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
368
-
369
- # **placeCalculatedTrades**
370
-
371
- #### **POST** /portfolioGroups/{portfolioGroupId}/calculatedtrades/{calculatedTradeId}/placeOrders
372
-
373
-
374
- ### Example
375
-
376
-
377
- ```typescript
378
- import { Snaptrade } from "snaptrade-typescript-sdk";
379
-
380
- const snaptrade = new Snaptrade({
381
- // Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
382
- // basePath: "https://api.snaptrade.com/api/v1",
383
- consumerKey: "YOUR_CONSUMER_KEY",
384
- clientId: "YOUR_CLIENT_ID",
385
- });
386
-
387
- const placeCalculatedTradesResponse =
388
- await snaptrade.trading.placeCalculatedTrades({
389
- portfolioGroupId: "portfolioGroupId_example",
390
- calculatedTradeId: "calculatedTradeId_example",
391
- });
392
-
393
- console.log(placeCalculatedTradesResponse);
394
- ```
395
-
396
-
397
- ### Parameters
398
-
399
- Name | Type | Description | Notes
400
- ------------- | ------------- | ------------- | -------------
401
- **portfolioGroupId** | [**string**] | The ID of the PortfolioGroup to perform rebalancing calculations | defaults to undefined
402
- **calculatedTradeId** | [**string**] | The ID of calculated trade to get account impact | defaults to undefined
403
-
404
-
405
- ### Return type
406
-
407
- **Array<TradeExecutionStatus>**
408
-
409
- ### HTTP request headers
410
-
411
- - **Content-Type**: Not defined
412
- - **Accept**: application/json
413
-
414
-
415
- ### HTTP response details
416
- | Status code | Description | Response headers |
417
- |-------------|-------------|------------------|
418
- **200** | Return trade execution statuses for all trades submitted | - |
419
-
420
- [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
421
-
422
- # **placeForceOrder**
423
-
424
- #### **POST** /trade/place
425
-
426
-
427
- ### Example
428
-
429
-
430
- ```typescript
431
- import { Snaptrade } from "snaptrade-typescript-sdk";
432
-
433
- const snaptrade = new Snaptrade({
434
- // Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
435
- // basePath: "https://api.snaptrade.com/api/v1",
436
- consumerKey: "YOUR_CONSUMER_KEY",
437
- clientId: "YOUR_CLIENT_ID",
438
- });
439
-
440
- const placeForceOrderResponse = await snaptrade.trading.placeForceOrder({
441
- userId: "John.doe@snaptrade.com",
442
- userSecret: "USERSECRET123",
443
- account_id: "2bcd7cc3-e922-4976-bce1-9858296801c3",
444
- action: "BUY",
445
- order_type: "Limit",
446
- price: 31.33,
447
- stop: 31.33,
448
- time_in_force: "Day",
449
- universal_symbol_id: "2bcd7cc3-e922-4976-bce1-9858296801c3",
450
- });
451
-
452
- console.log(placeForceOrderResponse);
453
- ```
454
-
455
-
456
- ### Parameters
457
-
458
- Name | Type | Description | Notes
459
- ------------- | ------------- | ------------- | -------------
460
- **manualTradeForm** | **ManualTradeForm**| |
461
- **userId** | [**string**] | | defaults to undefined
462
- **userSecret** | [**string**] | | defaults to undefined
463
-
464
-
465
- ### Return type
466
-
467
- **AccountOrderRecord**
468
-
469
- ### HTTP request headers
470
-
471
- - **Content-Type**: application/json
472
- - **Accept**: application/json
473
-
474
-
475
- ### HTTP response details
476
- | Status code | Description | Response headers |
477
- |-------------|-------------|------------------|
478
- **200** | Trade sucessfully placed | - |
479
- **400** | Trade could not be placed | - |
480
- **403** | User does not have permissions to place trades | - |
481
- **500** | Unexpected Error | - |
482
-
483
- [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
484
-
485
- # **placeOCOOrder**
486
-
487
- #### **POST** /trade/oco
488
-
489
-
490
- ### Example
491
-
492
-
493
- ```typescript
494
- import { Snaptrade } from "snaptrade-typescript-sdk";
495
-
496
- const snaptrade = new Snaptrade({
497
- // Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
498
- // basePath: "https://api.snaptrade.com/api/v1",
499
- consumerKey: "YOUR_CONSUMER_KEY",
500
- clientId: "YOUR_CLIENT_ID",
501
- });
502
-
503
- const placeOCOOrderResponse = await snaptrade.trading.placeOCOOrder({
504
- userId: "John.doe@snaptrade.com",
505
- userSecret: "USERSECRET123",
506
- });
507
-
508
- console.log(placeOCOOrderResponse);
509
- ```
510
-
511
-
512
- ### Parameters
513
-
514
- Name | Type | Description | Notes
515
- ------------- | ------------- | ------------- | -------------
516
- **tradingPlaceOCOOrderRequest** | **TradingPlaceOCOOrderRequest**| |
517
- **userId** | [**string**] | | defaults to undefined
518
- **userSecret** | [**string**] | | defaults to undefined
519
-
520
-
521
- ### Return type
522
-
523
- **AccountOrderRecord**
524
-
525
- ### HTTP request headers
526
-
527
- - **Content-Type**: application/json
528
- - **Accept**: application/json
529
-
530
-
531
- ### HTTP response details
532
- | Status code | Description | Response headers |
533
- |-------------|-------------|------------------|
534
- **200** | Status of order placed | - |
535
- **400** | Failed to submit order to broker | - |
536
- **500** | Unexpected Error | - |
537
-
538
- [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
539
-
540
- # **placeOrder**
541
-
542
- #### **POST** /trade/{tradeId}
543
-
544
-
545
- ### Example
546
-
547
-
548
- ```typescript
549
- import { Snaptrade } from "snaptrade-typescript-sdk";
550
-
551
- const snaptrade = new Snaptrade({
552
- // Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
553
- // basePath: "https://api.snaptrade.com/api/v1",
554
- consumerKey: "YOUR_CONSUMER_KEY",
555
- clientId: "YOUR_CLIENT_ID",
556
- });
557
-
558
- const placeOrderResponse = await snaptrade.trading.placeOrder({
559
- tradeId: "tradeId_example",
560
- userId: "John.doe@snaptrade.com",
561
- userSecret: "USERSECRET123",
562
- });
563
-
564
- console.log(placeOrderResponse);
565
- ```
566
-
567
-
568
- ### Parameters
569
-
570
- Name | Type | Description | Notes
571
- ------------- | ------------- | ------------- | -------------
572
- **tradeId** | [**string**] | The ID of trade object obtained from trade/impact endpoint | defaults to undefined
573
- **userId** | [**string**] | | defaults to undefined
574
- **userSecret** | [**string**] | | defaults to undefined
575
-
576
-
577
- ### Return type
578
-
579
- **AccountOrderRecord**
580
-
581
- ### HTTP request headers
582
-
583
- - **Content-Type**: Not defined
584
- - **Accept**: application/json
585
-
586
-
587
- ### HTTP response details
588
- | Status code | Description | Response headers |
589
- |-------------|-------------|------------------|
590
- **200** | Status of order placed | - |
591
- **400** | Failed to submit order to broker | - |
592
- **500** | Unexpected Error | - |
593
-
594
- [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
595
-
596
-